Sync GitLab linked issue back to error tracking system
Background
Full discussion here: &2034 (comment 247322347)
We are adding the ability for users to create GitLab issues from errors shown in the Error Tracking page. The functionality to link errors to GitLab issues also exists in Sentry.
It would be ideal to sync the issue link back to Sentry where possible. If we don't, we risk user confusion - users might unknowingly link the same error to two different GitLab issues. It seems reasonable to expect that any link they create in GitLab might also exist in Sentry.
Deliverables
- Upon issue creation, link GitLab issue to error in Sentry.
- Add docs detailing the required setup.
Notes on required setup
Sentry allows only linking to GitLab issues that belong to the integrated GitLab project. Nothing on our end requires this integration to exist, or to be setup for the right project. We should ensure that the backend flow is resilient enough to handle these cases. If it's possible - detect that the integration is not set up and avoid creating the link in Sentry.
We should document that for best possible integration both GitLab's Sentry integration and Sentry's GitLab integration should be set up and pointing at each other's projects.