Skip to content

API Pagination: Move specific methods out of Base

Andreas Brandl requested to merge ab/pagination-consolidate into master

What does this MR do?

Small refactoring only: This MR makes Gitlab::Pagination::Base a true skeleton class for pagination methods. For this, it moves the methods specific for offset pagination into OffsetPagination. Additionally, Gitlab::Pagination::Keyset::Pager now inherits from the skeleton class.

Additionally, I had wanted to find a better way to generate URLs to API endpoints (for the links in the header for e.g. the next page). I have not found an obvious better way and I don't think it's worth pursuing further.

Note that both offset and keyset pagination construct links and they do this in a similar manner. At this point, I don't think it's worth the effort to dry this up. If we had more than 2 implementations doing the same thing, I would want to dry it up though.

Closes #37447 (closed).

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports