diff options
author | twonegatives <whitewhiteheaven@gmail.com> | 2016-12-13 00:55:33 +0300 |
---|---|---|
committer | twonegatives <whitewhiteheaven@gmail.com> | 2016-12-16 21:16:24 +0300 |
commit | f14228f0f2f69a967c483e4aa4ef1568e5fdc49b (patch) | |
tree | 3654c8605a91e5a6b1d6aad5ddd94ea9a6ce97bc /app/services/todo_service.rb | |
parent | b1120fc3e702daac001d000263eac79f4629b595 (diff) |
Notify the user who set auto-merge when a build fails
Diffstat (limited to 'app/services/todo_service.rb')
-rw-r--r-- | app/services/todo_service.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index f8e6b2ef094..d67c166275a 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -98,10 +98,12 @@ class TodoService # When a build fails on the HEAD of a merge request we should: # - # * create a todo for that user to fix it + # * create a todo for author of MR to fix it + # * create a todo for merge_user to keep an eye on it # def merge_request_build_failed(merge_request) - create_build_failed_todo(merge_request) + create_build_failed_todo(merge_request, merge_request.author) + create_build_failed_todo(merge_request, merge_request.merge_user) if merge_request.merge_when_build_succeeds? end # When a new commit is pushed to a merge request we should: @@ -115,9 +117,11 @@ class TodoService # When a build is retried to a merge request we should: # # * mark all pending todos related to the merge request for the author as done + # * mark all pending todos related to the merge request for the merge_user as done # def merge_request_build_retried(merge_request) mark_pending_todos_as_done(merge_request, merge_request.author) + mark_pending_todos_as_done(merge_request, merge_request.merge_user) if merge_request.merge_when_build_succeeds? end # When create a note we should: @@ -236,10 +240,9 @@ class TodoService create_todos(mentioned_users, attributes) end - def create_build_failed_todo(merge_request) - author = merge_request.author - attributes = attributes_for_todo(merge_request.project, merge_request, author, Todo::BUILD_FAILED) - create_todos(author, attributes) + def create_build_failed_todo(merge_request, todo_author) + attributes = attributes_for_todo(merge_request.project, merge_request, todo_author, Todo::BUILD_FAILED) + create_todos(todo_author, attributes) end def attributes_for_target(target) |