Allow --system-config to be set via CLOUDAI_SYSTEM_CONFIG env var - #986
Allow --system-config to be set via CLOUDAI_SYSTEM_CONFIG env var#986shreyaskommuri wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe shared ChangesSystem config environment support
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Suggested by a maintainer as a small quality-of-life improvement while discussing parser work. Falls back to the env var only when --system-config isn't passed explicitly; the flag still takes precedence. Signed-off-by: shreyaskommuri <shreyaskommuri@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_cli.py`:
- Around line 49-60: Strengthen test_system_config_can_be_set_via_env_var so it
asserts the expected downstream configuration-validation error produced from
system_cfg, rather than only checking that the missing-option message is absent.
Include system_cfg’s path in the assertion when that path is exposed in the CLI
output, proving CLOUDAI_SYSTEM_CONFIG was actually used.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 853c4d21-40ba-4004-8d4d-8931d6da0abc
📒 Files selected for processing (2)
src/cloudai/cli/cli.pytests/test_cli.py
46433aa to
95836dd
Compare
Summary
--system-configcan now be set via aCLOUDAI_SYSTEM_CONFIGenvironment variable instead of always passing the flag explicitly.--system-configflag still takes precedence when both are set. The requirement that one of them is provided is unchanged (click'senvvar=mechanism satisfiesrequired=True).src/cloudai/cli/cli.py'scommon_options, so it applies toinstall,uninstall,dry-run,run, andgenerate-reportuniformly.verify-configsdoes not use--system-configand is unaffected.Test Plan
Added 3 tests to
tests/test_cli.py: env-var-only resolution, flag-takes-precedence-over-env-var, and env var documented in--helpacross all 5 subcommands.Also ran a real end-to-end
dry-runusing the env var instead of the flag, against the bundled sleep scenario:Also ran full suite (
uv run pytest -q, 1806 passed),ruff check,ruff format --check, andpyright, all clean.Additional Notes
None.