Skip to content

refactor(forge): share pagination as a function and keep RestClient for GitHub and Gitea - #1289

Merged
BryanFRD merged 1 commit into
mainfrom
refactor/gitlab-pagination-free-fn
Oct 6, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
refactor/gitlab-pagination-free-fn

Conversation

@BryanFRD

@BryanFRD BryanFRD commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Closes #1288

Follow-up to the review of #1287. GitLab used RestClient::gitlab only to paginate: the project URL it built was never read, and the client handed GitLab release and comment calls shaped for GitHub and Gitea (/issues/..., a body field) that would hit the wrong endpoints if ever called.

The pagination loop is now a free paginate function taking a request builder, the page-size parameter, the page size and a label. RestClient::paginated_json_array calls it for GitHub and Gitea, and GitLab calls it directly with its own token header. RestClient::gitlab is gone, so RestClient only exists for the two forges it fits.

No behaviour change: same URLs, headers and page sizes. Forge tests pass (186), including GitLab's fake-server tests.

@BryanFRD
BryanFRD enabled auto-merge (squash) October 6, 2026 07:36

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pagination behaviour hasn't changed. paginate uses the same loop, early exits and MAX_PAGES cap as before. GitLab still sends per_page=100 with the token header and User-Agent it had through RestClient::gitlab. That client also built a repo_url the pagination path never read, so removing it loses nothing. The inline request builder in gitlab.rs matches how the rest of that file talks to the API. Nothing blocking.

@BryanFRD
BryanFRD merged commit 9e01685 into main Oct 6, 2026
32 checks passed
@BryanFRD
BryanFRD deleted the refactor/gitlab-pagination-free-fn branch October 6, 2026 07:39
ferrflow Bot added a commit that referenced this pull request Oct 6, 2026
## [7.28.4] - 2026-10-06

### Refactoring

- refactor(forge): share pagination as a function and keep RestClient for GitHub and Gitea (#1289)
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.

refactor(forge): GitLab builds a RestClient it only uses for pagination

1 participant