fix: fix blob command based on spec#1242
Merged
8 commits merged intomainfrom Mar 27, 2025
unknown repository
Merged
Conversation
added 7 commits
March 26, 2025 15:43
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1242 +/- ##
==========================================
+ Coverage 76.81% 76.91% +0.09%
==========================================
Files 68 68
Lines 3809 3825 +16
==========================================
+ Hits 2926 2942 +16
Misses 680 680
Partials 203 203 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the blob sign command to meet the updated spec and improves the handling of signature file paths and error cases across sign, verify, and inspect commands. Key changes include:
- Removing the use of WithWorkDir in favor of dynamically computing the blob’s directory and signature file path.
- Adding new test cases for failure scenarios (e.g. empty blob path or empty signature directory).
- Refining command flag behavior and help messages to reflect the new default behavior of storing signature files in the same directory as the blob.
Reviewed Changes
Copilot reviewed 11 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/suite/command/blob/sign.go | Updates test cases to compute blob directory dynamically and update expected output strings. |
| test/e2e/suite/command/blob/verify.go | Removes WithWorkDir and uses blobDir consistently for signature file path construction. |
| cmd/notation/blob/sign.go | Updates help messages, adds pre-run validations, and defaults signature directory to blob location. |
| test/e2e/internal/notation/host.go | Replaces the global blob path with a dynamically created blob file via CreateBlobFile. |
| cmd/notation/blob/verify.go | Introduces a shorthand flag for the signature flag. |
| test/e2e/suite/command/blob/inspect.go | Uses signatureFilepath with blobDir for inspecting blob signatures. |
| cmd/notation/blob/sign_test.go | Adjusts test flags in accordance with the removal of an explicit signatureDirectory. |
| test/e2e/internal/notation/init.go | Removes the environment variable for blob path as it is now generated. |
Files not reviewed (5)
- go.mod: Language not supported
- test/e2e/go.mod: Language not supported
- test/e2e/plugin/go.mod: Language not supported
- test/e2e/run.sh: Language not supported
- test/e2e/testdata/blob/blobFile.txt: Language not supported
Comments suppressed due to low confidence (2)
test/e2e/suite/command/blob/sign.go:31
- [nitpick] Consider using a more descriptive test case name that explicitly conveys the default behavior or scenario being validated instead of 'with default'.
It("with default", func() {
cmd/notation/blob/verify.go:89
- [nitpick] Ensure that the shorthand flag 's' is mentioned in the command help or documentation so that users are aware of its availability.
command.Flags().StringVarP(&opts.signaturePath, "signature", "s", "", "filepath of the signature to be verified")
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes blob command based on updated spec.
Resolves #1171