Fixes for custom emoji
What does this MR do and why?
This MR fixes a couple of bugs around the use of custom emoji:
-
Award emoji do not work on MRs -
Award emoji do not work in subgroups (it should look in the root namespace) -
Not all custom emoji code is guarded by the feature flag -
Custom emoji do not work in Epic descriptions & comments
Check out each separate commit for the changes related to each of the items above.
This is a follow-up to !77478 (merged) and part of #333095 (closed) & &1820.
Screenshots or screen recordings
How to set up and validate locally
-
Enable the
custom_emoji
feature flag -
Make sure you've added custom emoji.
- You can do this through the GraphQL API:
- Browse to
/-/graphql-explorer
- And type and run:
mutation { createCustomEmoji(input: { groupPath: "gitlab-org", name: "partyparrot", url: "https://cultofthepartyparrot.com/parrots/hd/parrot.gif"}) { clientMutationId errors customEmoji { name } } }
- Browse to
- Or on the Rails console:
Group.find_by(path: 'gitlab-org').custom_emoji.create(name: 'partyparrot', file: 'https://cultofthepartyparrot.com/parrots/hd/parrot.gif', external: true, creator: User.first)
- You can do this through the GraphQL API:
-
Visit any merge request. And get the API URL for that issue, being
<group>%2f<project>/merge_requests/<iid>
-
Award a custom emoji using
curl
:curl -L --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "http://gdk.test:8080/api/v4/projects/gitlab-org%2fgitlab-test/merge_requests/9/award_emoji?name=partyparrot"
-
Visit the merge request again, and see the awarded emoji.
-
You can repeat this for an epic (required EE license)
curl -L --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "http://gdk.test:8080/api/v4/groups/gitlab-org/epics/5/award_emoji?name=partyparrot"
-
Also try to write
:partyparrot:
in a comment or description of an epic to see if it renders correctly.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.