Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration guide for legacy Slack apps to Granular Scopes #134

Closed
dblock opened this issue Nov 27, 2020 · 0 comments
Closed

Migration guide for legacy Slack apps to Granular Scopes #134

dblock opened this issue Nov 27, 2020 · 0 comments
Labels

Comments

@dblock
Copy link
Collaborator

dblock commented Nov 27, 2020

Long version: https://code.dblock.org/2020/11/30/migrating-classic-slack-ruby-bots-to-granular-permissions.html

Phase 1

This is a noop, but will ensure that the old RTM bot can co-exist in the same database as the newer version of the app with granular scopes.

  1. Upgrade to slack-ruby-bot-server-rtm , which extracts real-time components, e.g. slack-ruby/slack-shellbot@db40cb5. This gem was split out from slack-ruby-bot-server.
  2. Upgrade to slack-ruby-bot-server 1.2.0, which introduces oauth_version and oauth_scope, e.g. slack-ruby/slack-shellbot@bda862c. See https://github.com/slack-ruby/slack-ruby-bot-server/blob/master/UPGRADING.md#upgrading-to--120.

Make sure everything is working, keep v1 of the bot running in its own container/app.

Phase 2

  1. Create a new Slack app with new granular permissions and scopes.
  2. Migrate the app to support granular permissions and scopes, e.g. Migrate app to granular scopes and events API. slack-shellbot#22. YMMV depending on what scopes you use, you have to reimplement the RTM messaging as events. Use https://github.com/slack-ruby/slack-ruby-bot-server-events-app-mentions to make life easier.
  3. Create a new app deployment, use the same database, I follow https://code.dblock.org/2016/02/08/running-slack-bots-on-digital-ocean-with-dokku.html.
  4. Deploy the new app. Now there are two versions of the app running on top of the same database, one is the legacy and the other is the granular scopes app. Both work.
  5. Switch DNS, new bot registrations use the new granular scopes app. Make sure in Slack the event URLs are configured properly to point to this DNS.
  6. Existing teams can re-install with new granular scopes, the old bot will stop working and the new one will take over.
@dblock dblock added the chore label Nov 27, 2020
dblock added a commit to dblock/slack-ruby-bot-server that referenced this issue Nov 30, 2020
dblock added a commit to dblock/slack-ruby-bot-server that referenced this issue Nov 30, 2020
dblock added a commit to dblock/slack-ruby-bot-server that referenced this issue Nov 30, 2020
dblock added a commit to dblock/slack-ruby-bot-server that referenced this issue Nov 30, 2020
@dblock dblock closed this as completed in 82cd47d Nov 30, 2020
dblock added a commit that referenced this issue Nov 30, 2020
Added a migration guide for Legacy Apps, closes #134.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant