diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/services/draft_notes/publish_service.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/services/draft_notes/publish_service.rb')
-rw-r--r-- | app/services/draft_notes/publish_service.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/services/draft_notes/publish_service.rb b/app/services/draft_notes/publish_service.rb index a82a6e22a5a..fab7a227e7d 100644 --- a/app/services/draft_notes/publish_service.rb +++ b/app/services/draft_notes/publish_service.rb @@ -34,7 +34,12 @@ module DraftNotes created_notes = draft_notes.map do |draft_note| draft_note.review = review - create_note_from_draft(draft_note, skip_capture_diff_note_position: true, skip_keep_around_commits: true) + create_note_from_draft( + draft_note, + skip_capture_diff_note_position: true, + skip_keep_around_commits: true, + skip_merge_status_trigger: true + ) end capture_diff_note_positions(created_notes) @@ -43,16 +48,18 @@ module DraftNotes set_reviewed notification_service.async.new_review(review) MergeRequests::ResolvedDiscussionNotificationService.new(project: project, current_user: current_user).execute(merge_request) + GraphqlTriggers.merge_request_merge_status_updated(merge_request) end - def create_note_from_draft(draft, skip_capture_diff_note_position: false, skip_keep_around_commits: false) + def create_note_from_draft(draft, skip_capture_diff_note_position: false, skip_keep_around_commits: false, skip_merge_status_trigger: false) # Make sure the diff file is unfolded in order to find the correct line # codes. draft.diff_file&.unfold_diff_lines(draft.original_position) note_params = draft.publish_params.merge(skip_keep_around_commits: skip_keep_around_commits) note = Notes::CreateService.new(draft.project, draft.author, note_params).execute( - skip_capture_diff_note_position: skip_capture_diff_note_position + skip_capture_diff_note_position: skip_capture_diff_note_position, + skip_merge_status_trigger: skip_merge_status_trigger ) set_discussion_resolve_status(note, draft) |