Add includeChangedFiles parameter to get_pull_request_by_id#1117
Open
lgpearson1771 wants to merge 2 commits intomicrosoft:mainfrom
Open
Add includeChangedFiles parameter to get_pull_request_by_id#1117lgpearson1771 wants to merge 2 commits intomicrosoft:mainfrom
lgpearson1771 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Add an optional includeChangedFiles boolean parameter to the existing repo_get_pull_request_by_id tool. When set to true, fetches the PR iteration changes and enriches the response with a changedFilesSummary containing the list of changed files, file count, and pagination info. Follows the established includeLabels pattern: - Inner try/catch with console.warn on failure - Graceful fallback with empty changedFilesSummary - Both flags compose independently on the same response Resolves microsoft#958 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1117 +/- ##
=======================================
Coverage ? 91.28%
=======================================
Files ? 18
Lines ? 1881
Branches ? 422
=======================================
Hits ? 1717
Misses ? 56
Partials ? 108
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Adds an optional
includeChangedFilesparameter to the existingrepo_get_pull_request_by_idtool. When set totrue, it fetches the latest PR iteration and returns file-level change metadata (paths and change types) — no diffs, no file content.GitHub Issue
Closes #958
Approach
Per @danhellem's feedback, this avoids tool bloat by extending the existing tool with a parameter rather than adding a new standalone tool.
Note: I was on vacation when the issue was closed — this PR implements the approved approach from the discussion.
Changes
src/tools/repositories.ts— AddedincludeChangedFilesparam; fetches latest iteration and returnschangedFilesSummarywith change entries, file count, and pagination infotest/src/tools/repositories.test.ts— 7 new test cases: happy path, disabled/default, empty iterations, null iteration ID, API errors, and combo withincludeLabelsdocs/TOOLSET.md— Updated parameter docsAssociated Risks
Low risk — additive change behind an opt-in flag (
default: false), no change to existing behavior✅ PR Checklist
🧪 How did you test it?
npx jest --testPathPatterns="repositories")includeLabels