Allow Slack app to be reinstalled

Summary

Follow-up from #355998 (comment 921302547)

For the GBP update users will need to reinstall the app, so we need to provide a button to do that from the integration form in GitLab.

Currently we only show the Add to Slack button when the app isn't installed yet:

image

After installing the form looks like this:

image

Improvements

frontend:

  • Add a button Reinstall Slack app on the integration form, which is shown when the project alias already exists.
    • We could use the button generator from https://api.slack.com/docs/slack-button#using-the-slack-button__add-the-slack-button, which produces some HTML/SVG where we can customize the text (the current Add to Slack PNG button could be replaced by this too).
    • We could add some help text to explain when this would be necessary (or add it to our docs and link them here).

backend:

  • Check for an existing SlackIntegration record at https://gitlab.com/gitlab-org/gitlab/blob/67377043d28e0e53495452cc2d72ff78920d1b07/ee/app/services/projects/slack_application_install_service.rb#L37 and update it instead of creating a new one.
  • We could also start storing the bot_user_id and access_token in the SlackIntegration record, although we don't use them yet.
Edited Apr 27, 2022 by Markus Koller
Assignee Loading
Time tracking Loading