Skip to content

🐛 Fall back when check suites are truncated - #5150

Open
ECD5A wants to merge 1 commit into
ossf:mainfrom
ECD5A:fix/checksuite-truncation-fallback
Open

🐛 Fall back when check suites are truncated#5150
ECD5A wants to merge 1 commit into
ossf:mainfrom
ECD5A:fix/checksuite-truncation-fallback

Conversation

@ECD5A

@ECD5A ECD5A commented Jul 30, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix.

  • PR title follows the guidelines defined in our pull request documentation

What is the current behavior?

GitHub GraphQL check-suite results are cached even when the checkSuites connection is truncated.

When a commit has more check suites than the GraphQL query returns, the partial result is treated as complete. Because the commit SHA is present in the cache, listCheckRunsForRef does not use its existing REST fallback.

As a result, successful CI check runs located after the first GraphQL page can be missed by the CI-Tests and SAST checks.

What is the new behavior (if this is a feature change)?

The GitHub client now reads PageInfo.HasNextPage from the checkSuites connection.

When the GraphQL result is truncated, the pull request head SHA is not added to the check-run cache. This produces a cache miss and allows the existing REST fallback to retrieve the check runs for that ref.

A regression test verifies that truncated GraphQL data triggers the REST fallback and returns a successful github-actions check run.

  • Tests for the changes have been added

Which issue(s) this PR fixes

Fixes #5149

Special notes for your reviewer

The branch contains one DCO-signed commit.

Fork validation results:

  • build: passed
  • docker-build: passed
  • golangci-lint: passed
  • gitlab-tests: passed
  • PR title uses the required :bug: prefix

The fork's Dependency Review workflow could not run because Dependency Graph is not enabled on the fork.

The integration workflow reported two unrelated failures in e2e/vulnerabilities_test.go. The live OSV response returned three vulnerability warnings and score 7, while the test fixture expected four warnings and score 6. The other 58 executed integration specifications passed. This change does not modify vulnerability-related code.

Does this PR introduce a user-facing change?

Scorecard now falls back to the GitHub REST API when GraphQL check-suite results are truncated, preventing CI-Tests and SAST from missing successful check runs.

@ECD5A
ECD5A requested a review from a team as a code owner July 30, 2026 23:21
@ECD5A
ECD5A requested review from jeffmendoza and justaugustus and removed request for a team July 30, 2026 23:21
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 30, 2026
@dosubot

dosubot Bot commented Jul 30, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-08-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about scorecard Add Dosu to your team

@ECD5A ECD5A changed the title Fix truncated check suite cache entries 🐛 Fall back when check suites are truncated Jul 30, 2026
Signed-off-by: ECD5A <111098024+ECD5A@users.noreply.github.com>
@ECD5A
ECD5A force-pushed the fix/checksuite-truncation-fallback branch from cb5390a to 7b4a590 Compare August 10, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

BUG: CI-Tests misses successful CI when checkSuites exceed the first 30

1 participant