Issuables: Move some code from create services to Sidekiq workers

Merged Jarka Kadlecova requested to merge 32844-issuables-performance into master

What does this MR do?

It moves some code from Issues::CreateService and MergeRequests::CreateService to workers (NewIssueWorker, NewMergeRequestWorker) in order to improve performance.

This is the first part of improving performance when creating new issuables. There are probably more methods we can move (issuable.cache_merge_request_closes_issues!(current_user) for MRs or user_agent_detail_service.create for issues)

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Creating issuables is slow as described in the related issue. after_create takes reasonable amount of time and even moving only create_cross_references! should save some time. (

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#32844 (closed)

Edited by Jarka Kadlecova