Closed squaremo closed 8 years ago
Now uses a sentinel error to indicate that there are no more pages to request.
Thank you. Two additional notes:
Could you add tests?
How do I say this .. there were no tests present, so I didn't add any. I'm happy to add tests, given some scaffolding, but I'm less enthused about creating the scaffolding. Is that fair?
I merged repositories earlier today: d61a28e. I'm thinking this endpoint should get the same pagination.
OK.
How do I say this .. there were no tests present, so I didn't add any. I'm happy to add tests, given some scaffolding, but I'm less enthused about creating the scaffolding. Is that fair?
Argh my bad. I didn't write this project, and assumed there were tests in other places. No, please don't setup any scaffolding.
Catalog responses also now follow the pagination.
.. and some basic tests.
I believe it'd be better to introduce this without tests
I'm not clear whether you want the tests or not, since you've reviewed them ...
Yes, I've reviewed the tests. But to speed up merging this PR, and since there isn't any tests setup anywhere else in that project, I believe shipping this without tests is fine.
OKdokes. I think I've fixed the things pointed out in the review. This PR no longer includes the tests (they are in a branch squaremo/test-paginated-results; I've not acted on the review comments for that code).
Thank you! 🌷 I've just left a minor comment. I'm going to merge this and fix it.
Great! Thanks for your patient reviewing :)
Thank you for your contribution :)
In the Docker registry API v2 specification, the response to a list tags call may be paginated by the server. It does this using an RFC5988
Link
header, withrel=next
; no header means no more pages.At least quay.io uses this mechanism to return pages of 50 tags at a time, though it gets the format slightly wrong (by missing the
<
and>
around the URL).This PR makes the
registry.Tags
method deal with pagination, by following theLink
header when it's present. I've used a regexp to parse the Link header; it's not exactly correct, but probably good enough in practice.