Unify reading award emoji of legacy epics and work items
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
- Query plans: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/29248/commands/90979
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
How to set up and validate locally
- Make sure to have an ultimate license
- Enable
epic_and_work_item_unification
feature flag - Create one epic and add an emoji to it
- Visit its work item counterpart by replacing
epics
withwork_items
in the current URL - Add a different emoji to the work item
- 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:
- Create a legacy epic
- Also visit its work item counterpart and keep both windows open
- Add an emoji to epic
- 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 Cardozo