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

Support Github enterprise #74

Merged
merged 2 commits into from
Mar 23, 2021
Merged

Support Github enterprise #74

merged 2 commits into from
Mar 23, 2021

Conversation

nathanleiby
Copy link
Contributor

@nathanleiby nathanleiby commented Mar 21, 2021

JIRA

n/a

Overview

Allows microplane to work with Github enterprise.

Caveat noted in README: Self-hosted Github setup with different URLs for the main API and uploads API are not yet supported. If this is a blocker for you, please file an issue or make a PR.

Testing

  • Test e2e with a Github enterprise setup :octocat: 💰
  • Test e2e with normal Github setup :octocat: to verify no regressions

@nathanleiby nathanleiby marked this pull request as ready for review March 22, 2021 00:35
@nathanleiby
Copy link
Contributor Author

@Line-Noise @gtorre @VasuBhaskar hoping to land this soon.

  • Before (building from this branch yourself) or after that (downloading the latest release), would any of you be able to verify whether the change works for you?
  • A related question: do you use different URLs for the main API and uploads API in your setups?

Thank you!

--

Personally, I still haven't had a chance to get a working setup for Github enterprise. The simplest option for me seems like it would require running it myself on AWS. I've also reached out to their developer program seeking a developer license to work on enterprise, instead of using a free trial for Github enterprise.

@Line-Noise
Copy link

I'm happy to give this a test. I'm not sure about the upload URL. I doubt it's different but I don't know how to check.

@gtorre
Copy link

gtorre commented Mar 22, 2021

@nathanleiby I'd be happy to test the changes.

A related question: do you use different URLs for the main API and uploads API in your setups?

Same URL.

Copy link
Contributor

@ghirsch1 ghirsch1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, assuming the testing works as expected!

Base automatically changed from refactor-provider to master March 22, 2021 20:12
@nathanleiby nathanleiby requested a review from a team as a code owner March 22, 2021 20:12
@nathanleiby
Copy link
Contributor Author

Ran integration_test.sh and verified no regression for Github/Gitlab, so I'll merge this and ship a release.

I haven't tested Enterprise myself, but at that point can handoff to others for their help in testing 🙏 Thank you!

@nathanleiby nathanleiby merged commit 6d4c5bd into master Mar 23, 2021
@nathanleiby nathanleiby deleted the support-github-enterprise branch March 23, 2021 00:20
@nathanleiby
Copy link
Contributor Author

@Line-Noise @gtorre Thanks for being able to help test!

I've shipped a release here based on this change: https://github.com/Clever/microplane/releases/tag/v0.0.28

To use Github enterprise, download this new release, then use it to run:

mp init --provider-url https://your-enterprise-url.com
mp clone
<etc>

I don't expect problems other than "it doesn't work", as there's no special logic here other than setting up the Github Enterprise client. It's using the same API calls we've tested with non-enterprise Github. Still please understand that I haven't tested this feature myself so be cautious if anything seems amiss.

Thanks again!

@gtorre
Copy link

gtorre commented Mar 23, 2021

@nathanleiby thanks! I downloaded the darwin binary and getting this error:

gtorre@MacBook-Pro Downloads % ./mp-0.0.28-darwin-amd64 init --provider-url https://github.example.net
2021/03/23 13:21:34 to init via code search (default), you must pass a search query. If init from a repo file, specify a repos file with -f.If init with a github repo search, include --repo-search flag.
gtorre@MacBook-Pro Downloads % ./mp-0.0.28-darwin-amd64 clone
2021/03/23 13:21:39 open /Users/gtorre/Downloads/mp/init.json: no such file or directory

@nathanleiby
Copy link
Contributor Author

nathanleiby commented Mar 23, 2021

@gtorre Sorry for the confusion! init has several ways to select a list of repos. One option is to pass it a file containing the repos, with the -f flag.

Can you try creating a file named repos.txt that contains one or more projects listed in it, and pass that to init?

<your-org>/<your-repo1>
<your-org>/<your-repo2>

for example at Clever this might look like:

clever/microplane
clever/repo2

Once you've created that file, run:

./mp-0.0.28-darwin-amd64 init --provider-url <your URL> -f repos.txt

@gtorre
Copy link

gtorre commented Mar 24, 2021

@nathanleiby happy to report that it worked!

% ./mp-0.0.28-darwin-amd64 status
REPO		STATUS		DETAILS
halcyon		cloned

@nathanleiby
Copy link
Contributor Author

@gtorre glad to hear it and thank you for testing!

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.

4 participants