Skip to content

Sync work item rolledup dates widget updates with epics

Felipe Artur requested to merge issue_450302_sync_widget_dates into master

What does this MR do and why?

Sync epic date attributes when a work item rolledup dates widget is updated using GraphQL or other means.

Updates RolledupDates::HierarchyUpdateService to sync legacy epic attributes even if work item dates are fixed. This service is called through a subscription on event store whenever a work item rolled up dates is updated or created.

Part of #450302 (closed)

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.

How to set up and validate locally

Prepare

  1. Enable feature flag work_items_rolledup_dates
  2. Enable feature flag sync_epic_to_work_item
  3. Enable feature flag sync_work_item_to_epic
  4. Disable feature flag make_synced_work_item_read_only

Test Steps

  1. Create one epic visiting the URL http://localhost/groups/GROUP_PATH/-/epics/new or GraphQL mutation
  2. Take the epic synced work item global id, Rails console can be used with Epic.last.work_item.to_global_id.to_s
  3. Go to GraphQL explorer http://gdk.test:3000/-/graphql-explorer and execute the following mutation:
mutation UpdateWorkItem {
  workItemUpdate(input: { id: "gid://gitlab/WorkItem/GLOBAL_ID", rolledupDatesWidget: { startDateFixed: "2024-01-01", startDateIsFixed: true }  } ) {
	  workItem {
      title
      description
      widgets {
        ... on WorkItemWidgetRolledupDates {
          startDate
          startDateFixed
          startDateIsFixed
        }
      }
    }
  }
}
  1. Visit the work item legacy epic using the URL http://localhost/groups/GROUP_PATH/-/epics/EPIC_IID

The dates parameter on legacy epic should be the same as the ones returned by the mutation.

Edited by Felipe Artur

Merge request reports