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

fix: fix trust policy import #794

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

Two-Hearts
Copy link
Contributor

@Two-Hearts Two-Hearts commented Oct 9, 2023

Currently, notation policy import mypolicy.json would pop up confirmation before checking whether mypolicy.json file exists or valid.
This PR checks the mypolicy.json first and fast fail if the file does not exist or is invalid. If the file exists and valid, then pop up the confirmation to the end user.

Resolves #773.

Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
@Two-Hearts Two-Hearts self-assigned this Oct 9, 2023
@Two-Hearts Two-Hearts added the enhancement New feature or request label Oct 9, 2023
@Two-Hearts Two-Hearts added this to the 1.1.0 milestone Oct 9, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #794 (e1d6d74) into main (b7e5a6f) will not change coverage.
The diff coverage is 75.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##             main     #794   +/-   ##
=======================================
  Coverage   63.98%   63.98%           
=======================================
  Files          40       40           
  Lines        2252     2252           
=======================================
  Hits         1441     1441           
  Misses        689      689           
  Partials      122      122           
Files Coverage Δ
cmd/notation/policy/import.go 77.35% <75.00%> (ø)

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

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

@JeyJeyGao JeyJeyGao left a comment

Choose a reason for hiding this comment

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

LGTM

@Two-Hearts Two-Hearts merged commit b352d1e into notaryproject:main Oct 10, 2023
5 checks passed
@Two-Hearts Two-Hearts deleted the policy branch October 10, 2023 02:31
@shizhMSFT shizhMSFT mentioned this pull request Nov 6, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Policy import should check if a file exists first
4 participants