Skip to content

spec: add CLI specs for notation list/login/logout/plugin#362

Merged
shizhMSFT merged 17 commits intonotaryproject:mainfrom
yizha1:cli-other-specs
Oct 18, 2022
Merged

spec: add CLI specs for notation list/login/logout/plugin#362
shizhMSFT merged 17 commits intonotaryproject:mainfrom
yizha1:cli-other-specs

Conversation

@yizha1
Copy link
Copy Markdown
Contributor

@yizha1 yizha1 commented Sep 28, 2022

No description provided.

@yizha1 yizha1 added cli Issue or PR released to Notation CLI spec Specifications to define the product requirements labels Sep 28, 2022
@yizha1 yizha1 added this to the RC-1 milestone Sep 28, 2022
@yizha1 yizha1 self-assigned this Sep 28, 2022
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 28, 2022

Codecov Report

Merging #362 (c6c3444) into main (6e8e9c5) will increase coverage by 1.74%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #362      +/-   ##
==========================================
+ Coverage   30.54%   32.28%   +1.74%     
==========================================
  Files          25       26       +1     
  Lines        1614     1623       +9     
==========================================
+ Hits          493      524      +31     
+ Misses       1108     1086      -22     
  Partials       13       13              
Impacted Files Coverage Δ
cmd/notation/push.go 21.91% <0.00%> (-2.70%) ⬇️
internal/cmd/flags.go 52.74% <0.00%> (-1.80%) ⬇️
internal/cmd/signer.go 0.00% <0.00%> (ø)
internal/cmd/options.go 0.00% <0.00%> (ø)
cmd/notation/cert_gen.go 0.00% <0.00%> (ø)
internal/envelope/envelope.go 100.00% <0.00%> (ø)
cmd/notation/verify.go 29.16% <0.00%> (+10.53%) ⬆️
cmd/notation/sign.go 42.45% <0.00%> (+12.56%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

List all the signatures of signed artifacts

Usage:
notation list <reference> [flags]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, in review @priteshbandi brought up code use case of it handling an artifact which has a large number of signatures (i.e. via oras pagination). No change in spec per-se.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Linux/Unix, less can be used for pagination (e.g. notation list $ref | less). Details of less can be found in man less.

Generally speaking, less will block the write pipeline and thus force notation stopping query the next link returned by the referrer API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tacking it in #403 for RC1

@dtzar
Copy link
Copy Markdown

dtzar commented Oct 6, 2022

Reviewed this as a group during community call today. Once this feedback is addressed, we can merge.

List all the signatures of signed artifacts

Usage:
notation list <reference> [flags]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Signed-off-by: Yi Zha <zhayi@outlook.com>
Signed-off-by: Yi Zha <zhayi@outlook.com>
@yizha1 yizha1 requested review from dtzar and priteshbandi October 10, 2022 08:05
@priteshbandi priteshbandi removed this from the RC-1 milestone Oct 12, 2022
Signed-off-by: Yi Zha <zhayi@outlook.com>
Copy link
Copy Markdown
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one feedback

@yizha1 yizha1 linked an issue Oct 17, 2022 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@vaninrao10 vaninrao10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For notation login and logout, do we also outline how to login into multiple registries and logout from multiple registries. We discussed in one of the community call.

@yizha1
Copy link
Copy Markdown
Contributor Author

yizha1 commented Oct 18, 2022

For notation login and logout, do we also outline how to login into multiple registries and logout from multiple registries. We discussed in one of the community call.

Yes, I have added support for multiple login

Signed-off-by: Yi Zha <zhayi@outlook.com>
Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shizhMSFT shizhMSFT merged commit ab20527 into notaryproject:main Oct 18, 2022
7h3-3mp7y-m4n pushed a commit to 7h3-3mp7y-m4n/notation that referenced this pull request Mar 29, 2025
FeynmanZhou pushed a commit to FeynmanZhou/notation that referenced this pull request May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Issue or PR released to Notation CLI spec Specifications to define the product requirements

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Specification for login/logout, list, plugin commands

8 participants