summaryrefslogtreecommitdiff
path: root/Dangerfile
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
commitaee0a117a889461ce8ced6fcf73207fe017f1d99 (patch)
tree891d9ef189227a8445d83f35c1b0fc99573f4380 /Dangerfile
parent8d46af3258650d305f53b819eabf7ab18d22f59e (diff)
downloadgitlab-ce-aee0a117a889461ce8ced6fcf73207fe017f1d99.tar.gz
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'Dangerfile')
-rw-r--r--Dangerfile20
1 files changed, 15 insertions, 5 deletions
diff --git a/Dangerfile b/Dangerfile
index 212097f6a68..ca729f1b941 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -2,14 +2,24 @@
require 'gitlab-dangerfiles'
-gitlab_dangerfiles = Gitlab::Dangerfiles::Engine.new(self)
-gitlab_dangerfiles.import_plugins
+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
-return if helper.release_automation?
+project_name = ee? ? 'gitlab' : 'gitlab-foss'
-danger.import_plugin('danger/plugins/*.rb')
+Gitlab::Dangerfiles.for_project(self, project_name) do |gitlab_dangerfiles|
+ gitlab_dangerfiles.import_plugins
-gitlab_dangerfiles.import_dangerfiles
+ unless helper.release_automation?
+ danger.import_plugin('danger/plugins/*.rb')
+ gitlab_dangerfiles.import_dangerfiles(except: %w[simple_roulette])
+ gitlab_dangerfiles.config.files_to_category = ProjectHelper::CATEGORIES
+ end
+end
+
+return if helper.release_automation?
project_helper.rule_names.each do |rule|
danger.import_dangerfile(path: File.join('danger', rule))