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(cp): avoid showing empty descriptor in progress bar #1528

Merged

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Nov 8, 2024

What this PR does / why we need it:
This PR fixes progress ratio and missing descriptor in the progress output.

Before

> oras cp --to-oci-layout jinzha1.azurecr.io/test:blank-progress .
✓ Copied  application/vnd.docker.container.image.v1+json                                                              0/0  B 100.00%    9ms
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
⠋ [....................](   0  B/s) Copying application/vnd.docker.image.rootfs.diff.tar.gzip                      0.00/0  B   0.00%   26ms
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Copied  application/vnd.docker.distribution.manifest.v2+json                                                  6.16/6.16 kB 100.00%   19ms
  └─ sha256:47506275bd97c02cd5f2c8c86d67d1faf8d3816ba0278aae63fb9cd25ec02e6c
Copied [registry] jinzha1.azurecr.io/test:blank-progress => [oci-layout] .
Digest: sha256:47506275bd97c02cd5f2c8c86d67d1faf8d3816ba0278aae63fb9cd25ec02e6c

After

> oras cp --to-oci-layout jinzha1.azurecr.io/test:blank-progress ./debug
✓ Copied  application/vnd.docker.image.rootfs.diff.tar.gzip                                                                                                0/0  B 100.00%    1ms
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Copied  application/vnd.docker.container.image.v1+json                                                                                                   0/0  B 100.00%     0s
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Copied  application/vnd.docker.distribution.manifest.v2+json                                                                                       6.16/6.16 kB 100.00%  808µs
  └─ sha256:47506275bd97c02cd5f2c8c86d67d1faf8d3816ba0278aae63fb9cd25ec02e6c
Copied [registry] jinzha1.azurecr.io/test:blank-progress => [oci-layout] ./debug
Digest: sha256:47506275bd97c02cd5f2c8c86d67d1faf8d3816ba0278aae63fb9cd25ec02e6c

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 #1442

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Signed-off-by: Billy Zha <[email protected]>
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.99%. Comparing base (b8db531) to head (793acd1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1528      +/-   ##
==========================================
+ Coverage   83.87%   83.99%   +0.12%     
==========================================
  Files         118      118              
  Lines        5166     5174       +8     
==========================================
+ Hits         4333     4346      +13     
+ Misses        592      588       -4     
+ Partials      241      240       -1     

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

Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

@TerryHowe TerryHowe merged commit b4be9a6 into oras-project:main Nov 11, 2024
8 checks passed
qweeah added a commit to qweeah/oras that referenced this pull request Dec 5, 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.

progress bar missing when copying artifact with zero-length layer from registry to OCI layout
3 participants