Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conformance: LIST tags with n=0 #132

Closed
rchincha opened this issue Apr 8, 2020 · 5 comments
Closed

conformance: LIST tags with n=0 #132

rchincha opened this issue Apr 8, 2020 · 5 comments

Comments

@rchincha
Copy link
Contributor

rchincha commented Apr 8, 2020

To get the next n entries, one can create a URL where the argument last has the value from tags[len(tags)-1]. If there are indeed more results, the URL for the next block is encoded in an RFC5988 Link header, as a "next" relation.

However, conformance tests are testing for n=0 case.

So, for tags list with n=0, what is the expected response? we return nothing because n=0, but "last" needs to be set because there are indeed more, but since nothing was returned, how does one set "last"?

With n=0, this requirement cannot be met as it is stated

@rchincha
Copy link
Contributor Author

rchincha commented Apr 9, 2020

IMO, not sure how useful n=0 really except for checking if a "repo name" is present.

@eyJhb
Copy link

eyJhb commented Apr 25, 2020

Shouldn't this match for catalog as well? Not allowing 0 makes sense.

@dmcgowan
Copy link
Member

@eyJhb catalog is no longer covered by this spec. Generally the decisions made here for tags/list could apply there in implementations.

If we are going to test for the n=0 case, then we should make the behavior explicit. If the behavior is ignore n=0, then just test that it is ignored. If n=0 just returns an empty result, then no Link should be set, since this would lead to non-converging link following based on the current rules of reusing the n from the request.

@jdolitsky jdolitsky added this to the v1.0.0-rc2 milestone Oct 14, 2020
@jdolitsky
Copy link
Member

jdolitsky commented Oct 28, 2020

Copying text from this comment: distribution/distribution#3143 (comment)

Okay, so what I think should happen is the following.

  • n=0 will return a empty list, and will not include a Link, as there are no more entries (depends on how you look at it. But if I want 0 and I want more, I will still get 0).

  • last will be used to find the entries lexically after it, and the index does not need to exists.

    • this could bring some weird bugs for some people regarding encoding. but it does make sense to be able to search like this.
  • last can stand on its own without n, as to use the default n value from the server (which it may impose).

This language should be clarified in spec

@jdolitsky
Copy link
Member

Resolved by #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants