Support custom quick actions
Problem to solve
The list of available quick actions is hardcoded into GitLab. Since GitLab has an API and web hooks, it is theoretically possible for quick actions to be handled by an external service, thus allow custom actions to be created.
Further details
Use case: a bot that implements status labeling. Rather than changing labels manually, a user could issue a quick action like /status working
and the bot would validate the status and update the label (and perhaps change other things, as needed).
Proposal
- Add a way to register new quick actions either in the administrative UI, in the GitLab API, or both.
- Add a new webhook event type that is fired when one of the custom quick actions (registered in previous step) is included in a comment or new issue. It will provide the action name and any arguments, along with any associated context, such as the note ID or issue ID that contains it.
The quick actions should behave exactly the same way from the user's perspective as current quick actions do. That is:
- They will not appear in the rendered comment or issue description.
- They will appear if they are edited in, just as current actions are (they do not count as anything other than text in edits).
- They will appear in the context help (since they are pre-registered with GitLab).
- They will fail silently if they are invalid. This seems to be the current behavior for built-in quick actions.
What does success look like, and how can we measure that?
- New API endpoint or administrative page for custom quick actions.
- New webhook event type.
- User can use custom quick actions in comments, issue descriptions and merge requests and they will behave the same as built-in ones, except for their actual implementation.