Draft: Frontend: reconcile created Jira issues
What does this MR do and why?
This MR implements the frontend support for Jira's search and reconcile pattern to ensure newly created Jira issues appear immediately in the vulnerability related issues list.
Problem
Jira's /rest/api/3/search/jql endpoint (that we switched to in !206815 (merged)) uses eventual consistency, meaning newly created issues don't appear immediately in search results. When users create a Jira issue from a GitLab vulnerability, the issue sometimes won't show up in the related issues list until the page is refreshed.
Solution
This MR implements the frontend portion of Atlassian's recommended "search and reconcile" pattern, building on the backend support added in [insert backend MR link]:
-
Receive the issue ID: The
CreateJiraIssuecomponent now receives thejiraIssueIdfrom the GraphQL mutation response -
Pass it through: The component emits the issue ID in the
mutatedevent -
Reconcile on fetch: The
RelatedJiraIssuescomponent passes this ID as thereconcileIssuesparameter when immediately fetching the updated related issues list
The reconcileIssues parameter tells Jira's search endpoint: "I expect these issue IDs to exist, so if they're not in your index yet, please include them anyway." This ensures newly created issues appear immediately in the UI without requiring a page refresh.
References
- !206815 (comment 2792137174) (design discussion to split this out)
- !207768 (backend MR)
- #569792 (closed) (original issue)
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- In GDK, select a project and configure the Jira integration
- See gdk.test_3000_gitlab-org_gitlab-test_-_settings_integrations_jira_edit for the settings
- If you require Jira Cloud credentials, I'm happy to share mine. Please contact me in Slack.
- If you don't have vulnerabilities in the project, use
bundle exec rake gitlab:seed:vulnerabilitiesto seed some. - Try to create a Jira issue for a vulnerability. The created issue should always appear in the related Jira issues component.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.