diff options
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/.travis.yml | 3 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/README.md | 2 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/commits.go | 58 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/deploy_keys.go | 34 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/freeze_periods.go | 193 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/groups.go | 38 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/issues.go | 1 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/jobs.go | 35 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/merge_requests.go | 5 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/pipelines.go | 14 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/projects.go | 23 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/types.go | 26 | ||||
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/users.go | 41 |
13 files changed, 405 insertions, 68 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/.travis.yml b/vendor/github.com/xanzy/go-gitlab/.travis.yml index f389447c39..79772fc509 100644 --- a/vendor/github.com/xanzy/go-gitlab/.travis.yml +++ b/vendor/github.com/xanzy/go-gitlab/.travis.yml @@ -1,4 +1,7 @@ language: go +arch: + - amd64 + - ppc64le go: - 1.13.x diff --git a/vendor/github.com/xanzy/go-gitlab/README.md b/vendor/github.com/xanzy/go-gitlab/README.md index ead2361fe3..da5cf7b09d 100644 --- a/vendor/github.com/xanzy/go-gitlab/README.md +++ b/vendor/github.com/xanzy/go-gitlab/README.md @@ -109,7 +109,7 @@ There are a few `With...` option functions that can be used to customize the API client. For example, to set a custom base URL: ```go -git, err := gitlab.NewClient("yourtokengoeshere", WithBaseURL("https://git.mydomain.com/api/v4")) +git, err := gitlab.NewClient("yourtokengoeshere", gitlab.WithBaseURL("https://git.mydomain.com/api/v4")) if err != nil { log.Fatalf("Failed to create client: %v", err) } diff --git a/vendor/github.com/xanzy/go-gitlab/commits.go b/vendor/github.com/xanzy/go-gitlab/commits.go index c2b8dd566f..36b355b7fb 100644 --- a/vendor/github.com/xanzy/go-gitlab/commits.go +++ b/vendor/github.com/xanzy/go-gitlab/commits.go @@ -104,30 +104,6 @@ func (s *CommitsService) ListCommits(pid interface{}, opt *ListCommitsOptions, o return c, resp, err } -// FileAction represents the available actions that can be performed on a file. -// -// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions -type FileAction string - -// The available file actions. -const ( - FileCreate FileAction = "create" - FileDelete FileAction = "delete" - FileMove FileAction = "move" - FileUpdate FileAction = "update" -) - -// CommitAction represents a single file action within a commit. -type CommitAction struct { - Action FileAction `url:"action" json:"action"` - FilePath string `url:"file_path" json:"file_path"` - PreviousPath string `url:"previous_path,omitempty" json:"previous_path,omitempty"` - Content string `url:"content,omitempty" json:"content,omitempty"` - Encoding string `url:"encoding,omitempty" json:"encoding,omitempty"` - LastCommitID string `url:"last_commit_id,omitempty" json:"last_commit_id,omitempty"` - ExecuteFilemode bool `url:"execute_filemode,omitempty" json:"execute_filemode,omitempty"` -} - // CommitRef represents the reference of branches/tags in a commit. // // GitLab API docs: @@ -203,16 +179,30 @@ func (s *CommitsService) GetCommit(pid interface{}, sha string, options ...Reque // // GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions 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"` + Branch *string `url:"branch,omitempty" json:"branch,omitempty"` + CommitMessage *string `url:"commit_message,omitempty" json:"commit_message,omitempty"` + 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 []*CommitActionOptions `url:"actions,omitempty" json:"actions,omitempty"` + 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"` +} + +// CommitActionOptions represents the available options for a new single +// file action. +// +// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions +type CommitActionOptions struct { + Action *FileAction `url:"action,omitempty" json:"action,omitempty"` + FilePath *string `url:"file_path,omitempty" json:"file_path,omitempty"` + PreviousPath *string `url:"previous_path,omitempty" json:"previous_path,omitempty"` + Content *string `url:"content,omitempty" json:"content,omitempty"` + Encoding *string `url:"encoding,omitempty" json:"encoding,omitempty"` + LastCommitID *string `url:"last_commit_id,omitempty" json:"last_commit_id,omitempty"` + ExecuteFilemode *bool `url:"execute_filemode,omitempty" json:"execute_filemode,omitempty"` } // CreateCommit creates a commit with multiple files and actions. diff --git a/vendor/github.com/xanzy/go-gitlab/deploy_keys.go b/vendor/github.com/xanzy/go-gitlab/deploy_keys.go index adb50bdbff..9d71bffe5e 100644 --- a/vendor/github.com/xanzy/go-gitlab/deploy_keys.go +++ b/vendor/github.com/xanzy/go-gitlab/deploy_keys.go @@ -198,3 +198,37 @@ func (s *DeployKeysService) EnableDeployKey(pid interface{}, deployKey int, opti return k, resp, err } + +// UpdateDeployKeyOptions represents the available UpdateDeployKey() options. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/deploy_keys.html#update-deploy-key +type UpdateDeployKeyOptions struct { + Title *string `url:"title,omitempty" json:"title,omitempty"` + CanPush *bool `url:"can_push,omitempty" json:"can_push,omitempty"` +} + +// UpdateDeployKey updates a deploy key for a project. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/deploy_keys.html#update-deploy-key +func (s *DeployKeysService) UpdateDeployKey(pid interface{}, deployKey int, opt *UpdateDeployKeyOptions, options ...RequestOptionFunc) (*DeployKey, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/deploy_keys/%d", pathEscape(project), deployKey) + + req, err := s.client.NewRequest("PUT", u, opt, options) + if err != nil { + return nil, nil, err + } + + k := new(DeployKey) + resp, err := s.client.Do(req, k) + if err != nil { + return nil, resp, err + } + + return k, resp, err +} diff --git a/vendor/github.com/xanzy/go-gitlab/freeze_periods.go b/vendor/github.com/xanzy/go-gitlab/freeze_periods.go new file mode 100644 index 0000000000..f7483f3262 --- /dev/null +++ b/vendor/github.com/xanzy/go-gitlab/freeze_periods.go @@ -0,0 +1,193 @@ +// +// Copyright 2020 Paul Cioanca +// +// 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" +) + +// FreezePeriodsService handles the communication with the freeze periods +// related methods of the GitLab API. +// +// https://docs.gitlab.com/ce/api/freeze_periods.html +type FreezePeriodsService struct { + client *Client +} + +// FreezePeriod represents a freeze period object. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#list-freeze-periods +type FreezePeriod struct { + ID int `json:"id"` + FreezeStart string `json:"freeze_start"` + FreezeEnd string `json:"freeze_end"` + CronTimezone string `json:"cron_timezone"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` +} + +// ListFreezePeriodsOptions represents the available ListFreezePeriodsOptions() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#list-freeze-periods +type ListFreezePeriodsOptions ListOptions + +// ListFreezePeriods gets a list of project project freeze periods. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#list-freeze-periods +func (s *FreezePeriodsService) ListFreezePeriods(pid interface{}, opt *ListFreezePeriodsOptions, options ...RequestOptionFunc) ([]*FreezePeriod, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/freeze_periods", pathEscape(project)) + + req, err := s.client.NewRequest("GET", u, opt, options) + if err != nil { + return nil, nil, err + } + + var fp []*FreezePeriod + resp, err := s.client.Do(req, &fp) + if err != nil { + return nil, resp, err + } + + return fp, resp, err +} + +// GetFreezePeriod gets a specific freeze period for a project. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#get-a-freeze-period-by-a-freeze_period_id +func (s *FreezePeriodsService) GetFreezePeriod(pid interface{}, freezePeriod int, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/freeze_periods/%d", pathEscape(project), freezePeriod) + + req, err := s.client.NewRequest("GET", u, nil, options) + if err != nil { + return nil, nil, err + } + + fp := new(FreezePeriod) + resp, err := s.client.Do(req, fp) + if err != nil { + return nil, resp, err + } + + return fp, resp, err +} + +// CreateFreezePeriodOptions represents the available CreateFreezePeriodOptions() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#create-a-freeze-period +type CreateFreezePeriodOptions struct { + FreezeStart *string `url:"freeze_start,omitempty" json:"freeze_start,omitempty"` + FreezeEnd *string `url:"freeze_end,omitempty" json:"freeze_end,omitempty"` + CronTimezone *string `url:"cron_timezone,omitempty" json:"cron_timezone,omitempty"` +} + +// CreateFreezePeriodOptions adds a freeze period to a specified project. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#create-a-freeze-period +func (s *FreezePeriodsService) CreateFreezePeriodOptions(pid interface{}, opt *CreateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/freeze_periods", pathEscape(project)) + + req, err := s.client.NewRequest("POST", u, opt, options) + if err != nil { + return nil, nil, err + } + + fp := new(FreezePeriod) + resp, err := s.client.Do(req, fp) + if err != nil { + return nil, resp, err + } + + return fp, resp, err +} + +// UpdateFreezePeriodOptions represents the available UpdateFreezePeriodOptions() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#update-a-freeze-period +type UpdateFreezePeriodOptions struct { + FreezeStart *string `url:"freeze_start,omitempty" json:"freeze_start,omitempty"` + FreezeEnd *string `url:"freeze_end,omitempty" json:"freeze_end,omitempty"` + CronTimezone *string `url:"cron_timezone,omitempty" json:"cron_timezone,omitempty"` +} + +// UpdateFreezePeriodOptions edits a freeze period for a specified project. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#update-a-freeze-period +func (s *FreezePeriodsService) UpdateFreezePeriodOptions(pid interface{}, freezePeriod int, opt *UpdateFreezePeriodOptions, options ...RequestOptionFunc) (*FreezePeriod, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/freeze_periods/%d", pathEscape(project), freezePeriod) + + req, err := s.client.NewRequest("PUT", u, opt, options) + if err != nil { + return nil, nil, err + } + + fp := new(FreezePeriod) + resp, err := s.client.Do(req, fp) + if err != nil { + return nil, resp, err + } + + return fp, resp, err +} + +// DeleteFreezePeriod removes a freeze period from a project. This is an +// idempotent method and can be called multiple times. Either the hook is +// available or not. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/freeze_periods.html#delete-a-freeze-period +func (s *FreezePeriodsService) DeleteFreezePeriod(pid interface{}, freezePeriod int, options ...RequestOptionFunc) (*Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, err + } + u := fmt.Sprintf("projects/%s/freeze_periods/%d", pathEscape(project), freezePeriod) + + 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/groups.go b/vendor/github.com/xanzy/go-gitlab/groups.go index 1b8a0bea82..2aae865390 100644 --- a/vendor/github.com/xanzy/go-gitlab/groups.go +++ b/vendor/github.com/xanzy/go-gitlab/groups.go @@ -286,8 +286,7 @@ func (s *GroupsService) SearchGroup(query string, options ...RequestOptionFunc) return g, resp, err } -// ListGroupProjectsOptions represents the available ListGroupProjects() -// options. +// ListGroupProjectsOptions represents the available ListGroup() options. // // GitLab API docs: // https://docs.gitlab.com/ce/api/groups.html#list-a-group-39-s-projects @@ -333,8 +332,7 @@ func (s *GroupsService) ListGroupProjects(gid interface{}, opt *ListGroupProject return p, resp, err } -// ListSubgroupsOptions represents the available ListSubgroupsOptions() -// options. +// ListSubgroupsOptions represents the available ListSubgroups() options. // // GitLab API docs: // https://docs.gitlab.com/ce/api/groups.html#list-a-groups-s-subgroups @@ -365,6 +363,38 @@ func (s *GroupsService) ListSubgroups(gid interface{}, opt *ListSubgroupsOptions return g, resp, err } +// ListDescendantGroupsOptions represents the available ListDescendantGroups() +// options. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/groups.html#list-a-groups-descendant-groups +type ListDescendantGroupsOptions ListGroupsOptions + +// ListDescendantGroups gets a list of subgroups for a given project. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/groups.html#list-a-groups-descendant-groups +func (s *GroupsService) ListDescendantGroups(gid interface{}, opt *ListDescendantGroupsOptions, options ...RequestOptionFunc) ([]*Group, *Response, error) { + group, err := parseID(gid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("groups/%s/descendant_groups", pathEscape(group)) + + req, err := s.client.NewRequest("GET", u, opt, options) + if err != nil { + return nil, nil, err + } + + var g []*Group + resp, err := s.client.Do(req, &g) + if err != nil { + return nil, resp, err + } + + return g, resp, err +} + // ListGroupLDAPLinks lists the group's LDAP links. Available only for users who // can edit groups. // diff --git a/vendor/github.com/xanzy/go-gitlab/issues.go b/vendor/github.com/xanzy/go-gitlab/issues.go index 4670b3cb54..ffd412eeb6 100644 --- a/vendor/github.com/xanzy/go-gitlab/issues.go +++ b/vendor/github.com/xanzy/go-gitlab/issues.go @@ -215,6 +215,7 @@ type ListIssuesOptions struct { MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"` NotMyReactionEmoji []string `url:"not[my_reaction_emoji],omitempty" json:"not[my_reaction_emoji],omitempty"` IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"` + In *string `url:"in,omitempty" json:"in,omitempty"` OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"` Sort *string `url:"sort,omitempty" json:"sort,omitempty"` Search *string `url:"search,omitempty" json:"search,omitempty"` diff --git a/vendor/github.com/xanzy/go-gitlab/jobs.go b/vendor/github.com/xanzy/go-gitlab/jobs.go index c6e4ec1eac..0aaa5832a7 100644 --- a/vendor/github.com/xanzy/go-gitlab/jobs.go +++ b/vendor/github.com/xanzy/go-gitlab/jobs.go @@ -164,7 +164,7 @@ func (s *JobsService) GetJob(pid interface{}, jobID int, options ...RequestOptio // GetJobArtifacts get jobs artifacts of a project // // GitLab API docs: -// https://docs.gitlab.com/ce/api/jobs.html#get-job-artifacts +// https://docs.gitlab.com/ce/api/job_artifacts.html#get-job-artifacts func (s *JobsService) GetJobArtifacts(pid interface{}, jobID int, options ...RequestOptionFunc) (io.Reader, *Response, error) { project, err := parseID(pid) if err != nil { @@ -190,7 +190,7 @@ func (s *JobsService) GetJobArtifacts(pid interface{}, jobID int, options ...Req // options. // // GitLab API docs: -// https://docs.gitlab.com/ce/api/jobs.html#download-the-artifacts-file +// https://docs.gitlab.com/ce/api/job_artifacts.html#download-the-artifacts-archive type DownloadArtifactsFileOptions struct { Job *string `url:"job" json:"job"` } @@ -199,7 +199,7 @@ type DownloadArtifactsFileOptions struct { // reference name and job provided the job finished successfully. // // GitLab API docs: -// https://docs.gitlab.com/ce/api/jobs.html#download-the-artifacts-file +// https://docs.gitlab.com/ce/api/job_artifacts.html#download-the-artifacts-archive func (s *JobsService) DownloadArtifactsFile(pid interface{}, refName string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (io.Reader, *Response, error) { project, err := parseID(pid) if err != nil { @@ -227,7 +227,7 @@ func (s *JobsService) DownloadArtifactsFile(pid interface{}, refName string, opt // to a client. // // GitLab API docs: -// https://docs.gitlab.com/ce/api/jobs.html#download-a-single-artifact-file +// https://docs.gitlab.com/ce/api/job_artifacts.html#download-a-single-artifact-file-by-job-id func (s *JobsService) DownloadSingleArtifactsFile(pid interface{}, jobID int, artifactPath string, options ...RequestOptionFunc) (io.Reader, *Response, error) { project, err := parseID(pid) if err != nil { @@ -360,7 +360,7 @@ func (s *JobsService) EraseJob(pid interface{}, jobID int, options ...RequestOpt // expiration is set. // // GitLab API docs: -// https://docs.gitlab.com/ce/api/jobs.html#keep-artifacts +// https://docs.gitlab.com/ce/api/job_artifacts.html#keep-artifacts func (s *JobsService) KeepArtifacts(pid interface{}, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { project, err := parseID(pid) if err != nil { @@ -406,3 +406,28 @@ func (s *JobsService) PlayJob(pid interface{}, jobID int, options ...RequestOpti return job, resp, err } + +// DeleteArtifacts delete artifacts of a job +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/job_artifacts.html#delete-artifacts +func (s *JobsService) DeleteArtifacts(pid interface{}, jobID int, options ...RequestOptionFunc) (*Job, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/jobs/%d/artifacts", pathEscape(project), jobID) + + req, err := s.client.NewRequest("DELETE", u, nil, options) + if err != nil { + return nil, nil, err + } + + job := new(Job) + resp, err := s.client.Do(req, job) + if err != nil { + return nil, resp, err + } + + return job, 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 c2cc618325..c8f70c99c2 100644 --- a/vendor/github.com/xanzy/go-gitlab/merge_requests.go +++ b/vendor/github.com/xanzy/go-gitlab/merge_requests.go @@ -81,6 +81,9 @@ type MergeRequest struct { RenamedFile bool `json:"renamed_file"` DeletedFile bool `json:"deleted_file"` } `json:"changes"` + User struct { + CanMerge bool `json:"can_merge"` + } `json:"user"` TimeStats *TimeStats `json:"time_stats"` Squash bool `json:"squash"` Pipeline *PipelineInfo `json:"pipeline"` @@ -573,6 +576,8 @@ type UpdateMergeRequestOptions struct { AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"` Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"` + AddLabels Labels `url:"add_labels,comma,omitempty" json:"add_labels,omitempty"` + RemoveLabels Labels `url:"remove_labels,comma,omitempty" json:"remove_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"` diff --git a/vendor/github.com/xanzy/go-gitlab/pipelines.go b/vendor/github.com/xanzy/go-gitlab/pipelines.go index 1f1ab28525..5b893486fe 100644 --- a/vendor/github.com/xanzy/go-gitlab/pipelines.go +++ b/vendor/github.com/xanzy/go-gitlab/pipelines.go @@ -82,7 +82,7 @@ func (p Pipeline) String() string { // PipelineTestReport contains a detailed report of a test run. type PipelineTestReport struct { - TotalTime int `json:"total_time"` + TotalTime float64 `json:"total_time"` TotalCount int `json:"total_count"` SuccessCount int `json:"success_count"` FailedCount int `json:"failed_count"` @@ -94,7 +94,7 @@ type PipelineTestReport struct { // PipelineTestSuites contains test suites results. type PipelineTestSuites struct { Name string `json:"name"` - TotalTime int `json:"total_time"` + TotalTime float64 `json:"total_time"` TotalCount int `json:"total_count"` SuccessCount int `json:"success_count"` FailedCount int `json:"failed_count"` @@ -105,12 +105,10 @@ type PipelineTestSuites struct { // PipelineTestCases contains test cases details. type PipelineTestCases struct { - Status string `json:"status"` - Name string `json:"name"` - Classname string `json:"classname"` - ExecutionTime int `json:"execution_time"` - SystemOutput string `json:"system_output"` - StackTrace string `json:"stack_trace"` + Status string `json:"status"` + Name string `json:"name"` + Classname string `json:"classname"` + ExecutionTime float64 `json:"execution_time"` } func (p PipelineTestReport) String() string { diff --git a/vendor/github.com/xanzy/go-gitlab/projects.go b/vendor/github.com/xanzy/go-gitlab/projects.go index 6622444cb6..5d5ca8c386 100644 --- a/vendor/github.com/xanzy/go-gitlab/projects.go +++ b/vendor/github.com/xanzy/go-gitlab/projects.go @@ -106,11 +106,12 @@ type Project struct { GroupName string `json:"group_name"` GroupAccessLevel int `json:"group_access_level"` } `json:"shared_with_groups"` - Statistics *ProjectStatistics `json:"statistics"` - Links *Links `json:"_links,omitempty"` - CIConfigPath string `json:"ci_config_path"` - CIDefaultGitDepth int `json:"ci_default_git_depth"` - CustomAttributes []*CustomAttribute `json:"custom_attributes"` + Statistics *ProjectStatistics `json:"statistics"` + Links *Links `json:"_links,omitempty"` + CIConfigPath string `json:"ci_config_path"` + CIDefaultGitDepth int `json:"ci_default_git_depth"` + CustomAttributes []*CustomAttribute `json:"custom_attributes"` + ComplianceFrameworks []string `json:"compliance_frameworks"` } // Repository represents a repository. @@ -133,11 +134,13 @@ type Repository struct { // ProjectNamespace represents a project namespace. type ProjectNamespace struct { - ID int `json:"id"` - Name string `json:"name"` - Path string `json:"path"` - Kind string `json:"kind"` - FullPath string `json:"full_path"` + ID int `json:"id"` + Name string `json:"name"` + Path string `json:"path"` + Kind string `json:"kind"` + FullPath string `json:"full_path"` + AvatarURL string `json:"avatar_url"` + WebURL string `json:"web_url"` } // StorageStatistics represents a statistics record for a group or project. diff --git a/vendor/github.com/xanzy/go-gitlab/types.go b/vendor/github.com/xanzy/go-gitlab/types.go index bebb980bdd..2a7de69e5f 100644 --- a/vendor/github.com/xanzy/go-gitlab/types.go +++ b/vendor/github.com/xanzy/go-gitlab/types.go @@ -41,12 +41,13 @@ type AccessLevelValue int // // GitLab API docs: https://docs.gitlab.com/ce/permissions/permissions.html const ( - NoPermissions AccessLevelValue = 0 - GuestPermissions AccessLevelValue = 10 - ReporterPermissions AccessLevelValue = 20 - DeveloperPermissions AccessLevelValue = 30 - MaintainerPermissions AccessLevelValue = 40 - OwnerPermissions AccessLevelValue = 50 + NoPermissions AccessLevelValue = 0 + MinimalAccessPermissions AccessLevelValue = 5 + GuestPermissions AccessLevelValue = 10 + ReporterPermissions AccessLevelValue = 20 + DeveloperPermissions AccessLevelValue = 30 + MaintainerPermissions AccessLevelValue = 40 + OwnerPermissions AccessLevelValue = 50 // These are deprecated and should be removed in a future version MasterPermissions AccessLevelValue = 40 @@ -104,6 +105,19 @@ func DeploymentStatus(v DeploymentStatusValue) *DeploymentStatusValue { return p } +// FileAction represents the available actions that can be performed on a file. +// +// GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions +type FileAction string + +// The available file actions. +const ( + FileCreate FileAction = "create" + FileDelete FileAction = "delete" + FileMove FileAction = "move" + FileUpdate FileAction = "update" +) + // ISOTime represents an ISO 8601 formatted date type ISOTime time.Time diff --git a/vendor/github.com/xanzy/go-gitlab/users.go b/vendor/github.com/xanzy/go-gitlab/users.go index 9a220b8474..2dbed926c5 100644 --- a/vendor/github.com/xanzy/go-gitlab/users.go +++ b/vendor/github.com/xanzy/go-gitlab/users.go @@ -931,3 +931,44 @@ func (s *UsersService) SetUserStatus(opt *UserStatusOptions, options ...RequestO return status, resp, err } + +// UserMembership represents a membership of the user in a namespace or project. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/users.html#user-memberships-admin-only +type UserMembership struct { + SourceID int `json:"source_id"` + SourceName string `json:"source_name"` + SourceType string `json:"source_type"` + AccessLevel string `json:"access_level"` +} + +// GetUserMembershipOptions represents the options available to query user memberships. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/users.html#user-memberships-admin-only +type GetUserMembershipOptions struct { + ListOptions + Type *string `url:"type,omitempty" json:"type,omitempty"` +} + +// GetUserMemberships retrieves a list of the user's memberships. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/users.html#user-memberships-admin-only +func (s *UsersService) GetUserMemberships(user int, opt *GetUserMembershipOptions, options ...RequestOptionFunc) ([]*UserMembership, *Response, error) { + u := fmt.Sprintf("users/%d/memberships", user) + + req, err := s.client.NewRequest("GET", u, opt, options) + if err != nil { + return nil, nil, err + } + + var m []*UserMembership + resp, err := s.client.Do(req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, err +} |