2019-04-24 08:08:33 -04:00
|
|
|
# frozen_string_literal: true
|
2019-09-06 07:21:53 -04:00
|
|
|
|
2021-01-20 07:11:06 -05:00
|
|
|
require_relative 'tooling/gitlab_danger'
|
|
|
|
require_relative 'tooling/danger/request_helper'
|
2019-09-06 07:21:53 -04:00
|
|
|
|
2018-10-16 09:56:03 -04:00
|
|
|
danger.import_plugin('danger/plugins/helper.rb')
|
2019-05-29 10:38:26 -04:00
|
|
|
danger.import_plugin('danger/plugins/roulette.rb')
|
2019-12-12 10:08:41 -05:00
|
|
|
danger.import_plugin('danger/plugins/changelog.rb')
|
2020-06-26 11:08:45 -04:00
|
|
|
danger.import_plugin('danger/plugins/sidekiq_queues.rb')
|
2019-04-04 07:26:01 -04:00
|
|
|
|
2020-05-25 08:08:23 -04:00
|
|
|
return if helper.release_automation?
|
|
|
|
|
|
|
|
gitlab_danger = GitlabDanger.new(helper.gitlab_helper)
|
|
|
|
|
|
|
|
gitlab_danger.rule_names.each do |file|
|
|
|
|
danger.import_dangerfile(path: File.join('danger', file))
|
2019-04-04 07:26:01 -04:00
|
|
|
end
|
2020-05-25 08:08:23 -04:00
|
|
|
|
2020-05-26 08:08:22 -04:00
|
|
|
anything_to_post = status_report.values.any? { |data| data.any? }
|
|
|
|
|
|
|
|
if gitlab_danger.ci? && anything_to_post
|
|
|
|
markdown("**If needed, you can retry the [`danger-review` job](#{ENV['CI_JOB_URL']}) that generated this comment.**")
|
|
|
|
end
|