Skip to content

fix!: downgrade the global verbose flag#1553

Merged
shizhMSFT merged 7 commits into
oras-project:mainfrom
Wwwsylvia:downgrade_verbose
Dec 2, 2024
Merged

fix!: downgrade the global verbose flag#1553
shizhMSFT merged 7 commits into
oras-project:mainfrom
Wwwsylvia:downgrade_verbose

Conversation

@Wwwsylvia

@Wwwsylvia Wwwsylvia commented Nov 28, 2024

Copy link
Copy Markdown
Member

What this PR does / why we need it:

  1. [BREAKING CHANGE] Remove the global verbose flag out of opts.Common
  2. Add local verbose flags to the following commands:
  • oras push
  • oras pull
  • oras attach
  • oras cp
  • oras manifest push
  • oras blob push
  • oras discover
  1. Remove the verbose option for the logger

Note

#1533 will be addressed in steps:

  1. Downgrade the global level verbose flag to command-specific level
  2. Mark the command-specific level verbose flag as deprecated

The deprecation of the verbose flag will come in a future PR.

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 part of #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?

@codecov

codecov Bot commented Nov 28, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.98%. Comparing base (0483d7b) to head (bedfd51).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/oras/root/manifest/push.go 57.14% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1553      +/-   ##
==========================================
- Coverage   83.99%   83.98%   -0.02%     
==========================================
  Files         119      119              
  Lines        5306     5314       +8     
==========================================
+ Hits         4457     4463       +6     
- Misses        602      604       +2     
  Partials      247      247              

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

@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.

There are 17 commands that support verbose and this PR reduces that to 10 which is technically a breaking change, right?

@Wwwsylvia Wwwsylvia changed the title refactor: downgrade the global verbose flag refactor!: downgrade the global verbose flag Nov 29, 2024
@Wwwsylvia

Copy link
Copy Markdown
Member Author

There are 17 commands that support verbose and this PR reduces that to 10 which is technically a breaking change, right?

Indeed, it is technically a breaking change.
But the idea is that the verbose flag makes no difference on the output of the rest of 10 commands, so the existence of the flag is more like a bug instead of a feature for those commands. This change aims to fix the bug.

@Wwwsylvia Wwwsylvia changed the title refactor!: downgrade the global verbose flag fix!: downgrade the global verbose flag Nov 29, 2024

@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/internal/output/print.go Outdated
Comment thread cmd/oras/internal/option/common.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

@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

@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

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>
@shizhMSFT shizhMSFT merged commit 325572c into oras-project:main Dec 2, 2024
@Wwwsylvia Wwwsylvia deleted the downgrade_verbose branch December 2, 2024 06:44
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.

3 participants