Skip to content

Allow self-managed instances to rename the GitLab for Slack app /gitlab slash command (to support multiple GitLab instances in one Slack workspace)

About

Self-managed instances can create their own copy of the GitLab for Slack app, and use its /gitlab slash command feature

Problem

If a customer has more than one self-managed GitLab instance, they might want to issue slash commands against more than one GitLab instance, but out-of-the-box they can't, as the GitLab for Slack app manifest that we generate for an instance admin has hard-coded /gitlab as the slash command trigger name. Every GitLab instance will output manifests with the same slash command trigger name.

Workaround

A workaround is simply for customers to manually change this slash command trigger name to be unique per instance. They can do this when creating the GitLab for Slack app (during the Edit Configurations step documented here), or later in the Slack app admin https://slack.com/api/apps. They would just set the features.slash_commands.command value in the manifest to something different.

Proposal

We should let customers decide on the slash command for the Slack app. It would default to /gitlab.

This would let them to, for example:

  1. Create a Slack app with /gitlab as the slash command on their main GitLab instance
  2. Create a Slack app with /ops as the slash command on their second ops GitLab instance.

They could then use /gitlab slash command to control their main instance, and /ops slash command to control their second instance, from the one Slack workspace.

Technical proposal

  1. Add a new application setting called slack_app_slash_command, default "/gitlab".
  2. Update the GitLab for Slack app admin settings UI /admin/application_settings/general to allow editing it.
  3. Change the manifest to refer to this setting.
Edited by Luke Duncalfe
OSZAR »