Add error tracking widget to work items
What does this MR do and why?
Add the error tracking widget to work items, following the guide: https://docs.gitlab.com/ee/development/work_items_widgets.html#creating-a-new-backend-widget
When the error tracking feature is enabled, we can create work items from errors. This will create a work item that will have one sentry_issue. In order to display the stack trace of the error in the work item show page, we are adding an error tracking widget as a wrapper on the sentry_issue model and expose the identifier thought graphQL API.
- There will be a follow up MR, adding the stack trace into the graphQL resource
- At the moment, we will use the legacy services for creating the issue.
Database
https://console.postgres.ai/gitlab/gitlab-production-main/sessions/35767/commands/110583
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Use graphql explorer to perform queries. (You can create a sentry_issue record for a work items in order to get data)
query q {
workItem(id: "gid://gitlab/WorkItem/755") {
id
widgets {
... on WorkItemWidgetErrorTracking {
identifier
}
}
}
}