Add dev docs for GitLab Duo in Slack setup

What does this MR do and why?

Adds a developer guide for setting up GitLab Duo in Slack against a local GDK.

Slack delivers @mention events over the internet, so testing the feature locally needs a tunnel and a self-created copy of the GitLab for Slack app whose request URLs point at that tunnel.

The guide covers the tunnel, creating and installing the app and updating the manifest. It also includes some troubleshooting steps, which includes a few errors I encountered during my set up and testing.

How to set up and validate locally

  1. Reset your Slack set up if you've already set it up before (See collapsed section below)
  2. Follow the instructions end to end, and confirm that mentioning the bot in Slack starts a flow and posts a reply.
Reset your GDK if you have already set up the Slack app

Author: 🤖

State lives in four places. Which you clear depends on how far back you want to go.

  1. GitLab database In bundle exec rails console:

Installation records: bot token, team_id, scopes

SlackIntegration.delete_all

The integration records themselves (project/group/instance level)

Integrations::GitlabSlackApplication.delete_all

Your Slack <-> GitLab user link, so you re-do the authorize flow

ChatName.delete_all Notes from the code:

  • slack_integrations_scopes rows cascade on the FK (db/structure.sql:61467), so no separate cleanup.
  • SlackIntegration has an after_commit that flips integration.active (slack_integration.rb:82,137). delete_all skips callbacks; deleting the integrations in the same pass makes that moot. Use destroy_all if you'd rather keep the integrations and just deactivate them.
  • ChatName is optional — keep it and you stay linked, skipping the lock-emoji authorize step.
  1. Instance application settings Clears the four credentials so Create Slack app starts fresh: ApplicationSetting.current.update!( slack_app_enabled: false, slack_app_id: nil, slack_app_secret: nil, slack_app_signing_secret: nil, slack_app_verification_token: nil ) Or untick Enable GitLab for Slack app in Admin > Settings > General and clear the fields.
  2. Slack side The old app is now orphaned. At api.slack.com/apps (https://api.slack.com/apps), open it and either Delete App (clean slate) or keep it and reuse the credentials.
  3. duo-workspace project (optional) Only if you want to re-test auto-creation. Delete the duo-workspace project in your default Duo namespace; WorkspaceProjectService recreates it on the next mention.
Edited by Keeyan Nejad

Merge request reports

Loading
Loading