Skip to content

🏗️🔧:survive a failed call to the GitHub API - #1816

Merged
DerekNonGeneric merged 2 commits into
livefrom
fix/land-transient-failures
Aug 15, 2026
Merged

🏗️🔧:survive a failed call to the GitHub API#1816
DerekNonGeneric merged 2 commits into
livefrom
fix/land-transient-failures

Conversation

@DerekNonGeneric

Copy link
Copy Markdown
Member

Landing #1815 crashed with a stack trace, then worked on a second run with nothing changed — which is what a transient 502 or a throttled request looks like from here. Now that the queue runs unattended on a label, that failure mode reaches somebody who did not type the command and cannot read the stack.

Reads are tried twice, a merge is not

A read that fails because GitHub hiccuped is not a reason to refuse to land, so gh retries once. The merge itself deliberately does not: repeating one that had already reached GitHub would come back reporting the pull request as unmergeable, when in fact it had just been merged.

Anything else says so in a line

Could not land #1700: Command failed: gh api repos/OpenINF/openinf.github.io/pulls/1700 …

rather than a Node stack trace.

Making that true meant working out the repository, the default branch and the actor when they are first wanted rather than as the file loads. They were computed at the top of the module, which runs before any try can cover it — so with gh broken, the guard I had just added was bypassed entirely. Verified by putting a gh on PATH that fails every time: before, a stack trace; now, the line above.

Verification

  • nps test — 16/16 tasks, 63/63 tests
  • Refusals still correct by hand: a closed pull request, a non-numeric argument, no argument
  • With gh failing on every call: one line, exit 1

Note

This is the first pull request the commit queue can land, since #1815 put the workflow on live and pull_request_target takes its workflow from the base branch. Applying commit-queue here is the end-to-end test of the app, the token, both new guards, and whether the merge triggers deploy.yml.

Landing #1815 crashed once with a stack trace and worked on a second
run, unchanged, which is what a transient 502 or a throttled request
looks like from here. Reads are now tried twice; a merge is not, since
repeating one that already reached GitHub would report the pull request
as unmergeable when it had in fact just merged.

Anything still unexpected reports a line rather than a stack trace. That
needed the repository, the default branch and the actor to be worked out
when first wanted instead of as the file loads, since nothing could
catch them failing up there.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for gh-pages-openinf ready!

Name Link
🔨 Latest commit 90a68f7
🔍 Latest deploy log https://app.netlify.com/projects/gh-pages-openinf/deploys/6a7fdee01b7d690008364ea8
😎 Deploy Preview https://deploy-preview-1816--gh-pages-openinf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DerekNonGeneric DerekNonGeneric added the commit-queue Land this pull request when its checks pass label Aug 15, 2026
@openinf-commit-queue openinf-commit-queue Bot removed the commit-queue Land this pull request when its checks pass label Aug 15, 2026
@openinf-commit-queue

Copy link
Copy Markdown

The commit queue did not land this. See https://github.com/OpenINF/openinf.github.io/actions/runs/31862168870 — the label has been removed, so re-apply it once the reason is dealt with.

The queue reports as a check like any other job, so requiring every
check to have finished meant requiring itself to have finished, which it
cannot do until it stops waiting. Labelling #1816 deadlocked on exactly
that, which is what an end-to-end test is for.

Its own run is identified by the run id in the check's details URL
rather than by the job's name, so renaming the job cannot quietly
reintroduce the deadlock. Every other run still counts, including
another queue run on the same commit.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
@DerekNonGeneric
DerekNonGeneric merged commit 3c98bdf into live Aug 15, 2026
14 checks passed
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