sentrydiscord.dev icon indicating copy to clipboard operation
sentrydiscord.dev copied to clipboard

Switch to Bot [Version 2]

Open IanMitchell opened this issue 2 years ago • 7 comments

Summary

Rewrites this as a Sentry Integration instead of a legacy webhook callback. Utilizes a Discord Bot instead of a Discord Webhook. Will deprecate (but not remove support) for existing webhook functionality. The new version will support resolving, assigning, ignoring, and other actions on posted issues.

In Depth

I'm rewriting this as a new sentry integration - this gives me access to more modern APIs, and will allow the app to do some cooler things.

  1. Opt-In Event Storage: Users can opt-in to storing events the service receives. They'll be able to edit sensitive information out of them and submit them to me to use to improve the posted embed (I know different languages have varying quality right now). They can also "retry" posting to the bot if an event fails to post.
  2. Configuring Posts: Users will be able to select what tags to show and write a message to post when new events are received (useful for pings!)
  3. Preview Sentry Links: Users can opt-in to a message listener which looks for sentry links, and if found will post a preview embed for the issue.
  4. Dashboard Configuration: As a stretch goal, provide a dashboard that admins can use to configure the Discord integration (as an alternative to slash commands)

Cleanup

  • Fixes #13
  • Fixes #12
  • Fixes #11 (no longer uses webhooks)
  • Fixes #9 (adds debug mode which will help parser)
  • Fixes #7

IanMitchell avatar Feb 12 '22 20:02 IanMitchell

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ianmitchell/sentrydiscord/5QtHaLgpE4h6HyWSwpgVjFGeGW22
✅ Preview: Failed

[Deployment for a94878a failed]

vercel[bot] avatar Feb 12 '22 20:02 vercel[bot]

:warning: Migration Warning
It looks like this pull request modifies your Prisma schema in addition to other files. To minimize errors or downtime during deployment, make sure your schema changes don't rename or remove fields that are actively being used in production. You may want to separate your changes into two Pull Requests; one to change your application logic and another followup that updates your schema.

github-actions[bot] avatar Feb 12 '22 20:02 github-actions[bot]

I'm not sure what the authorization / installation flow for this should be. Gonna jot some scattered thoughts down.

  • There are two installation paths, or entry points. The user can either add the integration via Sentry, or they can add the bot via Discord. The bot will have a /setup command which, if needed, can redirect the user to Sentry. I'm not sure there is a path to go from Sentry -> Discord bot. Perhaps with the post installation callback?
  • How do I connect installation uuids with servers? Would that be part of the callback flow as well?
  • What is the uninstallation process like?
  • If a bot is removed, can I remove an integration from Sentry?
  • If an integration is removed, do I leave a guild?

IanMitchell avatar Feb 13 '22 00:02 IanMitchell

Documenting a flow for future me -

With /debug on, events get stored. These should go in a temporary state, viewable on a dashboard per installation. There, users can click into it, edit the JSON to strip sensitive information, and submit it for review in case the parser is bad. They should also be able to click "retry" to try and parse the item again.

IanMitchell avatar Feb 13 '22 00:02 IanMitchell

  • If an integration is removed, do I leave a guild?

Is this bot not going to be able to run multiple integrations in a single server? My current setup with the webhook brings together 3 different projects on Sentry in one category of channels.

If it is, why would you have the bot leave the guild and cause the rest of the integrations to become unusable?

thewilloftheshadow avatar Feb 13 '22 01:02 thewilloftheshadow

Posted some high level information in the PR description

IanMitchell avatar Feb 15 '22 01:02 IanMitchell

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
sentrydiscord ❌ Failed (Inspect) May 26, 2022 at 9:20PM (UTC)

vercel[bot] avatar May 26 '22 20:05 vercel[bot]