Skip to content

Allow custom award emoji through the API

Toon Claes requested to merge toon-custom-award-emoji into master

What does this MR do and why?

This change allows users to award custom emoji to issues/MRs/comments.

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: "troll", url: "https://upload.wikimedia.org/wikipedia/en/9/9a/Trollface_non-free.png"}) {
          clientMutationId
          errors
          customEmoji {
            name
          }
        }
      }
    • Or on the Rails console:
      CustomEmoji.create(namespace: Group.first, name: 'troll', file: 'https://upload.wikimedia.org/wikipedia/en/9/9a/Trollface_non-free.png', external: true, creator: User.first)
  3. Visit any issue. And get the API URL for that issue, being <group>%2f<project>/issues/<iid>

  4. Award a custom emoji using curl:

    curl -L --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "http://gdk.test:8080/api/v4/projects/flightjs%2fFlight/issues/6/award_emoji?name=troll"
  5. Visit the issue again, and see the awarded emoji.

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