Skip to content

ci: harden gate job -- fail open on gh api error, raise pr-list limit#337

Merged
LeoBuron merged 1 commit into
developfrom
ci-gate-fail-open
Jul 10, 2026
Merged

ci: harden gate job -- fail open on gh api error, raise pr-list limit#337
LeoBuron merged 1 commit into
developfrom
ci-gate-fail-open

Conversation

@LeoBuron

@LeoBuron LeoBuron commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Independent review of #325's gate job (.github/workflows/ci.yml) surfaced two real bugs:

  • run: steps default to bash -e. An unhandled gh pr list failure (e.g. a GitHub API hiccup) aborts the script before proceed is 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 from apt.llvm.org to api.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 list defaults 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

  • YAML validated
  • No behavioral change expected for the common case (few open PRs, healthy GitHub API) — this only changes behavior under the two edge cases above

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.
@LeoBuron LeoBuron merged commit f1bd8f9 into develop Jul 10, 2026
11 checks passed
@LeoBuron LeoBuron deleted the ci-gate-fail-open branch July 10, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant