Repository navigation
ci(quality-gate): say what stopped the gate when it exits without a report - #1053
Merged
Merged
Conversation
…eport A bug in the gate made it exit with no output at all, and finding the cause took a debugging round. An EXIT trap now prints the command that failed and the last stage the gate reported. Usage and environment errors go through die and stay as they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tr00d
marked this pull request as ready for review
December 3, 2026 07:42
bash 5 prints a here-string as <<< "x" where bash 3.2 prints <<<"x". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Step 7 of the quality gate review, 3 of 3.
During #1049, a bug in the gate made it exit with no output at all. Under
pipefail, a| head -n1inside a$(...)killed the script. There was no report and no message, and finding the cause took a debugging round.Changes
EXITtrap ingate.shcallsreport_unexpected_exitinlib/common.sh. When the gate stops with a non-zero code and didn't mean to, it prints the failing command and the last stage it reported:exit 3) go through a newdiehelper. It prints the message as before and marks the exit as intended.code=$(curl …) || code="", don't trigger the trap.EXITtrap, notERR: anERRtrap doesn't reach into functions withoutset -E. Withset -E, it fires inside$(...)on failures the code already handles.Tests
New suite
fixtures-unexpected-exit/run.sh, 7 cases, added to the "Quality gate tests" CI job:gate.sh:--helpstays quietdieprints only its messageThe real
gate.shcan't be made to crash from outside without adding a test hook to it, which is why some cases use the library.Verification
run-fixtures.sh: 57/57.compare-baselines: 12/12.compare-coverage: 7/7.identify-changes: 18/18.mark-api: 5/5.unexpected-exit: 7/7.gate.sh packageslocally, E2E included:GATE: PASS. A first run failed Functions and Gotrue E2E tests with "token is not valid yet" and invalid TOTP codes: the Docker VM's clock had drifted while the Mac slept. The clocks agreed again before the rerun.origin/master, which brought ci(quality-gate): report a non-blocking stage's finding as WARN #1051 and auto-merged the README,unexpected-exitstill passes 7/7.🤖 Generated with Claude Code