summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-19 10:31:56 +0000
committerRémy Coutable <remy@rymai.me>2016-07-19 12:48:28 +0200
commit6300f901d9f44b401e09f0f765d1d6e43b96802b (patch)
tree6a97dc01859e464ddbdd32abdb387c766cf05c8f /doc
parenta8250cd0bbedbb97c4acb82028c767653a211433 (diff)
downloadgitlab-ce-6300f901d9f44b401e09f0f765d1d6e43b96802b.tar.gz
Merge branch 'api-dev-can-push' into 'master'
API: Expose 'developers_can_push' for branches ## What does this MR do? Adds support for the `developers_can_push` flag for the branches API. It also supports creating protected branches with that flag. ## Are there points in the code the reviewer needs to double check? The API call requires an optional boolean parameter `developers_can_push`. If it is not either `true` or `false`, it should not update the value. I'm not sure if this is the right way to do it. Right now it always returns `200`. Maybe the `PUT` method should return different status codes depending if it really created or updated a branch. ## What are the relevant issue numbers? Closes #12735 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5208
Diffstat (limited to 'doc')
-rw-r--r--doc/api/branches.md20
1 files changed, 16 insertions, 4 deletions
diff --git a/doc/api/branches.md b/doc/api/branches.md
index abc4732c395..dbe8306c66f 100644
--- a/doc/api/branches.md
+++ b/doc/api/branches.md
@@ -23,6 +23,8 @@ Example response:
{
"name": "master",
"protected": true,
+ "developers_can_push": false,
+ "developers_can_merge": false,
"commit": {
"author_email": "john@example.com",
"author_name": "John Smith",
@@ -64,6 +66,8 @@ Example response:
{
"name": "master",
"protected": true,
+ "developers_can_push": false,
+ "developers_can_merge": false,
"commit": {
"author_email": "john@example.com",
"author_name": "John Smith",
@@ -91,13 +95,15 @@ PUT /projects/:id/repository/branches/:branch/protect
```
```bash
-curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/repository/branches/master/protect
+curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/repository/branches/master/protect?developers_can_push=true&developers_can_merge=true
```
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer | yes | The ID of a project |
| `branch` | string | yes | The name of the branch |
+| `developers_can_push` | boolean | no | Flag if developers can push to the branch |
+| `developers_can_merge` | boolean | no | Flag if developers can merge to the branch |
Example response:
@@ -117,7 +123,9 @@ Example response:
]
},
"name": "master",
- "protected": true
+ "protected": true,
+ "developers_can_push": true,
+ "developers_can_merge": true
}
```
@@ -158,7 +166,9 @@ Example response:
]
},
"name": "master",
- "protected": false
+ "protected": false,
+ "developers_can_push": false,
+ "developers_can_merge": false
}
```
@@ -196,7 +206,9 @@ Example response:
]
},
"name": "newbranch",
- "protected": false
+ "protected": false,
+ "developers_can_push": false,
+ "developers_can_merge": false
}
```