Add tag_list param to project api
This commit is contained in:
parent
8039b9c3c6
commit
0684073d1e
4 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Add tag_list param to project api
|
||||||
|
merge_request: 11799
|
||||||
|
author: Ivan Chernov
|
|
@ -473,6 +473,7 @@ Parameters:
|
||||||
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | Set whether merge requests can only be merged when all the discussions are resolved |
|
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | Set whether merge requests can only be merged when all the discussions are resolved |
|
||||||
| `lfs_enabled` | boolean | no | Enable LFS |
|
| `lfs_enabled` | boolean | no | Enable LFS |
|
||||||
| `request_access_enabled` | boolean | no | Allow users to request member access |
|
| `request_access_enabled` | boolean | no | Allow users to request member access |
|
||||||
|
| `tag_list` | array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
|
||||||
|
|
||||||
### Create project for user
|
### Create project for user
|
||||||
|
|
||||||
|
@ -506,6 +507,7 @@ Parameters:
|
||||||
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | Set whether merge requests can only be merged when all the discussions are resolved |
|
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | Set whether merge requests can only be merged when all the discussions are resolved |
|
||||||
| `lfs_enabled` | boolean | no | Enable LFS |
|
| `lfs_enabled` | boolean | no | Enable LFS |
|
||||||
| `request_access_enabled` | boolean | no | Allow users to request member access |
|
| `request_access_enabled` | boolean | no | Allow users to request member access |
|
||||||
|
| `tag_list` | array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
|
||||||
|
|
||||||
### Edit project
|
### Edit project
|
||||||
|
|
||||||
|
@ -538,6 +540,7 @@ Parameters:
|
||||||
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | Set whether merge requests can only be merged when all the discussions are resolved |
|
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | Set whether merge requests can only be merged when all the discussions are resolved |
|
||||||
| `lfs_enabled` | boolean | no | Enable LFS |
|
| `lfs_enabled` | boolean | no | Enable LFS |
|
||||||
| `request_access_enabled` | boolean | no | Allow users to request member access |
|
| `request_access_enabled` | boolean | no | Allow users to request member access |
|
||||||
|
| `tag_list` | array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
|
||||||
|
|
||||||
### Fork project
|
### Fork project
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ module API
|
||||||
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
|
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
|
||||||
optional :only_allow_merge_if_pipeline_succeeds, type: Boolean, desc: 'Only allow to merge if builds succeed'
|
optional :only_allow_merge_if_pipeline_succeeds, type: Boolean, desc: 'Only allow to merge if builds succeed'
|
||||||
optional :only_allow_merge_if_all_discussions_are_resolved, type: Boolean, desc: 'Only allow to merge if all discussions are resolved'
|
optional :only_allow_merge_if_all_discussions_are_resolved, type: Boolean, desc: 'Only allow to merge if all discussions are resolved'
|
||||||
|
optional :tag_list, type: Array[String], desc: 'The list of tags for a project'
|
||||||
end
|
end
|
||||||
|
|
||||||
params :optional_params do
|
params :optional_params do
|
||||||
|
@ -231,6 +232,7 @@ module API
|
||||||
:request_access_enabled,
|
:request_access_enabled,
|
||||||
:shared_runners_enabled,
|
:shared_runners_enabled,
|
||||||
:snippets_enabled,
|
:snippets_enabled,
|
||||||
|
:tag_list,
|
||||||
:visibility,
|
:visibility,
|
||||||
:wiki_enabled
|
:wiki_enabled
|
||||||
]
|
]
|
||||||
|
|
|
@ -390,6 +390,14 @@ describe API::Projects do
|
||||||
expect(json_response['visibility']).to eq('private')
|
expect(json_response['visibility']).to eq('private')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'sets tag list to a project' do
|
||||||
|
project = attributes_for(:project, tag_list: %w[tagFirst tagSecond])
|
||||||
|
|
||||||
|
post api('/projects', user), project
|
||||||
|
|
||||||
|
expect(json_response['tag_list']).to eq(%w[tagFirst tagSecond])
|
||||||
|
end
|
||||||
|
|
||||||
it 'sets a project as allowing merge even if build fails' do
|
it 'sets a project as allowing merge even if build fails' do
|
||||||
project = attributes_for(:project, { only_allow_merge_if_pipeline_succeeds: false })
|
project = attributes_for(:project, { only_allow_merge_if_pipeline_succeeds: false })
|
||||||
post api('/projects', user), project
|
post api('/projects', user), project
|
||||||
|
|
Loading…
Reference in a new issue