Skip to content

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

Open
ipanasenko wants to merge 4 commits into
pingdotgg:mainfrom
ipanasenko:fix/github-team-reviewers
Open

ipanasenko wants to merge 4 commits into
pingdotgg:mainfrom
ipanasenko:fix/github-team-reviewers

Conversation

@ipanasenko

Copy link
Copy Markdown
Contributor

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 fix(prs): reviewer menu searches past the first page and keeps GitLab's requested reviewers #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

Before After
Reviewer picker: no match for frontend Reviewer 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 fix(github): teams with access show in the reviewer picker #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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 12, 2026
@ipanasenko
ipanasenko marked this pull request as ready for review November 12, 2026 10:22
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 53e7afc

Macroscope's review found this PR approvable — The reviewer picker now includes visible organization teams with access to the repository, while preserving people results if team lookup fails. This adds selectable reviewers without granting access or automatically sending review requests.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

No code changes detected at 62727f9. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5e8aa97 and 62727f9.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

GitHub reviewer candidate lookup now includes eligible organization teams alongside assignable people. Team results are filtered by repository access, can match the search query, and contribute to pagination status. Team-query errors do not prevent people candidates from being returned.

Changes: GitHub reviewer team candidates

Layer / File(s) Summary
Team query and result contract
packages/source-control-github/src/server/pullRequestReads.graphql, packages/source-control-github/src/server/pullRequestReads.graphql.ts
Adds the ReviewerTeams query and its result schemas. Renames the schema for teams already requested as reviewers.
Team filtering and candidate merging
packages/source-control-github/src/server/gitHubPullRequestJson.ts, packages/source-control-github/src/server/gitHubPullRequestJson.test.ts
Filters teams by repository access and merges eligible teams with people candidates. Search matching and truncation account for both candidate types.
Reviewer candidate query integration
packages/source-control-github/src/server/GitHubPullRequestApi.ts, packages/source-control-github/src/server/GitHubPullRequestApi.test.ts
Runs people and team queries concurrently. Team-query errors produce no team results, while people candidates remain available.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant GitHubPullRequestApi
  participant GitHubGraphQL
  participant toReviewerTeams
  participant toReviewerCandidates
  GitHubPullRequestApi->>GitHubGraphQL: Run people and team queries
  GitHubGraphQL-->>GitHubPullRequestApi: Return query results
  GitHubPullRequestApi->>toReviewerTeams: Convert team results
  toReviewerTeams-->>GitHubPullRequestApi: Return eligible teams
  GitHubPullRequestApi->>toReviewerCandidates: Combine people and team candidates
Loading

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: Minimal · previous review 5e8aa

Teams with repository access now appear in the GitHub reviewer picker, and people still appear if the team lookup fails. No concrete defect was found in the changed code. The only open item is the web test failure in CI, which the visible logs do not tie to this change; confirm it is unrelated before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(github): teams with access show in the reviewer picker" names the main change: the GitHub reviewer-candidate read now returns teams with repository access. It follows conventional commi…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, with a conventional-style title and an agent attribution line. The Problem section explains the missing …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(github): teams with access show in the reviewer picker" names the main change: the GitHub reviewer-candidate read now returns teams with repository access. It follows conventional commit form and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, with a conventional-style title and an agent attribution line. The Problem section explains the missing team results and the reproduction (typing frontend shows no match). The Change section explains the fix. The Scope section explains why no issue is linked and notes that the change is a small fix. The Verification section lists manual checks, focused tests, and what was not checked. The description is complete and specific. The only gap is that the Scope section gives no issue link, but it explains why none is needed, as the template allows.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 53e7afc and 5e8aa97.

Files selected for processing: 6

  • packages/source-control-github/src/server/GitHubPullRequestApi.test.ts
  • packages/source-control-github/src/server/GitHubPullRequestApi.ts
  • packages/source-control-github/src/server/gitHubPullRequestJson.test.ts
  • packages/source-control-github/src/server/gitHubPullRequestJson.ts
  • packages/source-control-github/src/server/pullRequestReads.graphql
  • packages/source-control-github/src/server/pullRequestReads.graphql.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

packages/source-control-github/src/server/GitHubPullRequestApi.test.ts-4215-4215: 1

4215-4215: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Make the typed-search fixture match the query.

The mock returns team web for ReviewerTeams(query: "octo"), and this assertion expects acme/web. GitHub filters that query by team name and slug, so the real response would omit web. Use a team whose name or slug matches octo, or expect no team in this case. (docs.github.com)

As per coding guidelines, “Test behavior that can break.” As per path instructions, “Hold changed tests to the rules in docs/internals/testing.md.”

Sources: Coding guidelines, Path instructions

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ee90bdc and 38d9bd5.

Files selected for processing: 6

  • packages/source-control-github/src/server/GitHubPullRequestApi.test.ts
  • packages/source-control-github/src/server/GitHubPullRequestApi.ts
  • packages/source-control-github/src/server/gitHubPullRequestJson.test.ts
  • packages/source-control-github/src/server/gitHubPullRequestJson.ts
  • packages/source-control-github/src/server/pullRequestReads.graphql
  • packages/source-control-github/src/server/pullRequestReads.graphql.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…ld match

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review November 12, 2026 10:34

Dismissing prior approval to re-evaluate 53e7afc

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head 53e7afcf7dbecf5fa6893f5c584014dfdb3fb19a on a linux boat vm with real github credentials, playwright and /usr/bin/google-chrome.

  • reproduced on github/main at d6c1d17793: this pr's github reviewer picker returns "Nobody with access matches that." for ping-devs, although the live github team query confirms repository access.
  • stopped main's server before starting the exact pr head. added a real github-backed project through the app and completed a real codex gpt-6.1-sol turn on each version. no mocks, fixtures or demo data.
  • on the pr head, the same picker search returns pingdotgg/ping-devs, tagged "team". people search still returns maria-rcks; an unmatched search shows the empty state; closing and reopening the picker returns one team row.
  • checked the actual web-client websocket response and a typed search through the running server's github adapter:
pullRequests.reviewerCandidates
  host=github.com repository=pingdotgg/t3code number=35126
  Success: pingdotgg/ping-devs (team, isRequested=false), 8 people, truncated=false
same live RPC with query="ping"
  Success: pingdotgg/ping-devs (team)

blacksmith checks passed: the two focused suites (186 tests), then vp run check:changed ee90bdc9405d8d4b8ff78ce2133ccb04844298ab against the pr merge base. the latter passed format, lint, knip, graphql generation, typechecks for 11 packages and 188 tests. github ci is also green. no code changes or pushes were needed.

before, on main:

main: searching ping-devs finds no reviewer

after, on the exact pr head:

pr: searching ping-devs finds the team

team, people, unmatched search, then team again; playback and seeking checked after upload:

reviewer search interaction in the real app

Not verified

sending or removing a review request was not exercised because it would notify real reviewers and mutate the pr. native ios/android, electron, remote/relay/tunnel connections, tokens without read:org, user-owned repositories, already-requested-team deduplication and more-than-100-result pagination were not exercised in the running app. the existing focused tests cover the scope-error fallback and requested-team deduplication.

This branch has not been deployed

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants