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

etcdctl: move cobra helper of etcdctl from main pkg to etcdctl pkg #18356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ah8ad3
Copy link
Contributor

@ah8ad3 ah8ad3 commented Jul 23, 2024

This PR moves cobra helper of etcdctl from main pkg to etcdctl pkg. This will remove cobra dependency from main pkg which wasn't necessary.

This PR was created after suggestion in this comment #18183 (comment)
Part of #17777

@k8s-ci-robot
Copy link

Hi @ah8ad3. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@henrybear327
Copy link
Contributor

/ok-to-test

@ivanvc
Copy link
Member

ivanvc commented Aug 7, 2024

Thanks for the pull request, @ah8ad3. IMO, this change makes more sense in its own context than in the other pull request.

Looking at the test failure, it seems like you need to rebase your branch. Can you do it so we can start moving forward? Thanks again.

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.84%. Comparing base (df4e472) to head (300360e).

Current head 300360e differs from pull request most recent head e8f01c3

Please upload reports for the commit e8f01c3 to get more accurate results.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
Files Coverage Δ
etcdctl/ctlv3/ctl.go 0.00% <ø> (ø)
etcdctl/util/help.go 42.47% <ø> (ø)

... and 21 files with indirect coverage changes

@@           Coverage Diff           @@
##             main   #18356   +/-   ##
=======================================
  Coverage   68.83%   68.84%           
=======================================
  Files         420      420           
  Lines       35475    35473    -2     
=======================================
  Hits        24420    24420           
+ Misses       9631     9622    -9     
- Partials     1424     1431    +7     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df4e472...e8f01c3. Read the comment docs.

Signed-off-by: ah8ad3 <ah8ad3@gmail.com>
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Aug 9, 2024

Ok rebased, make fixed. I think we are good to go.

PTAL @ivanvc

Copy link
Member

@ivanvc ivanvc left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @ah8ad3.
cc. @jmhbnz, @ahrtr

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ah8ad3, ivanvc, jmhbnz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr
Copy link
Member

ahrtr commented Aug 12, 2024

The only concern is that UsageFunc is an exported function, which means it might be used by any application, although it is unlikely in practice.

func UsageFunc(cmd *cobra.Command, version, APIVersion string) error {

Please let's

  • either don't change it( close this PR);
  • or add a deprecation note, do not remove it until 3.7.

@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Aug 15, 2024

The only concern is that UsageFunc is an exported function, which means it might be used by any application, although it is unlikely in practice.

That is super unlikely for someone to use this, but you are right to ensure we don't break anybody we should do this.
Personally i think removing cobra from there is needed because both the main pkg become lighter and no other module needs it there.

I will try to add deprecation note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

7 participants