Skip to content

Fixes for custom emoji

Toon Claes requested to merge tc-custom-emoji-fixes into master

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

image

How to set up and validate locally

  1. Enable the custom_emoji feature flag

  2. Make sure you've added custom emoji.

    • You can do this through the GraphQL API:
      1. Browse to /-/graphql-explorer
      2. And type and run:
      mutation {
        createCustomEmoji(input: { groupPath: "gitlab-org", name: "partyparrot", url: "https://cultofthepartyparrot.com/parrots/hd/parrot.gif"}) {
          clientMutationId
          errors
          customEmoji {
            name
          }
        }
      }
    • 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)
  3. Visit any merge request. And get the API URL for that issue, being <group>%2f<project>/merge_requests/<iid>

  4. 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"
  5. Visit the merge request again, and see the awarded emoji.

  6. 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"
  7. 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.

Edited by Toon Claes

Merge request reports

Loading