Fix Authorize user page for Mattermost
What does this MR do and why?
The "chat name" authorize page is shared between Mattermost and the GitLab for Slack app integrations.
In !113801 (merged) the copy was changed to only reference Slack.
This change identifies the integration by the params to now also mention Mattermost correctly.
We can only do this because Slack and Mattermost use very different-looking IDs from each other. Mattermost's are lowercase and Slack are uppercase, and additionally Slack are reliably prefixed !116492 (comment 1338071973).
Screenshots or screen recordings
| GitLab for Slack app | Mattermost |
|---|---|
![]() |
![]() |
Recordings
| GitLab for Slack app | Mattermost |
|---|---|
| Screen_Recording_2023-04-03_at_11.10.47_AM | Screen_Recording_2023-04-03_at_11.41.18_AM |
How to set up and validate locally
Fully validate it
To fully test this out, members of ~"group::integrations" and ~"group::import" can set up a GitLab for Slack app integration according to this guide. Remember to change to this branch.
Anyone can sign up for a Mattermost Cloud account and configure the integration manually.
Then, from the either the development copy of our Slack app, or Mattermost Cloud: type: /gitlab help, and follow the link to authorize your account.
Quickly test it out
- On the rails console:
params = { team_id: 'T00', team_domain: 'my_chat_team', user_id: 'U01', user_name: 'my_chat_user' } ChatNames::AuthorizeUserService.new(params).execute - Follow the URL generated to see the GitLab for Slack app authorize page.
- Generate a second URI using non-Slack looking params.
params = { team_id: 'anything_else', team_domain: 'my_chat_team', user_id: 'something_else', user_name: 'my_chat_user' } ChatNames::AuthorizeUserService.new(params).execute - Follow the URL generated to see the Mattermost authorize page.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #395503 (closed)

