Repository navigation
Exit 1 from the legacy CLI flags when an action failed - #108
Merged
Merged
Conversation
The executor records a failed action and runs the next one, so the process ended with status 0 whatever happened. The executor now counts the actions that failed, and the entry point compares the count before and after the legacy dispatch and exits 1 with "N action(s) failed".
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
JE-Chen
marked this pull request as ready for review
October 11, 2026 07:38
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
python -m automation_filewith-e,-dor--execute_strexits with status 1 when an action of the list failed, and printserror: N action(s) failedon stderr. The rest of the list still runs first.Why
The executor records a failed action as
repr(error)and runs the next one, so the process ended with status 0 whatever happened. TestPioneer'sparallel_runstarts--execute_fileand reads the exit status (TestPioneer PR #32,docs/artifacts.rst, "Native Support"), and so does a CI job. LoadDensity made the same change in its PR #118; APITestka has it in its PR #149.Behaviour change
A script with a failing action now ends with status 1 where it ended with 0. PyBreeze only displays the status.
execute_actionand what it returns are unchanged.How
ActionExecutor.failure_count: how many actions have failed in the executor, thread-safe, dry runs excluded.__main__.maincompares the count before and after the legacy dispatch.architecture.md§6 said TestPioneer'sparallel_rundoes not spawn this package. It does, for itsfile-runner; the entry is corrected.Checks
tests/test_legacy_cli_contract.py+4 (real child processes),tests/test_cli_main.py+3.ruff check,ruff format --checkandmypyare clean for the package.tests/test_versioning.pyfail withFileNotFoundErroron the machine it was run on, with and without this change.Docs: the three READMEs,
docs/source/{Eng,Zh-TW,Zh-CN}/usage/cli.rst,architecture.md§6,docs/updates/.