Skip to content

Generate Slack app manifest for self-managed

What does this MR do and why?

The GitLab for Slack app that is distibuted through the Slack App Directory can only work with GitLab.com. This is because the Slack app configuration requires specific hard-coded URLs, so these are all set to gitlab.com.

This change allows self-managed customers to create a copy of the GitLab for Slack app to install into their Slack workspace.

The Slack app they create is functionally identical to the official public one.

The change is behind a feature flag.

#358872 (closed)

Screenshots or screen recordings

QA screen recordings

Creating and configuring Updating
SlackSM SlackSMUpdate

Admin

Before After
image image
image

How to set up and validate locally

  1. Start a GitPod instance (docs)
  2. After the GitPod instance has finished setting up and the GDK configuration steps have completed, change port 3000 to be public:
    1. On the bottom nav, select PORTS.
    2. On the Port 3000 row, click the lock icon to switch the state to open (public).
  3. In the GitPod terminal, check out this branch and run bundle and yarn and restart GDK for good measure:
    cd /workspace/gitlab-development-kit/gitlab &&
        git fetch origin 358872-make-slack-admin-section-visible-for-self-managed &&
        git checkout 358872-make-slack-admin-section-visible-for-self-managed &&
        bundle &&
        yarn &&
        cd /workspace/gitlab-development-kit &&
        gdk restart
  4. Enable the feature flag:
    1. Start a Rails console in the GitPod terminal:
    cd /workspace/gitlab-development-kit/gitlab && bundle exec rails c
    1. Enable the flag in the Rails console:
    Feature.enable(:slack_app_self_managed)
    User.first.update!(password_expires_at: nil) # We don't need to do this, but it makes logging in to the instance quicker
  5. Go to your GitPod GitLab instance (to find the address: on the bottom nav, select PORTS, click the address next to port 3000)
  6. Visit /admin/application_settings/general
  7. Expand the GitLab for Slack app section
  8. Click Create Slack app and follow the guidance in the Create a GitLab for Slack app section of doc/user/admin_area/settings/slack_app.md in this branch.
  9. After creating the app, follow the guidance in the Configure the settings section of doc/user/admin_area/settings/slack_app.md in this branch.

Once configured, you can test that it works by entering the /gitlab help slash command into a channel in your Slack workspace and hitting return. You should see a list of available Slash commands in response. Note: to use any of the other slash commands requires you to configure a GitLab for Slack app integration for a project - which you can do if you like!

To QA updating:

  1. Visit /admin/application_settings/general
  2. Expand the GitLab for Slack app section
  3. Click Download latest manifest file to download a JSON file
  4. Follow the guidance in the Updating the GitLab for Slack app section of doc/user/admin_area/settings/slack_app.md in this branch.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #358872 (closed)

Edited by Luke Duncalfe

Merge request reports