Skip to content
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

fix: update --add should add plain descriptor #1513

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

wangxiaoxuan273
Copy link
Contributor

@wangxiaoxuan273 wangxiaoxuan273 commented Oct 14, 2024

What this PR does / why we need it:

oras manifest index update --add now adds the original manifest descriptor, and which may include the annotations. The command should add the plain descriptor.

oras manifest index update --merge still adds the original manifest descriptors. The annotations may be meaningful under merge scenarios.

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 86.02%. Comparing base (304a89f) to head (955ade6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/oras/root/manifest/index/create.go 60.00% 2 Missing and 2 partials ⚠️
cmd/oras/root/manifest/index/update.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1513   +/-   ##
=======================================
  Coverage   86.01%   86.02%           
=======================================
  Files         118      118           
  Lines        4225     4228    +3     
=======================================
+ Hits         3634     3637    +3     
+ Misses        353      352    -1     
- Partials      238      239    +1     

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

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

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

LGTM with minor suggestions

cmd/oras/root/manifest/index/create.go Outdated Show resolved Hide resolved
cmd/oras/root/manifest/index/update.go Outdated Show resolved Hide resolved
Signed-off-by: Xiaoxuan Wang <[email protected]>
@qweeah
Copy link
Contributor

qweeah commented Oct 14, 2024

The code coverage is hard to increase since #1509 is still WIP. After #1509 is done, we can add a unified add function for both index create and index update and test when config cannot be fetched. @wangxiaoxuan273

@qweeah qweeah merged commit 1d60e22 into oras-project:main Oct 14, 2024
7 of 8 checks passed
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.

2 participants