etcd
etcd copied to clipboard
etcdctl: move cobra helper of etcdctl from main pkg to etcdctl pkg
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 https://github.com/etcd-io/etcd/pull/18183#discussion_r1687171454 Part of https://github.com/etcd-io/etcd/issues/17777
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.
/ok-to-test
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 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 :warning: |
| etcdctl/ctlv3/ctl.go | 0.00% | 1 Missing :warning: |
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 dataPowered by Codecov. Last update a423349...d42b043. Read the comment docs.
Ok rebased, make fixed. I think we are good to go.
PTAL @ivanvc
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.
https://github.com/etcd-io/etcd/blob/ad942b7118b0b2b640ea7bba2f1c45c39211f4c1/pkg/cobrautl/help.go#L154
Please let's
- either don't change it( close this PR);
- or add a deprecation note, do not remove it until 3.7.
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.
Covered during our triage meeting. @ah8ad3, are you looking into doing Benjamin's suggestion? Or should we close this pull request?
Thanks for looking into this @ivanvc , and sorry for delaying this task. I will take care of the comment and will add the note.
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
[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
- ~~OWNERS~~ [ahrtr,jmhbnz]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
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
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