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

refactor: deprecate --verbose and print all status output by default #1545

Closed Wwwsylvia closed 1 day ago

Wwwsylvia commented 1 week ago

What this PR does / why we need it:

  1. Move the --verbose flag out of opts.Common
  2. Print a deprecation message if the --verbose flag is used
  3. Hide the --verbose flag in help docs
  4. Print status output for untitled blobs by default
  5. Refactor internal types
  6. Update the corresponding tests

Updates on the oras discover command will come in a separate PR.


BEFORE: oras pull: image

oras pull --verbose: image

oras pull --help image

AFTER: oras pull: image

oras pull --verbose image

oras pull --help image

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

Please check the following list:

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 91.11111% with 4 lines in your changes missing coverage. Please review.

Project coverage is 83.99%. Comparing base (76eadf2) to head (cc5de49). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cmd/oras/root/manifest/push.go 50.00% 1 Missing and 2 partials :warning:
cmd/oras/root/blob/push.go 87.50% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1545 +/- ## ========================================== + Coverage 83.96% 83.99% +0.03% ========================================== Files 119 119 Lines 5306 5316 +10 ========================================== + Hits 4455 4465 +10 Misses 604 604 Partials 247 247 ```

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

wangxiaoxuan273 commented 1 week ago

LGTM but I'm not a maintainer.

Wwwsylvia commented 6 days ago

Refactoring in progress, mark this as draft for now.

Wwwsylvia commented 5 days ago

Experimenting another way of doing this in #1553