Skip to content

Per-repository pull request list never shows stack badges #16034

Closed

Description

@saphid

Bug

On a GitHub repository's pull request list, rows that belong to a GitHub stack show no stack badge when the list comes from the per-repository read (GitHubPullRequestCli.listPullRequests). Each time, the server logs Pull request stack membership enrichment failed (operation listPullRequestStackMemberships). The search-backed listing is not affected, which is why this usually goes unnoticed.

Confirmed on main 7812230 (2026-10-05). It has been present since #10875 (stack membership enrichment), which came after the GraphQL budget from #6466.

Root cause

graphqlRead (apps/server/src/pullRequest/GitHubPullRequestCli.ts) sends every document through graphQlBudget.query, which appends rateLimit { cost limit remaining resetAt } (apps/server/src/sourceControl/githubGraphQlBudget.ts). So the answer has a data.rateLimit key beside the s0..sN aliases. RawStackMembershipsSchema (apps/server/src/pullRequest/gitHubPullRequestJson.ts) decodes data as Record<string, null | { pullRequest: ... }> with pullRequest required. The rateLimit entry therefore fails the whole decode. The enrichment's Effect.catch swallows the failure and returns the rows without stack. The sibling stats schema already makes pullRequest optional, which is why counts still work.

The unit tests miss it because the CLI test mocks the membership answer without the rateLimit key that the real, budget-wrapped document produces.

Reproduction

Unit level:

decodePullRequestStackMembershipsJson(JSON.stringify({ data: {
  s0: { pullRequest: { stack: { number: 7, size: 2, baseRefName: "main" }, stackEntry: { position: 1 } } },
  rateLimit: { cost: 1, limit: 5000, remaining: 4990, resetAt: "2099-01-01T00:00:00Z" },
}}))
// main: Failure. Without the rateLimit key: Success.

Server level: run listPullRequests against a repository with a native stack. The rows come back without stack, and the warning above is logged. The same rows from searchPullRequests do carry stack.

Expected

Rows in a stack carry their stack membership on both listing paths, and nothing is logged.

Activity

  1. saphid commented on Oct 10, 2026

    @saphid
    ContributorAuthor

    Fixed on main by #16986: it removed the rateLimit GraphQL field that broke the stack-membership decode. Closing #16035 as no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions