feat(pull_requests): add get_ci_summary method to pull_request_read tool#2261
Open
mikelane wants to merge 1 commit intogithub:mainfrom
Open
feat(pull_requests): add get_ci_summary method to pull_request_read tool#2261mikelane wants to merge 1 commit intogithub:mainfrom
mikelane wants to merge 1 commit intogithub:mainfrom
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
7e8d487 to
1a62381
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
get_ci_summarymethod to the existingpull_request_readtool that aggregates combined commit status and check runs into a single result with an overall verdict.Problem: Determining if a PR's CI is passing currently requires two separate calls (
get_statusfor combined commit status +get_check_runsfor individual runs), plus client-side aggregation logic. This is the most common multi-step query in MCP-based workflows.Solution: A new method that returns one structured response with:
verdict:passing,failing,pending, orno_checkstotalCheckRuns,passing,failing,pendingfailingChecksarray for quick triageExample output
{ "verdict": "failing", "combinedStatus": "failure", "totalCheckRuns": 3, "passing": 2, "failing": 1, "pending": 0, "checks": [ {"name": "CI / test", "status": "completed", "conclusion": "success"}, {"name": "CI / lint", "status": "completed", "conclusion": "success"}, {"name": "CI / build", "status": "completed", "conclusion": "failure"} ], "failingChecks": ["CI / build"] }Changes
pkg/github/pullrequests.go— Addedget_ci_summaryto the method enum and switch, implementedGetPullRequestCISummaryandcomputeCIVerdicthelperpkg/github/pullrequests_test.go— 7 test cases covering: all passing, combined failure, check run failure, in-progress, no checks, mixed, and PR fetch errorpkg/github/__toolsnaps__/pull_request_read.snap— Auto-updatedNo new files, no new dependencies. Follows the exact patterns of adjacent methods (
GetPullRequestStatus,GetPullRequestCheckRuns).Verdict logic
Uses an allow-list approach (require known-good, not reject known-bad):
successAND all check runs completed withsuccess/neutral/skippedfailure/errorOR any check run withfailure/cancelled/timed_out/action_requiredcompleted, or combined statuspendingwith active statusespendingwith zero statuses and zero check runsTest plan
go build ./...passesgo vet ./...passesgolangci-lint run— 0 new issuesgo test ./pkg/github/... -count=1— all tests pass, no regressions🤖 Generated with Claude Code