Unverified Commit 92d5254f authored by Sander van Harmelen's avatar Sander van Harmelen Committed by GitHub

Merge pull request #635 from bytheway/author-approvals

Add support for merge_requests_author_approval in ApprovalConfigurations
parents f05516d0 06b3d588
......@@ -1243,6 +1243,7 @@ type ProjectApprovals struct {
ApprovalsBeforeMerge int `json:"approvals_before_merge"`
ResetApprovalsOnPush bool `json:"reset_approvals_on_push"`
DisableOverridingApproversPerMergeRequest bool `json:"disable_overriding_approvers_per_merge_request"`
MergeRequestsAuthorApproval bool `json:"merge_requests_author_approval"`
}
// GetApprovalConfiguration get the approval configuration for a project.
......@@ -1279,6 +1280,7 @@ type ChangeApprovalConfigurationOptions struct {
ApprovalsBeforeMerge *int `url:"approvals_before_merge,omitempty" json:"approvals_before_merge,omitempty"`
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"`
}
// ChangeApprovalConfiguration updates the approval configuration for a project.
......
......@@ -399,7 +399,8 @@ func TestGetApprovalConfiguration(t *testing.T) {
"approver_groups": [],
"approvals_before_merge": 3,
"reset_approvals_on_push": false,
"disable_overriding_approvers_per_merge_request": false
"disable_overriding_approvers_per_merge_request": false,
"merge_requests_author_approval": true
}`)
})
......@@ -414,6 +415,7 @@ func TestGetApprovalConfiguration(t *testing.T) {
ApprovalsBeforeMerge: 3,
ResetApprovalsOnPush: false,
DisableOverridingApproversPerMergeRequest: false,
MergeRequestsAuthorApproval: true,
}
if !reflect.DeepEqual(want, approvals) {
......@@ -433,7 +435,8 @@ func TestChangeApprovalConfiguration(t *testing.T) {
"approver_groups": [],
"approvals_before_merge": 3,
"reset_approvals_on_push": false,
"disable_overriding_approvers_per_merge_request": false
"disable_overriding_approvers_per_merge_request": false,
"merge_requests_author_approval": true
}`)
})
......@@ -452,6 +455,7 @@ func TestChangeApprovalConfiguration(t *testing.T) {
ApprovalsBeforeMerge: 3,
ResetApprovalsOnPush: false,
DisableOverridingApproversPerMergeRequest: false,
MergeRequestsAuthorApproval: true,
}
if !reflect.DeepEqual(want, approvals) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment