oras-project / oras

OCI registry client - managing content like artifacts, images, packages
https://oras.land
Apache License 2.0
1.52k stars 181 forks source link

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

Closed wangxiaoxuan273 closed 1 month ago

wangxiaoxuan273 commented 1 month ago

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.

codecov[bot] commented 1 month ago

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 :warning:
cmd/oras/root/manifest/index/update.go 0.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

qweeah commented 1 month ago

The code coverage is hard to increase since https://github.com/oras-project/oras/pull/1509 is still WIP. After https://github.com/oras-project/oras/pull/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