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
2e83665e
Commit
2e83665e
authored
Feb 13, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Promote project labels to group labels
parent
6ba51d69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
changelogs/unreleased/57657-promote-label-to-group-label-via-api-endpoint.yml
...d/57657-promote-label-to-group-label-via-api-endpoint.yml
+5
-0
lib/api/labels.rb
lib/api/labels.rb
+25
-0
No files found.
changelogs/unreleased/57657-promote-label-to-group-label-via-api-endpoint.yml
0 → 100644
View file @
2e83665e
---
title
:
'
API:
Promote
project
labels
to
group
labels'
merge_request
:
25218
author
:
Robert Schilling
type
:
added
lib/api/labels.rb
View file @
2e83665e
...
@@ -62,6 +62,31 @@ module API
...
@@ -62,6 +62,31 @@ module API
delete
':id/labels'
do
delete
':id/labels'
do
delete_label
(
user_project
)
delete_label
(
user_project
)
end
end
desc
'Promote a label to a group label'
do
detail
'This feature was added in GitLab 11.9'
success
Entities
::
GroupLabel
end
params
do
requires
:name
,
type:
String
,
desc:
'The name of the label to be promoted'
end
post
':id/labels/promote'
do
authorize!
:admin_label
,
parent
label
=
find_label
(
parent
,
params
[
:name
],
include_ancestor_groups:
false
)
begin
group_label
=
Labels
::
PromoteService
.
new
(
user_project
,
current_user
).
execute
(
label
)
if
group_label
present
group_label
,
with:
Entities
::
GroupLabel
,
current_user:
current_user
,
parent:
user_project
.
group
else
render_api_error!
(
'Failed to promote project label to group label'
,
400
)
end
rescue
=>
error
render_api_error!
(
error
.
to_s
,
400
)
end
end
end
end
end
end
end
end
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