diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-03-26 16:02:37 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-03-26 16:02:37 +0000 |
commit | 6c8d4b80daf95e8028fd038a7d71036bd224a2c9 (patch) | |
tree | 6e49c044363b96a067c9c4e8b43078b78ce96a16 /app/services/merge_requests/refresh_service.rb | |
parent | a1cde68d208437a470267e28ccff66fe8be88c2e (diff) | |
parent | 99b01e23598e6b0b2bcae891939ea28c67f7b2e9 (diff) | |
download | gitlab-ce-6c8d4b80daf95e8028fd038a7d71036bd224a2c9.tar.gz |
Merge branch 'YarNayar/gitlab-ce-23460-send-email-when-pushing-more-commits-to-the-merge-request' into 'master'
Send notification emails when push to a merge request
Closes #23460
See merge request gitlab-org/gitlab-ce!17865
Diffstat (limited to 'app/services/merge_requests/refresh_service.rb')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index 18c40ce8992..1fb1796b56c 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -21,7 +21,7 @@ module MergeRequests comment_mr_branch_presence_changed end - comment_mr_with_commits + notify_about_push mark_mr_as_wip_from_commits execute_mr_web_hooks @@ -141,8 +141,8 @@ module MergeRequests end end - # Add comment about pushing new commits to merge requests - def comment_mr_with_commits + # Add comment about pushing new commits to merge requests and send nofitication emails + def notify_about_push return unless @commits.present? merge_requests_for_source_branch.each do |merge_request| @@ -155,6 +155,8 @@ module MergeRequests SystemNoteService.add_commits(merge_request, merge_request.project, @current_user, new_commits, existing_commits, @oldrev) + + notification_service.push_to_merge_request(merge_request, @current_user, new_commits: new_commits, existing_commits: existing_commits) end end |