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

slack: add DM contact method and use for linking #2712

Closed
mastercactapus opened this issue Nov 30, 2022 · 2 comments · Fixed by #3071
Closed

slack: add DM contact method and use for linking #2712

mastercactapus opened this issue Nov 30, 2022 · 2 comments · Fixed by #3071
Assignees
Labels
enhancement New feature or request

Comments

@mastercactapus
Copy link
Member

What problem would you like to solve? Please describe:
Linking and managing the association with a Slack account is complex and "magical" currently.

Describe the solution you'd like:
Allow users to add a contact method for Slack and use this to identify actions coming from Slack.

Describe alternatives you've considered:
A suggested alternative was to add a /goalert link command, but this keeps the linking status invisible, and users/devs/admins are unable to remove the link (e.g., for testing).

Additional context:
Notes from the design session:

  • need to keep auth_subjects in sync with Slack contact methods
  • existing links must result in new, verified, contact methods
  • existing flows should remain untouched for MVP

To be added:

  • New contact method type SLACK_DM to be added
  • Mimic phone number entry but use @ instead of +
  • same format as channel notifications
  • Same validation & test flow
  • Use metadata column to store and display user name
  • store value as team_id:user_id
  • add cm_id as a nullable column to auth_subjects defaulting to null (on delete cascade)
  • create auth_subjects entry when creating new contact method (with cm_id set)
  • new engine compat module
  • create verified contact methods for providers starting with slack: and null cm_id, update cm_id

MVP+1:

  • update to use CM as the source of truth for slack user lookup
  • update slack username over time (maybe when a message is sent up to once per day?)
@mastercactapus mastercactapus added the enhancement New feature or request label Nov 30, 2022
@mastercactapus
Copy link
Member Author

mastercactapus commented Jan 11, 2023

We will try a new strategy instead of the giant long-lived feature branch to move this along: merging functionally verifiable pieces before the feature is ready.

Current work is in branch feat/2712-slack-dm-contactmethod

Remaining work:

  • remove user search GraphQL stuff from the branch
  • break existing work into PRs
    • Slack caching refactor (generics)
    • Add new CM type with GraphQL API (disabled: no registered sender, API/data only)
    • compatibility manager to sync CM with auth_subjects (disabled)
  • next: status update solution (e.g., update sent alert notifications)
  • next: enable disabled pieces

For the disabled parts, let's either have commented code or a temporary flag, so it's easy for a reviewer/dev to enable validating PRs but disabled in production.

@mastercactapus
Copy link
Member Author

mastercactapus commented Mar 8, 2023

Last items for the finish line:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant