API Pagination: Move specific methods out of Base
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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