Try fix "awaiting approval" issue#8835
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to address cases where GitHub Actions workflow runs are “awaiting approval” (common for fork PRs) and therefore don’t emit check runs yet, causing the extension to treat the PR as having no checks and potentially show an overly-optimistic overall status.
Changes:
- Extend the status-check GraphQL queries to also fetch
checkSuitesdata for the latest commit. - Add logic in
GitHubRepository.getStatusChecks()to synthesize pending check statuses from “awaiting approval” check suites and recompute the overall check state. - Add unit tests covering the new “awaiting approval” status synthesis behavior.
Show a summary per file
| File | Description |
|---|---|
| src/test/github/githubRepository.test.ts | Adds tests for synthesizing pending statuses from “awaiting approval” check suites. |
| src/github/queriesShared.gql | Fetches checkSuites in the checks queries to detect workflows awaiting approval. |
| src/github/graphql.ts | Introduces CheckSuiteForRollup and wires it into GetChecksResponse. |
| src/github/githubRepository.ts | Synthesizes pending statuses from check suites awaiting approval and recalculates overall check state. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+1199
to
+1210
| checkSuites(first: 100) { | ||
| nodes { | ||
| status | ||
| conclusion | ||
| workflowRun { | ||
| event | ||
| workflow { | ||
| name | ||
| } | ||
| } | ||
| } | ||
| } |
Comment on lines
+2148
to
+2163
| const existingWorkflowNames = new Set( | ||
| existingStatuses.map(status => status.workflowName).filter((name): name is string => !!name), | ||
| ); | ||
|
|
||
| const awaitingApproval: PullRequestCheckStatus[] = []; | ||
| for (const suite of checkSuites) { | ||
| // A suite that is waiting or has only been requested and hasn't concluded is | ||
| // awaiting approval before it can run. | ||
| if (suite.conclusion !== null || (suite.status !== 'WAITING' && suite.status !== 'REQUESTED')) { | ||
| continue; | ||
| } | ||
|
|
||
| const workflowName = suite.workflowRun?.workflow.name; | ||
| if (workflowName && existingWorkflowNames.has(workflowName)) { | ||
| continue; | ||
| } |
roblourens
approved these changes
Jul 9, 2026
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.
See #8813