Resolve epic link in issue sidebar changes to work_items link
What does this MR do and why?
The Epic
link in issue sidebar is changing from groups/gitlab-org/-/epics/153 to groups/gitlab-org/-/work_items/153 when description is changed. This is due to the issuable data getting updated when real time updates (Apollo GraphQL subscription) gets triggered by any change in the issuable. The subscription is targeted for only work items object but it also gets triggered if the object is an issue. This can be avoided by triggering the subscription only when work item Epic
is set as a Parent.
This only happens under following conditions:
-
epic_creation_with_synced_work_item
is enabled - Epic is created after
epic_creation_with_synced_work_item
is enabled -
namespace_level_work_items
anddisplay_work_item_epic_issue_sidebar
feature flags are turned off
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
Notice the
Before | After |
---|---|
Screen Recording 2024-03-28 at 8.18.19 PM.mov | Screen Recording 2024-03-28 at 8.22.13 PM.mov |
How to set up and validate locally
Prerequisites:
- Enable the OKRs feature as mentioned in the OKRs docs (e.g.
::Feature.enabled?(:okrs_mvc, Project.find(<PROJECT_ID>))
and the namespace must have Ultimate plan) - Make sure to disable the feature flag
display_work_item_epic_issue_sidebar
- Disable feature flag
namespace_level_work_items
to create legacy Epic
Steps to verify:
- Enable the feature flag
epic_creation_with_synced_work_item
is enabled - Go to Groups > Select any group > Epics > New Epic > Create an Epic
- Go to any project of the selected group where Epic is created
- Create an issue and select the legacy Epic from the sidebar
- Notice the epic link on sidebar is correct
- Edit the issue description
- Click "Save changes"
- Notice the epic link on sidebar is not changed
Related to #451920 (closed)