-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat: add support for github enterprise server #132
Conversation
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.
For what it's worth, these changes look good to me
GithubHostname := os.Getenv("GITHUB_HOSTNAME") | ||
baseUrl := fmt.Sprintf("https://%s/", GithubHostname) | ||
|
||
githubClient, _ = github.NewEnterpriseClient(baseUrl, baseUrl, tc) |
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.
NewEnterpriseClient
function checks out 👌 ... I was initially asking whether this took into account the path aspects for GHES API endpoints, but confirmed that it should be handled appropriately.
@brikis98 can you help with an approval for this PR? |
@brikis98 @zackproser : is there someone else at Gruntworks who might be capable of reviewing and approving this PR? 🙏 |
@andyfeller you could try @josh-padnick or @hongil0316 ? |
@gitsstewart Could you identify an SME to help review this PR? |
I will ask the team if anyone is available quickly for a review |
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.
Small nit comment but overall LGTM. Let me trigger the test pipeline
@@ -52,8 +52,20 @@ func ConfigureGithubClient() GithubClient { | |||
|
|||
tc := oauth2.NewClient(context.Background(), ts) | |||
|
|||
var githubClient *github.Client | |||
|
|||
if os.Getenv("GITHUB_HOSTNAME") != "" { |
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.
nit: can we change the environment variable name to something like: GITHUB_URL
and expect the user to pass in the full URL? This would potentially remove confusion from users whether they would have to include https:
at the front or not.
Will check when it complets - https://app.circleci.com/pipelines/github/gruntwork-io/git-xargs/332/workflows/aafce9b1-fd99-4708-9b0a-8ab1ad5a374b |
Confirmed that all the tests passed. Will merge. |
This will be very helpful to my team! @hongil0316 - could you release a new version with this feature? |
@hongil0316 I'll go ahead and issue the release since the only thing it includes is this change. |
Released in v0.1.11 |
Oh sorry about that @thirstydeveloper, I must have missed this. Thanks @josh-padnick for taking it! :) |
Description
This PR adds support for Github Enterprise. I used this PR as a guide, and added a small test.
TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added support for Github Enterprise servers.