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

Create an importable version cobra.Command #23

Closed
justaugustus opened this issue Jan 22, 2022 · 7 comments · Fixed by #28
Closed

Create an importable version cobra.Command #23

justaugustus opened this issue Jan 22, 2022 · 7 comments · Fixed by #28
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.

Comments

@justaugustus
Copy link
Contributor

justaugustus commented Jan 22, 2022

I feel like we write a version package/version for multiple projects. Could we abstract/de-dupe?

Consider writing this as a package in sigs.k8s.io/release-utils that can be an importable cobra.Command.

See https://github.com/kubernetes/enhancements/tree/master/pkg/kepctl/commands for an example, as well @n3wscott's comments in kubernetes/enhancements#2387 (review) for more background.

Originally posted by @justaugustus in kubernetes-sigs/bom#27 (review)

@justaugustus
Copy link
Contributor Author

/good-first-issue
/help

@k8s-ci-robot
Copy link
Contributor

@justaugustus:
This request has been marked as suitable for new contributors.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue
/help

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jan 22, 2022
@n3wscott
Copy link
Contributor

I like it. Take a look at what we did in cosign: https://github.com/sigstore/cosign/blob/main/cmd/cosign/cli/version.go

The cli calls to the version package lib and spits out a bunch of standard things. https://github.com/sigstore/cosign/blob/main/pkg/version/version.go

@n3wscott
Copy link
Contributor

/assign

@saschagrunert saschagrunert removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jan 24, 2022
@justaugustus
Copy link
Contributor Author

Thanks Scott!!!

@cpanato
Copy link
Member

cpanato commented Jan 25, 2022

thanks scott 🎉

@n3wscott
Copy link
Contributor

n3wscott commented Feb 3, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants