1
0
Fork 0
forked from forgejo/forgejo

Vendor Update Go Libs (#13166)

* update github.com/alecthomas/chroma v0.8.0 -> v0.8.1

* github.com/blevesearch/bleve v1.0.10 -> v1.0.12

* editorconfig-core-go v2.1.1 -> v2.3.7

* github.com/gliderlabs/ssh v0.2.2 -> v0.3.1

* migrate editorconfig.ParseBytes to Parse

* github.com/shurcooL/vfsgen to 0d455de96546

* github.com/go-git/go-git/v5 v5.1.0 -> v5.2.0

* github.com/google/uuid v1.1.1 -> v1.1.2

* github.com/huandu/xstrings v1.3.0 -> v1.3.2

* github.com/klauspost/compress v1.10.11 -> v1.11.1

* github.com/markbates/goth v1.61.2 -> v1.65.0

* github.com/mattn/go-sqlite3 v1.14.0 -> v1.14.4

* github.com/mholt/archiver v3.3.0 -> v3.3.2

* github.com/microcosm-cc/bluemonday 4f7140c49acb -> v1.0.4

* github.com/minio/minio-go v7.0.4 -> v7.0.5

* github.com/olivere/elastic v7.0.9 -> v7.0.20

* github.com/urfave/cli v1.20.0 -> v1.22.4

* github.com/prometheus/client_golang v1.1.0 -> v1.8.0

* github.com/xanzy/go-gitlab v0.37.0 -> v0.38.1

* mvdan.cc/xurls v2.1.0 -> v2.2.0

Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
6543 2020-10-16 07:06:27 +02:00 committed by GitHub
parent 91f2afdb54
commit 12a1f914f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
656 changed files with 52967 additions and 25229 deletions

View file

@ -446,6 +446,8 @@ type SetCommitStatusOptions struct {
Context *string `url:"context,omitempty" json:"context,omitempty"`
TargetURL *string `url:"target_url,omitempty" json:"target_url,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"`
Coverage *float64 `url:"coverage,omitempty" json:"coverage,omitempty"`
PipelineID *int `url:"pipeline_id,omitempty" json:"pipeline_id,omitempty"`
}
// SetCommitStatus sets the status of a commit in a project.

View file

@ -144,7 +144,7 @@ type UpdateGroupIssueBoardOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
Weight *int `url:"weight,omitempty" json:"weight,omitempty"`
}

View file

@ -43,6 +43,7 @@ type GroupMilestone struct {
State string `json:"state"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
Expired *bool `json:"expired"`
}
func (m GroupMilestone) String() string {
@ -56,9 +57,11 @@ func (m GroupMilestone) String() string {
// https://docs.gitlab.com/ce/api/group_milestones.html#list-group-milestones
type ListGroupMilestonesOptions 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"`
State *string `url:"state,omitempty" json:"state,omitempty"`
Title *string `url:"title,omitempty" json:"title,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
IncludeParentMilestones *bool `url:"include_parent_milestones,omitempty" json:"include_parent_milestones,omitempty"`
}
// ListGroupMilestones returns a list of group milestones.

View file

@ -471,3 +471,155 @@ func (s *GroupsService) DeleteGroupLDAPLinkForProvider(gid interface{}, provider
return s.client.Do(req, nil)
}
// GroupPushRules represents a group push rule.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#get-group-push-rules
type GroupPushRules struct {
ID int `json:"id"`
CreatedAt *time.Time `json:"created_at"`
CommitMessageRegex string `json:"commit_message_regex"`
CommitMessageNegativeRegex string `json:"commit_message_negative_regex"`
BranchNameRegex string `json:"branch_name_regex"`
DenyDeleteTag bool `json:"deny_delete_tag"`
MemberCheck bool `json:"member_check"`
PreventSecrets bool `json:"prevent_secrets"`
AuthorEmailRegex string `json:"author_email_regex"`
FileNameRegex string `json:"file_name_regex"`
MaxFileSize int `json:"max_file_size"`
CommitCommitterCheck bool `json:"commit_committer_check"`
RejectUnsignedCommits bool `json:"reject_unsigned_commits"`
}
// GetGroupPushRules gets the push rules of a group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#get-group-push-rules
func (s *GroupsService) GetGroupPushRules(gid interface{}, options ...RequestOptionFunc) (*GroupPushRules, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/push_rule", pathEscape(group))
req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil {
return nil, nil, err
}
gpr := new(GroupPushRules)
resp, err := s.client.Do(req, gpr)
if err != nil {
return nil, resp, err
}
return gpr, resp, err
}
// AddGroupPushRuleOptions represents the available AddGroupPushRule()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#add-group-push-rule
type AddGroupPushRuleOptions struct {
DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"`
MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"`
PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"`
CommitMessageNegativeRegex *string `url:"commit_message_negative_regex,omitempty" json:"commit_message_negative_regex,omitempty"`
BranchNameRegex *string `url:"branch_name_regex,omitempty" json:"branch_name_regex,omitempty"`
AuthorEmailRegex *string `url:"author_email_regex,omitempty" json:"author_email_regex,omitempty"`
FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"`
MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"`
CommitCommitterCheck *bool `url:"commit_committer_check,omitempty" json:"commit_committer_check,omitempty"`
RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
}
// AddGroupPushRule adds push rules to the specified group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#add-group-push-rule
func (s *GroupsService) AddGroupPushRule(gid interface{}, opt *AddGroupPushRuleOptions, options ...RequestOptionFunc) (*GroupPushRules, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/push_rule", pathEscape(group))
req, err := s.client.NewRequest("POST", u, opt, options)
if err != nil {
return nil, nil, err
}
gpr := new(GroupPushRules)
resp, err := s.client.Do(req, gpr)
if err != nil {
return nil, resp, err
}
return gpr, resp, err
}
// EditGroupPushRuleOptions represents the available EditGroupPushRule()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#edit-group-push-rule
type EditGroupPushRuleOptions struct {
DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"`
MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"`
PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"`
CommitMessageNegativeRegex *string `url:"commit_message_negative_regex,omitempty" json:"commit_message_negative_regex,omitempty"`
BranchNameRegex *string `url:"branch_name_regex,omitempty" json:"branch_name_regex,omitempty"`
AuthorEmailRegex *string `url:"author_email_regex,omitempty" json:"author_email_regex,omitempty"`
FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"`
MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"`
CommitCommitterCheck *bool `url:"commit_committer_check,omitempty" json:"commit_committer_check,omitempty"`
RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
}
// EditGroupPushRule edits a push rule for a specified group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#edit-group-push-rule
func (s *GroupsService) EditGroupPushRule(gid interface{}, opt *EditGroupPushRuleOptions, options ...RequestOptionFunc) (*GroupPushRules, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/push_rule", pathEscape(group))
req, err := s.client.NewRequest("PUT", u, opt, options)
if err != nil {
return nil, nil, err
}
gpr := new(GroupPushRules)
resp, err := s.client.Do(req, gpr)
if err != nil {
return nil, resp, err
}
return gpr, resp, err
}
// DeleteGroupPushRule deletes the push rules of a group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#delete-group-push-rule
func (s *GroupsService) DeleteGroupPushRule(gid interface{}, options ...RequestOptionFunc) (*Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("groups/%s/push_rule", pathEscape(group))
req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil {
return nil, err
}
return s.client.Do(req, nil)
}

View file

