Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped server decoder fix with regression tests, allowing stack-membership results to coexist with the existing GraphQL rate-limit field. It does not change product defaults, production infrastructure, APIs, or static-analysis configuration. You can add or adjust custom eligibility rules. Learn more. |
|
Review requested
Logged so this PR shows when a maintainer was asked to review it. |
The GraphQL budget appends a `rateLimit` reading to every document it sends, so the stack-membership answer carries a `rateLimit` key beside the `s<n>` aliases. The membership schema required `pullRequest` on every key, so the whole decode failed, enrichment was dropped with a warning, and the per-repository listing showed no stack badges. Make `pullRequest` optional; the decoder already reads only `s<n>` aliases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
8244cf0 to
3ec4980
Compare
|
Closing: #16986 (merged 2026-10-08) stopped adding the |
Fixes #16034.
Problem
The per-repository pull request listing (
GitHubPullRequestCli.listPullRequests) never shows stack badges. Every GraphQL document goes through the GraphQL budget, which appends arateLimitreading, so the stack-membership answer has adata.rateLimitkey beside itss<n>aliases.RawStackMembershipsSchemarequiredpullRequeston every key indata, so the whole decode failed. The enrichment swallowed the failure, loggedPull request stack membership enrichment failed, and returned the rows withoutstack.Why this qualifies
It is a small fix for an obvious bug, with an issue (#16034) that describes the root cause.
Fix
pullRequestis now optional inRawStackMembershipsSchema, as it already is in the sibling stats schema. The decoder already reads only thes<n>aliases, so therateLimitentry is ignored instead of failing the decode. That is the whole production change: one schema field inapps/server/src/pullRequest/gitHubPullRequestJson.ts.Tests:
gitHubPullRequestJson.test.ts: decodes a membership answer that has therateLimitkey beside the aliases.GitHubPullRequestCli.test.ts: the existing fallback-enrichment test now returns therateLimitkey that the real budget-wrapped document gets.Both tests fail with main's decoder (2 failed / 216 passed) and pass with this change (218/218).
Evidence
This is a server-only change, so the proof is a server-level trace rather than screenshots. For each revision, a small harness imported that revision's real
GitHubPullRequestCli, GraphQL budget and process runner. It calledlistPullRequestsagainst an offline fake GitHub, using the realghCLI routed to a local socket, no credentials and no network. The fake repository has four open PRs; #101 and #102 form native stack 7. Before is main 7812230572; after is this PR's head.listPullRequests→ #101stackmainlistPullRequests→ #102stackmainWARN Pull request stack membership enrichment failed { operation: 'listPullRequestStackMemberships', rows: 4 }PullRequestStackMemberships, with the budget'srateLimitselectionsearchPullRequests(control)The fake GitHub's answer to the membership document contained
data.rateLimitbesides0–s3, exactly the shape that failed the decode.Checks at this head (
CI=true): the two test files above (218 passed), andvp lint/vp fmt --check/vp run knip:checkon the changed files. GPT-6.1 Sol (high) reviewed the change: SHIP, no findings. This head is that reviewed commit rebased onto current main with an identical patch.Surfaces
stackwhen the server sends it, and now they get it from the per-repository path too.Not verified
Coordination and the fix by Claude Opus 5.5; review by GPT-6.1 Sol (high); the before/after trace by GPT-6 Astra, all through T3 Code.
🤖 Generated with Claude Code