From 3919f05548e2deb8cf276c03d14f71044e0eec7a Mon Sep 17 00:00:00 2001 From: Luke Kysow <1034429+lkysow@users.noreply.github.com> Date: Mon, 26 Aug 2019 18:23:52 +0200 Subject: [PATCH] Update to latest version of go-gitlab --- Gopkg.lock | 2 +- Gopkg.toml | 2 +- server/events/command_runner.go | 2 +- server/events/event_parser.go | 2 +- server/events/event_parser_test.go | 2 +- server/events/mocks/matchers/go_gitlab_mergecommentevent.go | 4 ++-- server/events/mocks/matchers/go_gitlab_mergeevent.go | 4 ++-- .../events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go | 4 ++-- server/events/mocks/mock_event_parsing.go | 2 +- server/events/mocks/mock_gitlab_merge_request_getter.go | 2 +- server/events/vcs/gitlab_client.go | 6 +++--- server/events/vcs/gitlab_client_test.go | 2 +- server/events_controller.go | 2 +- server/events_controller_test.go | 2 +- server/gitlab_request_parser_validator.go | 2 +- server/gitlab_request_parser_validator_test.go | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 3454107d7..9e1d3f436 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -799,7 +799,6 @@ "github.com/hashicorp/go-getter", "github.com/hashicorp/go-multierror", "github.com/hashicorp/go-version", - "github.com/lkysow/go-gitlab", "github.com/mitchellh/colorstring", "github.com/mitchellh/go-homedir", "github.com/mohae/deepcopy", @@ -811,6 +810,7 @@ "github.com/spf13/viper", "github.com/urfave/cli", "github.com/urfave/negroni", + "github.com/xanzy/go-gitlab", "golang.org/x/crypto/ssh/terminal", "gopkg.in/go-playground/validator.v9", "gopkg.in/yaml.v2", diff --git a/Gopkg.toml b/Gopkg.toml index cf7c4cf65..89e045799 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -94,7 +94,7 @@ [[constraint]] branch = "master" - name = "github.com/lkysow/go-gitlab" + name = "github.com/xanzy/go-gitlab" [[constraint]] name = "github.com/go-test/deep" diff --git a/server/events/command_runner.go b/server/events/command_runner.go index 2ef4113d1..ad2242203 100644 --- a/server/events/command_runner.go +++ b/server/events/command_runner.go @@ -17,13 +17,13 @@ import ( "fmt" "github.com/google/go-github/github" - gitlab "github.com/lkysow/go-gitlab" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/events/db" "github.com/runatlantis/atlantis/server/events/models" "github.com/runatlantis/atlantis/server/events/vcs" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/recovery" + gitlab "github.com/xanzy/go-gitlab" ) //go:generate pegomock generate -m --use-experimental-model-gen --package mocks -o mocks/mock_command_runner.go CommandRunner diff --git a/server/events/event_parser.go b/server/events/event_parser.go index eeccd1529..82acd04f5 100644 --- a/server/events/event_parser.go +++ b/server/events/event_parser.go @@ -20,11 +20,11 @@ import ( "strings" "github.com/google/go-github/github" - gitlab "github.com/lkysow/go-gitlab" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/events/models" "github.com/runatlantis/atlantis/server/events/vcs/bitbucketcloud" "github.com/runatlantis/atlantis/server/events/vcs/bitbucketserver" + gitlab "github.com/xanzy/go-gitlab" validator "gopkg.in/go-playground/validator.v9" ) diff --git a/server/events/event_parser_test.go b/server/events/event_parser_test.go index a2af742c7..5eb874f61 100644 --- a/server/events/event_parser_test.go +++ b/server/events/event_parser_test.go @@ -22,12 +22,12 @@ import ( "testing" "github.com/google/go-github/github" - gitlab "github.com/lkysow/go-gitlab" "github.com/mohae/deepcopy" "github.com/runatlantis/atlantis/server/events" "github.com/runatlantis/atlantis/server/events/models" . "github.com/runatlantis/atlantis/server/events/vcs/fixtures" . "github.com/runatlantis/atlantis/testing" + gitlab "github.com/xanzy/go-gitlab" ) var parser = events.EventParser{ diff --git a/server/events/mocks/matchers/go_gitlab_mergecommentevent.go b/server/events/mocks/matchers/go_gitlab_mergecommentevent.go index 4e702d99a..7a01f8950 100644 --- a/server/events/mocks/matchers/go_gitlab_mergecommentevent.go +++ b/server/events/mocks/matchers/go_gitlab_mergecommentevent.go @@ -2,9 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - go_gitlab "github.com/lkysow/go-gitlab" + go_gitlab "github.com/xanzy/go-gitlab" + "reflect" ) func AnyGoGitlabMergeCommentEvent() go_gitlab.MergeCommentEvent { diff --git a/server/events/mocks/matchers/go_gitlab_mergeevent.go b/server/events/mocks/matchers/go_gitlab_mergeevent.go index 73c70bfe0..a84c04512 100644 --- a/server/events/mocks/matchers/go_gitlab_mergeevent.go +++ b/server/events/mocks/matchers/go_gitlab_mergeevent.go @@ -2,9 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - go_gitlab "github.com/lkysow/go-gitlab" + go_gitlab "github.com/xanzy/go-gitlab" + "reflect" ) func AnyGoGitlabMergeEvent() go_gitlab.MergeEvent { diff --git a/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go b/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go index 568f4a6ed..dc884b0f3 100644 --- a/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go +++ b/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go @@ -2,9 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - go_gitlab "github.com/lkysow/go-gitlab" + go_gitlab "github.com/xanzy/go-gitlab" + "reflect" ) func AnyPtrToGoGitlabMergeRequest() *go_gitlab.MergeRequest { diff --git a/server/events/mocks/mock_event_parsing.go b/server/events/mocks/mock_event_parsing.go index 2f46ec8e6..4fd67e978 100644 --- a/server/events/mocks/mock_event_parsing.go +++ b/server/events/mocks/mock_event_parsing.go @@ -5,9 +5,9 @@ package mocks import ( github "github.com/google/go-github/github" - go_gitlab "github.com/lkysow/go-gitlab" pegomock "github.com/petergtz/pegomock" models "github.com/runatlantis/atlantis/server/events/models" + go_gitlab "github.com/xanzy/go-gitlab" "reflect" "time" ) diff --git a/server/events/mocks/mock_gitlab_merge_request_getter.go b/server/events/mocks/mock_gitlab_merge_request_getter.go index 5ce963298..20cfd835f 100644 --- a/server/events/mocks/mock_gitlab_merge_request_getter.go +++ b/server/events/mocks/mock_gitlab_merge_request_getter.go @@ -4,8 +4,8 @@ package mocks import ( - go_gitlab "github.com/lkysow/go-gitlab" pegomock "github.com/petergtz/pegomock" + go_gitlab "github.com/xanzy/go-gitlab" "reflect" "time" ) diff --git a/server/events/vcs/gitlab_client.go b/server/events/vcs/gitlab_client.go index 91beffc3a..c96550adb 100644 --- a/server/events/vcs/gitlab_client.go +++ b/server/events/vcs/gitlab_client.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/logging" - gitlab "github.com/lkysow/go-gitlab" "github.com/runatlantis/atlantis/server/events/models" + gitlab "github.com/xanzy/go-gitlab" ) type GitlabClient struct { @@ -165,7 +165,7 @@ func (g *GitlabClient) PullIsApproved(repo models.Repo, pull models.PullRequest) // - https://gitlab.com/gitlab-org/gitlab-ee/issues/3169 // - https://gitlab.com/gitlab-org/gitlab-ce/issues/42344 func (g *GitlabClient) PullIsMergeable(repo models.Repo, pull models.PullRequest) (bool, error) { - mr, _, err := g.Client.MergeRequests.GetMergeRequest(repo.FullName, pull.Num) + mr, _, err := g.Client.MergeRequests.GetMergeRequest(repo.FullName, pull.Num, nil) if err != nil { return false, err } @@ -196,7 +196,7 @@ func (g *GitlabClient) UpdateStatus(repo models.Repo, pull models.PullRequest, s } func (g *GitlabClient) GetMergeRequest(repoFullName string, pullNum int) (*gitlab.MergeRequest, error) { - mr, _, err := g.Client.MergeRequests.GetMergeRequest(repoFullName, pullNum) + mr, _, err := g.Client.MergeRequests.GetMergeRequest(repoFullName, pullNum, nil) return mr, err } diff --git a/server/events/vcs/gitlab_client_test.go b/server/events/vcs/gitlab_client_test.go index 3dffe5048..1fcad8456 100644 --- a/server/events/vcs/gitlab_client_test.go +++ b/server/events/vcs/gitlab_client_test.go @@ -8,8 +8,8 @@ import ( "testing" version "github.com/hashicorp/go-version" - gitlab "github.com/lkysow/go-gitlab" "github.com/runatlantis/atlantis/server/events/models" + gitlab "github.com/xanzy/go-gitlab" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/events_controller.go b/server/events_controller.go index 882fde53f..5b1deeda0 100644 --- a/server/events_controller.go +++ b/server/events_controller.go @@ -19,7 +19,6 @@ import ( "net/http" "github.com/google/go-github/github" - gitlab "github.com/lkysow/go-gitlab" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/events" "github.com/runatlantis/atlantis/server/events/models" @@ -27,6 +26,7 @@ import ( "github.com/runatlantis/atlantis/server/events/vcs/bitbucketcloud" "github.com/runatlantis/atlantis/server/events/vcs/bitbucketserver" "github.com/runatlantis/atlantis/server/logging" + gitlab "github.com/xanzy/go-gitlab" ) const githubHeader = "X-Github-Event" diff --git a/server/events_controller_test.go b/server/events_controller_test.go index 34449f8ee..6c2b97439 100644 --- a/server/events_controller_test.go +++ b/server/events_controller_test.go @@ -24,7 +24,6 @@ import ( "strings" "testing" - gitlab "github.com/lkysow/go-gitlab" . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server" "github.com/runatlantis/atlantis/server/events" @@ -35,6 +34,7 @@ import ( "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/mocks" . "github.com/runatlantis/atlantis/testing" + gitlab "github.com/xanzy/go-gitlab" ) const githubHeader = "X-Github-Event" diff --git a/server/gitlab_request_parser_validator.go b/server/gitlab_request_parser_validator.go index 28dca7dfc..00b35a2fc 100644 --- a/server/gitlab_request_parser_validator.go +++ b/server/gitlab_request_parser_validator.go @@ -19,7 +19,7 @@ import ( "io/ioutil" "net/http" - gitlab "github.com/lkysow/go-gitlab" + gitlab "github.com/xanzy/go-gitlab" ) const secretHeader = "X-Gitlab-Token" // #nosec diff --git a/server/gitlab_request_parser_validator_test.go b/server/gitlab_request_parser_validator_test.go index d6bb1e0f3..74a847212 100644 --- a/server/gitlab_request_parser_validator_test.go +++ b/server/gitlab_request_parser_validator_test.go @@ -19,10 +19,10 @@ import ( "reflect" "testing" - gitlab "github.com/lkysow/go-gitlab" . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server" . "github.com/runatlantis/atlantis/testing" + gitlab "github.com/xanzy/go-gitlab" ) var parser = server.DefaultGitlabRequestParserValidator{}