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

Merged
merged 1 commit into from
Feb 27, 2025

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

Codecov Report

Attention: Patch coverage is 42.10526% with 66 lines in your changes missing coverage. Please review.

Project coverage is 68.78%. Comparing base (a423349) to head (d42b043).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
etcdctl/util/help.go 42.47% 65 Missing ⚠️
etcdctl/ctlv3/ctl.go 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
pkg/cobrautl/help.go 42.47% <ø> (ø)
etcdctl/ctlv3/ctl.go 0.00% <0.00%> (ø)
etcdctl/util/help.go 42.47% <42.47%> (ø)

... and 26 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #18356      +/-   ##
==========================================
- Coverage   68.89%   68.78%   -0.12%     
==========================================
  Files         420      421       +1     
  Lines       35788    35901     +113     
==========================================
+ Hits        24656    24693      +37     
- Misses       9709     9777      +68     
- Partials     1423     1431       +8     

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 a423349...d42b043. Read the comment docs.

@ah8ad3 ah8ad3 force-pushed the move-cobra-from-pkg branch from b0135bc to e8f01c3 Compare August 9, 2024 13:10
@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

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

@ivanvc
Copy link
Member

ivanvc commented Feb 13, 2025

Covered during our triage meeting. @ah8ad3, are you looking into doing Benjamin's suggestion? Or should we close this pull request?

@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Feb 14, 2025

Thanks for looking into this @ivanvc , and sorry for delaying this task.
I will take care of the comment and will add the note.

@ah8ad3 ah8ad3 force-pushed the move-cobra-from-pkg branch from e8f01c3 to 58942d7 Compare February 27, 2025 08:58
@ah8ad3 ah8ad3 force-pushed the move-cobra-from-pkg branch 3 times, most recently from c885b4c to 1291513 Compare February 27, 2025 09:13
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Feb 27, 2025

I can not understand what the problem is with verify failing, am i missing some sort of convention in making a function deprecated?
Can you please help? @ivanvc

…eprecation note for UsageFunc.

Signed-off-by: ah8ad3 <ah8ad3@gmail.com>
@ah8ad3 ah8ad3 force-pushed the move-cobra-from-pkg branch from 1291513 to d42b043 Compare February 27, 2025 11:16
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ah8ad3, ahrtr, 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 ahrtr merged commit b9298ed into etcd-io:main Feb 27, 2025
40 checks passed
@ahrtr
Copy link
Member

ahrtr commented Feb 27, 2025

can you also add a changelog deprecation item for 3.7 (please add a CHANGELOG-3.7.md file), similar to CHANGELOG-3.6.md#deprecations? thx

@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Feb 27, 2025

can you also add a changelog deprecation item for 3.7 (please add a CHANGELOG-3.7.md file), similar to CHANGELOG-3.6.md#deprecations? thx

Of course i will do that as well @ahrtr

@ah8ad3 ah8ad3 deleted the move-cobra-from-pkg branch February 27, 2025 14:15
@ah8ad3 ah8ad3 mentioned this pull request Feb 27, 2025
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