aboutsummaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authoramine <hilalyamine@gmail.com>2019-10-24 20:45:02 +0200
committeramine <hilalyamine@gmail.com>2019-10-24 20:45:02 +0200
commita3a431edac978e20ab1887b902ee7240683f7d95 (patch)
tree79cc256c3e7cb2349174e77a33a6eb74c235b9f9 /vendor
parent683040dd7a26878a05902a98378c2ed0d5bf23ee (diff)
downloadgit-bug-a3a431edac978e20ab1887b902ee7240683f7d95.tar.gz
vendors: upgrade github.com/xanzy/go-gitlab dependencies to 0.21.0
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/xanzy/go-gitlab/.travis.yml1
-rw-r--r--vendor/github.com/xanzy/go-gitlab/commits.go7
-rw-r--r--vendor/github.com/xanzy/go-gitlab/discussions.go94
-rw-r--r--vendor/github.com/xanzy/go-gitlab/event_types.go29
-rw-r--r--vendor/github.com/xanzy/go-gitlab/gitlab.go20
-rw-r--r--vendor/github.com/xanzy/go-gitlab/go.mod4
-rw-r--r--vendor/github.com/xanzy/go-gitlab/go.sum8
-rw-r--r--vendor/github.com/xanzy/go-gitlab/group_clusters.go211
-rw-r--r--vendor/github.com/xanzy/go-gitlab/group_variables.go11
-rw-r--r--vendor/github.com/xanzy/go-gitlab/issues.go38
-rw-r--r--vendor/github.com/xanzy/go-gitlab/merge_request_approvals.go87
-rw-r--r--vendor/github.com/xanzy/go-gitlab/merge_requests.go148
-rw-r--r--vendor/github.com/xanzy/go-gitlab/milestones.go7
-rw-r--r--vendor/github.com/xanzy/go-gitlab/pipelines.go109
-rw-r--r--vendor/github.com/xanzy/go-gitlab/project_members.go2
-rw-r--r--vendor/github.com/xanzy/go-gitlab/project_variables.go11
-rw-r--r--vendor/github.com/xanzy/go-gitlab/projects.go150
-rw-r--r--vendor/github.com/xanzy/go-gitlab/runners.go18
-rw-r--r--vendor/github.com/xanzy/go-gitlab/search.go29
-rw-r--r--vendor/github.com/xanzy/go-gitlab/services.go53
-rw-r--r--vendor/github.com/xanzy/go-gitlab/users.go13
21 files changed, 802 insertions, 248 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/.travis.yml b/vendor/github.com/xanzy/go-gitlab/.travis.yml
index 0c9e8857..ee77c02b 100644
--- a/vendor/github.com/xanzy/go-gitlab/.travis.yml
+++ b/vendor/github.com/xanzy/go-gitlab/.travis.yml
@@ -4,6 +4,7 @@ go:
- 1.10.x
- 1.11.x
- 1.12.x
+ - 1.13.x
- master
stages:
diff --git a/vendor/github.com/xanzy/go-gitlab/commits.go b/vendor/github.com/xanzy/go-gitlab/commits.go
index cb03c3a0..27dd5645 100644
--- a/vendor/github.com/xanzy/go-gitlab/commits.go
+++ b/vendor/github.com/xanzy/go-gitlab/commits.go
@@ -176,6 +176,9 @@ func (s *CommitsService) GetCommit(pid interface{}, sha string, options ...Optio
if err != nil {
return nil, nil, err
}
+ if sha == "" {
+ return nil, nil, fmt.Errorf("SHA must be a non-empty string")
+ }
u := fmt.Sprintf("projects/%s/repository/commits/%s", pathEscape(project), url.PathEscape(sha))
req, err := s.client.NewRequest("GET", u, nil, options)
@@ -199,9 +202,13 @@ type CreateCommitOptions struct {
Branch *string `url:"branch" json:"branch"`
CommitMessage *string `url:"commit_message" json:"commit_message"`
StartBranch *string `url:"start_branch,omitempty" json:"start_branch,omitempty"`
+ StartSHA *string `url:"start_sha,omitempty" json:"start_sha,omitempty"`
+ StartProject *string `url:"start_project,omitempty" json:"start_project,omitempty"`
Actions []*CommitAction `url:"actions" json:"actions"`
AuthorEmail *string `url:"author_email,omitempty" json:"author_email,omitempty"`
AuthorName *string `url:"author_name,omitempty" json:"author_name,omitempty"`
+ Stats *bool `url:"stats,omitempty" json:"stats,omitempty"`
+ Force *bool `url:"force,omitempty" json:"force,omitempty"`
}
// CreateCommit creates a commit with multiple files and actions.
diff --git a/vendor/github.com/xanzy/go-gitlab/discussions.go b/vendor/github.com/xanzy/go-gitlab/discussions.go
index 7a964f14..17ed1c7d 100644
--- a/vendor/github.com/xanzy/go-gitlab/discussions.go
+++ b/vendor/github.com/xanzy/go-gitlab/discussions.go
@@ -46,14 +46,14 @@ func (d Discussion) String() string {
// options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-project-issue-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-issue-discussion-items
type ListIssueDiscussionsOptions ListOptions
// ListIssueDiscussions gets a list of all discussions for a single
// issue.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-project-issue-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-issue-discussion-items
func (s *DiscussionsService) ListIssueDiscussions(pid interface{}, issue int, opt *ListIssueDiscussionsOptions, options ...OptionFunc) ([]*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -78,7 +78,7 @@ func (s *DiscussionsService) ListIssueDiscussions(pid interface{}, issue int, op
// GetIssueDiscussion returns a single discussion for a specific project issue.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#get-single-issue-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#get-single-issue-discussion-item
func (s *DiscussionsService) GetIssueDiscussion(pid interface{}, issue int, discussion string, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -108,7 +108,7 @@ func (s *DiscussionsService) GetIssueDiscussion(pid interface{}, issue int, disc
// options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-thread
type CreateIssueDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -117,7 +117,7 @@ type CreateIssueDiscussionOptions struct {
// CreateIssueDiscussion creates a new discussion to a single project issue.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-thread
func (s *DiscussionsService) CreateIssueDiscussion(pid interface{}, issue int, opt *CreateIssueDiscussionOptions, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -143,7 +143,7 @@ func (s *DiscussionsService) CreateIssueDiscussion(pid interface{}, issue int, o
// options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-issue-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-issue-thread
type AddIssueDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -152,7 +152,7 @@ type AddIssueDiscussionNoteOptions struct {
// AddIssueDiscussionNote creates a new discussion to a single project issue.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-issue-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-issue-thread
func (s *DiscussionsService) AddIssueDiscussionNote(pid interface{}, issue int, discussion string, opt *AddIssueDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -182,7 +182,7 @@ func (s *DiscussionsService) AddIssueDiscussionNote(pid interface{}, issue int,
// UpdateIssueDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-issue-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-issue-thread-note
type UpdateIssueDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -191,7 +191,7 @@ type UpdateIssueDiscussionNoteOptions struct {
// UpdateIssueDiscussionNote modifies existing discussion of an issue.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-issue-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-issue-thread-note
func (s *DiscussionsService) UpdateIssueDiscussionNote(pid interface{}, issue int, discussion string, note int, opt *UpdateIssueDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -221,7 +221,7 @@ func (s *DiscussionsService) UpdateIssueDiscussionNote(pid interface{}, issue in
// DeleteIssueDiscussionNote deletes an existing discussion of an issue.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#delete-an-issue-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#delete-an-issue-thread-note
func (s *DiscussionsService) DeleteIssueDiscussionNote(pid interface{}, issue int, discussion string, note int, options ...OptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -246,14 +246,14 @@ func (s *DiscussionsService) DeleteIssueDiscussionNote(pid interface{}, issue in
// options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-all-snippet-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-snippet-discussion-items
type ListSnippetDiscussionsOptions ListOptions
// ListSnippetDiscussions gets a list of all discussions for a single
// snippet. Snippet discussions are comments users can post to a snippet.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-all-snippet-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-snippet-discussion-items
func (s *DiscussionsService) ListSnippetDiscussions(pid interface{}, snippet int, opt *ListSnippetDiscussionsOptions, options ...OptionFunc) ([]*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -278,7 +278,7 @@ func (s *DiscussionsService) ListSnippetDiscussions(pid interface{}, snippet int
// GetSnippetDiscussion returns a single discussion for a given snippet.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#get-single-snippet-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#get-single-snippet-discussion-item
func (s *DiscussionsService) GetSnippetDiscussion(pid interface{}, snippet int, discussion string, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -308,7 +308,7 @@ func (s *DiscussionsService) GetSnippetDiscussion(pid interface{}, snippet int,
// CreateSnippetDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-snippet-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-snippet-thread
type CreateSnippetDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -318,7 +318,7 @@ type CreateSnippetDiscussionOptions struct {
// Snippet discussions are comments users can post to a snippet.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-snippet-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-snippet-thread
func (s *DiscussionsService) CreateSnippetDiscussion(pid interface{}, snippet int, opt *CreateSnippetDiscussionOptions, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -344,7 +344,7 @@ func (s *DiscussionsService) CreateSnippetDiscussion(pid interface{}, snippet in
// AddSnippetDiscussionNote() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-snippet-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-snippet-thread
type AddSnippetDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -354,7 +354,7 @@ type AddSnippetDiscussionNoteOptions struct {
// snippet.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-snippet-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-snippet-thread
func (s *DiscussionsService) AddSnippetDiscussionNote(pid interface{}, snippet int, discussion string, opt *AddSnippetDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -384,7 +384,7 @@ func (s *DiscussionsService) AddSnippetDiscussionNote(pid interface{}, snippet i
// UpdateSnippetDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-snippet-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-snippet-thread-note
type UpdateSnippetDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -393,7 +393,7 @@ type UpdateSnippetDiscussionNoteOptions struct {
// UpdateSnippetDiscussionNote modifies existing discussion of a snippet.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-snippet-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-snippet-thread-note
func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid interface{}, snippet int, discussion string, note int, opt *UpdateSnippetDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -423,7 +423,7 @@ func (s *DiscussionsService) UpdateSnippetDiscussionNote(pid interface{}, snippe
// DeleteSnippetDiscussionNote deletes an existing discussion of a snippet.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#delete-a-snippet-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#delete-a-snippet-thread-note
func (s *DiscussionsService) DeleteSnippetDiscussionNote(pid interface{}, snippet int, discussion string, note int, options ...OptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -448,14 +448,14 @@ func (s *DiscussionsService) DeleteSnippetDiscussionNote(pid interface{}, snippe
// ListEpicDiscussions() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#list-all-epic-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-group-epic-discussion-items
type ListGroupEpicDiscussionsOptions ListOptions
// ListGroupEpicDiscussions gets a list of all discussions for a single
// epic. Epic discussions are comments users can post to a epic.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#list-all-epic-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-group-epic-discussion-items
func (s *DiscussionsService) ListGroupEpicDiscussions(gid interface{}, epic int, opt *ListGroupEpicDiscussionsOptions, options ...OptionFunc) ([]*Discussion, *Response, error) {
group, err := parseID(gid)
if err != nil {
@@ -483,7 +483,7 @@ func (s *DiscussionsService) ListGroupEpicDiscussions(gid interface{}, epic int,
// GetEpicDiscussion returns a single discussion for a given epic.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#get-single-epic-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#get-single-epic-discussion-item
func (s *DiscussionsService) GetEpicDiscussion(gid interface{}, epic int, discussion string, options ...OptionFunc) (*Discussion, *Response, error) {
group, err := parseID(gid)
if err != nil {
@@ -513,7 +513,7 @@ func (s *DiscussionsService) GetEpicDiscussion(gid interface{}, epic int, discus
// options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#create-new-epic-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-epic-thread
type CreateEpicDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -523,7 +523,7 @@ type CreateEpicDiscussionOptions struct {
// discussions are comments users can post to a epic.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#create-new-epic-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-epic-thread
func (s *DiscussionsService) CreateEpicDiscussion(gid interface{}, epic int, opt *CreateEpicDiscussionOptions, options ...OptionFunc) (*Discussion, *Response, error) {
group, err := parseID(gid)
if err != nil {
@@ -552,7 +552,7 @@ func (s *DiscussionsService) CreateEpicDiscussion(gid interface{}, epic int, opt
// AddEpicDiscussionNote() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#add-note-to-existing-epic-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-epic-thread
type AddEpicDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -561,7 +561,7 @@ type AddEpicDiscussionNoteOptions struct {
// AddEpicDiscussionNote creates a new discussion to a single project epic.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#add-note-to-existing-epic-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-epic-thread
func (s *DiscussionsService) AddEpicDiscussionNote(gid interface{}, epic int, discussion string, opt *AddEpicDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
group, err := parseID(gid)
if err != nil {
@@ -591,7 +591,7 @@ func (s *DiscussionsService) AddEpicDiscussionNote(gid interface{}, epic int, di
// options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#modify-existing-epic-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-epic-thread-note
type UpdateEpicDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -600,7 +600,7 @@ type UpdateEpicDiscussionNoteOptions struct {
// UpdateEpicDiscussionNote modifies existing discussion of a epic.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#modify-existing-epic-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-epic-thread-note
func (s *DiscussionsService) UpdateEpicDiscussionNote(gid interface{}, epic int, discussion string, note int, opt *UpdateEpicDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
group, err := parseID(gid)
if err != nil {
@@ -630,7 +630,7 @@ func (s *DiscussionsService) UpdateEpicDiscussionNote(gid interface{}, epic int,
// DeleteEpicDiscussionNote deletes an existing discussion of a epic.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#delete-an-epic-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#delete-an-epic-thread-note
func (s *DiscussionsService) DeleteEpicDiscussionNote(gid interface{}, epic int, discussion string, note int, options ...OptionFunc) (*Response, error) {
group, err := parseID(gid)
if err != nil {
@@ -655,14 +655,14 @@ func (s *DiscussionsService) DeleteEpicDiscussionNote(gid interface{}, epic int,
// ListMergeRequestDiscussions() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-all-merge-request-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-merge-request-discussion-items
type ListMergeRequestDiscussionsOptions ListOptions
// ListMergeRequestDiscussions gets a list of all discussions for a single
// merge request.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-all-merge-request-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-merge-request-discussion-items
func (s *DiscussionsService) ListMergeRequestDiscussions(pid interface{}, mergeRequest int, opt *ListMergeRequestDiscussionsOptions, options ...OptionFunc) ([]*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -691,7 +691,7 @@ func (s *DiscussionsService) ListMergeRequestDiscussions(pid interface{}, mergeR
// request.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#get-single-merge-request-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#get-single-merge-request-discussion-item
func (s *DiscussionsService) GetMergeRequestDiscussion(pid interface{}, mergeRequest int, discussion string, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -721,7 +721,7 @@ func (s *DiscussionsService) GetMergeRequestDiscussion(pid interface{}, mergeReq
// CreateMergeRequestDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-merge-request-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-merge-request-thread
type CreateMergeRequestDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -732,7 +732,7 @@ type CreateMergeRequestDiscussionOptions struct {
// request.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-merge-request-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-merge-request-thread
func (s *DiscussionsService) CreateMergeRequestDiscussion(pid interface{}, mergeRequest int, opt *CreateMergeRequestDiscussionOptions, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -761,7 +761,7 @@ func (s *DiscussionsService) CreateMergeRequestDiscussion(pid interface{}, merge
// ResolveMergeRequestDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#resolve-a-merge-request-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#resolve-a-merge-request-thread
type ResolveMergeRequestDiscussionOptions struct {
Resolved *bool `url:"resolved,omitempty" json:"resolved,omitempty"`
}
@@ -770,7 +770,7 @@ type ResolveMergeRequestDiscussionOptions struct {
// request.
//
// GitLab API docs:
-// https://docs.gitlab.com/ee/api/discussions.html#resolve-a-merge-request-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#resolve-a-merge-request-thread
func (s *DiscussionsService) ResolveMergeRequestDiscussion(pid interface{}, mergeRequest int, discussion string, opt *ResolveMergeRequestDiscussionOptions, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -907,14 +907,14 @@ func (s *DiscussionsService) DeleteMergeRequestDiscussionNote(pid interface{}, m
// ListCommitDiscussions() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-project-commit-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-commit-discussion-items
type ListCommitDiscussionsOptions ListOptions
// ListCommitDiscussions gets a list of all discussions for a single
// commit.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#list-project-commit-discussions
+// https://docs.gitlab.com/ce/api/discussions.html#list-project-commit-discussion-items
func (s *DiscussionsService) ListCommitDiscussions(pid interface{}, commit string, opt *ListCommitDiscussionsOptions, options ...OptionFunc) ([]*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -943,7 +943,7 @@ func (s *DiscussionsService) ListCommitDiscussions(pid interface{}, commit strin
// commit.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#get-single-commit-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#get-single-commit-discussion-item
func (s *DiscussionsService) GetCommitDiscussion(pid interface{}, commit string, discussion string, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -973,7 +973,7 @@ func (s *DiscussionsService) GetCommitDiscussion(pid interface{}, commit string,
// CreateCommitDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-commit-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-commit-thread
type CreateCommitDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -983,7 +983,7 @@ type CreateCommitDiscussionOptions struct {
// CreateCommitDiscussion creates a new discussion to a single project commit.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#create-new-commit-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#create-new-commit-thread
func (s *DiscussionsService) CreateCommitDiscussion(pid interface{}, commit string, opt *CreateCommitDiscussionOptions, options ...OptionFunc) (*Discussion, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -1012,7 +1012,7 @@ func (s *DiscussionsService) CreateCommitDiscussion(pid interface{}, commit stri
// AddCommitDiscussionNote() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-commit-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-commit-thread
type AddCommitDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -1021,7 +1021,7 @@ type AddCommitDiscussionNoteOptions struct {
// AddCommitDiscussionNote creates a new discussion to a single project commit.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-commit-discussion
+// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-commit-thread
func (s *DiscussionsService) AddCommitDiscussionNote(pid interface{}, commit string, discussion string, opt *AddCommitDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -1051,7 +1051,7 @@ func (s *DiscussionsService) AddCommitDiscussionNote(pid interface{}, commit str
// UpdateCommitDiscussion() options.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-commit-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-an-existing-commit-thread-note
type UpdateCommitDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
@@ -1060,7 +1060,7 @@ type UpdateCommitDiscussionNoteOptions struct {
// UpdateCommitDiscussionNote modifies existing discussion of an commit.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-commit-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#modify-an-existing-commit-thread-note
func (s *DiscussionsService) UpdateCommitDiscussionNote(pid interface{}, commit string, discussion string, note int, opt *UpdateCommitDiscussionNoteOptions, options ...OptionFunc) (*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
@@ -1090,7 +1090,7 @@ func (s *DiscussionsService) UpdateCommitDiscussionNote(pid interface{}, commit
// DeleteCommitDiscussionNote deletes an existing discussion of an commit.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/discussions.html#delete-an-commit-discussion-note
+// https://docs.gitlab.com/ce/api/discussions.html#delete-a-commit-thread-note
func (s *DiscussionsService) DeleteCommitDiscussionNote(pid interface{}, commit string, discussion string, note int, options ...OptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
diff --git a/vendor/github.com/xanzy/go-gitlab/event_types.go b/vendor/github.com/xanzy/go-gitlab/event_types.go
index dd1cc901..b4f48631 100644
--- a/vendor/github.com/xanzy/go-gitlab/event_types.go
+++ b/vendor/github.com/xanzy/go-gitlab/event_types.go
@@ -28,17 +28,18 @@ import (
// GitLab API docs:
// https://docs.gitlab.com/ce/user/project/integrations/webhooks.html#push-events
type PushEvent struct {
- ObjectKind string `json:"object_kind"`
- Before string `json:"before"`
- After string `json:"after"`
- Ref string `json:"ref"`
- CheckoutSHA string `json:"checkout_sha"`
- UserID int `json:"user_id"`
- UserName string `json:"user_name"`
- UserEmail string `json:"user_email"`
- UserAvatar string `json:"user_avatar"`
- ProjectID int `json:"project_id"`
- Project struct {
+ ObjectKind string `json:"object_kind"`
+ Before string `json:"before"`
+ After string `json:"after"`
+ Ref string `json:"ref"`
+ CheckoutSHA string `json:"checkout_sha"`
+ UserID int `json:"user_id"`
+ UserName string `json:"user_name"`
+ UserUsername string `json:"user_username"`
+ UserEmail string `json:"user_email"`
+ UserAvatar string `json:"user_avatar"`
+ ProjectID int `json:"project_id"`
+ Project struct {
Name string `json:"name"`
Description string `json:"description"`
AvatarURL string `json:"avatar_url"`
@@ -311,6 +312,7 @@ type MergeCommentEvent struct {
} `json:"project"`
ObjectAttributes struct {
ID int `json:"id"`
+ DiscussionID string `json:"discussion_id"`
Note string `json:"note"`
NoteableType string `json:"noteable_type"`
AuthorID int `json:"author_id"`
@@ -375,6 +377,7 @@ type MergeCommentEvent struct {
} `json:"last_commit"`
WorkInProgress bool `json:"work_in_progress"`
TotalTimeSpent int `json:"total_time_spent"`
+ HeadPipelineID int `json:"head_pipeline_id"`
} `json:"merge_request"`
}
@@ -592,6 +595,10 @@ type MergeEvent struct {
Previous int `json:"previous"`
Current int `json:"current"`
} `json:"updated_by_id"`
+ Title struct {
+ Previous string `json:"previous"`
+ Current string `json:"current"`
+ } `json:"title"`
} `json:"changes"`
}
diff --git a/vendor/github.com/xanzy/go-gitlab/gitlab.go b/vendor/github.com/xanzy/go-gitlab/gitlab.go
index dd015b4a..7b0dfc69 100644
--- a/vendor/github.com/xanzy/go-gitlab/gitlab.go
+++ b/vendor/github.com/xanzy/go-gitlab/gitlab.go
@@ -99,7 +99,7 @@ const iso8601 = "2006-01-02"
func (t ISOTime) MarshalJSON() ([]byte, error) {
if y := time.Time(t).Year(); y < 0 || y >= 10000 {
// ISO 8901 uses 4 digits for the years
- return nil, errors.New("ISOTime.MarshalJSON: year outside of range [0,9999]")
+ return nil, errors.New("json: ISOTime year outside of range [0,9999]")
}
b := make([]byte, 0, len(iso8601)+2)
@@ -317,6 +317,7 @@ type Client struct {
Features *FeaturesService
GitIgnoreTemplates *GitIgnoreTemplatesService
GroupBadges *GroupBadgesService
+ GroupCluster *GroupClustersService
GroupIssueBoards *GroupIssueBoardsService
GroupLabels *GroupLabelsService
GroupMembers *GroupMembersService
@@ -466,6 +467,7 @@ func newClient(httpClient *http.Client) *Client {
c.Features = &FeaturesService{client: c}
c.GitIgnoreTemplates = &GitIgnoreTemplatesService{client: c}
c.GroupBadges = &GroupBadgesService{client: c}
+ c.GroupCluster = &GroupClustersService{client: c}
c.GroupIssueBoards = &GroupIssueBoardsService{client: c}
c.GroupLabels = &GroupLabelsService{client: c}
c.GroupMembers = &GroupMembersService{client: c}
@@ -873,6 +875,14 @@ func String(v string) *string {
return p
}
+// Time is a helper routine that allocates a new time.Time value
+// to store v and returns a pointer to it.
+func Time(v time.Time) *time.Time {
+ p := new(time.Time)
+ *p = v
+ return p
+}
+
// AccessLevel is a helper routine that allocates a new AccessLevelValue
// to store v and returns a pointer to it.
func AccessLevel(v AccessLevelValue) *AccessLevelValue {
@@ -897,6 +907,14 @@ func NotificationLevel(v NotificationLevelValue) *NotificationLevelValue {
return p
}
+// VariableType is a helper routine that allocates a new VariableTypeValue
+// to store v and returns a pointer to it.
+func VariableType(v VariableTypeValue) *VariableTypeValue {
+ p := new(VariableTypeValue)
+ *p = v
+ return p
+}
+
// Visibility is a helper routine that allocates a new VisibilityValue
// to store v and returns a pointer to it.
func Visibility(v VisibilityValue) *VisibilityValue {
diff --git a/vendor/github.com/xanzy/go-gitlab/go.mod b/vendor/github.com/xanzy/go-gitlab/go.mod
index c74a1d6d..0632997b 100644
--- a/vendor/github.com/xanzy/go-gitlab/go.mod
+++ b/vendor/github.com/xanzy/go-gitlab/go.mod
@@ -2,9 +2,11 @@ module github.com/xanzy/go-gitlab
require (
github.com/google/go-querystring v1.0.0
- github.com/stretchr/testify v1.3.0
+ github.com/stretchr/testify v1.4.0
golang.org/x/net v0.0.0-20181108082009-03003ca0c849 // indirect
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
google.golang.org/appengine v1.3.0 // indirect
)
+
+go 1.13
diff --git a/vendor/github.com/xanzy/go-gitlab/go.sum b/vendor/github.com/xanzy/go-gitlab/go.sum
index ef4a85ee..d78b9d5f 100644
--- a/vendor/github.com/xanzy/go-gitlab/go.sum
+++ b/vendor/github.com/xanzy/go-gitlab/go.sum
@@ -7,8 +7,8 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849 h1:FSqE2GGG7wzsYUsWiQ8MZrvEd1EOyU3NCF0AW3Wtltg=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -19,3 +19,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/appengine v1.3.0 h1:FBSsiFRMz3LBeXIomRnVzrQwSDj4ibvcRexLG0LZGQk=
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/vendor/github.com/xanzy/go-gitlab/group_clusters.go b/vendor/github.com/xanzy/go-gitlab/group_clusters.go
new file mode 100644
index 00000000..9f38bc0b
--- /dev/null
+++ b/vendor/github.com/xanzy/go-gitlab/group_clusters.go
@@ -0,0 +1,211 @@
+//
+// Copyright 2019, Paul Shoemaker
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package gitlab
+
+import (
+ "fmt"
+ "time"
+)
+
+// GroupClustersService handles communication with the
+// group clusters related methods of the GitLab API.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html
+type GroupClustersService struct {
+ client *Client
+}
+
+// GroupCluster represents a GitLab Group Cluster.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/group_clusters.html
+type GroupCluster struct {
+ ID int `json:"id"`
+ Name string `json:"name"`
+ Domain string `json:"domain"`
+ CreatedAt *time.Time `json:"created_at"`
+ ProviderType string `json:"provider_type"`
+ PlatformType string `json:"platform_type"`
+ EnvironmentScope string `json:"environment_scope"`
+ ClusterType string `json:"cluster_type"`
+ User *User `json:"user"`
+ PlatformKubernetes *PlatformKubernetes `json:"platform_kubernetes"`
+ Group *Group `json:"group"`
+}
+
+func (v GroupCluster) String() string {
+ return Stringify(v)
+}
+
+// ListClusters gets a list of all clusters in a group.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#list-group-clusters
+func (s *GroupClustersService) ListClusters(pid interface{}, options ...OptionFunc) ([]*GroupCluster, *Response, error) {
+ group, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("groups/%s/clusters", pathEscape(group))
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var pcs []*GroupCluster
+ resp, err := s.client.Do(req, &pcs)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return pcs, resp, err
+}
+
+// GetCluster gets a cluster.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#get-a-single-group-cluster
+func (s *GroupClustersService) GetCluster(pid interface{}, cluster int, options ...OptionFunc) (*GroupCluster, *Response, error) {
+ group, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("groups/%s/clusters/%d", pathEscape(group), cluster)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ pc := new(GroupCluster)
+ resp, err := s.client.Do(req, &pc)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return pc, resp, err
+}
+
+// AddGroupClusterOptions represents the available AddCluster() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#add-existing-cluster-to-group
+type AddGroupClusterOptions struct {
+ Name *string `url:"name,omitempty" json:"name,omitempty"`
+ Domain *string `url:"domain,omitempty" json:"domain,omitempty"`
+ Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
+ Managed *bool `url:"managed,omitempty" json:"managed,omitempty"`
+ EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
+ PlatformKubernetes *AddGroupPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
+}
+
+// AddGroupPlatformKubernetesOptions represents the available PlatformKubernetes options for adding.
+type AddGroupPlatformKubernetesOptions struct {
+ APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"`
+ Token *string `url:"token,omitempty" json:"token,omitempty"`
+ CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"`
+ Namespace *string `url:"namespace,omitempty" json:"namespace,omitempty"`
+ AuthorizationType *string `url:"authorization_type,omitempty" json:"authorization_type,omitempty"`
+}
+
+// AddCluster adds an existing cluster to the group.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#add-existing-cluster-to-group
+func (s *GroupClustersService) AddCluster(pid interface{}, opt *AddGroupClusterOptions, options ...OptionFunc) (*GroupCluster, *Response, error) {
+ group, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("groups/%s/clusters/user", pathEscape(group))
+
+ req, err := s.client.NewRequest("POST", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ pc := new(GroupCluster)
+ resp, err := s.client.Do(req, pc)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return pc, resp, err
+}
+
+// EditGroupClusterOptions represents the available EditCluster() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#edit-group-cluster
+type EditGroupClusterOptions struct {
+ Name *string `url:"name,omitempty" json:"name,omitempty"`
+ Domain *string `url:"domain,omitempty" json:"domain,omitempty"`
+ EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
+ PlatformKubernetes *EditGroupPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
+}
+
+// EditGroupPlatformKubernetesOptions represents the available PlatformKubernetes options for editing.
+type EditGroupPlatformKubernetesOptions struct {
+ APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"`
+ Token *string `url:"token,omitempty" json:"token,omitempty"`
+ CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"`
+}
+
+// EditCluster updates an existing group cluster.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#edit-group-cluster
+func (s *GroupClustersService) EditCluster(pid interface{}, cluster int, opt *EditGroupClusterOptions, options ...OptionFunc) (*GroupCluster, *Response, error) {
+ group, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("groups/%s/clusters/%d", pathEscape(group), cluster)
+
+ req, err := s.client.NewRequest("PUT", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ pc := new(GroupCluster)
+ resp, err := s.client.Do(req, pc)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return pc, resp, err
+}
+
+// DeleteCluster deletes an existing group cluster.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_clusters.html#delete-group-cluster
+func (s *GroupClustersService) DeleteCluster(pid interface{}, cluster int, options ...OptionFunc) (*Response, error) {
+ group, err := parseID(pid)
+ if err != nil {
+ return nil, err
+ }
+ u := fmt.Sprintf("groups/%s/clusters/%d", pathEscape(group), cluster)
+
+ req, err := s.client.NewRequest("DELETE", u, nil, options)
+ if err != nil {
+ return nil, err
+ }
+
+ return s.client.Do(req, nil)
+}
diff --git a/vendor/github.com/xanzy/go-gitlab/group_variables.go b/vendor/github.com/xanzy/go-gitlab/group_variables.go
index 942618b2..694b2019 100644
--- a/vendor/github.com/xanzy/go-gitlab/group_variables.go
+++ b/vendor/github.com/xanzy/go-gitlab/group_variables.go
@@ -45,18 +45,25 @@ func (v GroupVariable) String() string {
return Stringify(v)
}
+// ListGroupVariablesOptions represents the available options for listing variables
+// for a group.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/group_level_variables.html#list-group-variables
+type ListGroupVariablesOptions ListOptions
+
// ListVariables gets a list of all variables for a group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_level_variables.html#list-group-variables
-func (s *GroupVariablesService) ListVariables(gid interface{}, options ...OptionFunc) ([]*GroupVariable, *Response, error) {
+func (s *GroupVariablesService) ListVariables(gid interface{}, opt *ListGroupVariablesOptions, options ...OptionFunc) ([]*GroupVariable, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/variables", pathEscape(group))
- req, err := s.client.NewRequest("GET", u, nil, options)
+ req, err := s.client.NewRequest("GET", u, opt, options)
if err != nil {
return nil, nil, err
}
diff --git a/vendor/github.com/xanzy/go-gitlab/issues.go b/vendor/github.com/xanzy/go-gitlab/issues.go
index ed9c2bf0..70a1255d 100644
--- a/vendor/github.com/xanzy/go-gitlab/issues.go
+++ b/vendor/github.com/xanzy/go-gitlab/issues.go
@@ -75,7 +75,7 @@ type Issue struct {
Assignee *IssueAssignee `json:"assignee"`
Upvotes int `json:"upvotes"`
Downvotes int `json:"downvotes"`
- Labels []string `json:"labels"`
+ Labels Labels `json:"labels"`
Title string `json:"title"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
@@ -280,7 +280,7 @@ type CreateIssueOptions struct {
Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"`
AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
- Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
DueDate *ISOTime `url:"due_date,omitempty" json:"due_date,omitempty"`
MergeRequestToResolveDiscussionsOf *int `url:"merge_request_to_resolve_discussions_of,omitempty" json:"merge_request_to_resolve_discussions_of,omitempty"`
@@ -321,7 +321,7 @@ type UpdateIssueOptions struct {
Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"`
AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
- Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
StateEvent *string `url:"state_event,omitempty" json:"state_event,omitempty"`
UpdatedAt *time.Time `url:"updated_at,omitempty" json:"updated_at,omitempty"`
DueDate *ISOTime `url:"due_date,omitempty" json:"due_date,omitempty"`
@@ -372,6 +372,38 @@ func (s *IssuesService) DeleteIssue(pid interface{}, issue int, options ...Optio
return s.client.Do(req, nil)
}
+// MoveIssueOptions represents the available MoveIssue() options.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/issues.html#move-an-issue
+type MoveIssueOptions struct {
+ ToProjectID *int `url:"to_project_id,omitempty" json:"to_project_id,omitempty"`
+}
+
+// MoveIssue updates an existing project issue. This function is also used
+// to mark an issue as closed.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/issues.html#move-an-issue
+func (s *IssuesService) MoveIssue(pid interface{}, issue int, opt *MoveIssueOptions, options ...OptionFunc) (*Issue, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/move", pathEscape(project), issue)
+
+ req, err := s.client.NewRequest("POST", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ i := new(Issue)
+ resp, err := s.client.Do(req, i)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return i, resp, err
+}
+
// SubscribeToIssue subscribes the authenticated user to the given issue to
// receive notifications. If the user is already subscribed to the issue, the
// status code 304 is returned.
diff --git a/vendor/github.com/xanzy/go-gitlab/merge_request_approvals.go b/vendor/github.com/xanzy/go-gitlab/merge_request_approvals.go
index 43b96520..e4057c1a 100644
--- a/vendor/github.com/xanzy/go-gitlab/merge_request_approvals.go
+++ b/vendor/github.com/xanzy/go-gitlab/merge_request_approvals.go
@@ -33,6 +33,11 @@ type MergeRequestApprovals struct {
ApprovedBy []*MergeRequestApproverUser `json:"approved_by"`
Approvers []*MergeRequestApproverUser `json:"approvers"`
ApproverGroups []*MergeRequestApproverGroup `json:"approver_groups"`
+ SuggestedApprovers []*BasicUser `json:"suggested_approvers"`
+}
+
+func (m MergeRequestApprovals) String() string {
+ return Stringify(m)
}
// MergeRequestApproverGroup represents GitLab project level merge request approver group.
@@ -60,18 +65,7 @@ type MergeRequestApproverGroup struct {
// GitLab API docs:
// https://docs.gitlab.com/ee/api/merge_request_approvals.html#project-level-mr-approvals
type MergeRequestApproverUser struct {
- User struct {
- ID int `json:"id"`
- Name string `json:"name"`
- Username string `json:"username"`
- State string `json:"state"`
- AvatarURL string `json:"avatar_url"`
- WebURL string `json:"web_url"`
- }
-}
-
-func (m MergeRequestApprovals) String() string {
- return Stringify(m)
+ User *BasicUser
}
// ApproveMergeRequestOptions represents the available ApproveMergeRequest() options.
@@ -126,3 +120,72 @@ func (s *MergeRequestApprovalsService) UnapproveMergeRequest(pid interface{}, mr
return s.client.Do(req, nil)
}
+
+// ChangeMergeRequestApprovalConfigurationOptions represents the available
+// ChangeMergeRequestApprovalConfiguration() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-approval-configuration
+type ChangeMergeRequestApprovalConfigurationOptions struct {
+ ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"`
+}
+
+// ChangeApprovalConfiguration updates the approval configuration of a merge request.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-approval-configuration
+func (s *MergeRequestApprovalsService) ChangeApprovalConfiguration(pid interface{}, mergeRequestIID int, opt *ChangeMergeRequestApprovalConfigurationOptions, options ...OptionFunc) (*MergeRequest, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/merge_requests/%d/approvals", pathEscape(project), mergeRequestIID)
+
+ req, err := s.client.NewRequest("POST", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ m := new(MergeRequest)
+ resp, err := s.client.Do(req, m)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return m, resp, err
+}
+
+// ChangeMergeRequestAllowedApproversOptions represents the available
+// ChangeMergeRequestAllowedApprovers() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-allowed-approvers-for-merge-request
+type ChangeMergeRequestAllowedApproversOptions struct {
+ ApproverIDs []int `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
+ ApproverGroupIDs []int `url:"approver_group_ids,omitempty" json:"approver_group_ids,omitempty"`
+}
+
+// ChangeAllowedApprovers updates the approvers for a merge request.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-allowed-approvers-for-merge-request
+func (s *MergeRequestApprovalsService) ChangeAllowedApprovers(pid interface{}, mergeRequestIID int, opt *ChangeMergeRequestAllowedApproversOptions, options ...OptionFunc) (*MergeRequest, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/merge_requests/%d/approvers", pathEscape(project), mergeRequestIID)
+
+ req, err := s.client.NewRequest("PUT", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ m := new(MergeRequest)
+ resp, err := s.client.Do(req, m)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return m, resp, err
+}
diff --git a/vendor/github.com/xanzy/go-gitlab/merge_requests.go b/vendor/github.com/xanzy/go-gitlab/merge_requests.go
index 0626db1f..4e10cb8f 100644
--- a/vendor/github.com/xanzy/go-gitlab/merge_requests.go
+++ b/vendor/github.com/xanzy/go-gitlab/merge_requests.go
@@ -34,74 +34,43 @@ type MergeRequestsService struct {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html
type MergeRequest struct {
- ID int `json:"id"`
- IID int `json:"iid"`
- TargetBranch string `json:"target_branch"`
- SourceBranch string `json:"source_branch"`
- ProjectID int `json:"project_id"`
- Title string `json:"title"`
- State string `json:"state"`
- CreatedAt *time.Time `json:"created_at"`
- UpdatedAt *time.Time `json:"updated_at"`
- Upvotes int `json:"upvotes"`
- Downvotes int `json:"downvotes"`
- Author struct {
- ID int `json:"id"`
- Username string `json:"username"`
- Name string `json:"name"`
- State string `json:"state"`
- CreatedAt *time.Time `json:"created_at"`
- AvatarURL string `json:"avatar_url"`
- WebURL string `json:"web_url"`
- } `json:"author"`
- Assignee struct {
- ID int `json:"id"`
- Username string `json:"username"`
- Name string `json:"name"`
- State string `json:"state"`
- CreatedAt *time.Time `json:"created_at"`
- AvatarURL string `json:"avatar_url"`
- WebURL string `json:"web_url"`
- } `json:"assignee"`
- SourceProjectID int `json:"source_project_id"`
- TargetProjectID int `json:"target_project_id"`
- Labels []string `json:"labels"`
- Description string `json:"description"`
- WorkInProgress bool `json:"work_in_progress"`
- Milestone *Milestone `json:"milestone"`
- MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
- MergeStatus string `json:"merge_status"`
- MergeError string `json:"merge_error"`
- MergedBy struct {
- ID int `json:"id"`
- Username string `json:"username"`
- Name string `json:"name"`
- State string `json:"state"`
- CreatedAt *time.Time `json:"created_at"`
- AvatarURL string `json:"avatar_url"`
- WebURL string `json:"web_url"`
- } `json:"merged_by"`
- MergedAt *time.Time `json:"merged_at"`
- ClosedBy struct {
- ID int `json:"id"`
- Username string `json:"username"`
- Name string `json:"name"`
- State string `json:"state"`
- CreatedAt *time.Time `json:"created_at"`
- AvatarURL string `json:"avatar_url"`
- WebURL string `json:"web_url"`
- } `json:"closed_by"`
- ClosedAt *time.Time `json:"closed_at"`
- Subscribed bool `json:"subscribed"`
- SHA string `json:"sha"`
- MergeCommitSHA string `json:"merge_commit_sha"`
- UserNotesCount int `json:"user_notes_count"`
- ChangesCount string `json:"changes_count"`
- ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"`
- ForceRemoveSourceBranch bool `json:"force_remove_source_branch"`
- WebURL string `json:"web_url"`
- DiscussionLocked bool `json:"discussion_locked"`
- Changes []struct {
+ ID int `json:"id"`
+ IID int `json:"iid"`
+ TargetBranch string `json:"target_branch"`
+ SourceBranch string `json:"source_branch"`
+ ProjectID int `json:"project_id"`
+ Title string `json:"title"`
+ State string `json:"state"`
+ CreatedAt *time.Time `json:"created_at"`
+ UpdatedAt *time.Time `json:"updated_at"`
+ Upvotes int `json:"upvotes"`
+ Downvotes int `json:"downvotes"`
+ Author *BasicUser `json:"author"`
+ Assignee *BasicUser `json:"assignee"`
+ Assignees []*BasicUser `json:"assignees"`
+ SourceProjectID int `json:"source_project_id"`
+ TargetProjectID int `json:"target_project_id"`
+ Labels Labels `json:"labels"`
+ Description string `json:"description"`
+ WorkInProgress bool `json:"work_in_progress"`
+ Milestone *Milestone `json:"milestone"`
+ MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
+ MergeStatus string `json:"merge_status"`
+ MergeError string `json:"merge_error"`
+ MergedBy *BasicUser `json:"merged_by"`
+ MergedAt *time.Time `json:"merged_at"`
+ ClosedBy *BasicUser `json:"closed_by"`
+ ClosedAt *time.Time `json:"closed_at"`
+ Subscribed bool `json:"subscribed"`
+ SHA string `json:"sha"`
+ MergeCommitSHA string `json:"merge_commit_sha"`
+ UserNotesCount int `json:"user_notes_count"`
+ ChangesCount string `json:"changes_count"`
+ ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"`
+ ForceRemoveSourceBranch bool `json:"force_remove_source_branch"`
+ WebURL string `json:"web_url"`
+ DiscussionLocked bool `json:"discussion_locked"`
+ Changes []struct {
OldPath string `json:"old_path"`
NewPath string `json:"new_path"`
AMode string `json:"a_mode"`
@@ -111,22 +80,23 @@ type MergeRequest struct {
RenamedFile bool `json:"renamed_file"`
DeletedFile bool `json:"deleted_file"`
} `json:"changes"`
- TimeStats *TimeStats `json:"time_stats"`
- Squash bool `json:"squash"`
- Pipeline struct {
- ID int `json:"id"`
- Ref string `json:"ref"`
- SHA string `json:"sha"`
- Status string `json:"status"`
- } `json:"pipeline"`
- DiffRefs struct {
+ TimeStats *TimeStats `json:"time_stats"`
+ Squash bool `json:"squash"`
+ Pipeline *PipelineInfo `json:"pipeline"`
+ HeadPipeline *Pipeline `json:"head_pipeline"`
+ DiffRefs struct {
BaseSha string `json:"base_sha"`
HeadSha string `json:"head_sha"`
StartSha string `json:"start_sha"`
} `json:"diff_refs"`
- DivergedCommitsCount int `json:"diverged_commits_count"`
- RebaseInProgress bool `json:"rebase_in_progress"`
- ApprovalsBeforeMerge int `json:"approvals_before_merge"`
+ DivergedCommitsCount int `json:"diverged_commits_count"`
+ RebaseInProgress bool `json:"rebase_in_progress"`
+ ApprovalsBeforeMerge int `json:"approvals_before_merge"`
+ Reference string `json:"reference"`
+ TaskCompletionStatus struct {
+ Count int `json:"count"`
+ CompletedCount int `json:"completed_count"`
+ } `json:"task_completion_status"`
}
func (m MergeRequest) String() string {
@@ -166,7 +136,7 @@ type ListMergeRequestsOptions struct {
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"`
View *string `url:"view,omitempty" json:"view,omitempty"`
- Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
+ Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
@@ -216,7 +186,7 @@ type ListGroupMergeRequestsOptions struct {
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"`
View *string `url:"view,omitempty" json:"view,omitempty"`
- Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
@@ -268,7 +238,7 @@ type ListProjectMergeRequestsOptions struct {
Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"`
View *string `url:"view,omitempty" json:"view,omitempty"`
- Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
CreatedAfter *time.Time `url:"created_after,omitempty" json:"created_after,omitempty"`
CreatedBefore *time.Time `url:"created_before,omitempty" json:"created_before,omitempty"`
UpdatedAfter *time.Time `url:"updated_after,omitempty" json:"updated_after,omitempty"`
@@ -431,7 +401,7 @@ func (s *MergeRequestsService) GetMergeRequestChanges(pid interface{}, mergeRequ
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#list-mr-pipelines
-func (s *MergeRequestsService) ListMergeRequestPipelines(pid interface{}, mergeRequest int, options ...OptionFunc) (PipelineList, *Response, error) {
+func (s *MergeRequestsService) ListMergeRequestPipelines(pid interface{}, mergeRequest int, options ...OptionFunc) ([]*PipelineInfo, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@@ -443,7 +413,7 @@ func (s *MergeRequestsService) ListMergeRequestPipelines(pid interface{}, mergeR
return nil, nil, err
}
- var p PipelineList
+ var p []*PipelineInfo
resp, err := s.client.Do(req, &p)
if err != nil {
return nil, resp, err
@@ -495,8 +465,9 @@ type CreateMergeRequestOptions struct {
Description *string `url:"description,omitempty" json:"description,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
- Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
+ AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
TargetProjectID *int `url:"target_project_id,omitempty" json:"target_project_id,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
RemoveSourceBranch *bool `url:"remove_source_branch,omitempty" json:"remove_source_branch,omitempty"`
@@ -539,7 +510,8 @@ type UpdateMergeRequestOptions struct {
Description *string `url:"description,omitempty" json:"description,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
- Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
+ AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
+ Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
StateEvent *string `url:"state_event,omitempty" json:"state_event,omitempty"`
RemoveSourceBranch *bool `url:"remove_source_branch,omitempty" json:"remove_source_branch,omitempty"`
@@ -599,6 +571,8 @@ func (s *MergeRequestsService) DeleteMergeRequest(pid interface{}, mergeRequest
// https://docs.gitlab.com/ce/api/merge_requests.html#accept-mr
type AcceptMergeRequestOptions struct {
MergeCommitMessage *string `url:"merge_commit_message,omitempty" json:"merge_commit_message,omitempty"`
+ SquashCommitMessage *string `url:"squash_commit_message,omitempty" json:"squash_commit_message,omitempty"`
+ Squash *bool `url:"squash,omitempty" json:"squash,omitempty"`
ShouldRemoveSourceBranch *bool `url:"should_remove_source_branch,omitempty" json:"should_remove_source_branch,omitempty"`
MergeWhenPipelineSucceeds *bool `url:"merge_when_pipeline_succeeds,omitempty" json:"merge_when_pipeline_succeeds,omitempty"`
SHA *string `url:"sha,omitempty" json:"sha,omitempty"`
diff --git a/vendor/github.com/xanzy/go-gitlab/milestones.go b/vendor/github.com/xanzy/go-gitlab/milestones.go
index e96b3446..f3f7f7c8 100644
--- a/vendor/github.com/xanzy/go-gitlab/milestones.go
+++ b/vendor/github.com/xanzy/go-gitlab/milestones.go
@@ -55,9 +55,10 @@ func (m Milestone) String() string {
// https://docs.gitlab.com/ce/api/milestones.html#list-project-milestones
type ListMilestonesOptions struct {
ListOptions
- IIDs []int `url:"iids,omitempty" json:"iids,omitempty"`
- State string `url:"state,omitempty" json:"state,omitempty"`
- Search string `url:"search,omitempty" json:"search,omitempty"`
+ IIDs []int `url:"iids,omitempty" json:"iids,omitempty"`
+ Title *string `url:"title,omitempty" json:"title,omitempty"`
+ State *string `url:"state,omitempty" json:"state,omitempty"`
+ Search *string `url:"search,omitempty" json:"search,omitempty"`
}
// ListMilestones returns a list of project milestones.
diff --git a/vendor/github.com/xanzy/go-gitlab/pipelines.go b/vendor/github.com/xanzy/go-gitlab/pipelines.go
index 456de643..bf3f814b 100644
--- a/vendor/github.com/xanzy/go-gitlab/pipelines.go
+++ b/vendor/github.com/xanzy/go-gitlab/pipelines.go
@@ -41,39 +41,43 @@ type PipelineVariable struct {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/pipelines.html
type Pipeline struct {
- ID int `json:"id"`
- Status string `json:"status"`
- Ref string `json:"ref"`
- SHA string `json:"sha"`
- BeforeSHA string `json:"before_sha"`
- Tag bool `json:"tag"`
- YamlErrors string `json:"yaml_errors"`
- User struct {
- Name string `json:"name"`
- Username string `json:"username"`
- ID int `json:"id"`
- State string `json:"state"`
- AvatarURL string `json:"avatar_url"`
- WebURL string `json:"web_url"`
- }
- UpdatedAt *time.Time `json:"updated_at"`
- CreatedAt *time.Time `json:"created_at"`
- StartedAt *time.Time `json:"started_at"`
- FinishedAt *time.Time `json:"finished_at"`
- CommittedAt *time.Time `json:"committed_at"`
- Duration int `json:"duration"`
- Coverage string `json:"coverage"`
- WebURL string `json:"web_url"`
-}
-
-func (i Pipeline) String() string {
- return Stringify(i)
-}
-
-// PipelineList represents a GitLab list project pipelines
-//
-// GitLab API docs: https://docs.gitlab.com/ce/api/pipelines.html#list-project-pipelines
-type PipelineList []*PipelineInfo
+ ID int `json:"id"`
+ Status string `json:"status"`
+ Ref string `json:"ref"`
+ SHA string `json:"sha"`
+ BeforeSHA string `json:"before_sha"`
+ Tag bool `json:"tag"`
+ YamlErrors string `json:"yaml_errors"`
+ User *BasicUser `json:"user"`
+ UpdatedAt *time.Time `json:"updated_at"`
+ CreatedAt *time.Time `json:"created_at"`
+ StartedAt *time.Time `json:"started_at"`
+ FinishedAt *time.Time `json:"finished_at"`
+ CommittedAt *time.Time `json:"committed_at"`
+ Duration int `json:"duration"`
+ Coverage string `json:"coverage"`
+ WebURL string `json:"web_url"`
+ DetailedStatus *DetailedStatus `json:"detailed_status"`
+}
+
+// DetailedStatus contains detailed information about the status of a pipeline
+type DetailedStatus struct {
+ Icon string `json:"icon"`
+ Text string `json:"text"`
+ Label string `json:"label"`
+ Group string `json:"group"`
+ Tooltip string `json:"tooltip"`
+ HasDetails bool `json:"has_details"`
+ DetailsPath string `json:"details_path"`
+ Illustration struct {
+ Image string `json:"image"`
+ } `json:"illustration"`
+ Favicon string `json:"favicon"`
+}
+
+func (p Pipeline) String() string {
+ return Stringify(p)
+}
// PipelineInfo shows the basic entities of a pipeline, mostly used as fields
// on other assets, like Commit.
@@ -85,8 +89,8 @@ type PipelineInfo struct {
WebURL string `json:"web_url"`
}
-func (i PipelineList) String() string {
- return Stringify(i)
+func (p PipelineInfo) String() string {
+ return Stringify(p)
}
// ListProjectPipelinesOptions represents the available ListProjectPipelines() options.
@@ -108,7 +112,7 @@ type ListProjectPipelinesOptions struct {
// ListProjectPipelines gets a list of project piplines.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/pipelines.html#list-project-pipelines
-func (s *PipelinesService) ListProjectPipelines(pid interface{}, opt *ListProjectPipelinesOptions, options ...OptionFunc) (PipelineList, *Response, error) {
+func (s *PipelinesService) ListProjectPipelines(pid interface{}, opt *ListProjectPipelinesOptions, options ...OptionFunc) ([]*PipelineInfo, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@@ -120,11 +124,12 @@ func (s *PipelinesService) ListProjectPipelines(pid interface{}, opt *ListProjec
return nil, nil, err
}
- var p PipelineList
+ var p []*PipelineInfo
resp, err := s.client.Do(req, &p)
if err != nil {
return nil, resp, err
}
+
return p, resp, err
}
@@ -152,6 +157,30 @@ func (s *PipelinesService) GetPipeline(pid interface{}, pipeline int, options ..
return p, resp, err
}
+// GetPipelineVariables gets the variables of a single project pipeline.
+//
+// GitLab API docs: https://docs.gitlab.com/ce/api/pipelines.html#get-variables-of-a-pipeline
+func (s *PipelinesService) GetPipelineVariables(pid interface{}, pipeline int, options ...OptionFunc) ([]*PipelineVariable, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/pipelines/%d/variables", pathEscape(project), pipeline)
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var p []*PipelineVariable
+ resp, err := s.client.Do(req, &p)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return p, resp, err
+}
+
// CreatePipelineOptions represents the available CreatePipeline() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/pipelines.html#create-a-new-pipeline
@@ -193,7 +222,7 @@ func (s *PipelinesService) RetryPipelineBuild(pid interface{}, pipeline int, opt
if err != nil {
return nil, nil, err
}
- u := fmt.Sprintf("projects/%s/pipelines/%d/retry", project, pipeline)
+ u := fmt.Sprintf("projects/%s/pipelines/%d/retry", pathEscape(project), pipeline)
req, err := s.client.NewRequest("POST", u, nil, options)
if err != nil {
@@ -218,7 +247,7 @@ func (s *PipelinesService) CancelPipelineBuild(pid interface{}, pipeline int, op
if err != nil {
return nil, nil, err
}
- u := fmt.Sprintf("projects/%s/pipelines/%d/cancel", project, pipeline)
+ u := fmt.Sprintf("projects/%s/pipelines/%d/cancel", pathEscape(project), pipeline)
req, err := s.client.NewRequest("POST", u, nil, options)
if err != nil {
@@ -243,7 +272,7 @@ func (s *PipelinesService) DeletePipeline(pid interface{}, pipeline int, options
if err != nil {
return nil, err
}
- u := fmt.Sprintf("projects/%s/pipelines/%d", project, pipeline)
+ u := fmt.Sprintf("projects/%s/pipelines/%d", pathEscape(project), pipeline)
req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil {
diff --git a/vendor/github.com/xanzy/go-gitlab/project_members.go b/vendor/github.com/xanzy/go-gitlab/project_members.go
index abd964a1..54a25fdc 100644
--- a/vendor/github.com/xanzy/go-gitlab/project_members.go
+++ b/vendor/github.com/xanzy/go-gitlab/project_members.go
@@ -124,6 +124,7 @@ func (s *ProjectMembersService) GetProjectMember(pid interface{}, user int, opti
type AddProjectMemberOptions struct {
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
+ ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"`
}
// AddProjectMember adds a user to a project team. This is an idempotent
@@ -160,6 +161,7 @@ func (s *ProjectMembersService) AddProjectMember(pid interface{}, opt *AddProjec
// https://docs.gitlab.com/ce/api/members.html#edit-a-member-of-a-group-or-project
type EditProjectMemberOptions struct {
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
+ ExpiresAt *string `url:"expires_at,omitempty" json:"expires_at"`
}
// EditProjectMember updates a project team member to a specified access level..
diff --git a/vendor/github.com/xanzy/go-gitlab/project_variables.go b/vendor/github.com/xanzy/go-gitlab/project_variables.go
index 2068f9eb..155e3e55 100644
--- a/vendor/github.com/xanzy/go-gitlab/project_variables.go
+++ b/vendor/github.com/xanzy/go-gitlab/project_variables.go
@@ -47,18 +47,25 @@ func (v ProjectVariable) String() string {
return Stringify(v)
}
+// ListProjectVariablesOptions represents the available options for listing variables
+// in a project.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/project_level_variables.html#list-project-variables
+type ListProjectVariablesOptions ListOptions
+
// ListVariables gets a list of all variables in a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_level_variables.html#list-project-variables
-func (s *ProjectVariablesService) ListVariables(pid interface{}, options ...OptionFunc) ([]*ProjectVariable, *Response, error) {
+func (s *ProjectVariablesService) ListVariables(pid interface{}, opt *ListProjectVariablesOptions, options ...OptionFunc) ([]*ProjectVariable, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/variables", pathEscape(project))
- req, err := s.client.NewRequest("GET", u, nil, options)
+ req, err := s.client.NewRequest("GET", u, opt, options)
if err != nil {
return nil, nil, err
}
diff --git a/vendor/github.com/xanzy/go-gitlab/projects.go b/vendor/github.com/xanzy/go-gitlab/projects.go
index b6c513fa..04c3c894 100644
--- a/vendor/github.com/xanzy/go-gitlab/projects.go
+++ b/vendor/github.com/xanzy/go-gitlab/projects.go
@@ -184,6 +184,25 @@ func (s Project) String() string {
return Stringify(s)
}
+// ProjectApprovalRule represents a GitLab project approval rule.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#get-project-level-rules
+type ProjectApprovalRule struct {
+ ID int `json:"id"`
+ Name string `json:"name"`
+ RuleType string `json:"rule_type"`
+ EligibleApprovers []*BasicUser `json:"eligible_approvers"`
+ ApprovalsRequired int `json:"approvals_required"`
+ Users []*BasicUser `json:"users"`
+ Groups []*Group `json:"groups"`
+ ContainsHiddenGroups bool `json:"contains_hidden_groups"`
+}
+
+func (s ProjectApprovalRule) String() string {
+ return Stringify(s)
+}
+
// ListProjectsOptions represents the available ListProjects() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/projects.html#list-projects
@@ -203,6 +222,7 @@ type ListProjectsOptions struct {
WithMergeRequestsEnabled *bool `url:"with_merge_requests_enabled,omitempty" json:"with_merge_requests_enabled,omitempty"`
MinAccessLevel *AccessLevelValue `url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
WithCustomAttributes *bool `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"`
+ WithProgrammingLanguage *string `url:"with_programming_language,omitempty" json:"with_programming_language,omitempty"`
}
// ListProjects gets a list of projects accessible by the authenticated user.
@@ -448,6 +468,9 @@ type CreateProjectOptions struct {
Mirror *bool `url:"mirror,omitempty" json:"mirror,omitempty"`
MirrorTriggerBuilds *bool `url:"mirror_trigger_builds,omitempty" json:"mirror_trigger_builds,omitempty"`
InitializeWithReadme *bool `url:"initialize_with_readme,omitempty" json:"initialize_with_readme,omitempty"`
+ TemplateName *string `url:"template_name,omitempty" json:"template_name,omitempty"`
+ UseCustomTemplate *bool `url:"use_custom_template,omitempty" json:"use_custom_template,omitempty"`
+ GroupWithProjectTemplatesID *int `url:"group_with_project_templates_id,omitempty" json:"group_with_project_templates_id,omitempty"`
}
// CreateProject creates a new project owned by the authenticated user.
@@ -768,6 +791,7 @@ type ProjectMember struct {
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
+ ExpiresAt *ISOTime `json:"expires_at"`
AccessLevel AccessLevelValue `json:"access_level"`
}
@@ -1244,6 +1268,7 @@ type ProjectApprovals struct {
ResetApprovalsOnPush bool `json:"reset_approvals_on_push"`
DisableOverridingApproversPerMergeRequest bool `json:"disable_overriding_approvers_per_merge_request"`
MergeRequestsAuthorApproval bool `json:"merge_requests_author_approval"`
+ MergeRequestsDisableCommittersApproval bool `json:"merge_requests_disable_committers_approval"`
}
// GetApprovalConfiguration get the approval configuration for a project.
@@ -1281,6 +1306,7 @@ type ChangeApprovalConfigurationOptions struct {
ResetApprovalsOnPush *bool `url:"reset_approvals_on_push,omitempty" json:"reset_approvals_on_push,omitempty"`
DisableOverridingApproversPerMergeRequest *bool `url:"disable_overriding_approvers_per_merge_request,omitempty" json:"disable_overriding_approvers_per_merge_request,omitempty"`
MergeRequestsAuthorApproval *bool `url:"merge_requests_author_approval,omitempty" json:"merge_requests_author_approval,omitempty"`
+ MergeRequestsDisableCommittersApproval *bool `url:"merge_requests_disable_committers_approval,omitempty" json:"merge_requests_disable_committers_approval,omitempty"`
}
// ChangeApprovalConfiguration updates the approval configuration for a project.
@@ -1308,14 +1334,132 @@ func (s *ProjectsService) ChangeApprovalConfiguration(pid interface{}, opt *Chan
return pa, resp, err
}
+// GetProjectApprovalRules looks up the list of project level approvers.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#get-project-level-rules
+func (s *ProjectsService) GetProjectApprovalRules(pid interface{}, options ...OptionFunc) ([]*ProjectApprovalRule, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/approval_rules", pathEscape(project))
+
+ req, err := s.client.NewRequest("GET", u, nil, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var par []*ProjectApprovalRule
+ resp, err := s.client.Do(req, &par)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return par, resp, err
+}
+
+// CreateProjectLevelRuleOptions represents the available CreateProjectApprovalRule()
+// options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rules
+type CreateProjectLevelRuleOptions struct {
+ Name *string `url:"name,omitempty" json:"name,omitempty"`
+ ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"`
+ UserIDs []int `url:"user_ids,omitempty" json:"user_ids,omitempty"`
+ GroupIDs []int `url:"group_ids,omitempty" json:"group_ids,omitempty"`
+}
+
+// CreateProjectApprovalRule creates a new project-level approval rule.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rules
+func (s *ProjectsService) CreateProjectApprovalRule(pid interface{}, opt *CreateProjectLevelRuleOptions, options ...OptionFunc) (*ProjectApprovalRule, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/approval_rules", pathEscape(project))
+
+ req, err := s.client.NewRequest("POST", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ par := new(ProjectApprovalRule)
+ resp, err := s.client.Do(req, &par)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return par, resp, err
+}
+
+// UpdateProjectLevelRuleOptions represents the available UpdateProjectApprovalRule()
+// options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#update-project-level-rules
+type UpdateProjectLevelRuleOptions struct {
+ Name *string `url:"name,omitempty" json:"name,omitempty"`
+ ApprovalsRequired *int `url:"approvals_required,omitempty" json:"approvals_required,omitempty"`
+ UserIDs []int `url:"user_ids,omitempty" json:"user_ids,omitempty"`
+ GroupIDs []int `url:"group_ids,omitempty" json:"group_ids,omitempty"`
+}
+
+// UpdateProjectApprovalRule updates an existing approval rule with new options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#update-project-level-rules
+func (s *ProjectsService) UpdateProjectApprovalRule(pid interface{}, approvalRule int, opt *UpdateProjectLevelRuleOptions, options ...OptionFunc) (*ProjectApprovalRule, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/approval_rules/%d", pathEscape(project), approvalRule)
+
+ req, err := s.client.NewRequest("PUT", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ par := new(ProjectApprovalRule)
+ resp, err := s.client.Do(req, &par)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return par, resp, err
+}
+
+// DeleteProjectApprovalRule deletes a project-level approval rule.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/merge_request_approvals.html#delete-project-level-rules
+func (s *ProjectsService) DeleteProjectApprovalRule(pid interface{}, approvalRule int, options ...OptionFunc) (*Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, err
+ }
+ u := fmt.Sprintf("projects/%s/approval_rules/%d", pathEscape(project), approvalRule)
+
+ req, err := s.client.NewRequest("DELETE", u, nil, options)
+ if err != nil {
+ return nil, err
+ }
+
+ return s.client.Do(req, nil)
+}
+
// ChangeAllowedApproversOptions represents the available ChangeAllowedApprovers()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/merge_request_approvals.html#change-allowed-approvers
type ChangeAllowedApproversOptions struct {
- ApproverIDs []*int `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
- ApproverGroupIDs []*int `url:"approver_group_ids,omitempty" json:"approver_group_ids,omitempty"`
+ ApproverIDs []int `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
+ ApproverGroupIDs []int `url:"approver_group_ids,omitempty" json:"approver_group_ids,omitempty"`
}
// ChangeAllowedApprovers updates the list of approvers and approver groups.
@@ -1329,7 +1473,7 @@ func (s *ProjectsService) ChangeAllowedApprovers(pid interface{}, opt *ChangeAll
}
u := fmt.Sprintf("projects/%s/approvers", pathEscape(project))
- req, err := s.client.NewRequest("POST", u, opt, options)
+ req, err := s.client.NewRequest("PUT", u, opt, options)
if err != nil {
return nil, nil, err
}
diff --git a/vendor/github.com/xanzy/go-gitlab/runners.go b/vendor/github.com/xanzy/go-gitlab/runners.go
index 365b6124..d3330d44 100644
--- a/vendor/github.com/xanzy/go-gitlab/runners.go
+++ b/vendor/github.com/xanzy/go-gitlab/runners.go
@@ -72,6 +72,11 @@ type RunnerDetails struct {
Version string `json:"version"`
AccessLevel string `json:"access_level"`
MaximumTimeout int `json:"maximum_timeout"`
+ Groups []struct {
+ ID int `json:"id"`
+ Name string `json:"name"`
+ WebURL string `json:"web_url"`
+ } `json:"groups"`
}
// ListRunnersOptions represents the available ListRunners() options.
@@ -80,9 +85,10 @@ type RunnerDetails struct {
// https://docs.gitlab.com/ce/api/runners.html#list-owned-runners
type ListRunnersOptions struct {
ListOptions
- Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
- Status *string `url:"status,omitempty" json:"status,omitempty"`
- Type *string `url:"type,omitempty" json:"type,omitempty"`
+ Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
+ Type *string `url:"type,omitempty" json:"type,omitempty"`
+ Status *string `url:"status,omitempty" json:"status,omitempty"`
+ TagList []string `url:"tag_list,comma,omitempty" json:"tag_list,omitempty"`
}
// ListRunners gets a list of runners accessible by the authenticated user.
@@ -211,10 +217,12 @@ func (s *RunnersService) RemoveRunner(rid interface{}, options ...OptionFunc) (*
// options. Status can be one of: running, success, failed, canceled.
//
// GitLab API docs:
-// https://docs.gitlab.com/ce/api/runners.html#list-runner-39-s-jobs
+// https://docs.gitlab.com/ce/api/runners.html#list-runners-jobs
type ListRunnerJobsOptions struct {
ListOptions
- Status *string `url:"status,omitempty" json:"status,omitempty"`
+ Status *string `url:"status,omitempty" json:"status,omitempty"`
+ OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
+ Sort *string `url:"sort,omitempty" json:"sort,omitempty"`
}
// ListRunnerJobs gets a list of jobs that are being processed or were processed by specified Runner.
diff --git a/vendor/github.com/xanzy/go-gitlab/search.go b/vendor/github.com/xanzy/go-gitlab/search.go
index 708db063..de3ad362 100644
--- a/vendor/github.com/xanzy/go-gitlab/search.go
+++ b/vendor/github.com/xanzy/go-gitlab/search.go
@@ -279,6 +279,35 @@ func (s *SearchService) BlobsByProject(pid interface{}, query string, opt *Searc
return bs, resp, err
}
+// Users searches the expression within all users
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/search.html#scope-users
+func (s *SearchService) Users(query string, opt *SearchOptions, options ...OptionFunc) ([]*User, *Response, error) {
+ var ret []*User
+ resp, err := s.search("users", query, &ret, opt, options...)
+ return ret, resp, err
+}
+
+// UsersByGroup searches the expression within users for the specified
+// group
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/search.html#scope-users-1
+func (s *SearchService) UsersByGroup(gid interface{}, query string, opt *SearchOptions, options ...OptionFunc) ([]*User, *Response, error) {
+ var ret []*User
+ resp, err := s.searchByGroup(gid, "users", query, &ret, opt, options...)
+ return ret, resp, err
+}
+
+// UsersByProject searches the expression within users for the
+// specified project
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/search.html#scope-users-2
+func (s *SearchService) UsersByProject(pid interface{}, query string, opt *SearchOptions, options ...OptionFunc) ([]*User, *Response, error) {
+ var ret []*User
+ resp, err := s.searchByProject(pid, "users", query, &ret, opt, options...)
+ return ret, resp, err
+}
+
func (s *SearchService) search(scope, query string, result interface{}, opt *SearchOptions, options ...OptionFunc) (*Response, error) {
opts := &searchOptions{SearchOptions: *opt, Scope: scope, Search: query}
diff --git a/vendor/github.com/xanzy/go-gitlab/services.go b/vendor/github.com/xanzy/go-gitlab/services.go
index 8c1c5531..e9df5a6b 100644
--- a/vendor/github.com/xanzy/go-gitlab/services.go
+++ b/vendor/github.com/xanzy/go-gitlab/services.go
@@ -255,27 +255,20 @@ type SlackService struct {
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#slack
type SlackServiceProperties struct {
- // Note: NotifyOnlyBrokenPipelines and NotifyOnlyDefaultBranch are not
- // just "bool" because in some cases gitlab returns
- // "notify_only_broken_pipelines": true, and in other cases
- // "notify_only_broken_pipelines": "1". The same is for
- // "notify_only_default_branch" field.
- // We need to handle this, until the bug will be fixed.
- // Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/50122
-
- NotifyOnlyBrokenPipelines BoolValue `json:"notify_only_broken_pipelines,omitempty"`
- NotifyOnlyDefaultBranch BoolValue `json:"notify_only_default_branch,omitempty"`
WebHook string `json:"webhook,omitempty"`
Username string `json:"username,omitempty"`
Channel string `json:"channel,omitempty"`
- PushChannel string `json:"push_channel,omitempty"`
- IssueChannel string `json:"issue_channel,omitempty"`
+ NotifyOnlyBrokenPipelines BoolValue `json:"notify_only_broken_pipelines,omitempty"`
+ NotifyOnlyDefaultBranch BoolValue `json:"notify_only_default_branch,omitempty"`
ConfidentialIssueChannel string `json:"confidential_issue_channel,omitempty"`
+ ConfidentialNoteChannel string `json:"confidential_note_channel,omitempty"`
+ DeploymentChannel string `json:"deployment_channel,omitempty"`
+ IssueChannel string `json:"issue_channel,omitempty"`
MergeRequestChannel string `json:"merge_request_channel,omitempty"`
NoteChannel string `json:"note_channel,omitempty"`
- ConfidentialNoteChannel string `json:"confidential_note_channel,omitempty"`
TagPushChannel string `json:"tag_push_channel,omitempty"`
PipelineChannel string `json:"pipeline_channel,omitempty"`
+ PushChannel string `json:"push_channel,omitempty"`
WikiPageChannel string `json:"wiki_page_channel,omitempty"`
}
@@ -315,27 +308,29 @@ type SetSlackServiceOptions struct {
Channel *string `url:"channel,omitempty" json:"channel,omitempty"`
NotifyOnlyBrokenPipelines *bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"`
NotifyOnlyDefaultBranch *bool `url:"notify_only_default_branch,omitempty" json:"notify_only_default_branch,omitempty"`
- PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"`
- PushChannel *string `url:"push_channel,omitempty" json:"push_channel,omitempty"`
- IssuesEvents *bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
- IssueChannel *string `url:"issue_channel,omitempty" json:"issue_channel,omitempty"`
- ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
ConfidentialIssueChannel *string `url:"confidential_issue_channel,omitempty" json:"confidential_issue_channel,omitempty"`
- MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
- MergeRequestChannel *string `url:"merge_request_channel,omitempty" json:"merge_request_channel,omitempty"`
- TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
- TagPushChannel *string `url:"tag_push_channel,omitempty" json:"tag_push_channel,omitempty"`
- NoteEvents *bool `url:"note_events,omitempty" json:"note_events,omitempty"`
- NoteChannel *string `url:"note_channel,omitempty" json:"note_channel,omitempty"`
- ConfidentialNoteEvents *bool `url:"confidential_note_events" json:"confidential_note_events"`
+ ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
// TODO: Currently, GitLab ignores this option (not implemented yet?), so
// there is no way to set it. Uncomment when this is fixed.
// See: https://gitlab.com/gitlab-org/gitlab-ce/issues/49730
//ConfidentialNoteChannel *string `json:"confidential_note_channel,omitempty"`
- PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
- PipelineChannel *string `url:"pipeline_channel,omitempty" json:"pipeline_channel,omitempty"`
- WikiPageChannel *string `url:"wiki_page_channel,omitempty" json:"wiki_page_channel,omitempty"`
- WikiPageEvents *bool `url:"wiki_page_events" json:"wiki_page_events"`
+ ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
+ DeploymentChannel *string `url:"deployment_channel,omitempty" json:"deployment_channel,omitempty"`
+ DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
+ IssueChannel *string `url:"issue_channel,omitempty" json:"issue_channel,omitempty"`
+ IssuesEvents *bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
+ MergeRequestChannel *string `url:"merge_request_channel,omitempty" json:"merge_request_channel,omitempty"`
+ MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
+ TagPushChannel *string `url:"tag_push_channel,omitempty" json:"tag_push_channel,omitempty"`
+ TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
+ NoteChannel *string `url:"note_channel,omitempty" json:"note_channel,omitempty"`
+ NoteEvents *bool `url:"note_events,omitempty" json:"note_events,omitempty"`
+ PipelineChannel *string `url:"pipeline_channel,omitempty" json:"pipeline_channel,omitempty"`
+ PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
+ PushChannel *string `url:"push_channel,omitempty" json:"push_channel,omitempty"`
+ PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"`
+ WikiPageChannel *string `url:"wiki_page_channel,omitempty" json:"wiki_page_channel,omitempty"`
+ WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
}
// SetSlackService sets Slack service for a project
diff --git a/vendor/github.com/xanzy/go-gitlab/users.go b/vendor/github.com/xanzy/go-gitlab/users.go
index b6e68b68..c8015cda 100644
--- a/vendor/github.com/xanzy/go-gitlab/users.go
+++ b/vendor/github.com/xanzy/go-gitlab/users.go
@@ -37,6 +37,17 @@ type UsersService struct {
client *Client
}
+// BasicUser included in other service responses (such as merge requests, pipelines, etc).
+type BasicUser struct {
+ ID int `json:"id"`
+ Username string `json:"username"`
+ Name string `json:"name"`
+ State string `json:"state"`
+ CreatedAt *time.Time `json:"created_at"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
+}
+
// User represents a GitLab user.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/users.html
@@ -163,6 +174,7 @@ type CreateUserOptions struct {
CanCreateGroup *bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"`
SkipConfirmation *bool `url:"skip_confirmation,omitempty" json:"skip_confirmation,omitempty"`
External *bool `url:"external,omitempty" json:"external,omitempty"`
+ PrivateProfile *bool `url:"private_profile,omitempty" json:"private_profile,omitempty"`
}
// CreateUser creates a new user. Note only administrators can create new users.
@@ -205,6 +217,7 @@ type ModifyUserOptions struct {
CanCreateGroup *bool `url:"can_create_group,omitempty" json:"can_create_group,omitempty"`
SkipReconfirmation *bool `url:"skip_reconfirmation,omitempty" json:"skip_reconfirmation,omitempty"`
External *bool `url:"external,omitempty" json:"external,omitempty"`
+ PrivateProfile *bool `url:"private_profile,omitempty" json:"private_profile,omitempty"`
}
// ModifyUser modifies an existing user. Only administrators can change attributes