Skip to content

ErrNoSignaturesFound should be used when there is no signature attached to an image. #3526

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

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

zhaoyonghe
Copy link
Contributor

Summary

This PR closes #3525.

Release Note

NONE

Documentation

No documentation change.

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2ef6022) 40.10% compared to head (a6fa8dd) 40.46%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3526      +/-   ##
==========================================
+ Coverage   40.10%   40.46%   +0.35%     
==========================================
  Files         155      155              
  Lines       10044    10044              
==========================================
+ Hits         4028     4064      +36     
+ Misses       5530     5491      -39     
- Partials      486      489       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhaoyonghe zhaoyonghe marked this pull request as ready for review February 5, 2024 22:46
Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

Any test updates?

Signed-off-by: zhaoyonghe <[email protected]>
@zhaoyonghe
Copy link
Contributor Author

Any test updates?

The current tests only check whether an error occurs or not. I do not see them checking the return error type and message. Therefore, this change should not break any current tests.

@haydentherapper
Copy link
Contributor

What about adding a test that covers this code path?

@zhaoyonghe
Copy link
Contributor Author

What about adding a test that covers this code path?

Yes. I can do that. Do you mean checking the exit code in the test scripts?

Now we indeed return NoMatchingSignature (12) in ImageWithoutSignature (10) cases.

@haydentherapper
Copy link
Contributor

It can be simpler - Add a unit test that calls verifySignatures with signature struct without signatures and verifies the returned error.

Signed-off-by: zhaoyonghe <[email protected]>
Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

Thanks!

@haydentherapper haydentherapper merged commit daec5ec into sigstore:main Feb 7, 2024
@github-actions github-actions bot added this to the v2.3.0 milestone Feb 7, 2024
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.

ErrNoSignaturesFound should be used when there is no signature attached to an image.
2 participants