Skip to content

Fix label in bulk epic edit and cross epic and epic work item

What does this MR do and why?

This MR fixes a couple things related to unified labels between epic and epic work item

  1. Skip unified query on the issues side when it is done from project context. We do not yet have epic work items at project level so we can skip that
  2. Fix the preloading of labels on epic/epic work item to load labels from both the legacy epic and epic work item side. It is the same query as reviewed in Add capability to handle labels unified between... (!151490 - merged) the change is that we use a batch loader to preload labels now
  3. Fix the labels removal from epic/epic work item to be based on label_links.id rather that label_links.label_id as in some situations this may result in labels being removed from unintended items that also have the same label_ids.
    • new query

      DELETE FROM "label_links" WHERE "label_links"."id" IN (SELECT "label_links"."id" FROM ((SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_id" = 1341 AND "label_links"."target_type" = 'Epic')
      UNION
      (SELECT "label_links".* FROM "label_links" WHERE "label_links"."target_id" = 4879 AND "label_links"."target_type" = 'Issue')) label_links WHERE "label_links"."label_id" = 3528)
    • old query

      DELETE FROM "label_links" WHERE "label_links"."label_id" IN (SELECT "labels"."id" FROM ((SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 4879 AND "label_links"."target_type" = 'Issue')
      UNION
      (SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = 1341 AND "label_links"."target_type" = 'Epic')) labels WHERE "labels"."id" IN (3527, 3510) ORDER BY "labels"."title" ASC)

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(master branch) After(this MR)
Screen_Recording_2024-06-12_at_14.35.40 Screen_Recording_2024-06-12_at_14.05.14

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Alexandru Croitor

Merge request reports

Loading