fix(cli): propagate deploy failure exit codes#4136
Open
H4ck3r-netizen wants to merge 1 commit into
Open
Conversation
- Refactor command handlers to return explicit integer exit codes - _cmd_deploy returns 1 on missing manifest, invalid JSON, or load failure - _cmd_deploy returns 0 on successful manifest load - All handlers (_cmd_init, _cmd_status, _cmd_logs) return explicit codes - cli() dispatches to handlers and calls sys.exit with the returned code - Add 11 regression tests covering success and failure paths Fixes orchestration-agent#4032
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4032
The CLI deploy command was not propagating failure exit codes. When the deploy backend failed (missing manifest, invalid JSON, etc.), the CLI would still exit with code 0, making it impossible for scripts and automation to detect failures.
Changes
_cmd_deploynow returns 1 on: missing manifest file, invalid JSON, or any load failure_cmd_deployreturns 0 on successful manifest load_cmd_init,_cmd_status,_cmd_logs) return explicit exit codessys.exit(handler(args))Testing
pytest tests/test_cli.py -vBounty
This PR addresses the $3k bounty on issue #4032.