Add target branches to JiraCommit initial merge request sync

In !43880 (merged) we added a worker that sends up to 400 existing merge requests to Jira when the Gitlab for Jira app is installed. The data contains only MR info, but no details about branches or commits.

Gitaly N+1 mitigation - add pause to sync loop

There are N+1 issues with Gitaly in retrieving this data (see #263240 (comment 465301685)).

There are some issues in &7658 to do with addressing the N+1.

But in the meantime, in this issue, we will slow the sync down to mitigate the effects of the Gitaly N+1 problems. We would hit Gitaly n times, and then pause for N seconds. For example, hit Gitaly 10 times then pause for 0.5s - but the exact variables can be determined when working on this issue.

Feature flag

This should be added behind a feature flag so we can monitor performance while rolling it out.

Availability & Testing

Suggestions:

  • update spec/workers/jira_connect/sync_project_worker_spec.rb to reflect the new additions to the request body for the sync request event.
  • run package-and-qa
Edited by Luke Duncalfe