add reflex hosting cli#6369
Conversation
Greptile SummaryThis PR introduces the
Confidence Score: 4/5Safe to merge after the envfile silent-drop bug in deploy is fixed; all other previously flagged P0/P1 issues are resolved. One remaining P1 defect: the envfile ImportError in v2/cli.py:deploy falls through without exiting, causing a deploy with no env vars when python-dotenv is missing. All other major issues from prior review rounds are addressed. The P2 mutation in ScaleParams.as_json does not block merge. packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py — the envfile ImportError handler in deploy() Important Files Changed
Reviews (8): Last reviewed commit: "add any missing timeouts and guard again..." | Re-trigger Greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
|
@greptile |
| if envfile: | ||
| try: | ||
| from dotenv import dotenv_values # pyright: ignore[reportMissingImports] | ||
|
|
||
| processed_envs = dotenv_values(envfile) | ||
| except ImportError: | ||
| console.error( | ||
| """The `python-dotenv` package is required to load environment variables from a file. Run `pip install "python-dotenv>=1.0.1"`.""" | ||
| ) | ||
|
|
There was a problem hiding this comment.
envfile ImportError falls through — deployment uses wrong env vars
When --envfile is given but python-dotenv is not installed, the ImportError is caught and logged, but execution falls through without exiting. The processed_envs variable retains whatever was set earlier (typically None when only --envfile was provided, since the --env flags are ignored when --envfile is set), so create_deployment is called with no env vars at all — silently dropping every intended secret from the deployment. The identical bug was already fixed in secrets.py's update_secrets; a raise click.exceptions.Exit(1) from None is needed inside this except ImportError block.
No description provided.