Skip to content

feat: add support for github enterprise server#132

Merged
james00012 merged 1 commit into
gruntwork-io:masterfrom
kennyg:ghe-support
Nov 30, 2023
Merged

feat: add support for github enterprise server#132
james00012 merged 1 commit into
gruntwork-io:masterfrom
kennyg:ghe-support

Conversation

@kennyg

@kennyg kennyg commented Jul 30, 2023

Copy link
Copy Markdown
Contributor

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.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added support for Github Enterprise servers.

@kennyg kennyg requested a review from brikis98 as a code owner July 30, 2023 21:33

@andyfeller andyfeller left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread auth/auth.go
GithubHostname := os.Getenv("GITHUB_HOSTNAME")
baseUrl := fmt.Sprintf("https://%s/", GithubHostname)

githubClient, _ = github.NewEnterpriseClient(baseUrl, baseUrl, tc)

Copy link
Copy Markdown
Contributor

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.

@kennyg

kennyg commented Aug 27, 2023

Copy link
Copy Markdown
Contributor Author

@brikis98 can you help with an approval for this PR?

@andyfeller

Copy link
Copy Markdown
Contributor

@brikis98 @zackproser : is there someone else at Gruntworks who might be capable of reviewing and approving this PR? 🙏

@zackproser

Copy link
Copy Markdown
Contributor

@andyfeller you could try @josh-padnick or @hongil0316 ?

@josh-padnick

Copy link
Copy Markdown

@gitsstewart Could you identify an SME to help review this PR?

@gitsstewart

Copy link
Copy Markdown

I will ask the team if anyone is available quickly for a review

@james00012 james00012 left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread auth/auth.go

var githubClient *github.Client

if os.Getenv("GITHUB_HOSTNAME") != "" {

Copy link
Copy Markdown
Contributor

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.

@james00012

Copy link
Copy Markdown
Contributor

@james00012

Copy link
Copy Markdown
Contributor

Confirmed that all the tests passed. Will merge.

@james00012 james00012 merged commit 070d1a6 into gruntwork-io:master Nov 30, 2023
@thirstydeveloper

Copy link
Copy Markdown

This will be very helpful to my team!

@hongil0316 - could you release a new version with this feature?

@josh-padnick

Copy link
Copy Markdown

@hongil0316 I'll go ahead and issue the release since the only thing it includes is this change.

@josh-padnick

Copy link
Copy Markdown

Released in v0.1.11

@james00012

Copy link
Copy Markdown
Contributor

Oh sorry about that @thirstydeveloper, I must have missed this. Thanks @josh-padnick for taking it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants