fix(hosting-cli): exit deploy when --envfile requires missing python-dotenv#6414
fix(hosting-cli): exit deploy when --envfile requires missing python-dotenv#6414BABTUNA wants to merge 1 commit intoreflex-dev:mainfrom
Conversation
Greptile SummaryThis PR fixes a bug where Confidence Score: 5/5This PR is safe to merge — it is a minimal, targeted bug fix with a focused regression test. The change is a single line that corrects a clear fall-through bug: the missing No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[deploy called with --envfile] --> B{envfile set?}
B -- No --> D[Continue: compile app]
B -- Yes --> C{import dotenv}
C -- Success --> C2[dotenv_values loaded] --> D
C -- ImportError --> E[console.error message]
E --> F["raise click.exceptions.Exit(1)\n(NEW: previously fell through)"]
D --> G[export_fn]
G --> H[create_deployment]
H --> I[watch_deployment_status]
Reviews (1): Last reviewed commit: "fix(hosting-cli): exit deploy when envfi..." | Re-trigger Greptile |
All Submissions:
Type of change
Changes To Core Features:
Description
Fixes a deploy error path in
reflex-hosting-cliwhen--envfileis provided butpython-dotenvis not installed.Before this change,
deploy()logged an error in theImportErrorbranch but continued execution, which could lead to a deployment proceeding without envfile secrets.After this change,
deploy()exits immediately withclick.exceptions.Exit(1)in that branch (matching existing behavior inv2/secrets.py).Tests
Added regression test:
test_deploy_envfile_missing_python_dotenv_exitsThe test verifies:
deploy()exits when dotenv import failsValidation
uv run ruff check packages/reflex-hosting-cli/src/reflex_cli/v2/cli.py tests/units/reflex_cli/v2/test_cli.pyuv run pytest tests/units/reflex_cli/v2/test_cli.py -qFollow-up to #6369