Sync linked namespaces to Jira Cloud Dev Info API
After we have the namespaces linked to a Jira install from #9641 (closed), we need to handle the initial sync and subsequent updates when new commits, branches, and merge requests are added to the namespace.
The Dev Info API allows us to push these information through the POST /rest/devinfo/0.10/bulk
endpoint. This API is available in Jira Cloud. The API docs on the specific fields are a bit hard to find, here's a GIF to help navigate:
For GitLab.com, we can generate a JWT token from the shared secret we stored during app install to authenticate these requests. For self-hosted GitLab, we don't have definite information yet on authentication but the same API for pushing data applies.
For the initial sync, we need to decide how far back we want to sync and how we split these into multiple POST requests. Atlassian specially mentioned this because data sent here are processed async and might take a long time for them to show up if we send too much and start from the older ones.
We could also consider only sending commits, branches, and merge requests that has the Jira issue pattern (SOMEPROJ-123) in its name as these are the only ones that get linked to the Jira issues anyway.
For subsequent updates, it should work like webhooks where we push the data when a new commit, branch, or merge request is added. We could also consider scheduled syncs if real-time is not feasible.
For GitLab.com, this should also respect the enabled / disabled status of the Jira app installation.
Note: User needs to delete the old DVCS integration for the data here to show up. Atlassian may provide us with an API to do this for the user.