Repository navigation
Conversation
GitLab leaves out x-total and x-total-pages once a listing passes 10,000 rows, and a proxy can strip them. The merge request list then computed ceil(0 / perPage) and reported one page, so later merge requests could not be reached. Use the rule the issue list already uses: with no totals, a full page advertises one more page to probe and a short page is the last. Fixes stablyai#33800
|
No actionable comments were generated in the recent review.
|
ELI5
On a big GitLab project, GitLab sometimes doesn't say how many pages of merge requests there are. Orca then assumed "1 page", so you could never get past the first page in the Merge Requests list. Now, if a page comes back full, Orca offers the next one, the same way the GitLab issues list already works.
What Changed
listMergeRequests(src/main/gitlab/merge-request-list.ts) usedx-total-pages, elseceil(x-total / perPage). GitLab omits both headers once a listing has more than 10,000 rows (common forstate=allor merged MRs on large projects), and a proxy can strip them. Then the second fallback becameMath.max(1, ceil(0 / perPage))= 1, and the pager stopped at page 1 even when that page was full.x-total-pagesis present, it still wins.x-totalis present, it still decides.page + 1, and a short page reportspage.totalCountstaysx-total, or 0 when it's unknown, as before.Why
This is the rule
src/main/gitlab/issues.tsalready uses for the same missing-headers case (#13357), and the one theglab mr listfallback in this same file uses. Reusing it keeps the two GitLab lists consistent instead of adding a second pagination strategy. A probe costs at most one extra request on the last page, which comes back short and ends paging.Linked Issue
Fixes #33800
Visual Proof
N/A: no UI change. The existing pager now gets a correct page count, which the test below checks.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New case in
client-mr-listing.test.ts:x-totalpresent, the count still decides.It fails on the old code (
totalPages: 1).src/main/gitlabpasses (19 files, 301 tests), and so dopnpm typecheck,oxlintandpnpm run check:code-quality:changed. Tested on macOS.AI Disclosure
I used Claude Code (Claude Opus 5.5) to search the GitLab helpers for bugs; it found the mismatch with the issue list. I checked it against
issues.ts, wrote the fix and test, and reviewed them.Review
My review of the change, with the agent's help:
glabruns wherever it runs today; only the page-count math changed.Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)