fix: propagate deploy failure exit codes#3597
Open
hikali123456789 wants to merge 2 commits into
Open
Conversation
- Refactor CLI branches into handler functions that return int exit codes - Add EXIT_SUCCESS/EXIT_FAILURE constants - cli() now returns exit code instead of calling sys.exit directly - Each command handler (init, deploy, status, logs) returns explicit exit code - Enables scripts to reliably detect failed deploys Fixes orchestration-agent#3584
- Test EXIT_SUCCESS/EXIT_FAILURE constants - Test each handler returns explicit exit code - Test cli() returns proper codes for all commands - Test no-command case returns EXIT_FAILURE
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
Refactors CLI command branches into handler functions that return explicit integer exit codes, enabling scripts to reliably detect failed deploys.
Changes
Added exit code constants (
src/cli/main.py)EXIT_SUCCESS = 0andEXIT_FAILURE = 1Extracted command handlers (
src/cli/main.py)handle_init(),handle_deploy(),handle_status(),handle_logs()COMMAND_HANDLERSdict maps command names to handlersRefactored
cli()function (src/cli/main.py)intexit code instead of callingsys.exit()directly__main__block usessys.exit(cli())to propagate the codeAdded regression tests (
tests/test_cli_deploy.py)cli()return valuesBefore
After
Acceptance Criteria
Fixes #3584