Skip to content

fix(cli): propagate deploy failure exit codes#4136

Open
H4ck3r-netizen wants to merge 1 commit into
orchestration-agent:mainfrom
H4ck3r-netizen:fix/cli-deploy-exit-codes
Open

fix(cli): propagate deploy failure exit codes#4136
H4ck3r-netizen wants to merge 1 commit into
orchestration-agent:mainfrom
H4ck3r-netizen:fix/cli-deploy-exit-codes

Conversation

@H4ck3r-netizen
Copy link
Copy Markdown

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

  • Refactored command handlers into separate functions that return explicit integer exit codes
  • _cmd_deploy now returns 1 on: missing manifest file, invalid JSON, or any load failure
  • _cmd_deploy returns 0 on successful manifest load
  • All handlers (_cmd_init, _cmd_status, _cmd_logs) return explicit exit codes
  • cli() dispatches to handlers via a dict lookup and calls sys.exit(handler(args))

Testing

  • 11 new tests covering: successful deploy, missing file, invalid JSON, empty file, init, status, logs, and CLI integration tests
  • All tests pass: pytest tests/test_cli.py -v

Bounty

This PR addresses the $3k bounty on issue #4032.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Bounty $3k ] [ CLI ] Propagate deploy failure exit codes — exit status

1 participant