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

Merged
merged 11 commits into from
Dec 6, 2024

Conversation

Wwwsylvia
Copy link
Member

@Wwwsylvia Wwwsylvia commented Dec 2, 2024

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
  1. 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:

  • 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 Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.05%. Comparing base (ae989e8) to head (e171d73).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1558      +/-   ##
==========================================
- Coverage   84.07%   84.05%   -0.02%     
==========================================
  Files         119      119              
  Lines        5325     5331       +6     
==========================================
+ Hits         4477     4481       +4     
- Misses        602      604       +2     
  Partials      246      246              

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

@TerryHowe
Copy link
Member

Maybe mark it deprecated in the Printer object too

@Wwwsylvia
Copy link
Member Author

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 Wwwsylvia marked this pull request as ready for review December 3, 2024 06:42
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 with suggestions

cmd/oras/root/attach.go Outdated Show resolved Hide resolved
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

@Wwwsylvia
Copy link
Member Author

@TerryHowe This is now ready for review.

Copy link
Member

@FeynmanZhou FeynmanZhou left a comment

Choose a reason for hiding this comment

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

The examples align with the spec and look good to me. Thanks @Wwwsylvia

@FeynmanZhou
Copy link
Member

@TerryHowe would you mind taking a look at this PR?

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]>
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

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

LGTM

@qweeah qweeah merged commit 3b2d90d into oras-project:main Dec 6, 2024
8 checks passed
@Wwwsylvia Wwwsylvia deleted the deprecate_verbose branch December 6, 2024 07:22
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
5 participants