@ -37,6 +37,7 @@ type InstanceCluster struct {
ID int `json:"id"`
Name string `json:"name"`
Domain string `json:"domain"`
Managed bool `json:"managed"`
CreatedAt *time.Time `json:"created_at"`
ProviderType string `json:"provider_type"`
PlatformType string `json:"platform_type"`

View file

@ -390,7 +390,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"`
@ -431,9 +431,9 @@ 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"`
AddLabels *Labels `url:"add_labels,comma,omitempty" json:"add_labels,omitempty"`
RemoveLabels *Labels `url:"remove_labels,comma,omitempty" json:"remove_labels,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"`
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"`

View file

@ -51,8 +51,8 @@ func (n IssuesStatistics) String() string {
// GitLab API docs:
// https://docs.gitlab.com/ee/api/issues_statistics.html#get-issues-statistics
type GetIssuesStatisticsOptions struct {
Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
Milestone *Milestone `url:"milestone,omitempty" json:"milestone,omitempty"`
Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
Milestone *string `url:"milestone,omitempty" json:"milestone,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"`
@ -95,7 +95,7 @@ func (s *IssuesStatisticsService) GetIssuesStatistics(opt *GetIssuesStatisticsOp
// GitLab API docs:
// https://docs.gitlab.com/ee/api/issues_statistics.html#get-group-issues-statistics
type GetGroupIssuesStatisticsOptions struct {
Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
IIDs []int `url:"iids,omitempty" json:"iids,omitempty"`
Milestone *Milestone `url:"milestone,omitempty" json:"milestone,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
@ -144,7 +144,7 @@ func (s *IssuesStatisticsService) GetGroupIssuesStatistics(gid interface{}, opt
// https://docs.gitlab.com/ee/api/issues_statistics.html#get-project-issues-statistics
type GetProjectIssuesStatisticsOptions struct {
IIDs []int `url:"iids,omitempty" json:"iids,omitempty"`
Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"`
Labels Labels `url:"labels,omitempty" json:"labels,omitempty"`
Milestone *Milestone `url:"milestone,omitempty" json:"milestone,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`

View file

@ -133,25 +133,28 @@ func (m MergeRequestDiffVersion) String() string {
// https://docs.gitlab.com/ce/api/merge_requests.html#list-merge-requests
type ListMergeRequestsOptions struct {
ListOptions
State *string `url:"state,omitempty" json:"state,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
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,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"`
UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
In *string `url:"in,omitempty" json:"in,omitempty"`
WIP *string `url:"wip,omitempty" json:"wip,omitempty"`
State *string `url:"state,omitempty" json:"state,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
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,comma,omitempty" json:"labels,omitempty"`
NotLabels Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
WithLabelsDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
WithMergeStatusRecheck *bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,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"`
UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
In *string `url:"in,omitempty" json:"in,omitempty"`
WIP *string `url:"wip,omitempty" json:"wip,omitempty"`
}
// ListMergeRequests gets all merge requests. The state parameter can be used
@ -183,23 +186,26 @@ func (s *MergeRequestsService) ListMergeRequests(opt *ListMergeRequestsOptions,
// https://docs.gitlab.com/ce/api/merge_requests.html#list-group-merge-requests
type ListGroupMergeRequestsOptions struct {
ListOptions
State *string `url:"state,omitempty" json:"state,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
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"`
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"`
UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
State *string `url:"state,omitempty" json:"state,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
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"`
NotLabels Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
WithLabelsDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
WithMergeStatusRecheck *bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,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"`
UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
}
// ListGroupMergeRequests gets all merge requests for this group.
@ -234,25 +240,28 @@ func (s *MergeRequestsService) ListGroupMergeRequests(gid interface{}, opt *List
// https://docs.gitlab.com/ce/api/merge_requests.html#list-project-merge-requests
type ListProjectMergeRequestsOptions struct {
ListOptions
IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"`
State *string `url:"state,omitempty" json:"state,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
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,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"`
UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
WIP *string `url:"wip,omitempty" json:"wip,omitempty"`
IIDs []int `url:"iids[],omitempty" json:"iids,omitempty"`
State *string `url:"state,omitempty" json:"state,omitempty"`
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
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,comma,omitempty" json:"labels,omitempty"`
NotLabels Labels `url:"not[labels],comma,omitempty" json:"not[labels],omitempty"`
WithLabelsDetails *bool `url:"with_labels_details,omitempty" json:"with_labels_details,omitempty"`
WithMergeStatusRecheck *bool `url:"with_merge_status_recheck,omitempty" json:"with_merge_status_recheck,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"`
UpdatedBefore *time.Time `url:"updated_before,omitempty" json:"updated_before,omitempty"`
Scope *string `url:"scope,omitempty" json:"scope,omitempty"`
AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
MyReactionEmoji *string `url:"my_reaction_emoji,omitempty" json:"my_reaction_emoji,omitempty"`
SourceBranch *string `url:"source_branch,omitempty" json:"source_branch,omitempty"`
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
Search *string `url:"search,omitempty" json:"search,omitempty"`
WIP *string `url:"wip,omitempty" json:"wip,omitempty"`
}
// ListProjectMergeRequests gets all merge requests for this project.
@ -517,7 +526,7 @@ 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"`
@ -563,7 +572,7 @@ type UpdateMergeRequestOptions struct {
TargetBranch *string `url:"target_branch,omitempty" json:"target_branch,omitempty"`
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"`
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"`

View file

@ -44,6 +44,7 @@ type Milestone struct {
WebURL string `json:"web_url"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
Expired *bool `json:"expired"`
}
func (m Milestone) String() string {

View file

@ -61,7 +61,7 @@ type Pipeline struct {
DetailedStatus *DetailedStatus `json:"detailed_status"`
}
// DetailedStatus contains detailed information about the status of a pipeline
// DetailedStatus contains detailed information about the status of a pipeline.
type DetailedStatus struct {
Icon string `json:"icon"`
Text string `json:"text"`
@ -80,6 +80,43 @@ func (p Pipeline) String() string {
return Stringify(p)
}
// PipelineTestReport contains a detailed report of a test run.
type PipelineTestReport struct {
TotalTime int `json:"total_time"`
TotalCount int `json:"total_count"`
SuccessCount int `json:"success_count"`
FailedCount int `json:"failed_count"`
SkippedCount int `json:"skipped_count"`
ErrorCount int `json:"error_count"`
TestSuites []PipelineTestSuites `json:"test_suites"`
}
// PipelineTestSuites contains test suites results.
type PipelineTestSuites struct {
Name string `json:"name"`
TotalTime int `json:"total_time"`
TotalCount int `json:"total_count"`
SuccessCount int `json:"success_count"`
FailedCount int `json:"failed_count"`
SkippedCount int `json:"skipped_count"`
ErrorCount int `json:"error_count"`
TestCases []PipelineTestCases `json:"test_cases"`
}
// 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"`
}
func (p PipelineTestReport) String() string {
return Stringify(p)
}
// PipelineInfo shows the basic entities of a pipeline, mostly used as fields
// on other assets, like Commit.
type PipelineInfo struct {
@ -186,6 +223,30 @@ func (s *PipelinesService) GetPipelineVariables(pid interface{}, pipeline int, o
return p, resp, err
}
// GetPipelineTestReport gets the test report of a single project pipeline.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/pipelines.html#get-a-pipelines-test-report
func (s *PipelinesService) GetPipelineTestReport(pid interface{}, pipeline int) (*PipelineTestReport, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/pipelines/%d/test_report", pathEscape(project), pipeline)
req, err := s.client.NewRequest("GET", u, nil, nil)
if err != nil {
return nil, nil, err
}
p := new(PipelineTestReport)
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

View file

@ -117,6 +117,31 @@ func (s *ProjectMembersService) GetProjectMember(pid interface{}, user int, opti
return pm, resp, err
}
// GetInheritedProjectMember gets a project team member, including inherited
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/members.html#get-a-member-of-a-group-or-project-including-inherited-members
func (s *ProjectMembersService) GetInheritedProjectMember(pid interface{}, user int, options ...RequestOptionFunc) (*ProjectMember, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/members/all/%d", pathEscape(project), user)
req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil {
return nil, nil, err
}
pm := new(ProjectMember)
resp, err := s.client.Do(req, pm)
if err != nil {
return nil, resp, err
}
return pm, resp, err
}
// AddProjectMemberOptions represents the available AddProjectMember() options.
//
// GitLab API docs:

View file

@ -89,6 +89,7 @@ type Project struct {
MirrorTriggerBuilds bool `json:"mirror_trigger_builds"`
OnlyMirrorProtectedBranches bool `json:"only_mirror_protected_branches"`
MirrorOverwritesDivergedBranches bool `json:"mirror_overwrites_diverged_branches"`
PackagesEnabled bool `json:"packages_enabled"`
ServiceDeskEnabled bool `json:"service_desk_enabled"`
ServiceDeskAddress string `json:"service_desk_address"`
IssuesAccessLevel AccessControlValue `json:"issues_access_level"`
@ -1190,19 +1191,20 @@ func (s *ProjectsService) ListProjectForks(pid interface{}, opt *ListProjectsOpt
// GitLab API docs:
// https://docs.gitlab.com/ee/api/projects.html#push-rules
type ProjectPushRules struct {
ID int `json:"id"`
ProjectID int `json:"project_id"`
CommitMessageRegex string `json:"commit_message_regex"`
BranchNameRegex string `json:"branch_name_regex"`
DenyDeleteTag bool `json:"deny_delete_tag"`
CreatedAt *time.Time `json:"created_at"`
MemberCheck bool `json:"member_check"`
PreventSecrets bool `json:"prevent_secrets"`
AuthorEmailRegex string `json:"author_email_regex"`
FileNameRegex string `json:"file_name_regex"`
MaxFileSize int `json:"max_file_size"`
CommitCommitterCheck bool `json:"commit_committer_check"`
RejectUnsignedCommits bool `json:"reject_unsigned_commits"`
ID int `json:"id"`
ProjectID int `json:"project_id"`
CommitMessageRegex string `json:"commit_message_regex"`
CommitMessageNegativeRegex string `json:"commit_message_negative_regex"`
BranchNameRegex string `json:"branch_name_regex"`
DenyDeleteTag bool `json:"deny_delete_tag"`
CreatedAt *time.Time `json:"created_at"`
MemberCheck bool `json:"member_check"`
PreventSecrets bool `json:"prevent_secrets"`
AuthorEmailRegex string `json:"author_email_regex"`
FileNameRegex string `json:"file_name_regex"`
MaxFileSize int `json:"max_file_size"`
CommitCommitterCheck bool `json:"commit_committer_check"`
RejectUnsignedCommits bool `json:"reject_unsigned_commits"`
}
// GetProjectPushRules gets the push rules of a project.
@ -1236,14 +1238,17 @@ func (s *ProjectsService) GetProjectPushRules(pid interface{}, options ...Reques
// GitLab API docs:
// https://docs.gitlab.com/ee/api/projects.html#add-project-push-rule
type AddProjectPushRuleOptions struct {
DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"`
MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"`
PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"`
BranchNameRegex *string `url:"branch_name_regex,omitempty" json:"branch_name_regex,omitempty"`
AuthorEmailRegex *string `url:"author_email_regex,omitempty" json:"author_email_regex,omitempty"`
FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"`
MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"`
DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"`
MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"`
PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"`
CommitMessageNegativeRegex *string `url:"commit_message_negative_regex,omitempty" json:"commit_message_negative_regex,omitempty"`
BranchNameRegex *string `url:"branch_name_regex,omitempty" json:"branch_name_regex,omitempty"`
AuthorEmailRegex *string `url:"author_email_regex,omitempty" json:"author_email_regex,omitempty"`
FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"`
MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"`
CommitCommitterCheck *bool `url:"commit_committer_check,omitempty" json:"commit_committer_check,omitempty"`
RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
}
// AddProjectPushRule adds a push rule to a specified project.
@ -1277,16 +1282,17 @@ func (s *ProjectsService) AddProjectPushRule(pid interface{}, opt *AddProjectPus
// GitLab API docs:
// https://docs.gitlab.com/ee/api/projects.html#edit-project-push-rule
type EditProjectPushRuleOptions struct {
AuthorEmailRegex *string `url:"author_email_regex,omitempty" json:"author_email_regex,omitempty"`
BranchNameRegex *string `url:"branch_name_regex,omitempty" json:"branch_name_regex,omitempty"`
CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"`
FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"`
DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"`
MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"`
PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"`
CommitCommitterCheck *bool `url:"commit_committer_check,omitempty" json:"commit_committer_check,omitempty"`
RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
AuthorEmailRegex *string `url:"author_email_regex,omitempty" json:"author_email_regex,omitempty"`
BranchNameRegex *string `url:"branch_name_regex,omitempty" json:"branch_name_regex,omitempty"`
CommitMessageRegex *string `url:"commit_message_regex,omitempty" json:"commit_message_regex,omitempty"`
CommitMessageNegativeRegex *string `url:"commit_message_negative_regex,omitempty" json:"commit_message_negative_regex,omitempty"`
FileNameRegex *string `url:"file_name_regex,omitempty" json:"file_name_regex,omitempty"`
DenyDeleteTag *bool `url:"deny_delete_tag,omitempty" json:"deny_delete_tag,omitempty"`
MemberCheck *bool `url:"member_check,omitempty" json:"member_check,omitempty"`
PreventSecrets *bool `url:"prevent_secrets,omitempty" json:"prevent_secrets,omitempty"`
MaxFileSize *int `url:"max_file_size,omitempty" json:"max_file_size,omitempty"`
CommitCommitterCheck *bool `url:"commit_committer_check,omitempty" json:"commit_committer_check,omitempty"`
RejectUnsignedCommits *bool `url:"reject_unsigned_commits,omitempty" json:"reject_unsigned_commits,omitempty"`
}
// EditProjectPushRule edits a push rule for a specified project.

View file

@ -190,9 +190,13 @@ func (s *ContainerRegistryService) DeleteRegistryRepositoryTag(pid interface{},
// GitLab API docs:
// https://docs.gitlab.com/ee/api/container_registry.html#delete-repository-tags-in-bulk
type DeleteRegistryRepositoryTagsOptions struct {
NameRegexpDelete *string `url:"name_regex_delete,omitempty" json:"name_regex_delete,omitempty"`
NameRegexpKeep *string `url:"name_regex_keep,omitempty" json:"name_regex_keep,omitempty"`
KeepN *int `url:"keep_n,omitempty" json:"keep_n,omitempty"`
OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"`
// Deprecated members
NameRegexp *string `url:"name_regex,omitempty" json:"name_regex,omitempty"`
KeepN *int `url:"keep_n,omitempty" json:"keep_n,omitempty"`
OlderThan *string `url:"older_than,omitempty" json:"older_than,omitempty"`
}
// DeleteRegistryRepositoryTags deletes repository tags in bulk based on

View file

@ -59,6 +59,7 @@ type User struct {
Email string `json:"email"`
Name string `json:"name"`
State string `json:"state"`
WebURL string `json:"web_url"`
CreatedAt *time.Time `json:"created_at"`
Bio string `json:"bio"`
Location string `json:"location"`