From dca3dfdbe43804f907d07e46b265c0dbf1aa5ebf Mon Sep 17 00:00:00 2001 From: Erik Godding Boye Date: Sat, 28 Dec 2024 13:09:14 +0100 Subject: [PATCH] Migrate to new GitLab client-go --- gitlab/auth.go | 2 +- gitlab/client.go | 2 +- gitlab/client_organization_teams.go | 2 +- gitlab/client_repositories_org.go | 2 +- gitlab/client_repository_branch.go | 2 +- gitlab/client_repository_commit.go | 2 +- gitlab/client_repository_deploykey.go | 2 +- gitlab/client_repository_deploytoken.go | 2 +- gitlab/client_repository_file.go | 2 +- gitlab/client_repository_pullrequest.go | 2 +- gitlab/client_repository_tree.go | 2 +- gitlab/example_organization_test.go | 2 +- gitlab/example_repository_test.go | 2 +- gitlab/gitlabclient.go | 2 +- gitlab/integration_test.go | 2 +- gitlab/resource_commit.go | 2 +- gitlab/resource_deploykey.go | 2 +- gitlab/resource_deploytoken.go | 2 +- gitlab/resource_organization.go | 2 +- gitlab/resource_pullrequest.go | 2 +- gitlab/resource_repository.go | 2 +- gitlab/util.go | 2 +- gitlab/util_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gitlab/auth.go b/gitlab/auth.go index 300fa828..87097be6 100644 --- a/gitlab/auth.go +++ b/gitlab/auth.go @@ -18,7 +18,7 @@ package gitlab import ( "github.com/fluxcd/go-git-providers/gitprovider" - gogitlab "github.com/xanzy/go-gitlab" + gogitlab "gitlab.com/gitlab-org/api/client-go" ) const ( diff --git a/gitlab/client.go b/gitlab/client.go index ab2d3cc3..6cb40348 100644 --- a/gitlab/client.go +++ b/gitlab/client.go @@ -22,7 +22,7 @@ import ( "net/url" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // ProviderID is the provider ID for GitLab. diff --git a/gitlab/client_organization_teams.go b/gitlab/client_organization_teams.go index 644e79cc..ede92bd2 100644 --- a/gitlab/client_organization_teams.go +++ b/gitlab/client_organization_teams.go @@ -20,7 +20,7 @@ import ( "context" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // TeamsClient implements the gitprovider.TeamsClient interface. diff --git a/gitlab/client_repositories_org.go b/gitlab/client_repositories_org.go index 302d32d3..122b210c 100644 --- a/gitlab/client_repositories_org.go +++ b/gitlab/client_repositories_org.go @@ -21,7 +21,7 @@ import ( "errors" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // OrgRepositoriesClient implements the gitprovider.OrgRepositoriesClient interface. diff --git a/gitlab/client_repository_branch.go b/gitlab/client_repository_branch.go index feea7cf2..b4ce3628 100644 --- a/gitlab/client_repository_branch.go +++ b/gitlab/client_repository_branch.go @@ -20,7 +20,7 @@ import ( "context" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // BranchClient implements the gitprovider.BranchClient interface. diff --git a/gitlab/client_repository_commit.go b/gitlab/client_repository_commit.go index 5275305d..cdd96ea9 100644 --- a/gitlab/client_repository_commit.go +++ b/gitlab/client_repository_commit.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // CommitClient implements the gitprovider.CommitClient interface. diff --git a/gitlab/client_repository_deploykey.go b/gitlab/client_repository_deploykey.go index 9f028ee4..9da7bf4f 100644 --- a/gitlab/client_repository_deploykey.go +++ b/gitlab/client_repository_deploykey.go @@ -22,7 +22,7 @@ import ( "fmt" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // DeployKeyClient implements the gitprovider.DeployKeyClient interface. diff --git a/gitlab/client_repository_deploytoken.go b/gitlab/client_repository_deploytoken.go index b1d4bce0..7e8898f9 100644 --- a/gitlab/client_repository_deploytoken.go +++ b/gitlab/client_repository_deploytoken.go @@ -22,7 +22,7 @@ import ( "fmt" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // DeployTokenClient implements the gitprovider.DeployTokenClient interface. diff --git a/gitlab/client_repository_file.go b/gitlab/client_repository_file.go index 6d65243d..abe03d6e 100644 --- a/gitlab/client_repository_file.go +++ b/gitlab/client_repository_file.go @@ -23,7 +23,7 @@ import ( "strings" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // FileClient implements the gitprovider.FileClient interface. diff --git a/gitlab/client_repository_pullrequest.go b/gitlab/client_repository_pullrequest.go index 8c2bc85f..34f45e7a 100644 --- a/gitlab/client_repository_pullrequest.go +++ b/gitlab/client_repository_pullrequest.go @@ -22,7 +22,7 @@ import ( "time" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // mergeStatusChecking indicates that gitlab has not yet asynchronously updated the merge status for a merge request diff --git a/gitlab/client_repository_tree.go b/gitlab/client_repository_tree.go index 86e0ea4f..1b5a2315 100644 --- a/gitlab/client_repository_tree.go +++ b/gitlab/client_repository_tree.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // TreeClient implements the gitprovider.TreeClient interface. diff --git a/gitlab/example_organization_test.go b/gitlab/example_organization_test.go index a00fe0b0..d7e2bcba 100644 --- a/gitlab/example_organization_test.go +++ b/gitlab/example_organization_test.go @@ -10,7 +10,7 @@ import ( "github.com/fluxcd/go-git-providers/gitlab" "github.com/fluxcd/go-git-providers/gitprovider" - gogitlab "github.com/xanzy/go-gitlab" + gogitlab "gitlab.com/gitlab-org/api/client-go" ) // checkErr is used for examples in this repository. diff --git a/gitlab/example_repository_test.go b/gitlab/example_repository_test.go index 75c7f1b1..3b3b5ef3 100644 --- a/gitlab/example_repository_test.go +++ b/gitlab/example_repository_test.go @@ -9,7 +9,7 @@ import ( "github.com/fluxcd/go-git-providers/gitlab" "github.com/fluxcd/go-git-providers/gitprovider" - gogitlab "github.com/xanzy/go-gitlab" + gogitlab "gitlab.com/gitlab-org/api/client-go" ) func ExampleOrgRepositoriesClient_Get() { diff --git a/gitlab/gitlabclient.go b/gitlab/gitlabclient.go index dca8ee46..3bbb201f 100644 --- a/gitlab/gitlabclient.go +++ b/gitlab/gitlabclient.go @@ -22,7 +22,7 @@ import ( "strings" "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // gitlabClientImpl is a wrapper around *github.Client, which implements higher-level methods, diff --git a/gitlab/integration_test.go b/gitlab/integration_test.go index bb9512ea..0cc3e7cd 100644 --- a/gitlab/integration_test.go +++ b/gitlab/integration_test.go @@ -37,7 +37,7 @@ import ( "github.com/gregjones/httpcache" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" testutils "github.com/fluxcd/go-git-providers/gitprovider/testutils" diff --git a/gitlab/resource_commit.go b/gitlab/resource_commit.go index 2ae8a9b7..0580cf5f 100644 --- a/gitlab/resource_commit.go +++ b/gitlab/resource_commit.go @@ -17,7 +17,7 @@ limitations under the License. package gitlab import ( - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" ) diff --git a/gitlab/resource_deploykey.go b/gitlab/resource_deploykey.go index 7064e951..059a6751 100644 --- a/gitlab/resource_deploykey.go +++ b/gitlab/resource_deploykey.go @@ -22,7 +22,7 @@ import ( "fmt" "reflect" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" "github.com/fluxcd/go-git-providers/validation" diff --git a/gitlab/resource_deploytoken.go b/gitlab/resource_deploytoken.go index d7ba790c..832a5537 100644 --- a/gitlab/resource_deploytoken.go +++ b/gitlab/resource_deploytoken.go @@ -21,7 +21,7 @@ import ( "fmt" "reflect" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" "github.com/fluxcd/go-git-providers/validation" diff --git a/gitlab/resource_organization.go b/gitlab/resource_organization.go index c4ca5428..3631c5f9 100644 --- a/gitlab/resource_organization.go +++ b/gitlab/resource_organization.go @@ -17,7 +17,7 @@ limitations under the License. package gitlab import ( - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" "github.com/fluxcd/go-git-providers/validation" diff --git a/gitlab/resource_pullrequest.go b/gitlab/resource_pullrequest.go index 5cdbae58..7dda016d 100644 --- a/gitlab/resource_pullrequest.go +++ b/gitlab/resource_pullrequest.go @@ -18,7 +18,7 @@ package gitlab import ( "github.com/fluxcd/go-git-providers/gitprovider" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) // The value of the "State" field of a gitlab merge request after it has been merged" diff --git a/gitlab/resource_repository.go b/gitlab/resource_repository.go index ea385a96..33878531 100644 --- a/gitlab/resource_repository.go +++ b/gitlab/resource_repository.go @@ -21,7 +21,7 @@ import ( "errors" "github.com/google/go-cmp/cmp" - gogitlab "github.com/xanzy/go-gitlab" + gogitlab "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" ) diff --git a/gitlab/util.go b/gitlab/util.go index b370a102..60b9ee33 100644 --- a/gitlab/util.go +++ b/gitlab/util.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" "github.com/fluxcd/go-git-providers/gitprovider" "github.com/fluxcd/go-git-providers/validation" diff --git a/gitlab/util_test.go b/gitlab/util_test.go index 90b53e22..76bee7ea 100644 --- a/gitlab/util_test.go +++ b/gitlab/util_test.go @@ -23,7 +23,7 @@ import ( "github.com/fluxcd/go-git-providers/gitprovider" "github.com/fluxcd/go-git-providers/validation" - "github.com/xanzy/go-gitlab" + "gitlab.com/gitlab-org/api/client-go" ) func Test_validateAPIObject(t *testing.T) { diff --git a/go.mod b/go.mod index cc7c07ae..0cb8c156 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/ktrysmt/go-bitbucket v0.9.81 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.36.1 - github.com/xanzy/go-gitlab v0.114.0 + gitlab.com/gitlab-org/api/client-go v0.116.0 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.30.0 golang.org/x/oauth2 v0.24.0 diff --git a/go.sum b/go.sum index 8604e6f0..0b1b8bce 100644 --- a/go.sum +++ b/go.sum @@ -154,12 +154,12 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= -github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.com/gitlab-org/api/client-go v0.116.0 h1:Dy534gtZPMrnm3fAcmQRMadrcoUyFO4FQ4rXlSAdHAw= +gitlab.com/gitlab-org/api/client-go v0.116.0/go.mod h1:B29OfnZklmaoiR7uHANh9jTyfWEgmXvZLVEnosw2Dx0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=