Apply lockdown check to pull_request_read get_diff/get_files/get_check_runs#2883
Open
kerobbi wants to merge 2 commits into
Open
Apply lockdown check to pull_request_read get_diff/get_files/get_check_runs#2883kerobbi wants to merge 2 commits into
pull_request_read get_diff/get_files/get_check_runs#2883kerobbi wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extends lockdown filtering to additional pull-request read operations and fixes empty-author review filtering.
Changes:
- Enforces PR-author lockdown checks for diffs, files, and check runs.
- Correctly removes reviews with empty author logins.
- Adds lockdown and regression tests.
Exported function signature changes introduce Go API compatibility issues.
Show a summary per file
| File | Description |
|---|---|
pkg/github/pullrequests.go |
Adds lockdown enforcement and fixes review filtering. |
pkg/github/pullrequests_test.go |
Adds lockdown and empty-author coverage. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Medium
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.
Note
Stacked on #2881.
Summary
Applies the shared lockdown author check to
pull_request_read'sget_diff/get_files/get_check_runs, and fixes an empty-author edge inget_reviews.Why
Part of https://github.com/github/copilot-mcp-core/issues/1798 - these three read branches didn't apply the lockdown check, and the
get_reviewsdidn't drop reviews with an empty author on an all-empty page.What changed
enforcePullRequestLockdown(fetches the PR to resolve the author under lockdown, then appliesauthorLockdownResult); use it inGetPullRequestDiffandGetPullRequestFiles.GetPullRequestCheckRunsapplies the check inline using the PR it already fetches.GetPullRequestReviews: drop reviews with an empty author login and hoist the filtered-slice assignment out of the loop so an all-empty page returns an empty list.MCP impact
GetPullRequest).Prompts tested (tool changes only)
Security / limits
get_reviews; no change outside lockdown mode.Tool renaming
Lint & tests
./script/lint./script/testDocs