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

Add examples to etcdctl snapshot command's help #18183

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

ah8ad3
Copy link
Contributor

@ah8ad3 ah8ad3 commented Jun 16, 2024

Part of #17777.
Add example section into etcdctl by first adding it to helper function of cobra.
Create a util module into etcdctl move helper there.
Add a normalizer function for exmaples.
Change indent of etcdctl from "\t" to " ".

I tried to keep this PR simple and add only functionality of examples to helper and add examples of snapshot so it can be easy to review.
/cc @ivanvc @jmhbnz

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

@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jun 16, 2024

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 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 0.00%. Comparing base (e758ffc) to head (fecb094).
Report is 157 commits behind head on main.

Current head fecb094 differs from pull request most recent head 16fb3f6

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

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

Additional details and impacted files
@@      Coverage Diff      @@
##   main   #18183   +/-   ##
=============================
=============================

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 e758ffc...16fb3f6. Read the comment docs.

@ivanvc
Copy link
Member

ivanvc commented Jun 17, 2024

Im not sure about this test https://github.com/etcd-io/etcd/actions/runs/9534220896/job/26278395488?pr=18183

I think you need to run a make fix and commit the changes to the go.mods, because you moved a file from pkg to etcdctl and didn't update the go.mod.

@ah8ad3 ah8ad3 force-pushed the etcdctl-doc branch 2 times, most recently from 9ab112f to 8fc2134 Compare June 18, 2024 10:45
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jun 18, 2024

I think you need to run a make fix and commit the changes to the go.mods, because you moved a file from pkg to etcdctl and didn't update the go.mod.

I see what you mean, thanks that makes sense. I updated the code hopefully that will fix it.

@ivanvc
Copy link
Member

ivanvc commented Jun 18, 2024

Speaking of moving the file from pkg/cobrautil to etcdctl/util, why did you decide to do so? I'm not persuaded by this change, as if at some point we want to improve the help from other commands like etcdutl, it would make sense to move it back. Or maybe there's some reason why you moved it that is not clear to me.

@ivanvc
Copy link
Member

ivanvc commented Jun 18, 2024

/retitle Add examples to etcdctl snapshot command's help

@k8s-ci-robot k8s-ci-robot changed the title Add exmaples to etcdctl snapshot Add examples to etcdctl snapshot command's help Jun 18, 2024
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jun 18, 2024

Speaking of moving the file from pkg/cobrautil to etcdctl/util, why did you decide to do so? I'm not persuaded by this change, as if at some point we want to improve the help from other commands like etcdutl, it would make sense to move it back. Or maybe there's some reason why you moved it that is not clear to me.

As i understand this help file is only for etcdctl and not etcdutl and etcd commands, So it would make sense to move it to the etcdctl package.
Also this helper is not well written, or maybe it was few years ago, we should change it to be more readable but i don't want to do that in this PR.

etcdctl/util/help.go Outdated Show resolved Hide resolved
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jul 23, 2024

/remove-label area/*

@k8s-ci-robot
Copy link

@ah8ad3: The label(s) /remove-label area/* cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to this:

/remove-label area/*

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.

@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jul 23, 2024

Sorry, always happens to me when i rebase with wrong repository(forked one), tried to fix it.
Let me know if should i do something.
PTAL @jmhbnz

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.

Thanks for addressing James' comment. I think this is going in the right direction. I left a couple of comments.

pkg/cobrautl/help.go Show resolved Hide resolved
etcdctl/util/normalizer.go Outdated Show resolved Hide resolved
etcdctl/util/normalizer.go Outdated Show resolved Hide resolved
etcdctl/util/normalizer.go Outdated Show resolved Hide resolved
etcdctl util, create normalizer of examples in util, add some more
examples, change indent of etcdctl from "\t" to "  "

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

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

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 - New help examples look great, thanks @ah8ad3

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 :)

@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

@jmhbnz jmhbnz merged commit bb6ce78 into etcd-io:main Aug 5, 2024
33 checks passed
@ah8ad3 ah8ad3 deleted the etcdctl-doc branch August 5, 2024 04:43
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.

6 participants