Add Talos operator CLI commands - #14
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR extends the Talos CLI beyond a single ChangesSnapshot-based CLI workflow and integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Closing for now so these changes can land one at a time and leave room for CodeRabbit review. I’ll reopen this follow-up after the review window. |
|
@coderabbitai Please review |
|
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@talos/cli.py`:
- Around line 70-74: The evaluate command currently always returns 0 even if
persistence fails; modify the evaluate flow (in talos/cli.py, function evaluate)
so that after calling save_state, save_status, and append_history you detect
failure: either catch exceptions from those calls or check their return values
(save_state, save_status, append_history) and if any indicate failure, emit an
error via the existing logger and return a non-zero exit code (e.g., return 1)
instead of 0; ensure _print_json(evaluation.to_dict()) only runs when
persistence succeeded or still allow printing but still return non-zero on
persistence failure.
- Around line 76-78: When handling the "status" command in the args.command
branch, wrap the call to args.status_file.read_text() and json.loads(...) (used
by _print_json) in a try/except that catches FileNotFoundError and
json.JSONDecodeError and routes errors to the CLI parser error path (call
parser.error(...) with a clear message about missing or invalid status file);
reference the "args.command" check, the "_print_json" invocation, and the
"args.status_file.read_text()" / "json.loads" operations and ensure the handler
returns or exits via parser.error so a traceback is not exposed.
🪄 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: CHILL
Plan: Pro
Run ID: eeceff20-dfef-4928-89bc-4f46efe993e3
📒 Files selected for processing (5)
README.mdTESTING.mddocs/OVERVIEW.mdtalos/cli.pytests/test_cli.py
Summary
Testing
Summary by CodeRabbit
New Features
evaluate,status, andexplainsubcommands to the Talos CLIDocumentation