Skip to content

refactor: pass cobra.Command to all cmd exec functions#1285

Merged
shizhMSFT merged 2 commits into
oras-project:mainfrom
TerryHowe:cmd-refactor
Mar 15, 2024
Merged

refactor: pass cobra.Command to all cmd exec functions#1285
shizhMSFT merged 2 commits into
oras-project:mainfrom
TerryHowe:cmd-refactor

Conversation

@TerryHowe

Copy link
Copy Markdown
Member

What this PR does / why we need it:
This is a minor refactor to make the command private methods consistent. Most of them take a cmd and not a context except for these six. The reason for this is to make logging and output more consistent across the commands and thecorbra.Command has methods like OutOrStdout

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 #

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?

Signed-off-by: Terry Howe <tlhowe@amazon.com>
@codecov

codecov Bot commented Mar 12, 2024

Copy link
Copy Markdown

Codecov Report

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

Project coverage is 81.90%. Comparing base (777d750) to head (bd13588).

Files Patch % Lines
cmd/oras/root/logout.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1285      +/-   ##
==========================================
- Coverage   81.92%   81.90%   -0.03%     
==========================================
  Files          83       83              
  Lines        3995     3996       +1     
==========================================
  Hits         3273     3273              
- Misses        499      500       +1     
  Partials      223      223              

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

@qweeah

qweeah commented Mar 14, 2024

Copy link
Copy Markdown
Contributor

@TerryHowe Can you help make the PR title complaint to conventional commits? E.g. for this PR it can be refactor: pass cobra.Command to all cmd exec functions

@TerryHowe TerryHowe changed the title Pass cobra.Command to all functions refactor: pass cobra.Command to all cmd exec functions Mar 14, 2024

@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

@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 merged commit 9dbac04 into oras-project:main Mar 15, 2024
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 11, 2024
@TerryHowe TerryHowe deleted the cmd-refactor branch May 27, 2024 14:35
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