Skip to content

Conversation

@ghost
Copy link

@ghost ghost 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>
@ghost ghost self-assigned this Oct 9, 2023
@ghost ghost added the enhancement New feature or request label Oct 9, 2023
@ghost ghost 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

@ghost ghost merged commit b352d1e into notaryproject:main Oct 10, 2023
@ghost ghost deleted the policy branch October 10, 2023 02:31
@shizhMSFT shizhMSFT mentioned this pull request Nov 6, 2023
6 tasks
@ghost ghost mentioned this pull request Jan 25, 2024
6 tasks
7h3-3mp7y-m4n pushed a commit to 7h3-3mp7y-m4n/notation that referenced this pull request Mar 29, 2025
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
FeynmanZhou pushed a commit to FeynmanZhou/notation that referenced this pull request May 15, 2025
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
This pull request was closed.
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

3 participants