Skip to content

feat: add get_reviewers and get_status_checks to pull_request_read#2639

Open
salakonrad wants to merge 2 commits 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 2 commits into
github:mainfrom
salakonrad:feat/pr-reviewers-and-status-checks

Conversation

@salakonrad

@salakonrad salakonrad commented Jun 8, 2026

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, 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 + tests pass: go test ./pkg/github/...

🤖 Generated with Claude Code

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

Copilot AI 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.

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.

Comment thread pkg/github/pullrequests.go Outdated
Comment thread pkg/github/pullrequests.go Outdated
Comment thread pkg/github/pullrequests.go Outdated
Comment thread pkg/github/pullrequests.go Outdated
Comment thread pkg/github/pullrequests.go Outdated
Comment thread pkg/github/pullrequests.go Outdated
@salakonrad
salakonrad force-pushed the feat/pr-reviewers-and-status-checks branch 4 times, most recently from 9a10a8b to 7c277bf Compare July 16, 2026 10:05
salakonrad and others added 2 commits July 16, 2026 14:38
…_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

Adds unit tests for both methods (success and API-failure paths),
regenerates the pull_request_read toolsnap, and updates the generated
README tool documentation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve Copilot review comments on get_status_checks:

- Fix response body leak: deferred closures captured the reused `resp`
  variable, so earlier bodies were never closed. Add a closeStatusResponse
  helper that closes each body synchronously.
- Paginate GetCombinedStatus and ListCheckRunsForRef so the unified view
  includes all statuses and check runs, not just the first page.
- Collapse the duplicated status-error handling into the shared helper.
@salakonrad
salakonrad force-pushed the feat/pr-reviewers-and-status-checks branch from 2403b0a to e2ca49b Compare July 16, 2026 12:39
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