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
16024dad
Commit
16024dad
authored
Nov 03, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
danger: Don't override already-set scoped labels
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
7304f86c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
danger/specialization_labels/Dangerfile
danger/specialization_labels/Dangerfile
+7
-1
No files found.
danger/specialization_labels/Dangerfile
View file @
16024dad
...
...
@@ -15,8 +15,14 @@ SPECIALIZATIONS = {
labels_to_add
=
project_helper
.
changes_by_category
.
each_with_object
([])
do
|
(
category
,
_changes
),
memo
|
label
=
SPECIALIZATIONS
[
category
]
next
unless
label
next
if
gitlab
.
mr_labels
.
include?
(
label
)
memo
<<
label
if
label
&&
!
gitlab
.
mr_labels
.
include?
(
label
)
# Don't override already-set scoped labels.
label_scope
=
label
.
split
(
'::'
)[
0
...-
1
].
join
(
'::'
)
next
if
!
label_scope
.
empty?
&&
gitlab
.
mr_labels
.
any?
{
|
mr_label
|
mr_label
.
start_with?
(
label_scope
)
}
memo
<<
label
end
project_helper
.
labels_to_add
.
concat
(
labels_to_add
)
if
labels_to_add
.
any?
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