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
b860a605
Commit
b860a605
authored
Mar 09, 2018
by
Mario de la Ossa
Committed by
Sean McGivern
Mar 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put global project approval docs under Merge Request approvals
parent
01912a7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
185 additions
and
181 deletions
+185
-181
doc/api/README.md
doc/api/README.md
+1
-2
doc/api/merge_request_approvals.md
doc/api/merge_request_approvals.md
+180
-4
doc/api/merge_requests.md
doc/api/merge_requests.md
+4
-0
doc/api/project_approvals.md
doc/api/project_approvals.md
+0
-175
No files found.
doc/api/README.md
View file @
b860a605
...
...
@@ -37,7 +37,7 @@ following locations:
-
[
Labels
](
labels.md
)
-
[
License
](
license.md
)
-
[
Merge Requests
](
merge_requests.md
)
-
[
Merge Request Approvals
](
merge_request_approvals.md
)
- for project-level settings see
[
Project Approvals
](
project_approvals.md
)
-
[
Merge Request Approvals
](
merge_request_approvals.md
)
-
[
Project milestones
](
milestones.md
)
-
[
Group milestones
](
group_milestones.md
)
-
[
Namespaces
](
namespaces.md
)
...
...
@@ -50,7 +50,6 @@ following locations:
-
[
Pipeline Triggers
](
pipeline_triggers.md
)
-
[
Pipeline Schedules
](
pipeline_schedules.md
)
-
[
Projects
](
projects.md
)
including setting Webhooks
-
[
Project Approvals
](
project_approvals.md
)
-
[
Project Access Requests
](
access_requests.md
)
-
[
Project Badges
](
project_badges.md
)
-
[
Project import/export
](
project_import_export.md
)
...
...
doc/api/merge_request_approvals.md
View file @
b860a605
#
Merge request approvals API
#
Project-level approvals
Every API call must be authenticated
Configuration for approvals on all Merge Requests in the project. Must be authenticated for all endpoints.
## Merge Request Approvals
## Get Configuration
>**Note:** This API endpoint is only available on 10.6 Starter and above.
You can request information about a project's approval configuration using the
following endpoint:
```
GET /projects/:id/approvals
```
**Parameters:**
| Attribute | Type | Required | Description |
| --------- | ------- | -------- | ------------------- |
|
`id`
| integer | yes | The ID of a project |
```
json
{
"approvers"
:
[
{
"user"
:
{
"id"
:
5
,
"name"
:
"John Doe6"
,
"username"
:
"user5"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80
\u
0026d=identicon"
,
"web_url"
:
"http://localhost/user5"
}
}
],
"approver_groups"
:
[
{
"group"
:
{
"id"
:
1
,
"name"
:
"group1"
,
"path"
:
"group1"
,
"description"
:
""
,
"visibility"
:
"public"
,
"lfs_enabled"
:
false
,
"avatar_url"
:
null
,
"web_url"
:
"http://localhost/groups/group1"
,
"request_access_enabled"
:
false
,
"full_name"
:
"group1"
,
"full_path"
:
"group1"
,
"parent_id"
:
null
,
"ldap_cn"
:
null
,
"ldap_access"
:
null
}
}
],
"approvals_before_merge"
:
2
,
"reset_approvals_on_push"
:
true
,
"disable_overriding_approvers_per_merge_request"
:
false
}
```
## Change configuration
>**Note:** This API endpoint is only available on 10.6 Starter and above.
If you are allowed to, you can change approval configuration using the following
endpoint:
```
POST /projects/:id/approvals
```
**Parameters:**
| Attribute | Type | Required | Description |
| ------------------------------------------------ | ------- | -------- | ---------------------------------------------------------- |
|
`id`
| integer | yes | The ID of a project |
|
`approvals_before_merge`
| integer | no | How many approvals are required before an MR can be merged |
|
`reset_approvals_on_push`
| boolean | no | Reset approvals on a new push |
|
`disable_overriding_approvers_per_merge_request`
| boolean | no | Allow/Disallow overriding approvers per MR |
```
json
{
"approvers"
:
[
{
"user"
:
{
"id"
:
5
,
"name"
:
"John Doe6"
,
"username"
:
"user5"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80
\u
0026d=identicon"
,
"web_url"
:
"http://localhost/user5"
}
}
],
"approver_groups"
:
[
{
"group"
:
{
"id"
:
1
,
"name"
:
"group1"
,
"path"
:
"group1"
,
"description"
:
""
,
"visibility"
:
"public"
,
"lfs_enabled"
:
false
,
"avatar_url"
:
null
,
"web_url"
:
"http://localhost/groups/group1"
,
"request_access_enabled"
:
false
,
"full_name"
:
"group1"
,
"full_path"
:
"group1"
,
"parent_id"
:
null
,
"ldap_cn"
:
null
,
"ldap_access"
:
null
}
}
],
"approvals_before_merge"
:
2
,
"reset_approvals_on_push"
:
true
,
"disable_overriding_approvers_per_merge_request"
:
false
}
```
## Change allowed approvers
>**Note:** This API endpoint is only available on 10.6 Starter and above.
If you are allowed to, you can change approvers and approver groups using
the following endpoint:
```
PUT /projects/:id/approvers
```
**Important:**
Approvers and groups not in the request will be
**removed**
**Parameters:**
| Attribute | Type | Required | Description |
| -------------------- | ------- | -------- | --------------------------------------------------- |
|
`id`
| integer | yes | The ID of a project |
|
`approver_ids`
| Array | yes | An array of User IDs that can approve MRs |
|
`approver_group_ids`
| Array | yes | An array of Group IDs whose members can approve MRs |
```
json
{
"approvers"
:
[
{
"user"
:
{
"id"
:
5
,
"name"
:
"John Doe6"
,
"username"
:
"user5"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80
\u
0026d=identicon"
,
"web_url"
:
"http://localhost/user5"
}
}
],
"approver_groups"
:
[
{
"group"
:
{
"id"
:
1
,
"name"
:
"group1"
,
"path"
:
"group1"
,
"description"
:
""
,
"visibility"
:
"public"
,
"lfs_enabled"
:
false
,
"avatar_url"
:
null
,
"web_url"
:
"http://localhost/groups/group1"
,
"request_access_enabled"
:
false
,
"full_name"
:
"group1"
,
"full_path"
:
"group1"
,
"parent_id"
:
null
,
"ldap_cn"
:
null
,
"ldap_access"
:
null
}
}
],
"approvals_before_merge"
:
2
,
"reset_approvals_on_push"
:
true
,
"disable_overriding_approvers_per_merge_request"
:
false
}
```
# Merge Request-level Approvals
Configuration for approvals on a specific Merge Request. Must be authenticated for all endpoints.
## Get Configuration
>**Note:** This API endpoint is only available on 8.9 Starter and above.
...
...
@@ -50,7 +226,7 @@ GET /projects/:id/merge_requests/:merge_request_iid/approvals
}
```
## Change
Merge Request approvals
configuration
## Change
approval
configuration
>**Note:** This API endpoint is only available on 10.6 Starter and above.
...
...
doc/api/merge_requests.md
View file @
b860a605
...
...
@@ -1488,3 +1488,7 @@ Example response:
[
ce-13060
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13060
[
ce-14016
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14016
[
ce-15454
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15454
## Approvals
For approvals, please see
[
Merge Request Approvals
](
merge_request_approvals.md
)
doc/api/project_approvals.md
deleted
100644 → 0
View file @
01912a7b
# Project approvals API
Global configuration for approvals on all Merge Requests in the project. Must be authenticated for all endpoints.
## Project Approvals
>**Note:** This API endpoint is only available on 10.6 Starter and above.
You can request information about a project's approval configuration using the
following endpoint:
```
GET /projects/:id/approvals
```
**Parameters:**
| Attribute | Type | Required | Description |
| --------- | ------- | -------- | ------------------- |
|
`id`
| integer | yes | The ID of a project |
```
json
{
"approvers"
:
[
{
"user"
:
{
"id"
:
5
,
"name"
:
"John Doe6"
,
"username"
:
"user5"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80
\u
0026d=identicon"
,
"web_url"
:
"http://localhost/user5"
}
}
],
"approver_groups"
:
[
{
"group"
:
{
"id"
:
1
,
"name"
:
"group1"
,
"path"
:
"group1"
,
"description"
:
""
,
"visibility"
:
"public"
,
"lfs_enabled"
:
false
,
"avatar_url"
:
null
,
"web_url"
:
"http://localhost/groups/group1"
,
"request_access_enabled"
:
false
,
"full_name"
:
"group1"
,
"full_path"
:
"group1"
,
"parent_id"
:
null
,
"ldap_cn"
:
null
,
"ldap_access"
:
null
}
}
],
"approvals_before_merge"
:
2
,
"reset_approvals_on_push"
:
true
,
"disable_overriding_approvers_per_merge_request"
:
false
}
```
## Change project approvals configuration
>**Note:** This API endpoint is only available on 10.6 Starter and above.
If you are allowed to, you can change global approval configuration using the following
endpoint:
```
POST /projects/:id/approvals
```
**Parameters:**
| Attribute | Type | Required | Description |
| ------------------------------------------------ | ------- | -------- | ---------------------------------------------------------- |
|
`id`
| integer | yes | The ID of a project |
|
`approvals_before_merge`
| integer | no | How many approvals are required before an MR can be merged |
|
`reset_approvals_on_push`
| boolean | no | Reset approvals on a new push |
|
`disable_overriding_approvers_per_merge_request`
| boolean | no | Allow/Disallow overriding approvers per MR |
```
json
{
"approvers"
:
[
{
"user"
:
{
"id"
:
5
,
"name"
:
"John Doe6"
,
"username"
:
"user5"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80
\u
0026d=identicon"
,
"web_url"
:
"http://localhost/user5"
}
}
],
"approver_groups"
:
[
{
"group"
:
{
"id"
:
1
,
"name"
:
"group1"
,
"path"
:
"group1"
,
"description"
:
""
,
"visibility"
:
"public"
,
"lfs_enabled"
:
false
,
"avatar_url"
:
null
,
"web_url"
:
"http://localhost/groups/group1"
,
"request_access_enabled"
:
false
,
"full_name"
:
"group1"
,
"full_path"
:
"group1"
,
"parent_id"
:
null
,
"ldap_cn"
:
null
,
"ldap_access"
:
null
}
}
],
"approvals_before_merge"
:
2
,
"reset_approvals_on_push"
:
true
,
"disable_overriding_approvers_per_merge_request"
:
false
}
```
## Change allowed approvers globally for Project
>**Note:** This API endpoint is only available on 10.6 Starter and above.
If you are allowed to, you can change global approvers and approver groups using
the following endpoint:
```
PUT /projects/:id/approvers
```
**Important:**
Approvers and groups not in the request will be
**removed**
**Parameters:**
| Attribute | Type | Required | Description |
| -------------------- | ------- | -------- | --------------------------------------------------- |
|
`id`
| integer | yes | The ID of a project |
|
`approver_ids`
| Array | yes | An array of User IDs that can approve MRs |
|
`approver_group_ids`
| Array | yes | An array of Group IDs whose members can approve MRs |
```
json
{
"approvers"
:
[
{
"user"
:
{
"id"
:
5
,
"name"
:
"John Doe6"
,
"username"
:
"user5"
,
"state"
:
"active"
,
"avatar_url"
:
"https://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80
\u
0026d=identicon"
,
"web_url"
:
"http://localhost/user5"
}
}
],
"approver_groups"
:
[
{
"group"
:
{
"id"
:
1
,
"name"
:
"group1"
,
"path"
:
"group1"
,
"description"
:
""
,
"visibility"
:
"public"
,
"lfs_enabled"
:
false
,
"avatar_url"
:
null
,
"web_url"
:
"http://localhost/groups/group1"
,
"request_access_enabled"
:
false
,
"full_name"
:
"group1"
,
"full_path"
:
"group1"
,
"parent_id"
:
null
,
"ldap_cn"
:
null
,
"ldap_access"
:
null
}
}
],
"approvals_before_merge"
:
2
,
"reset_approvals_on_push"
:
true
,
"disable_overriding_approvers_per_merge_request"
:
false
}
```
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