Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Openipanasenko(GitHub profile, opens in a new tab)wants to merge 12 commits intomain fromrefs/pull/35126/headopened View on GitHub

Note

🤖 Written by Claude Opus 5.5 on behalf of Illia

Fresh from current main, replacing #31150, which was closed for conflicts.

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, same `query`
+    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.
  • The host search from #22489 now covers teams too: the typed text also goes to teams(query:), which GitHub matches on team name and slug, and host-matched teams are kept alongside host-matched people.
  • An already requested team is listed once. More than 100 teams sets the existing truncated flag, which turns the host search on.
  • 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. Other hosts are unchanged. #19375 made teams that were already requested show up.

Verification

BeforeAfter
Reviewer picker: no match for frontendReviewer picker: stashgg/frontend team listed
  • Manual check: local dev server on this branch against a real organization pull request. The picker lists the 9 teams with access to the repository before the people (the organization has 11; the 2 without access aren't offered). Typing frontend lists the frontend team, tagged "team". The before capture is from #31150's base, where the picker behaved the same for this case.
  • Live teams(first: 100, query: "front") on that organization returns the frontend team with the repository in its access list.
  • GitHubPullRequestApi.test.ts: teams with access appear between the requested reviewers and the people; an INSUFFICIENT_SCOPES refusal of the teams query still returns the people; a typed query is sent to both reads and keeps host-matched teams. All three 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. Pushed55019d5

    2. Pushed8693be3

    3. Pushedb8c376b

    4. Pushed2a9ee17

    5. Pusheda586351

    6. Pushed7f78e62

    7. Pusheddf43749

Sign in to join this conversation.