Skip to content

Unify reading award emoji of legacy epics and work items

Felipe Artur requested to merge issue_443543 into master

What does this MR do and why?

Part of the migration of epics to group-level work items. It turns the award emoji association into a union of epic and its work item counterpart records.

The next step is to allow filtering of epics and work items by unified award emoji association.

related to #443543 (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.

SQL queries

issuable.award_emoji

  • Before
SELECT  "award_emoji".*
FROM    "award_emoji"
WHERE   "award_emoji" . "awardable_id" = 118
       AND  "award_emoji" . "awardable_type" = 'Epic'
ORDER  BY  "award_emoji" . "id" asc 
  • After
SELECT "award_emoji".*
FROM   (
       (
              SELECT "award_emoji".*
              FROM   "award_emoji"
              WHERE  "award_emoji"."awardable_id" = 5707
              AND    "award_emoji"."awardable_type" = 'Issue')
              UNION ALL
       (
              SELECT "award_emoji".*
              FROM   "award_emoji"
              WHERE  "award_emoji"."awardable_id" = 118
              AND    "award_emoji"."awardable_type" = 'Epic')) award_emoji

Batch load

SELECT "award_emoji".*
FROM   ((SELECT "award_emoji".*
         FROM   "award_emoji"
         WHERE  "award_emoji"."awardable_type" = 'Issue'
                AND "award_emoji"."awardable_id" IN (SELECT "issues"."id"
                                                     FROM   "issues"
                                                     WHERE  "issues"."id" IN
                                                            ( 74, 73, 72, 69 )))
        UNION ALL
        (SELECT "award_emoji".*
         FROM   "award_emoji"
         WHERE  "award_emoji"."awardable_type" = 'Epic'
                AND "award_emoji"."awardable_id" IN (SELECT "epics"."id"
                                                     FROM   "epics"
                                                     WHERE  "epics"."id" IN (
                                                            46, 45, 44, 43 ))))

Screenshots or screen recordings

award_emoji_unification

How to set up and validate locally

  1. Make sure to have an ultimate license
  2. Enable epic_and_work_item_unification feature flag
  3. Create one epic and add an emoji to it
  4. Visit its work item counterpart by replacing epics with work_items in the current URL
  5. Add a different emoji to the work item
  6. Refresh the epic and the work item pages and the two emojis should be present for both

Caveat

There is a small UI bug that can be reproduced as the following:

  1. Create a legacy epic
  2. Also visit its work item counterpart and keep both windows open
  3. Add an emoji to epic
  4. Go to work item without refreshing the page and add the same emoji to it.

The emoji will blink in the work item page and then disappear. As expected nothing happens at the backend because of validations. I guess we can live with this edge case.

Edited by Felipe Artur

Merge request reports