Conversation
Test Coverage ReportChanged files have no coverage data (not instrumented or no tests ran). |
Greptile SummaryThis PR fixes a GraphQL batch enrichment bug where AO's 18-check CI pipeline exceeded the previous
Confidence Score: 5/5Safe to merge — the change raises a context fetch limit that was silently dropping check details, and the existing REST fallback guards correctness for any repo that exceeds the new limit. The change is narrowly scoped: one new named constant, one template interpolation, and corresponding test updates. The No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/plugins/scm-github/src/graphql-batch.ts | Introduces CI_CONTEXTS_FIRST = 20 constant and substitutes it into the GraphQL template; preserves pageInfo.hasNextPage REST fallback; updates inline comments for accuracy. |
| packages/plugins/scm-github/test/graphql-batch.test.ts | Imports and asserts CI_CONTEXTS_FIRST, adds a query-generation assertion for contexts(first: 20), renames/updates test descriptions to match new behaviour, and refreshes stale fixture comments. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[GraphQL batch query\ncontexts first: CI_CONTEXTS_FIRST=20] --> B{pageInfo.hasNextPage?}
B -- false\ncomplete page --> C[parseCheckContexts\nreturn ciChecks]
B -- true\ntruncated --> D[ciChecks = undefined]
D --> E[maybeDispatchCIFailureDetails\nfalls back to REST getCIChecks]
C --> F[Use ciChecks directly\nno REST call needed]
Reviews (2): Last reviewed commit: "fix(scm-github): cover 18-check CI in Gr..." | Re-trigger Greptile
Raise the bounded statusCheckRollup context page to 20 so normal AO PRs include individual CI details without REST fallback, while preserving hasNextPage fallback for larger repos.
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub SCM plugin’s GraphQL batch PR enrichment query to request a larger (but still bounded) page of CI check contexts so AO’s current 18-check CI fits within the initial batch response, reducing unnecessary REST fallback for typical PRs.
Changes:
- Introduces and exports
CI_CONTEXTS_FIRST = 20as the bounded per-PR CI context page size. - Updates the GraphQL batch query to use
statusCheckRollup.contexts(first: ${CI_CONTEXTS_FIRST})instead of a hardcoded smaller value. - Adjusts unit tests and comments to reflect the new bounded 20-context behavior and its truncation fallback semantics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/plugins/scm-github/src/graphql-batch.ts |
Adds CI_CONTEXTS_FIRST and applies it to the GraphQL batch query’s statusCheckRollup.contexts(first: ...) selection, with updated explanatory comments. |
packages/plugins/scm-github/test/graphql-batch.test.ts |
Updates tests to assert the query includes the new contexts(first: ${CI_CONTEXTS_FIRST}) and adds coverage for the new sizing constant. |
Fixes #1969
Summary
CI_CONTEXTS_FIRSTconstant set to 20 for GitHub GraphQL batch PR enrichment.statusCheckRollup.contexts(first: ...)so AO's current 18-check CI fits in the batch response.pageInfo.hasNextPagehandling so repos with more than 20 contexts still fall back to REST for complete details.Tests
pnpm --filter @aoagents/ao-core build && pnpm --filter @aoagents/ao-plugin-scm-github test -- graphql-batch.test.tspnpm buildpnpm typecheckpnpm lint(passes with existing warnings)pnpm test(fails on existing/unrelated environment-sensitive tests: notifier-desktop integration expectations on macOS with terminal-notifier, andcanonicalCompareKey > expands ~ to HOMEpath normalization)