Skip to content

fix: pass top and skip to the changed files call in repo_pull_request get - #1615

Merged
Dan Hellem (danhellem) merged 4 commits into
microsoft:mainfrom
saryn17:fix/1611-page-changed-files
Sep 24, 2026
Merged

Dan Hellem (danhellem) merged 4 commits into
microsoft:mainfrom
saryn17:fix/1611-page-changed-files

Conversation

@saryn17

@saryn17 sary (saryn17) commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

repo_pull_request with action: "get" and includeChangedFiles: true did not pass top or skip to getPullRequestIterationChanges, so callers could not retrieve changes beyond the first page (#1611).

This change forwards the existing top and skip parameters and documents how to request the next page using nextSkip and nextTop from changedFilesSummary. The defaults remain top: 100 and skip: 0.

GitHub issue number

#1611

Associated Risks

  • top and skip now apply to get (changed files) as well as list (pull requests). Both descriptions name both actions.
  • top is not clamped, so a value above the documented maximum of 2000 reaches the service as written.
  • Paging is caller-driven, so iterations[iterations.length - 1] is re-read on every call. Page 2 can land on a newer iteration than page 1 if someone pushes in between. secondComparingIteration is in the summary whenever there is an iteration to compare, so a caller can see that. Iteration pinning is tracked in Expose pull request iteration identity in get_changes #1551.

✅ PR Checklist

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • Title of the pull request is clear and informative.
  • 👌 Code hygiene
  • 🔭 Telemetry added, updated, or N/A
  • 📄 Documentation added, updated, or N/A
  • 🛡️ Automated tests added, or N/A

🧪 How did you test it?

Unit tests in test/src/tools/repositories.test.ts cover the default page size, a non-default page size, the continuation fields, both ways the endpoint ends a list, and the absence of hasMore:

  • neither top nor skip given: the schema fills in 100 and 0, and both reach getPullRequestIterationChanges
  • top: 100, skip: 0 against the 150-file response recorded in repo_pull_request get: includeChangedFiles silently stops at 100 files #1611: fileCount: 100, the first entry is the first file, nextSkip: 100, nextTop: 50
  • top: 50, skip: 100, following the REST example for this endpoint: fileCount: 50, the last entry is the 150th file, no nextSkip or nextTop
  • an explicit nextSkip: 0 and nextTop: 0 is surfaced as the API sent it
  • the existing includeChangedFiles test asserts the two added arguments

21 suites, 1298 tests passing. npm run validate-tools, eslint and prettier --check clean.

With includeChangedFiles, the get branch called getPullRequestIterationChanges
with no top or skip, so it received the endpoint's default page of 100 and
reported fileCount: 100 for any larger PR, with no way for the caller to ask
for the rest: skip is on the schema but was only wired for list.

Ask for the endpoint's maximum page (2000) and pass skip through. When the
response has a nextSkip, add hasMore: true next to it so the caller can page
the way every other paged tool here does. The last page arrives with nextSkip 0
or without it; both mean done.
@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b271bec). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1615   +/-   ##
=======================================
  Coverage        ?   99.91%           
=======================================
  Files           ?       23           
  Lines           ?     2240           
  Branches        ?      692           
=======================================
  Hits            ?     2238           
  Misses          ?        0           
  Partials        ?        2           
Flag Coverage Δ
unittests 99.91% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/tools/repositories.ts Resolved
Comment thread src/tools/repositories.ts Resolved
@saryn17 sary (saryn17) changed the title fix: page changed files in repo_pull_request get instead of stopping at 100 fix: pass top and skip to the changed files call in repo_pull_request get Sep 23, 2026
@danhellem
Dan Hellem (danhellem) merged commit e9322bc into microsoft:main Sep 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge ❌ do not merge this pull request Needs Review 👓 needs review by the product team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repo_pull_request get: includeChangedFiles silently stops at 100 files

4 participants