Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(github): teams with access show in the reviewer picker #31150

Closedipanasenko(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/31150/headopened View on GitHub

Note

🤖 Written by Claude Opus 5.5 on behalf of Illia

Problem

On GitHub, the pull request reviewer picker can't find a team. Typing a team name such as frontend shows "Nobody with access matches that.", so a team can only be asked for a review on GitHub itself. The picker lists assignableUsers (people only), plus teams already requested on the pull request, so those requests can be taken back.

Change

 listReviewerCandidates (GitHub)
   ReviewerCandidates       # people + already requested reviewers
+  ReviewerTeams            # organization teams, in parallel
+    keep teams whose repositories include owner/name
+    on any failure: no teams, people still listed
   merge: requested → teams → people
  • ReviewerTeams reads organization(login: owner).teams. It needs read:org, and a GraphQL query GitHub refuses fails whole. That's why teams were left out of ReviewerCandidates. They stay in their own query and are dropped on failure (a token without read:org, or a repository owned by a user).
  • GitHub refuses a review request to a team without access to the repository, so each team's repositories(query: name) is checked for the exact owner/name. The REST list of a repository's teams needs admin (it returns 404 with repo + read:org as a non-admin), so it can't be used here.
  • An already requested team is listed once. More than 100 teams sets the existing truncated flag.
  • No client or contract change: web and mobile already render kind: "team" candidates, and requests already send team_reviewers.

Scope and approval

A small, focused fix for an obvious bug, with no prior issue. The capability is half there already: the candidate contract has kind: "team", both pickers render team rows, the request payload sends team_reviewers, and the mobile picker says "Search people and teams with access to this repository." But the GitHub adapter never returns a team that hasn't been requested yet, so none of this can be reached. This PR changes only the GitHub reviewer candidate read. GitLab, Forgejo and Bitbucket are unchanged. #19375 made teams that were already requested show up. #22489 (open) adds host search for people and doesn't touch teams.

Verification

BeforeAfter
Reviewer picker: no match for frontendReviewer picker: stashgg/frontend team listed
  • Manual check: local dev server against a real organization pull request. Typing frontend lists the frontend team, tagged "team". A live query on that organization returned 11 teams. The 9 with access to the repository are offered; the 2 without access aren't.
  • GitHubPullRequestApi.test.ts: teams with access appear between the requested reviewers and the people, and an INSUFFICIENT_SCOPES refusal of the teams query still returns the people. Both fail on main.
  • gitHubPullRequestJson.test.ts: the access filter is case-insensitive and drops a loose query match (acme/web-legacy), a requested team appears once, and a teams next page sets truncated.
  • vp run check:changed: format, lint, knip, GraphQL codegen check, typecheck and tests pass.
  • Not checked: sending a team review request from the picker. It uses the existing team_reviewers path, and I didn't want to ping a real team.

Done with Claude Opus 5.5 in Claude Code, run through T3 Code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. tanstack-source added labelsbug

    3. Note

      🤖 Claude Opus 5.5 responding on behalf of Theo

      Closing. This PR conflicts with main in 4 files, which is more than we will review as a rebase. If the change still matters, open a fresh PR from current main.

Sign in to join this conversation.