Slash commands (and ChatOps) not working with Cells 1.0 (investigation issue)
About
Slash commands are not routed correctly to a secondary cell.
This is a meta investigative issue, and actionable issues will be created from it as an outcome.
Steps to test locally:
- Configure a Cells setup locally using 2 GDKs and the router https://gitlab.com/gitlab-org/tenant-scale-group/pocs/routing/rules-router#local-development
- When the Cells setup is running, open the router URL
http://localhost:9393/and set the 3 values into your cookie that are mentioned in https://gitlab.com/gitlab-org/tenant-scale-group/pocs/routing/rules-router#force-cell-2. (Note, you may need to edit them in a different way from the docs mention depending on your browser, e.g Chrome).cell_2=true;path=/;domain=gitlab.steveazz.xyz - Reload your browser, you should be on Cell 2
- Now on Cell 2, create a new project with a full path that doesn't exist on cell 1
- Create a Slack Slash commands integration
(it doesn't need to be a real one configured in Slack, just enter
tokenin the form and save the integration). - Copy the URL that is presented in the form and change the host to
http://localhost:9393/. For example:http://localhost:9393/api/v4/projects/<PROJECT_ID>/integrations/slack_slash_commands/trigger
Make a curl request to the router app URL:
curl --location --request POST 'http://localhost:9393/api/v4/projects/<PROJECT_ID>/integrations/slack_slash_commands/trigger?token=token' \
--header 'Authorization: Bearer <YOUR_PAT>'
Response:
{"message":"404 Integration Not Found"}
Note, if you hit Cell 2's web server outside of the router (e.g. http://gdk.test:3001), the request will hit Cell 2 and you'll see what the response should be if it were routed correctly:
curl --location --request POST 'http://<CELL_2_HOST>/api/v4/projects/<PROJECT_ID>/integrations/slack_slash_commands/trigger?token=token' \
--header 'Authorization: <YOUR_PAT>'
Response:
{"response_type":"ephemeral","status":200,"text":":sweat_smile: Couldn't identify you, nor can I authorize you!"}%
Affected integrations
This will affects the following Slash command integrations:
- Mattermost slash commands
- GitLab for Slack app
- Chatops that can be configured to use the above two integrations.
Slack Slash commands is self-managed only, so not required for Cells 1.0. Although it's codebase shares so much with Mattermost slash commands that any change to Mattermost will likely mean it's simpler for Slack Slash Commands to also support Cells 1.0.
Edited by Luke Duncalfe