Commit eb5c2807 authored by Tiago Botelho's avatar Tiago Botelho

Removes batch_review_notification feature flag

This feature flag was being used as a gatekeeper
for the one notification for every batch review
feature.

We no longer require the feature flag since the
code is working as expected
parent 3bb830f2
...@@ -27,21 +27,15 @@ module DraftNotes ...@@ -27,21 +27,15 @@ module DraftNotes
def publish_draft_notes def publish_draft_notes
return if draft_notes.empty? return if draft_notes.empty?
if Feature.enabled?(:batch_review_notification, project)
review = Review.create!(author: current_user, merge_request: merge_request, project: project) review = Review.create!(author: current_user, merge_request: merge_request, project: project)
draft_notes.map do |draft_note| draft_notes.map do |draft_note|
draft_note.review = review draft_note.review = review
create_note_from_draft(draft_note) create_note_from_draft(draft_note)
end end
notification_service.async.new_review(review)
else
draft_notes.each(&method(:create_note_from_draft))
end
draft_notes.delete_all draft_notes.delete_all
notification_service.async.new_review(review)
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(merge_request) MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(merge_request)
end end
......
...@@ -65,7 +65,6 @@ describe DraftNotes::PublishService do ...@@ -65,7 +65,6 @@ describe DraftNotes::PublishService do
expect(DraftNote.count).to eq(0) expect(DraftNote.count).to eq(0)
end end
context 'when batch_review_notification feature is enabled' do
it 'sends batch notification' do it 'sends batch notification' do
expect_next_instance_of(NotificationService) do |notification_service| expect_next_instance_of(NotificationService) do |notification_service|
expect(notification_service).to receive_message_chain(:async, :new_review).with(kind_of(Review)) expect(notification_service).to receive_message_chain(:async, :new_review).with(kind_of(Review))
...@@ -75,21 +74,6 @@ describe DraftNotes::PublishService do ...@@ -75,21 +74,6 @@ describe DraftNotes::PublishService do
end end
end end
context 'when batch_review_notification feature is disabled' do
it 'send a notification for each note' do
stub_feature_flags(batch_review_notification: false)
2.times do
expect_next_instance_of(NotificationService) do |notification_service|
expect(notification_service).to receive(:new_note).with(kind_of(Note))
end
end
publish
end
end
end
it 'only publishes the draft notes belonging to the current user' do it 'only publishes the draft notes belonging to the current user' do
other_user = create(:user) other_user = create(:user)
project.add_maintainer(other_user) project.add_maintainer(other_user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment