feat(forge): read PR review threads and required checks from GitHub GraphQL (RIG-1728) - #1354
Open
rigel-mintaka wants to merge 3 commits into
Open
rigel-mintaka wants to merge 3 commits into
rigel-mintaka wants to merge 3 commits into
Conversation
…raphQL (RIG-1728) GetPullRequest and Checks now add one paginated GraphQL leg. It fills PullRequest.Threads (with resolution and bot-suffixed authors) and sets Check.Required from isRequired(pullRequestNumber:). Rulesets make the REST branch-protection endpoint 404. Contexts are read through the PR's last commit, so the App needs only Pull requests: read. The fail-fast rate gate is now keyed per x-ratelimit-resource, so a drained GraphQL bucket no longer blocks REST calls, and RATE_LIMITED on HTTP 200 maps to RateLimitError. Refs RIG-1728 Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
The contexts read through the PR's last commit now select its oid. Each page fails with errHeadMoved when that oid differs from the REST head SHA. Before this, a push between the reads could clear a failing required check's flag. Refs RIG-1728 Co-authored-by: Matt Wilkinson <matt@rigel.build>
No caller retries errHeadMoved, so the comment now says only that a fresh read is consistent. Refs RIG-1728 Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Compass engineering docs preview: https://compass-server-rig-1728-pr-t.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
marked this pull request as ready for review
September 26, 2026 12:03
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.
Refs RIG-1728 (forge read half; PR ingestion and projection wait on RIG-4034).
What
GitHub.GetPullRequestandGitHub.Checksadd one paginated GraphQL leg (go/internal/forge/github_graphql.go):PullRequest.Threadsis filled fromreviewThreads, with resolution state and paged comments. A bot author gets the REST[bot]suffix. A null author gives an empty author.Check.Requiredcomes fromisRequired(pullRequestNumber:). The repo uses rulesets, so the REST branch-protection endpoint returns 404.pullRequest.commits(last:1), so the App needs only Pull requests: read. The commitoidis pinned to the REST head SHA on every page. A push mid-read fails witherrHeadMoved, never a silentRequired:false.x-ratelimit-resource(core vs graphql). A drained GraphQL bucket no longer blocks REST calls.RATE_LIMITEDon HTTP 200 maps to*RateLimitError.errorsarray is always an error. A cursor that is missing or repeated is an error.ChecksConditional(the notify poller) is unchanged and stays on REST core.Tests
github_graphql_test.go: paging (threads, contexts, both together), error branches, head moved, per-resource gate, RATE_LIMITED.endCursorandoidare canonicalized inwireVolatile.go test ./internal/forge/... ./internal/ingest/... ./internal/board/...passes.golangci-lint ./internal/forge/: 0 issues.rolluprequired) and cli/cli bot threads.