Skip to content

feat: Fetch all merge request beyond the default 20#549

Merged
harrisoncramer merged 2 commits intoharrisoncramer:developfrom
Clement-Hue:feature-merge-request-per-page
Apr 25, 2026
Merged

feat: Fetch all merge request beyond the default 20#549
harrisoncramer merged 2 commits intoharrisoncramer:developfrom
Clement-Hue:feature-merge-request-per-page

Conversation

@Clement-Hue
Copy link
Copy Markdown
Contributor

@Clement-Hue Clement-Hue commented Apr 24, 2026

Summary

Fetch all project merge requests from the GitLab API by paginating through results server-side, instead of relying on a single page (default 20). This ensures the merge request chooser shows the complete list regardless of project size.

Problem

The ListProjectMergeRequests call only returned the first page of results (default 20 MRs per the GitLab API). Projects with more merge requests had entries silently truncated, so users could not select older or less recent MRs from the picker. An earlier attempt added a per_page option on the Lua side, but that only shifted the limit instead of solving the truncation.

Changes

  • cmd/app/merge_requests.go: loop over all pages using res.NextPage, accumulating results into a single mergeRequests slice before responding.
  • Default PerPage to 100, to minimize round-trips.

@Clement-Hue Clement-Hue changed the title feat(choose_merge_request): add per_page option for merge request fet… feat(choose_merge_request): add per_page option Apr 24, 2026
@Clement-Hue Clement-Hue force-pushed the feature-merge-request-per-page branch from f0d2a1a to 7413bbe Compare April 24, 2026 14:16
…ching

Allow users to configure the number of merge requests fetched via the
`per_page` setting in `choose_merge_request`. Defaults to 100.
@Clement-Hue Clement-Hue force-pushed the feature-merge-request-per-page branch from 7413bbe to 7a70bef Compare April 24, 2026 14:20
@Clement-Hue Clement-Hue changed the title feat(choose_merge_request): add per_page option feat: Fetch all merge request beyond the default 20 Apr 25, 2026
@Clement-Hue Clement-Hue force-pushed the feature-merge-request-per-page branch from ff5e351 to 6898cbf Compare April 25, 2026 14:20
@harrisoncramer
Copy link
Copy Markdown
Owner

Thank you!

@harrisoncramer harrisoncramer merged commit 7c2415a into harrisoncramer:develop Apr 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants