Skip to content

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

Merged
qweeah merged 3 commits into
oras-project:mainfrom
wangxiaoxuan273:update-add-fix
Oct 14, 2024
Merged

fix: update --add should add plain descriptor#1513
qweeah merged 3 commits into
oras-project:mainfrom
wangxiaoxuan273:update-add-fix

Conversation

@wangxiaoxuan273

@wangxiaoxuan273 wangxiaoxuan273 commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

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.

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
@codecov

codecov Bot commented Oct 14, 2024

Copy link
Copy Markdown

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.

Comment thread cmd/oras/root/manifest/index/update.go Outdated
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>

@qweeah qweeah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with minor suggestions

Comment thread cmd/oras/root/manifest/index/create.go Outdated
Comment thread cmd/oras/root/manifest/index/update.go Outdated
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
@qweeah

qweeah commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

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
@wangxiaoxuan273 wangxiaoxuan273 deleted the update-add-fix branch February 17, 2025 10:26
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