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

Support pagination as default option in notation list CLI. #403

Closed
priteshbandi opened this issue Oct 18, 2022 · 7 comments
Closed

Support pagination as default option in notation list CLI. #403

priteshbandi opened this issue Oct 18, 2022 · 7 comments
Assignees
Milestone

Comments

@priteshbandi
Copy link
Contributor

priteshbandi commented Oct 18, 2022

IMO default behavior should be paginated as ORAS referrers API is paginated. Not having pagination will result in an unnecessary load on servers when 1st returned item in the list is what the user wanted. Also, it's usually good practice to have a paginated list API.

Maybe we can create another issue to address your comments. The implementation depends on the behavior of oras-go library. IMO, the current spec is good enough for rc.1 release.

Originally posted by @yizha1 in #362 (comment)

@priteshbandi priteshbandi added this to the RC-1 milestone Oct 18, 2022
@priteshbandi priteshbandi changed the title Support pagination as defualt option in notation list CLI. Support pagination as default option in notation list CLI. Oct 18, 2022
@shizhMSFT
Copy link
Contributor

The Referrers() API in oras-go is paginated.

@rgnote
Copy link
Contributor

rgnote commented Oct 21, 2022

Here is the proposal for supporting pagination in notation list command

The default experience for this command will be to list ALL signatures for a given reference. This is the provided behavior in notation rc.1

After rc.1, notation list command will support two new switches

  • first-page :
  • next-page : <marker to the next page>

Users will be able to paginate through the entire result set of signatures for a given reference. These two will be optional switches. If --next-page is not provided, notation will return the first page.

Examples:

  1. notation list - list all signatures
  2. notation list --first-page - lists the first page and a token to the next page (token is included only if there are signatures in the second page)
  3. notation list --next-page <token> - the page referring to the given

@shizhMSFT
Copy link
Contributor

@rgnote As specified in the distribution-spec, the Referrers API does not support listing from the middle of the list. Also, the Referrers API does not support specifying the number of max results to be returned.

@rgnote
Copy link
Contributor

rgnote commented Oct 25, 2022

@shizhMSFT You are right. I was looking at Oras spec. I will update my comment accordingly.

@iamsamirzon
Copy link
Contributor

@rgnote and @shizhMSFT will discuss this and then likely move it out of RC-1 into RC-2

cc: @vaninrao10

@yizha1 yizha1 modified the milestones: RC-1, Discuss Nov 9, 2022
@yizha1
Copy link
Contributor

yizha1 commented Nov 9, 2022

Confirmed to move this issue out of rc-1 scope. Now moved to "Discuss". We will review all the issues later for rc-2 release scope.

@priteshbandi priteshbandi modified the milestones: Discuss, RC-2 Nov 23, 2022
@yizha1 yizha1 modified the milestones: RC-2, Discuss Dec 14, 2022
@yizha1
Copy link
Contributor

yizha1 commented Aug 4, 2023

Close this issue as no activities for more than 8 months. Referrers API defined by distribution spec supports pagination and Notation has experimental feature --allow-referrers that supports it. Please open new issue if you still see any issues.

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

No branches or pull requests

5 participants