-auto_devops_message=s_("AutoDevOps|The Auto DevOps pipeline has been enabled and will be used if no alternative CI configuration file is found. %{more_information_link}")%{more_information_link: more_information_link}
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `name` | string | yes | The name of the label |
| `label_id` | integer or string | yes | The ID or title of a group's label. |
| `new_name` | string | no | The new name of the label |
| `color` | string | no | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) |
| `description` | string | no | The description of the label. |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `label_id` | integer | yes (or `name`) | The id of the existing label |
| `name` | string | yes (or `label_id`) | The name of the existing label |
| `label_id` | integer or string | yes | The ID or title of a group's label. |
| `new_name` | string | yes if `color` is not provided | The new name of the label |
| `color` | string | yes if `new_name` is not provided | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) |
| `description` | string | no | The new description of the label |
| `priority` | integer | no | The new priority of the label. Must be greater or equal than zero or `null` to remove the priority. |
```bash
curl --request PUT --data"name=documentation&new_name=docs&color=#8E44AD&description=Documentation"--header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/1/labels"
curl --request PUT --data"new_name=docs&color=#8E44AD&description=Documentation"--header"PRIVATE-TOKEN: <your_access_token>""https://gitlab.example.com/api/v4/projects/1/labels/documentation"
```
Example response:
...
...
@@ -187,6 +223,8 @@ Example response:
}
```
NOTE: **Note:** An older endpoint `PUT /projects/:id/labels` with `name` or `label_id` in the params is still available, but deprecated.
## Promote a project label to a group label
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/25218) in GitLab 12.3.
@@ -149,8 +149,13 @@ You can find the groups listed in the [Product Stages, Groups, and Categories](h
We use the term group to map down product requirements from our product stages.
As a team needs some way to collect the work their members are planning to be assigned to, we use the `~group::` labels to do so.
Normally there is a 1:1 relationship between Stage labels and Group labels. In the spirit of "Everyone can contribute",
any issue can be picked up by any group, depending on current priorities. For example, an issue labeled ~"devops::create" may be picked up by the ~"group::access" group.
Normally there is a 1:1 relationship between Stage labels and Group labels. In
the spirit of "Everyone can contribute", any issue can be picked up by any group,
depending on current priorities. When picking up an issue belonging to a different
group, it should be relabelled. For example, if an issue labelled ~"devops::create"
and ~"group::knowledge" is picked up by someone in the Access group of the Plan stage,
the issue should be relabelled as ~"group::access" while keeping the original
~"devops::create" unchanged.
We also use stage and group labels to help quantify our [throughput](https://about.gitlab.com/handbook/engineering/management/throughput/).
Please read [Stage and Group labels in Throughtput](https://about.gitlab.com/handbook/engineering/management/throughput/#stage-and-group-labels-in-throughput) for more information on how the labels are used in this context.
-**Do**: Split tests across separate files, unless the tests share expensive setup.
-**Don't**: Put new tests in an existing file without considering the impact on parallelization.
## Limit the use of `before(:all)` hook
Limit the use of `before(:all)` to perform setup tasks with only API calls, non UI operations
or basic UI operations such as login.
We use [`capybara-screenshot`](https://github.com/mattheworiordan/capybara-screenshot) library to automatically save screenshots on failures.
This library [saves the screenshots in the RSpec's `after` hook](https://github.com/mattheworiordan/capybara-screenshot/blob/master/lib/capybara-screenshot/rspec.rb#L97).
[If there is a failure in `before(:all)`, the `after` hook is not called](https://github.com/rspec/rspec-core/pull/2652/files#diff-5e04af96d5156e787f28d519a8c99615R148) and so the screenshots are not saved.
Given this fact, we should limit the use of `before(:all)` to only those operations where a screenshot is not
necessary in case of failure and QA logs would be enough for debugging.
desc'Update an existing label. At least one optional parameter is required.'do
detail'This feature was added in GitLab 11.8'
detail'This feature was added in GitLab 11.8 and deprecated in GitLab 12.4.'
successEntities::GroupLabel
end
paramsdo
requires:name,type: String,desc: 'The name of the label to be updated'
optional:new_name,type: String,desc: 'The new name of the label'
optional:color,type: String,desc: "The new color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names"
optional:description,type: String,desc: 'The new description of label'
at_least_one_of:new_name,:color,:description
optional:label_id,type: Integer,desc: 'The id of the label to be updated'
optional:name,type: String,desc: 'The name of the label to be updated'
use:group_label_update_params
exactly_one_of:label_id,:name
end
put':id/labels'do
update_label(user_group,Entities::GroupLabel)
end
desc'Delete an existing label'do
detail'This feature was added in GitLab 11.8'
detail'This feature was added in GitLab 11.8 and deprecated in GitLab 12.4.'
successEntities::GroupLabel
end
paramsdo
...
...
@@ -62,6 +73,29 @@ module API
delete':id/labels'do
delete_label(user_group)
end
desc'Update an existing label. At least one optional parameter is required.'do
detail'This feature was added in GitLab 12.4.'
successEntities::GroupLabel
end
paramsdo
requires:name,type: String,desc: 'The name or id of the label to be updated'
use:group_label_update_params
end
put':id/labels/:name'do
update_label(user_group,Entities::GroupLabel)
end
desc'Delete an existing label'do
detail'This feature was added in GitLab 12.4.'
successEntities::GroupLabel
end
paramsdo
requires:name,type: String,desc: 'The name or id of the label to be deleted'
optional:description,type: String,desc: 'The description of label to be created'
end
params:label_update_paramsdo
optional:new_name,type: String,desc: 'The new name of the label'
optional:color,type: String,desc: "The new color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names"
optional:description,type: String,desc: 'The new description of label'
end
params:project_label_update_paramsdo
use:label_update_params
optional:priority,type: Integer,desc: 'The priority of the label',allow_blank: true
desc'Update an existing label. At least one optional parameter is required.'do
detail'This feature was deprecated in GitLab 12.4.'
successEntities::ProjectLabel
end
paramsdo
optional:label_id,type: Integer,desc: 'The id of the label to be updated'
optional:name,type: String,desc: 'The name of the label to be updated'
optional:new_name,type: String,desc: 'The new name of the label'
optional:color,type: String,desc: "The new color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the allowed CSS color names"
optional:description,type: String,desc: 'The new description of label'
optional:priority,type: Integer,desc: 'The priority of the label',allow_blank: true
raiseUnknownTestLevelError,"Test level for #{file_path} couldn't be set. Please rename the file properly or change the test level detection regexes in #{__FILE__}."
end
end
private
deffolders_pattern(level)
caselevel
# Geo specs aren't in a specific folder, but they all have the :geo tag, so we must search for them globally
when:all,:geo
'**'
else
"{#{TEST_LEVEL_FOLDERS.fetch(level).join(',')}}"
end
end
deffolders_regex(level)
caselevel
# Geo specs aren't in a specific folder, but they all have the :geo tag, so we must search for them globally