diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-15 20:08:27 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-10-09 16:07:10 +0300 |
commit | 67d5ca9f9220e5572f3fa6d0d8290cd7b802f02f (patch) | |
tree | d424fc71d20847c8a7c0314ff081f3d2ed9afbe4 /app/services/merge_requests/base_service.rb | |
parent | f277fa14094e5515e2317d2baa1fa0bfb95966da (diff) |
Include the changes in issuable webhook payloads
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/services/merge_requests/base_service.rb')
-rw-r--r-- | app/services/merge_requests/base_service.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/services/merge_requests/base_service.rb b/app/services/merge_requests/base_service.rb index 35ccff26262..7cdb45ca552 100644 --- a/app/services/merge_requests/base_service.rb +++ b/app/services/merge_requests/base_service.rb @@ -18,19 +18,19 @@ module MergeRequests super if changed_title end - def hook_data(merge_request, action, oldrev = nil) - hook_data = merge_request.to_hook_data(current_user) - hook_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(merge_request) + def hook_data(merge_request, action, old_rev: nil, old_labels: []) + hook_data = merge_request.to_hook_data(current_user, old_labels: old_labels) hook_data[:object_attributes][:action] = action - if oldrev && !Gitlab::Git.blank_ref?(oldrev) - hook_data[:object_attributes][:oldrev] = oldrev + if old_rev && !Gitlab::Git.blank_ref?(old_rev) + hook_data[:object_attributes][:oldrev] = old_rev end + hook_data end - def execute_hooks(merge_request, action = 'open', oldrev = nil) + def execute_hooks(merge_request, action = 'open', old_rev: nil, old_labels: []) if merge_request.project - merge_data = hook_data(merge_request, action, oldrev) + merge_data = hook_data(merge_request, action, old_rev: old_rev, old_labels: old_labels) merge_request.project.execute_hooks(merge_data, :merge_request_hooks) merge_request.project.execute_services(merge_data, :merge_request_hooks) end |