Repository navigation
Conversation
… the branch's MR lookup `glab mr list --output json` returns every MR's full description, so one MR with a very long description pushed the output past the default 1 MB read cap, the JSON was cut off, and the list failed to decode. The list now reads up to 16 MiB, the same limit pingdotgg#24215 gives GitLabPullRequestCli's list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — GitLab merge-request lookup now accepts up to 16 MiB of output so large descriptions do not break branch lookup. The increase is bounded and limited to this read-only operation, with existing timeout and query behavior unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
On GitLab, T3 Code finds the current branch's merge request with
glab mr list --source-branch <branch> --output json. glab returns every merge request's full description, and the command runs with the default 1,000,000-byte output cap. When one merge request's JSON passes that cap, the output is cut off and decoding fails with "GitLab CLI returned invalid MR list JSON". Renovate merge requests with long release notes are a realistic example.Then the branch shows no merge request, and the create/open merge request action fails with that error instead of finding the existing one.
Change
GitLabCli.listMergeRequestsnow passesmaxOutputBytesof 16 MiB. This is the same limit and constant name as #24215, which fixes the same cap for the Pull Requests page list inGitLabPullRequestCli, and the same limit as the Azure DevOps list (#8572). A new case inGitLabCli.test.tsreturns one valid merge request whose JSON is over 1,000,000 bytes, truncating at the requested cap like the process runner does, and expects it to decode.Scope and approval
A very small, focused fix for an obvious bug: one constant, one option on one call, one test. It does not touch
GitLabPullRequestCli(#24215 covers that list) and does not change the process runner's default.Related open PRs: #24215 is the sibling fix on the other GitLab list. #29791 rewrites this function to read 100 rows and retry a truncated page with smaller pages; a single merge request over the cap still fails there at one row per page, so the two changes work together. If #29791 lands first, this line moves into its
executecall.Verification
packages/source-control-gitlab:vp test run src/server/GitLabCli.test.ts1 failed | 5 passed, the new case fails withGitLabMergeRequestListDecodeError: GitLab CLI failed in listMergeRequests: GitLab CLI returned invalid MR list JSON.6 passed, and6 passedagain with this branch merged locally with main 6a8f82c.vp run check:changedon this branch merged locally with main 6a8f82c: format, lint, knip, typecheck (11 packages) and tests pass.renovate/all-minor-patchwhose description is 1,019,968 bytes, and realglab1.130.0, not signed in. I cloned it from that GitLab and added it in the web app (Browser panel; dev servers named "Test machine", empty test homes). Order: main 6a8f82c, this branch 0f73521, then this branch merged locally with main.glab mr listfor the branch prints 1,033,753 bytes, past the 1,000,000-byte cap (output below).Before (main 6a8f82c): the branch's Git panel offers Create MR and shows no merge request.
Before (main 6a8f82c): running Create MR fails with "GitLab CLI returned invalid MR list JSON."
After (this branch 0f73521): the same branch shows its merge request #1.
After (this branch 0f73521 merged locally with main 6a8f82c): the same branch shows merge request #1.
glab output and server logs
glab, run in the project clone:
Server log, main 6a8f82c:
Server log, this branch 0f73521:
Not checked: a signed-in
glab; desktop and mobile (the fix is server-side, so they read the same status);glab mr view, which still uses the default cap for a single merge request; Bitbucket and Forgejo list paths; the merge request detail panel.Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly