fix: allow setting org.opencontainers.image.title in annotation file#1872
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1872 +/- ##
==========================================
+ Coverage 85.32% 85.36% +0.03%
==========================================
Files 143 143
Lines 6739 6743 +4
==========================================
+ Hits 5750 5756 +6
+ Misses 703 701 -2
Partials 286 286 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
shizhMSFT
left a comment
There was a problem hiding this comment.
It looks valid. Wait other maintainers to review.
|
@rafaelgieschke Thanks for your contribution! Could you provide more tests for better coverage? |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where setting the "org.opencontainers.image.title" annotation in an annotation file would cause an error. The fix allows users to override file names using the OCI annotation title field.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Are we good to merge this PR? |
bc341f1 to
744dd1f
Compare
As suggested in #1872 (comment), I just added some test. It should give coverage of the changed lines but I am not sure if this is the most elegant test for this change. |
|
The codecov is behaving a bit strangely. 🤨 Maybe we can bypass it for this time? |
Currently, trying to set "org.opencontainers.image.title" in an annotation
file will error:
$ echo $RANDOM > file; echo '{"file":{"org.opencontainers.image.title":"file2"}}' > annotations.json; oras push --annotation-file annotations.json registry.example/test/test file
Error response from registry: file2: application/vnd.oci.image.layer.v1.tar: not found
Signed-off-by: Rafael Gieschke <rafael@gieschke.de>
744dd1f to
8d74fad
Compare
…ras-project#1872) Signed-off-by: Rafael Gieschke <rafael@gieschke.de>

What this PR does / why we need it:
Currently, trying to set "org.opencontainers.image.title" in an annotation file will error:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Please check the following list: