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

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

Closed
wants to merge 19 commits into from

Conversation

Wwwsylvia
Copy link
Member

@Wwwsylvia Wwwsylvia commented Nov 25, 2024

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:

  • 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?

Copy link

codecov bot commented Nov 25, 2024

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 ⚠️
cmd/oras/root/blob/push.go 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            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              

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

@Wwwsylvia Wwwsylvia changed the title refactor!: deprecate --verbose and print all status output by default refactor: deprecate --verbose and print all status output by default Nov 26, 2024
@Wwwsylvia Wwwsylvia marked this pull request as ready for review November 26, 2024 08:14
@wangxiaoxuan273
Copy link
Contributor

LGTM but I'm not a maintainer.

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.

I think we should take the fix into multiple steps:

  1. Downgrade global level --verbose to command-specific level
  2. Mark the command-specific level --verbose as deprecated
  3. Propose a more meaningful flag to replace the functionality of the deprecated --verbose flag.

cmd/oras/internal/option/common.go Outdated Show resolved Hide resolved
@Wwwsylvia Wwwsylvia marked this pull request as draft November 27, 2024 09:03
@Wwwsylvia
Copy link
Member Author

Refactoring in progress, mark this as draft for now.

Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
@Wwwsylvia Wwwsylvia marked this pull request as ready for review November 27, 2024 11:09
@Wwwsylvia
Copy link
Member Author

Experimenting another way of doing this in #1553

@Wwwsylvia Wwwsylvia marked this pull request as draft November 29, 2024 02:55
@Wwwsylvia Wwwsylvia closed this Dec 3, 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.

Deprecate the --verbose flag
4 participants