summaryrefslogtreecommitdiff
path: root/danger
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-04 03:13:32 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-04 03:13:32 +0000
commit96e9edba8a8898045daca33ae7dc3f03aa5b0677 (patch)
tree282e0acccde9ba825e873cc865b2b9966aa91eaa /danger
parent4e86ca506d67f27cb4ca93b47efc53adc1c237a6 (diff)
downloadgitlab-ce-96e9edba8a8898045daca33ae7dc3f03aa5b0677.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'danger')
-rw-r--r--danger/specialization_labels/Dangerfile8
1 files changed, 7 insertions, 1 deletions
diff --git a/danger/specialization_labels/Dangerfile b/danger/specialization_labels/Dangerfile
index ec79611d93d..8da00fcd6d9 100644
--- a/danger/specialization_labels/Dangerfile
+++ b/danger/specialization_labels/Dangerfile
@@ -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?