Repository navigation
fix: make tool-error paths exit 2 in release doc sync [skip version] - #199
Open
abhicodes-007 wants to merge 1 commit into
Open
abhicodes-007 wants to merge 1 commit into
abhicodes-007 wants to merge 1 commit into
Conversation
Bad arguments raised SystemExit with a string, which exits 1. The
release-doc-sync action treats 1 as "files changed", so bad input produced
a green step with no edits. UnicodeDecodeError escaped the OSError-only
handler, and drift_check re-raised a string SystemExit for a malformed
STANDARDS_VERSION, also exiting 1 ("drift found").
Print diagnostics to stderr and exit 2 in both CLIs, catch ValueError
alongside OSError in sync main, and validate --date as YYYY-MM-DD. The
action already fails on rc>=2, so no action.yml change is needed.
Adds focused regression tests for every validation branch, the subprocess
exit code, undecodable docs, and malformed STANDARDS_VERSION.
Closes TMHSDigital#152
Signed-off-by: Abhishek Deepak <abhicodes-007@users.noreply.github.com>
3 tasks
This branch has not been deployed
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.
Problem
Bad arguments in
release-doc-syncraised a stringSystemExit, which exits 1. The composite action treats 1 as "files changed", so invalid input produced a green step with no edits. An undecodable doc raised an uncaughtUnicodeDecodeError(also exit 1), anddrift_checkreported a malformedSTANDARDS_VERSIONas drift (1) instead of a tool error.Approach
Both CLIs now print diagnostics to stderr and exit 2.
sync.pycatchesValueErroralongsideOSError, and--dateis validated asYYYY-MM-DD.action.ymlis unchanged because it already treats rc>=2 as failure.Tests
pytest: 361 passed, 2 skipped. Nine new regression tests cover every validation branch, subprocess exit code, undecodable docs, and malformedSTANDARDS_VERSION. Each of the three fix loci was sabotaged separately and the tests failed as expected.Risk
No VERSION bump is included;
[skip version]is in the PR title for the repo's validate workflow. Follow-up docs/ROADMAP alignment remains with maintainers.Closes #152