Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e4ccdc60
Commit
e4ccdc60
authored
Mar 14, 2019
by
Athar Hameed
Committed by
Nick Thomas
Mar 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add self approval of merge requests setting to Merge Request Approvals API
parent
05e292d5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
2 deletions
+12
-2
ee/changelogs/unreleased/9496-add-enable-self-approval-of-merge-requests-setting-to-merge-request-approvals-api.yml
...merge-requests-setting-to-merge-request-approvals-api.yml
+5
-0
ee/lib/api/project_approvals.rb
ee/lib/api/project_approvals.rb
+2
-1
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+1
-0
ee/spec/fixtures/api/schemas/public_api/v4/project_approvers.json
...fixtures/api/schemas/public_api/v4/project_approvers.json
+1
-0
ee/spec/requests/api/project_approvals_spec.rb
ee/spec/requests/api/project_approvals_spec.rb
+3
-1
No files found.
ee/changelogs/unreleased/9496-add-enable-self-approval-of-merge-requests-setting-to-merge-request-approvals-api.yml
0 → 100644
View file @
e4ccdc60
---
title
:
Add self approval of merge requests setting to merge requests approvals API
merge_request
:
10050
author
:
type
:
changed
ee/lib/api/project_approvals.rb
View file @
e4ccdc60
...
...
@@ -28,7 +28,8 @@ module API
optional
:approvals_before_merge
,
type:
Integer
,
desc:
'The amount of approvals required before an MR can be merged'
optional
:reset_approvals_on_push
,
type:
Boolean
,
desc:
'Should the approval count be reset on a new push'
optional
:disable_overriding_approvers_per_merge_request
,
type:
Boolean
,
desc:
'Should MRs be able to override approvers and approval count'
at_least_one_of
:approvals_before_merge
,
:reset_approvals_on_push
,
:disable_overriding_approvers_per_merge_request
optional
:merge_requests_author_approval
,
type:
Boolean
,
desc:
'Should authors be able to self approve merge requests'
at_least_one_of
:approvals_before_merge
,
:reset_approvals_on_push
,
:disable_overriding_approvers_per_merge_request
,
:merge_requests_author_approval
end
post
'/'
do
project_params
=
declared
(
params
,
include_missing:
false
,
include_parent_namespaces:
false
)
...
...
ee/lib/ee/api/entities.rb
View file @
e4ccdc60
...
...
@@ -324,6 +324,7 @@ module EE
expose
:approvals_before_merge
expose
:reset_approvals_on_push
expose
:disable_overriding_approvers_per_merge_request
expose
:merge_requests_author_approval
end
class
Approvals
<
Grape
::
Entity
...
...
ee/spec/fixtures/api/schemas/public_api/v4/project_approvers.json
View file @
e4ccdc60
...
...
@@ -4,6 +4,7 @@
"approvals_before_merge"
:
{
"type"
:
"integer"
},
"disable_overriding_approvers_per_merge_request"
:
{
"type"
:
[
"boolean"
,
"null"
]
},
"reset_approvals_on_push"
:
{
"type"
:
"boolean"
},
"merge_requests_author_approval"
:
{
"type"
:
[
"boolean"
,
"null"
]
},
"approvers"
:
{
"type"
:
"array"
,
"items"
:
{
...
...
ee/spec/requests/api/project_approvals_spec.rb
View file @
e4ccdc60
...
...
@@ -70,12 +70,14 @@ describe API::ProjectApprovals do
project
.
approvals_before_merge
=
2
project
.
reset_approvals_on_push
=
false
project
.
disable_overriding_approvers_per_merge_request
=
true
project
.
merge_requests_author_approval
=
false
project
.
save
settings
=
{
approvals_before_merge:
4
,
reset_approvals_on_push:
true
,
disable_overriding_approvers_per_merge_request:
false
disable_overriding_approvers_per_merge_request:
false
,
merge_requests_author_approval:
true
}
post
api
(
url
,
current_user
),
params:
settings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment