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: mark `--verbose` as deprecated #1558

Open Wwwsylvia opened 1 day ago

Wwwsylvia commented 1 day ago

What this PR does / why we need it:

  1. Mark the --verbose flag as deprecated and print verbose output by default for the following six commands. As a result, the --verbose flag will be hidden in the help doc, and there will be a warning message when --verbose is specified.

    • oras push
    • oras pull
    • oras attach
    • oras cp
    • oras manifest push
    • oras blob push
  2. Add the corresponding E2E tests

The deprecation of --verbose for oras discover will be addressed with #1534.

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 Prerequisite: #1553


Examples: oras pull BEFORE: image

oras pull AFTER: image

oras pull --verbose BEFORE: image

oras pull --verbose AFTER: image

oras pull --verbose=false BEFORE: image

oras pull --verbose=false AFTER: image

oras pull --help BEFORE: image

oras pull --help AFTER: image

Please check the following list:

codecov[bot] commented 1 day ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.04%. Comparing base (2703462) to head (4680d74).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1558 +/- ## ========================================== + Coverage 84.02% 84.04% +0.01% ========================================== Files 119 119 Lines 5315 5321 +6 ========================================== + Hits 4466 4472 +6 Misses 602 602 Partials 247 247 ```

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

TerryHowe commented 1 day ago

Maybe mark it deprecated in the Printer object too

Wwwsylvia commented 1 day ago

Maybe mark it deprecated in the Printer object too

Currently it is still functioning, we can consider removing the whole verbose stuff in v1.4.0 or something? From my understanding, the printer will be refactored by @wangxiaoxuan273 soon as part of handler refactoring.

Wwwsylvia commented 19 hours ago

@TerryHowe This is now ready for review.