Skip to content

Fix tags api first page pagination with search

What does this MR do and why?

The GitalyKeySetPager expects the tags finder to paginate the first page of results via Gitaly. However, tags search currently does not work with Gitaly pagination, which means the tags finder just returns all of the tags. We change GitalyKeySetPager to no longer expect the tags finder to paginate the first page if there is a search.

References

Resolves #372875 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

# Request the tags API with `search` and `page=1`, get good paginated results:
$ curl -v 'http://localhost:3000/api/v4/projects/<project_id>repository/tags?search=^v17&per_page=7&page=0' > tags.json

# Check number of items returned
$ jq length tags.json 
7

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Fred Reinink

Merge request reports

Loading