diff options
Diffstat (limited to 'tooling')
-rw-r--r-- | tooling/danger/project_helper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tooling/danger/project_helper.rb b/tooling/danger/project_helper.rb index b60a3aa1adc..7aac0de0b6b 100644 --- a/tooling/danger/project_helper.rb +++ b/tooling/danger/project_helper.rb @@ -5,6 +5,7 @@ module Tooling module ProjectHelper LOCAL_RULES ||= %w[ changelog + changes_size commit_messages database datateam @@ -175,12 +176,26 @@ module Tooling ee? ? 'gitlab' : 'gitlab-foss' end + def missing_database_labels(current_mr_labels) + labels = if has_database_scoped_labels?(current_mr_labels) + ['database'] + else + ['database', 'database::review pending'] + end + + labels - current_mr_labels + end + private def ee? # Support former project name for `dev` and support local Danger run %w[gitlab gitlab-ee].include?(ENV['CI_PROJECT_NAME']) || Dir.exist?(File.expand_path('../../../ee', __dir__)) end + + def has_database_scoped_labels?(current_mr_labels) + current_mr_labels.any? { |label| label.start_with?('database::') } + end end end end |