create-tag: switch GitHub API from REST to GraphQL#43
Merged
Conversation
Replace per-commit REST API calls (ghapi) with batched GitHub GraphQL
queries, reducing ~100+ HTTP requests and 60+ seconds of mandatory
sleep to 1-3 requests with no sleeps.
Benchmarked against osbuild/osbuild-composer:
23 commits (v170..v171): 111 API calls / 100.3s → 1 call / 1.2s (81.6x)
7 commits (v171..v172): 34 API calls / 27.3s → 1 call / 0.9s (31.6x)
3 image tags: 6 API calls / 5.2s → 1 call / 0.4s (11.7x)
Images changelog output is byte-identical. PR coverage is a strict
superset (GraphQL associatedPullRequests finds PRs that the REST search
index occasionally misses). Author name resolution for bot accounts is
also fixed (REST/ghapi returned '{}' instead of falling back to login).
Co-authored-by: Cursor <cursoragent@cursor.com>
thozza
approved these changes
May 21, 2026
Member
thozza
left a comment
There was a problem hiding this comment.
Amazing. Tested locally, it seems to work and it is fast as hell... 👍
thozza
reviewed
May 21, 2026
Comment on lines
+212
to
+214
| except Exception as e: | ||
| msg_info(f"GraphQL request failed for batch: {e}") | ||
| continue |
Member
There was a problem hiding this comment.
Note that in case of an error (could be a transient network issue), the continue will drop a whole batch of commits and the final pushed tag will be incomplete. It may make more sense to hard fail in such a case or catch a more specific exception.
Contributor
Author
There was a problem hiding this comment.
Darn, didn't see that comment in time for the merge, but will create a follow-up.
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.
Replace per-commit REST API calls (ghapi) with batched GitHub GraphQL queries, reducing ~100+ HTTP requests and 60+ seconds of mandatory sleep to 1-3 requests with no sleeps.
Benchmarked against osbuild/osbuild-composer:
23 commits (v170..v171): 111 API calls / 100.3s → 1 call / 1.2s (81.6x)
7 commits (v171..v172): 34 API calls / 27.3s → 1 call / 0.9s (31.6x)
3 image tags: 6 API calls / 5.2s → 1 call / 0.4s (11.7x)
Summary