Skip to content

Resolve epic link in issue sidebar changes to work_items link

Rajan Mistry requested to merge 451920-epic-link-changes-work_items-link into master

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:

  1. epic_creation_with_synced_work_item is enabled
  2. Epic is created after epic_creation_with_synced_work_item is enabled
  3. namespace_level_work_items and display_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:

  1. 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)
  2. Make sure to disable the feature flag display_work_item_epic_issue_sidebar
  3. Disable feature flag namespace_level_work_items to create legacy Epic

Steps to verify:

  1. Enable the feature flag epic_creation_with_synced_work_item is enabled
  2. Go to Groups > Select any group > Epics > New Epic > Create an Epic
  3. Go to any project of the selected group where Epic is created
  4. Create an issue and select the legacy Epic from the sidebar
  5. Notice the epic link on sidebar is correct
  6. Edit the issue description
  7. Click "Save changes"
  8. Notice the epic link on sidebar is not changed

Related to #451920 (closed)

Edited by Rajan Mistry

Merge request reports