Skip to content

feat: add get_reviewers and get_status_checks to pull_request_read#2639

Open
salakonrad wants to merge 1 commit into
github:mainfrom
salakonrad:feat/pr-reviewers-and-status-checks
Open

feat: add get_reviewers and get_status_checks to pull_request_read#2639
salakonrad wants to merge 1 commit into
github:mainfrom
salakonrad:feat/pr-reviewers-and-status-checks

Conversation

@salakonrad
Copy link
Copy Markdown

Summary

This PR extends the pull_request_read tool with two new methods that address gaps in the current PR toolset:

  • get_reviewers — returns the list of pending reviewer requests for a pull request, including both individual users and team reviewers. Previously, the get method only exposed requested user reviewers (as a flat list of logins) and team reviewers were entirely invisible in the MCP server. This uses the PullRequests.ListReviewers REST endpoint.

  • get_status_checks — returns a unified view of all status checks for the PR's head commit by combining:

    • Legacy commit statuses (e.g. Atlantis plan/policy_check, external CI tools) via Repositories.GetCombinedStatus
    • Modern check runs (GitHub Actions, etc.) via Checks.ListCheckRunsForRef

    The response includes a top-level combined_state and a total_count across both sources. Previously these required two separate calls (get_status and get_check_runs) with no unified view.

New types (minimal_types.go)

Type Purpose
MinimalReviewerUser Pending user reviewer (login, html_url)
MinimalReviewerTeam Pending team reviewer (slug, name, description, html_url)
MinimalPRReviewers Top-level response for get_reviewers
MinimalCommitStatus Single legacy commit status entry
MinimalStatusChecks Combined check runs + statuses response

Test plan

  • get_reviewers returns correct users and teams for a PR with review requests
  • get_reviewers returns empty arrays for a PR with no pending reviewers
  • get_status_checks returns both legacy statuses and check runs for a PR
  • get_status_checks combined_state reflects the overall GitHub status
  • Existing methods (get, get_reviews, get_check_runs, etc.) unaffected
  • Build passes: go build ./pkg/github/...

🤖 Generated with Claude Code

…_read

Extends the pull_request_read tool with two new methods:

- get_reviewers: returns pending reviewer requests (both individual users
  and teams) using the PullRequests.ListReviewers API. This fills a gap
  in the existing toolset — requested team reviewers were previously
  not exposed anywhere in the MCP server.

- get_status_checks: returns a unified view of all status checks for a
  PR's head commit by combining legacy commit statuses (e.g. Atlantis
  plan/policy results) and modern GitHub Actions check runs into a single
  response with a top-level combined_state.

New output types added to minimal_types.go:
  - MinimalReviewerUser, MinimalReviewerTeam, MinimalPRReviewers
  - MinimalCommitStatus, MinimalStatusChecks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 06:34
@salakonrad salakonrad requested a review from a team as a code owner June 8, 2026 06:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds new pull request tool methods to retrieve requested reviewers and a unified status-checks view (commit statuses + check runs), with accompanying minimal response types.

Changes:

  • Extend pull request tool method enum + dispatcher to support get_reviewers and get_status_checks.
  • Implement GetPullRequestReviewers and GetPullRequestStatusChecks in the GitHub PR tool.
  • Add minimal JSON output types for reviewers and combined status/check data.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
pkg/github/pullrequests.go Adds tool methods and implementations for requested reviewers and unified status checks.
pkg/github/minimal_types.go Introduces minimal response structs for reviewers and combined status/checks output.

if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get pull request", resp, err), nil
}
defer func() { _ = resp.Body.Close() }()
if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get combined status", resp, err), nil
}
defer func() { _ = resp.Body.Close() }()
if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get check runs", resp, err), nil
}
defer func() { _ = resp.Body.Close() }()

sha := pr.GetHead().GetSHA()

combinedStatus, resp, err := client.Repositories.GetCombinedStatus(ctx, owner, repo, sha, nil)
return ghErrors.NewGitHubAPIStatusErrorResponse(ctx, "failed to get combined status", resp, body), nil
}

checkRuns, resp, err := client.Checks.ListCheckRunsForRef(ctx, owner, repo, sha, nil)
Comment on lines +395 to +401
if resp.StatusCode != http.StatusOK {
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read response body: %w", err)
}
return ghErrors.NewGitHubAPIStatusErrorResponse(ctx, "failed to get pull request", resp, body), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants