Skip to content

refactor: mark --verbose as deprecated#1558

Merged
qweeah merged 11 commits into
oras-project:mainfrom
Wwwsylvia:deprecate_verbose
Dec 6, 2024
Merged

refactor: mark --verbose as deprecated#1558
qweeah merged 11 commits into
oras-project:mainfrom
Wwwsylvia:deprecate_verbose

Conversation

@Wwwsylvia

@Wwwsylvia Wwwsylvia commented Dec 2, 2024

Copy link
Copy Markdown
Member

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?

@codecov

codecov Bot commented Dec 2, 2024

Copy link
Copy Markdown

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
Copy Markdown
Member

Maybe mark it deprecated in the Printer object too

@Wwwsylvia

Copy link
Copy Markdown
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

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with suggestions

Comment thread cmd/oras/root/attach.go Outdated

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia

Copy link
Copy Markdown
Member Author

@TerryHowe This is now ready for review.

Comment thread test/e2e/internal/utils/deprecation.go Outdated
Comment thread test/e2e/internal/utils/match/status.go
Comment thread test/e2e/suite/command/attach.go Outdated
Comment thread test/e2e/suite/command/blob.go
Comment thread test/e2e/suite/command/manifest.go Outdated

@FeynmanZhou FeynmanZhou left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@qweeah qweeah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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