-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update package constructors #2904
Conversation
# Conflicts: # github/github.go
Codecov Report
@@ Coverage Diff @@
## master #2904 +/- ##
=======================================
Coverage 98.10% 98.11%
=======================================
Files 142 142
Lines 12347 12385 +38
=======================================
+ Hits 12113 12151 +38
Misses 159 159
Partials 75 75
|
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 looks great, @WillAbides !
Just a few minor nits, please, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
Co-authored-by: Glenn Lewis <[email protected]>
@gmlewis Updated with your suggestions. As an aside, is there a way to get a preview of what codecov is going to report before pushing? I looked for a way to run it locally, and it appears to require an API token and membership in the right org. |
Not that I'm aware of. Sometimes, to get an idea of what it might report, I run this locally first: $ cat coverage-web.sh
#!/bin/bash -ex
go test -coverprofile=cover.out ./...
go tool cover -html cover.out but it is obviously not the same. |
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.
Awesome! Thank you, @WillAbides !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
I made a script to preview whether codecov will fail your PR: https://gist.github.com/WillAbides/e0bbffccb34d9922cecb2ab9d66defec |
Thank you, @WillAbides ! That's fantastic! |
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.
LGTM! Thanks for the updates 💖 .
Thank you, @sridharavinash ! |
google/go-github#2904 added support for bypassing github.com/x/oauth2. Use it.
google/go-github#2904 added support for bypassing github.com/x/oauth2. Use it.
Closes #2897
After experimenting with implementing #2897, I think this ends up with better usage for end users.
This deprecates
github.NewTokenClient
andgithub.NewEnterpriseClient
and replaces them withClient.WithAuthToken
andClient.WithEnterpriseURLs
.Now you can create an authenticated client for an enterprise server with:
There is no need for users import
github.com/x/oauth2
anymore.I opted for this implementation over my
WithOptions
proposal the error returned fromWithOptions
means that most uses of go-github would have an unnecessary error check.vs