Skip to content

github: Rework GraphQL batching and error handling to salvage partial work - #253

Merged
jerry-skydio merged 1 commit into
mainfrom
jerry/revup/main/graphqutil
Jul 28, 2026
Merged

github: Rework GraphQL batching and error handling to salvage partial work#253
jerry-skydio merged 1 commit into
mainfrom
jerry/revup/main/graphqutil

Conversation

@jerry-skydio

@jerry-skydio jerry-skydio commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Restructure the GitHub GraphQL layer around a flat, resizable query so that
partial results are never thrown away and failed work is re-transacted
precisely.

GraphqlQuery now holds a heterogeneous list of aliased fields (SingleQuery)
with stable per-prefix alias indices, so it can split() in half or subset()
to arbitrary fields without result aliases colliding. GithubQuery subclasses
it with the repo-specific field builders and result parsers.

endpoint.graphql no longer raises on GraphQL field errors. It returns a
GraphqlResponse carrying partial data plus per-field errors, and only raises
for a request error (200 with no data) or a non-retryable HTTP status. Retry
backoff is now driven by GitHub's headers, honoring Retry-After and waiting
out an exhausted rate-limit budget, and retries secondary-limit (403) as well
as transient 5xx.

Also recover a PR's id via a head-ref lookup when a create comes back
"already exists", so a later update never targets an empty id, and log the
remaining rate-limit budget at the end of a verbose run.

@jerry-skydio

jerry-skydio commented May 21, 2026

Copy link
Copy Markdown
Collaborator Author

Reviews in this chain:
#253 github: Rework GraphQL batching and error handling to salvage partial work
 └#285 build: Rename types to core_types to avoid stdlib shadow

@jerry-skydio

jerry-skydio commented May 21, 2026

Copy link
Copy Markdown
Collaborator Author
# head base diff date summary
0 978add51 4599c0ba diff May 20 17:00 PM 3 files changed, 892 insertions(+), 472 deletions(-)
1 550ecf7b 4599c0ba diff May 21 13:44 PM 1 file changed, 274 deletions(-)
2 3466dcba b7cbff59 rebase Jun 19 10:47 AM 0 files changed
3 252ff615 aab90897 diff Jun 19 12:49 PM 0 files changed
4 9645b7ff d1589ef0 diff Jun 19 13:17 PM 1 file changed, 31 insertions(+), 23 deletions(-)
5 262cc29f d1589ef0 diff Jun 19 13:24 PM 1 file changed, 6 insertions(+), 6 deletions(-)
6 07520e54 d8008423 rebase Jun 26 10:38 AM 0 files changed
7 40b85aad d8008423 diff Jul 23 17:58 PM 2 files changed, 211 insertions(+), 291 deletions(-)
8 e365bc59 d8008423 diff Jul 24 13:00 PM 4 files changed, 911 insertions(+), 105 deletions(-)
9 bb9d762f d8008423 diff Jul 24 17:57 PM 2 files changed, 223 insertions(+), 220 deletions(-)
10 f39a1362 d8008423 diff Jul 24 17:59 PM 1 file changed, 22 insertions(+), 26 deletions(-)
11 381121c3 d8008423 diff Jul 24 18:19 PM 1 file changed, 38 insertions(+), 17 deletions(-)
12 1a44d102 d8008423 diff Jul 24 18:31 PM 2 files changed, 49 insertions(+), 53 deletions(-)
13 65c7b87d d8008423 diff Jul 24 20:00 PM 6 files changed, 650 insertions(+), 355 deletions(-)
14 c559e5af d8008423 diff Jul 27 13:13 PM 0 files changed
15 5efbae68 bb92346f rebase Jul 27 13:47 PM 0 files changed
16 26f03961 74e57423 diff Jul 27 14:34 PM 2 files changed, 181 insertions(+), 5 deletions(-)
17 6f986972 74e57423 diff Jul 27 16:09 PM 1 file changed, 3 deletions(-)
18 d050ee57 74e57423 diff Jul 27 16:12 PM 3 files changed, 16 insertions(+), 16 deletions(-)
19 483b9ab0 74e57423 diff Jul 27 16:16 PM 2 files changed, 5 insertions(+), 7 deletions(-)
20 dff3aa7e 74e57423 diff Jul 27 16:24 PM 2 files changed, 20 insertions(+), 7 deletions(-)

@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/fakeforge branch from 4599c0b to b7cbff5 Compare June 19, 2026 17:47
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch from 550ecf7 to 3466dcb Compare June 19, 2026 17:47
Base automatically changed from jerry/revup/main/fakeforge to main June 19, 2026 19:47
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch 2 times, most recently from 252ff61 to 9645b7f Compare June 19, 2026 20:17
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch 2 times, most recently from 262cc29 to 07520e5 Compare June 26, 2026 17:38
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch 7 times, most recently from 1a44d10 to 65c7b87 Compare July 25, 2026 03:00
@jerry-skydio jerry-skydio changed the title github: Add graphql utility class to contain query fields github: Rework GraphQL batching and error handling to salvage partial work Jul 27, 2026
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch 3 times, most recently from 5efbae6 to 26f0396 Compare July 27, 2026 21:34
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch 3 times, most recently from d050ee5 to 483b9ab Compare July 27, 2026 23:16
… work

Restructure the GitHub GraphQL layer around a flat, resizable query so that
partial results are never thrown away and failed work is re-transacted
precisely.

GraphqlQuery now holds a heterogeneous list of aliased fields (SingleQuery)
with stable per-prefix alias indices, so it can split() in half or subset()
to arbitrary fields without result aliases colliding. GithubQuery subclasses
it with the repo-specific field builders and result parsers.

endpoint.graphql no longer raises on GraphQL field errors. It returns a
GraphqlResponse carrying partial data plus per-field errors, and only raises
for a request error (200 with no data) or a non-retryable HTTP status. Retry
backoff is now driven by GitHub's headers, honoring Retry-After and waiting
out an exhausted rate-limit budget, and retries secondary-limit (403) as well
as transient 5xx.

Also recover a PR's id via a head-ref lookup when a create comes back
"already exists", so a later update never targets an empty id, and log the
remaining rate-limit budget at the end of a verbose run.
@jerry-skydio
jerry-skydio force-pushed the jerry/revup/main/graphqutil branch from 483b9ab to dff3aa7 Compare July 27, 2026 23:25
@jerry-skydio
jerry-skydio merged commit 4d581eb into main Jul 28, 2026
6 checks passed
@jerry-skydio
jerry-skydio deleted the jerry/revup/main/graphqutil branch July 28, 2026 19:19
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.

2 participants