-
Notifications
You must be signed in to change notification settings - Fork 29
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
Rewrite CLI in Go #24
Conversation
1654ed5
to
bf776cd
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
a884a39
to
28ebbf7
Compare
I'll ping you on Monday. I'd like to get some app credentials into the Actions Secret store for this repo for a test app so I can write e2e integration tests for the functionality. Eventually I'll get to writing unit tests as well, but the scope of the CLI is small, so integration tests will be a better use of my dev cycles. |
Signed-off-by: Brett Logan <[email protected]>
Fixes #24 - I'll review shortly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, I still need to run some tests and we need to do the following before merging:
- Push out an announcement that we're migrating to Go
- Update README.md to cover the new changes
- It'll be awesome to have an e2e test workflow (but this is a nice to have)
Signed-off-by: Brett Logan <[email protected]>
Signed-off-by: Brett Logan <[email protected]>
Signed-off-by: Brett Logan <[email protected]>
I 💯 agree on the e2e tests, this should be simple to test all functions, I'll ping you in Slack with app credentials, if you can add them to the secret store I'll write the e2e tests tomorrow, I have some free cycles Friday afternoon. |
Signed-off-by: Brett Logan <[email protected]>
Signed-off-by: Brett Logan <[email protected]>
@lindluni can you have a look at the recent changes? I think we're ready to merge this when this deadline hits: https://github.com/Link-/gh-token/discussions/26 |
Love it! It'd still be great if we could get some unit tests and then some E2E tests done in the future with an actual app, but that's a story for another PR, and maybe something someone in the community would be interested in helping with (we can open a I do think we should create a tag for the current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this!
This PR introduces a full rewrite of the
gh-token
CLI as a pure-Gogh
CLI extension.Of note is the choice of
urfave/cli
overspf13/cobra
for the command package. Having spent years usingspf13/cobra
I preferurfave
for the simplicity due to the future features this extension itself actually requires, the Cobra command package provides much more functionality than we need.While I pulled in
google/go-github
, I chose to use it for the types only, and not for using it as an API client. Using thego-github
client pulls in many 3rd party dependencies, including the additional 3rd partyghinstallations
library. All of this just increases the maintenance surface, so I chose to implement the http calls using pure Go, which reduces the maintenance burden of keeping the app's dependencies up to date.To test this PR you can build and install the extension locally, in prod the extension will be built and pinned by Actions as a release: