Report what GitHub said when the commit request fails, and retry a transient one - #1
Merged
Merged
Conversation
…ansient one --fail-with-body writes the error body and exits non-zero. Under set -e that exit skipped the reporting below it and the EXIT trap then deleted the file, so an auth failure or a 502 surfaced as curl's generic "returned error: NNN" and nothing GitHub actually said. The careful error handling that exists only ever ran on HTTP 200, which is where GraphQL puts most of its errors -- but not 401s, rate limits or 5xx. The request also had no timeout and no retry, and it runs after the archive has already been published to R2: a transient failure here leaves the bucket ahead of both state branches until the next ingest repairs it. A retry is safe rather than merely convenient, because expectedHeadOid makes the mutation conditional -- if the first attempt did land, the retry is refused for the right reason instead of committing twice.
barnumbirr
force-pushed
the
report-what-github-said
branch
from
September 3, 2026 07:00
6e49111 to
0621383
Compare
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.
--fail-with-body writes the error body and exits non-zero. Under set -e that
exit skipped the reporting below it and the EXIT trap then deleted the file,
so an auth failure or a 502 surfaced as curl's generic "returned error: NNN"
and nothing GitHub actually said. The careful error handling that exists only
ever ran on HTTP 200, which is where GraphQL puts most of its errors -- but
not 401s, rate limits or 5xx.
The request also had no timeout and no retry, and it runs after the archive
has already been published to R2: a transient failure here leaves the bucket
ahead of both state branches until the next ingest repairs it. A retry is
safe rather than merely convenient, because expectedHeadOid makes the mutation
conditional -- if the first attempt did land, the retry is refused for the
right reason instead of committing twice.