Welcome to mirror list, hosted at ThFree Co, Russian Federation.

new_review.rb « builder « notification_recipients « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3b1296f696706046812e9e30908edcd3cb6ea860 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# frozen_string_literal: true

module NotificationRecipients
  module Builder
    class NewReview < Base
      attr_reader :review
      def initialize(review)
        @review = review
      end

      def target
        review.merge_request
      end

      def project
        review.project
      end

      def group
        project.group
      end

      def build!
        add_participants(review.author)
        add_mentions(review.author, target: review)
        add_project_watchers
        add_custom_notifications
        add_subscribed_users
      end

      # A new review is a batch of new notes
      # therefore new_note subscribers should also
      # receive incoming new reviews
      def custom_action
        :new_note
      end

      def acting_user
        review.author
      end
    end
  end
end