summaryrefslogtreecommitdiff
path: root/danger/sidekiq_queues/Dangerfile
blob: b40be7a486ea5fc897d530347ed01c115fa11c3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

SCALABILITY_REVIEW_MESSAGE = <<~MSG
## Sidekiq queue changes

This merge request contains changes to Sidekiq queues. Please follow the [documentation on changing a queue's urgency](https://docs.gitlab.com/ee/development/sidekiq_style_guide.html#changing-a-queues-urgency).
MSG

ADDED_QUEUES_MESSAGE = <<~MSG
These queues were added:
MSG

CHANGED_QUEUES_MESSAGE = <<~MSG
These queues had their attributes changed:
MSG

if sidekiq_queues.added_queue_names.any? || sidekiq_queues.changed_queue_names.any?
  markdown(SCALABILITY_REVIEW_MESSAGE)

  if sidekiq_queues.added_queue_names.any?
    markdown(ADDED_QUEUES_MESSAGE + helper.markdown_list(sidekiq_queues.added_queue_names))
  end

  if sidekiq_queues.changed_queue_names.any?
    markdown(CHANGED_QUEUES_MESSAGE + helper.markdown_list(sidekiq_queues.changed_queue_names))
  end
end