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

fix!: downgrade the global verbose flag #1553

Merged
merged 7 commits into from
Dec 2, 2024

Conversation

Wwwsylvia
Copy link
Member

@Wwwsylvia Wwwsylvia commented Nov 28, 2024

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?

Copy link

codecov bot commented Nov 28, 2024

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.

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.

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
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
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/internal/output/print.go Outdated Show resolved Hide resolved
cmd/oras/internal/option/common.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

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

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

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
8 checks passed
@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