1123057ab7
When a merge request can only be merged when all discussions are resolved. This feature allows to easily delegate those discussions to a new issue, while marking them as resolved in the merge request. The user is presented with a new issue, prepared with mentions of all unresolved discussions, including the first unresolved note of the discussion, time and link to the note. When the issue is created, the discussions in the merge request will get a system note directing the user to the newly created issue.
31 lines
885 B
Ruby
31 lines
885 B
Ruby
module Issues
|
|
class BaseService < ::IssuableBaseService
|
|
attr_reader :merge_request_for_resolving_discussions
|
|
|
|
def initialize(*args)
|
|
super
|
|
|
|
@merge_request_for_resolving_discussions ||= params.delete(:merge_request_for_resolving_discussions)
|
|
end
|
|
|
|
def hook_data(issue, action)
|
|
issue_data = issue.to_hook_data(current_user)
|
|
issue_url = Gitlab::UrlBuilder.build(issue)
|
|
issue_data[:object_attributes].merge!(url: issue_url, action: action)
|
|
issue_data
|
|
end
|
|
|
|
private
|
|
|
|
def filter_params
|
|
super(:issue)
|
|
end
|
|
|
|
def execute_hooks(issue, action = 'open')
|
|
issue_data = hook_data(issue, action)
|
|
hooks_scope = issue.confidential? ? :confidential_issue_hooks : :issue_hooks
|
|
issue.project.execute_hooks(issue_data, hooks_scope)
|
|
issue.project.execute_services(issue_data, hooks_scope)
|
|
end
|
|
end
|
|
end
|