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

chore: updated warning printout logic for Sign with --allow-referrers-api flag #682

Merged
merged 3 commits into from
May 25, 2023

Conversation

Two-Hearts
Copy link
Contributor

@Two-Hearts Two-Hearts commented May 25, 2023

This quick PR updates the printout logic for sign, when user enables --allow-referrers-api.
The warning should be valid only when target artifact is stored in a registry.
If the user enables --oci-layout, i.e., target artifact is stored in an OCI layout, enabling --allow-referrers-api won't take any effect (this is because oci.Store does not support Referrers API yet). In this case, we shouldn't print out the warning.

The fix: During Sign, mark flags --oci-layout and --allow-referrers-api mutually exclusive.

Resolves #683.

Signed-off-by: Patrick Zheng <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented May 25, 2023

Codecov Report

Merging #682 (0507d6e) into main (a695b60) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
+ Coverage   59.13%   59.15%   +0.01%     
==========================================
  Files          40       40              
  Lines        2183     2184       +1     
==========================================
+ Hits         1291     1292       +1     
  Misses        795      795              
  Partials       97       97              
Impacted Files Coverage Δ
cmd/notation/sign.go 79.38% <100.00%> (+0.15%) ⬆️

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

@Two-Hearts Two-Hearts self-assigned this May 25, 2023
@Two-Hearts Two-Hearts added this to the v1.0.0-rc.6 milestone May 25, 2023
priteshbandi
priteshbandi previously approved these changes May 25, 2023
Copy link
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

@priteshbandi
Copy link
Contributor

Should we also add a check that --oci-layout and --allow-referrers-api cannot be used simultaneously?

@Two-Hearts
Copy link
Contributor Author

Should we also add a check that --oci-layout and --allow-referrers-api cannot be used simultaneously?

@priteshbandi Then that would be an error for the user instead of dropping the --allow-referrers-api flag silently. (I'm okay with both of the options though.) /cc: @shizhMSFT @yizha1 @FeynmanZhou

Signed-off-by: Patrick Zheng <[email protected]>
Copy link
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

Copy link
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 5181b9d into notaryproject:main May 25, 2023
@Two-Hearts Two-Hearts deleted the chore branch May 25, 2023 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign with --allow-referrers-api and --oci-layout flag shouldn't print the warning from allowReferrersAPI
4 participants