fix(cli): exit non-zero when miner post / miner check report success: false#843
Open
ebios-star wants to merge 1 commit intoentrius:testfrom
Open
fix(cli): exit non-zero when miner post / miner check report success: false#843ebios-star wants to merge 1 commit intoentrius:testfrom
ebios-star wants to merge 1 commit intoentrius:testfrom
Conversation
… false `gitt miner post` and `gitt miner check` already encode their logical outcome in the JSON `success` field (`accepted_count > 0` / `valid_count > 0`), but the process exit code stayed 0 even when every validator rejected the broadcast or no validator had a valid stored PAT. Shell pipelines and CI steps that ran `gitt miner post && next-step` or used the exit code as a health-check signal silently treated total failure as success. After this change both commands sys.exit(1) when their respective count is zero, matching the JSON `success` field and the family already fixed for `gitt admin`/`gitt vote`/`gitt harvest` in entrius#707 and `gitt issues list --id` / miner-check JSON aggregate counts in entrius#724. Add four regression tests under TestMinerPostExitCodeOnZeroAccepted and TestMinerCheckExitCodeOnZeroValid (zero-success exits 1, non-zero success exits 0). The harmless "coroutine never awaited" RuntimeWarning that fires because we patch asyncio.run is filtered at class scope. Closes entrius#841 Closes entrius#842
Contributor
Author
|
@anderdc @LandynDev — friendly ping for review when you have a moment. Closes #841 and #842. Same family as #707 (your merged Happy to rebase if needed. |
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
`gitt miner post` and `gitt miner check` already encode their logical outcome in the JSON `success` field (`accepted_count > 0` / `valid_count > 0`), but the process exit code stayed `0` even when every validator rejected the broadcast or no validator had a valid stored PAT. Shell pipelines and CI steps that ran `gitt miner post && next-step` or used the exit code as a health-check signal silently treated total failure as success.
After this change both commands `sys.exit(1)` when their respective count is zero — matching the JSON `success` field and the family already fixed for `gitt admin` / `gitt vote` / `gitt harvest` in #707 and `gitt issues list --id` / miner-check JSON aggregate counts in #724.
The fix is minimal: 6 lines in post.py and 6 lines in check.py, each guarded so the success exit code stays `0`.
Related Issues
Closes #841 (`gitt miner post`)
Closes #842 (`gitt miner check`)
Type of Change
Testing
Checklist