Separate a failed run from a wait that could not finish - #6
Merged
Conversation
#5 stopped `run wait` sharing exit code 2 with Click. The same collision was still present one layer over: an API error with no code of its own exits 1, and 1 is what this command uses to say "a run you waited for failed". Those want opposite responses. The gating script in #5's own description -- case $? in 0) merge ;; 1) block ;; 9) retry ;; esac -- blocks the branch when the platform returns a 500, and retrying, which is the right answer to a 500, is the one branch it will not take. Nothing about the code was learned, but the verdict says otherwise. Codeless API failures now exit 10. Errors that map to a code of their own (3 through 8) keep it, and 1 is left meaning only what a run itself reported. Also drops a stray blank line that landed above constants.py's module docstring.
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.
Follow-up to #5, whose fix was right and whose reasoning applies once more one layer over.
The same collision, one layer up
#5 established that
run waitmust not share an exit code with something that means a different thing. It still does. AnApiErrorwith no code of its own exits 1, and 1 is what this command uses for a run you waited for failed:Measured on
masterat fe8384a.These want opposite responses. The gating script from #5's own description:
A 500 from the platform takes the
blockbranch — the branch is reported bad although nothing was learned about it — andretry, the correct response to a 500, is the one path the script will not take. Same shape as the original bug: a condition that is not an outcome wearing an outcome's code.The fix
Codeless API failures exit 10. Errors that map to a code of their own keep it, so nothing that already worked changes:
After this,
1underrun waitmeans exactly one thing: a run reported a bad verdict. Everything else that can go wrong has its own code, which is the property #5 was after.Testing
Two tests, both of which fail without the change:
test_a_broken_wait_is_distinguishable_from_a_failed_run— a 500 and a failed run must not share a codetest_api_errors_that_map_to_a_code_keep_it— 404→4, 401→6, 429→7, 409→8 are untouched, so the remap is narrow220 pass under both pytest and
unittest discover; isort, pycodestyle, pydocstyle, mypy clean. README and AGENTS.md tables updated, including the workedcaseabove.Also
Drops a stray blank line that landed above
constants.py's module docstring in #5. Harmless —__doc__still resolves — but it is not meant to be there and no linter flags it.