ci: harden gate job -- fail open on gh api error, raise pr-list limit#337
Merged
Conversation
Independent review (fable) of #325 found two real bugs in the gate job: - run: steps use bash -e by default; an unhandled gh pr list failure (API hiccup) would abort the script before `proceed` is ever written, failing the gate job itself -- the exact red-X-on-transient-flake outcome #325 was meant to eliminate, now just relocated to api.github.com instead of apt.llvm.org. `|| dup=0` makes a lookup failure fail open (full run proceeds) instead of failing the gate. - `gh pr list` defaults to --limit 30; past that many concurrently open PRs, a real duplicate could go undetected (fails open the same way, just silently -- harmless but worth closing). --limit 100 covers this repo's realistic ceiling.
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
Independent review of #325's gate job (
.github/workflows/ci.yml) surfaced two real bugs:run:steps default tobash -e. An unhandledgh pr listfailure (e.g. a GitHub API hiccup) aborts the script beforeproceedis ever written to$GITHUB_OUTPUT, failing the gate job itself — reproducing the exact "red X on a transient external flake" outcome ci: skip redundant push-triggered runs cleanly instead of cancelling them #325 existed to eliminate, just relocated fromapt.llvm.orgtoapi.github.com. Fixed with|| dup=0, so a lookup failure fails open (the run proceeds normally, same as if no open PR existed) instead of failing the gate.gh pr listdefaults to--limit 30. Past 30 concurrently open PRs, a genuine duplicate could go undetected — harmless (fails open, same as above, just silently missing a dedup opportunity) but worth closing. Added--limit 100.Test plan