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
9d72822b
Commit
9d72822b
authored
Jul 06, 2020
by
Alex Kalderimis
Committed by
Alex Kalderimis
Oct 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge requests: use GlobalID scalar
parent
13e00158
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
app/graphql/mutations/merge_requests/set_labels.rb
app/graphql/mutations/merge_requests/set_labels.rb
+3
-9
No files found.
app/graphql/mutations/merge_requests/set_labels.rb
View file @
9d72822b
...
...
@@ -6,7 +6,7 @@ module Mutations
graphql_name
'MergeRequestSetLabels'
argument
:label_ids
,
[
GraphQL
::
ID_TYPE
],
[
::
Types
::
GlobalIDType
[
Label
]
],
required:
true
,
description:
<<~
DESC
The Label IDs to set. Replaces existing labels by default.
...
...
@@ -23,10 +23,8 @@ module Mutations
merge_request
=
authorized_find!
(
project_path:
project_path
,
iid:
iid
)
project
=
merge_request
.
project
label_ids
=
label_ids
.
map
{
|
gid
|
GlobalID
.
parse
(
gid
)
}
.
select
(
&
method
(
:label_descendant?
))
.
map
(
&
:model_id
)
# MergeRequests::UpdateService expects integers
# MergeRequests::UpdateService expects integers
label_ids
=
label_ids
.
compact
.
map
(
&
:model_id
)
attribute_name
=
case
operation_mode
when
Types
::
MutationOperationModeEnum
.
enum
[
:append
]
...
...
@@ -45,10 +43,6 @@ module Mutations
errors:
errors_on_object
(
merge_request
)
}
end
def
label_descendant?
(
gid
)
gid
&
.
model_class
&
.
ancestors
&
.
include?
(
Label
)
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