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: pass cobra.Command to all cmd exec functions #1285

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

TerryHowe
Copy link
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?

Copy link

codecov bot commented Mar 12, 2024

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

qweeah commented Mar 14, 2024

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

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

@shizhMSFT shizhMSFT merged commit 9dbac04 into oras-project:main Mar 15, 2024
8 checks passed
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