Skip to content

Comments

fix: fix blob command based on spec#1242

Merged
8 commits merged intomainfrom
unknown repository
Mar 27, 2025
Merged

fix: fix blob command based on spec#1242
8 commits merged intomainfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Mar 26, 2025

This PR fixes blob command based on updated spec.

Resolves #1171

Patrick Zheng added 7 commits March 26, 2025 15:43
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
@codecov
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.91%. Comparing base (73a4da6) to head (71736e9).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ghost ghost requested a review from Copilot March 26, 2025 10:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ghost ghost requested a review from Copilot March 26, 2025 10:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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")

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

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 4b873a7 into notaryproject:main Mar 27, 2025
7 checks passed
@ghost ghost deleted the blob branch March 27, 2025 03:42
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blob commands UX revisit

2 participants