Closed sco11morgan closed 5 years ago
I believe @jniesen was kind enough to add GitHub Enterprise support. Any chance you know what the issue above is?
@brikis98 I think I see the problem. Some tests need to added to file_test.go
and URL parsing needs to be introduced into MakeGitHubZipFileRequest
https://github.com/gruntwork-io/fetch/blob/48ae79f9b8aa0842ad22e07b2fae5e5669dcbcfc/file.go#L117
I'll be able to work on this in a few hours.
Thanks @jniesen!
@jniesen, were you able to fix this? Before I dig in too deep, wanted to doublecheck since we are experiencing the same issue and it is now a blocker for us. Interested in getting it fixed, and a new release cut.
@dg-nthompson No, sorry you got blocked by this. I had to let this get this displaced by other things.
If you would like to dig in, the link in my previous comment is a good place to start. The occurence of api.github.com
in that func and any other occurrence needs to be looked at and possibly updated to take advantage of the URL detection logic used elsewhere.
Like on this line:
url := fmt.Sprintf("https://api.github.com/repos/%s/%s/zipball/%s", gitHubCommit.Repo.Owner, gitHubCommit.Repo.Name, gitRef)
The api.github.com
could be replaced with gitHubCommit.Repo.BaseUrl
like:
url := fmt.Sprintf("https://%s/repos/%s/%s/zipball/%s", gitHubCommit.Repo.BaseURL, gitHubCommit.Repo.Owner, gitHubCommit.Repo.Name, gitRef)
Then the bulk of the work lies in updating the tests. Also, just from looking at it some now, I'm not totally positive that you'd use BaseUrl
or ApiUrl
.
I hope this helps and I won't be doing any coding unless I let you know and get an ack that we're not stepping on each other's toes. Sorry again.
@jniesen, thank you for the reply! No worries on being blocked, it was more to determine how we wanted to proceed. @josh-padnick has been able to jump in an help, so hope to have something in place with tests when he is ready. Thank you all!
I'm using fetch v0.3.2 against our GH Enterprise instance. The initial logging indicates Enteprise is detected
Assuming GitHub Enterprise since the provided url (<enterprise url>/<redacted repo>) does not appear to be for GitHub.com
but then later on there is an error
ERROR: Error occurred while downloading zip file from GitHub repo: 500 - Failed to download file at the url https://api.github.com/repos/<redacted repo>
It should be using a URL beginning with
https://<enterprise url>/api/v3/<repo>