Closed zackproser closed 1 year ago
Would adding baseUrl support be enough to work with other git providers? (e.g. Gitlab)
Hi @ejstreet,
Thanks for the great question. Git-xargs grew organically out of an internal tool at Gruntwork, where we exclusively use Github, so the tool currently pre-supposes Github as the version control system for opening PRs.
So, I think adding support for additional git providers would be a bit more involved. One initial thought about approaching this is that we could create an interface for a version control provider. For example, the interface would have a method like OpenPullRequest
and then we could create a concrete implementation for Github, Gitlab, etc and provide additional CLI flags and fallback behavior for choosing which VCS provider to use at runtime.
We might also consider implementing a config file and syntax for it if we go down that route. That all said, it sounds like discussion might be better split into a new ticket specifically about adding support for other version control providers like Gitlab, Bitbucket, etc (whereas this ticket is about supporting Github enterprise instances.)
I have an internal backlog of git-xargs
issues I still need to migrate to this repo, so I will open one there (or you could feel free to open a new ticket specifically for supporting other version control providers).
Thanks!
I ran into this issue as well. Until there's a robust solution, this worked for me in GitHub Enterprise.
diff --git a/auth/auth.go b/auth/auth.go
index 73ac8c0..b07d8ac 100644
--- a/auth/auth.go
+++ b/auth/auth.go
@@ -52,7 +52,8 @@ func ConfigureGithubClient() GithubClient {
tc := oauth2.NewClient(context.Background(), ts)
// Wrap the go-github client in a GithubClient struct, which is common between production and test code
- client := NewClient(github.NewClient(tc))
+ _client, _ := github.NewEnterpriseClient("https://${INSERT_BASE_URL_HERE}/api/v3/", "${INSERT_BASE_URL_HERE}/api/v3/upload", tc)
+ client := NewClient(_client)
return client
}
Any chance of this being added? Would love to use this tool, but stuck on Enterprise.
does it still no exit fot github enterprise?
Closing as I'm no longer working at Gruntwork and this issue is stale. If someone would like to pick up this work, please open a new issue to discuss it with the team and propose a pull request.
Related: https://github.com/gruntwork-io/fetch/pull/43