Installing Slack app across multiple workspaces
Closed this issue · 0 comments
alysivji commented
Look into how Slack does this so we can add this functionality.
Steps
- Incorporate OAuth2 flow to allow other Slack workspaces to install the integration (#174)
- get OAuth2 flow working locally
- figure out what information needs to be saved to the DB; plan data model
- store bot-token securely in the database (SQLAlchemy-Utils has an encrypted method)
- set up scripts to migrate data if
secret_key
changes - look at how flask-dance does things
- set up scripts to migrate data if
- Go thru apps to figure out what needs to be changed
- Slack adapter needs to be initialized upon use -- dependency injection
- How does each app change? How does each data model change?
- Design a nicer app experience; read Slack docs
App Changes
- Events Database
- no changes at the moment, except for point to the right Slack adapter
- GitHub Summary (#179)
- rename Slack adapter instance to be specific for ChiPy
- migration
- schema -- add a column for installation_id to connect to slack installation
- data -- for each user in the GitHub table, add the foreign key for the ChiPy slack; only run this one in production. Test in both for sure, but we do not want this migration run in dev
- rename table -- User should be GitHubSummaryUser
- when creating an account, ensure we add the installation foreign key
- parse
team_id
from request and pass it into task; all modifications that go along with that - create a new Slack adapter to post in the correct workspace
- for now pass in the
workspace_id
in the poller json - use
workspace_id
to find bot token
- for now pass in the
- GitHub Webhook
- no changes at the moment, except for point to the right Slack adapter
- Retweeter
- no changes at the moment, except for point to the right Slack adapter
- Upcoming Events
- no changes at the moment
Things to Think About
- welcome workflow (room specific)
Reading Material
This epic was too big, so we split into multiple issues. See #186
Notes
- Have an admin site for workspace admins to configure settings
- look at other slack apps to figure out what they do
- upon login
- not a workspace admin
- workspace admin, but app is not installed
- admin, show them panel allowing them to configure settings
- External integration
- implement GitHub OAuth flow
- Events Database
- no changes at the moment, except for point to the right Slack adapter
- each slack installation can have multiple meetup groups they can associate with
- set up jobs for
workspace_id
to scrap as needed, attach workspace_id to each record, or maybe use a many-to-many as we don't want to fetch the same events over and over again- think this thru
- GitHub Webhook
- move
post_to_slack
toworkflow.py
- move
- Retweeter
- each slack installation can have multiple twitter accounts they want to share
- start thinking about how we are going to store info; key_value doesn't make much sense; learn from previous migration