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

WIP: Bleatbot #41

Merged
merged 5 commits into from
Aug 21, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions text/41-bleatbot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
- Feature Name: Bleatbot
- Start Date: 2022-06-11
- DIP PR: [goatcorp/DIPs#41](https://github.com/goatcorp/DIPs/pull/41)
- Repo-Relevant Issue: [goatcorp/DIPs#37](https://github.com/goatcorp/DIPs/issues/37)

# Summary

[summary]: #summary

Introducing Bleatbot, a GitHub bot designed to help manage issues and pull requests for various repositories (support, plugin submissions, DIPs, etc.).

# Motivation

[motivation]: #motivation

There are many problems with GitHub issues:

- It is difficult to provide support via GitHub issues. Franzbot (the FAQ bot in the Goat Place Discord server) does not exist outside of Discord, so the support team does not have an easy way to provide common troubleshooting steps.
- Issues and pull requests often are forgotten about and become stale, left open for extended periods of time. While Caprine Operator exists to help plugin PRs, there is no functionality to help clean up issues.
- The DIP process is manual, done by humans, even including the merge process.

# Guide-level explanation

[guide-level-explanation]: #guide-level-explanation

In the comments of a issue/pull request on a goatcorp GitHub repository, members of the goatcorp GitHub group can execute any of the following commands:

- `@bleatbot faq <entry>` - Post an FAQ entry.
- `@bleatbot autoClose <when>` - Automatically close an issue after the specified time (e.g `24h`).
- `@bleatbot autoMerge <when>` - Automatically merge a pull request after the specified time (e.g. `24h`).
- `@bleatbot cancelAuto` - Cancel any automatic tasks.
NotNite marked this conversation as resolved.
Show resolved Hide resolved

TODO

# Reference-level explanation

[reference-level-explanation]: #reference-level-explanation

Bleatbot is written in TypeScript. Its source code is available in the [NotNite/bleatbot](https://github.com/NotNite/bleatbot) GitHub repository.

It uses SQLite as its database (through Prisma), Octokit to use the GitHub API, and Koa to receive events through a webhook.

Each GitHub repository has a webhook added to it, which points to an HTTP server the Bleatbot codebase runs. Upon an event, the webhook is triggered and validated, and the command is parsed and ran.

# Drawbacks

[drawbacks]: #drawbacks

- Data storage of any kind is a liability.
- This adds complexity to the core Dalamud ecosystem, both as a result of being an additional tool and through its terminology/commands.
- Server resources are required to host Bleatbot.

# Rationale and alternatives

[rationale-and-alternatives]: #rationale-and-alternatives

- As a member of the support team myself, it is annoying to either type out a long-winded sentence or redirect users to our Discord server, because we do not have the proper functionality desired.
- I chose TypeScript because I like TypeScript. This would work as well in other languages, it's just what I'm comfortable in. I have no excuses.
- I chose the libraries I used because they either fit TypeScript well, I'm comfortable with them, or they were suggested to me by ackwell.

# Prior art

[prior-art]: #prior-art

Franzbot is prior art regarding the FAQ system. It has proven to be massively helpful in the Discord server, where we receive a lot more users needing support.

Many GitHub bots with command functionality & auto merging exist for communities, but there are far too many to list.

# Unresolved questions

[unresolved-questions]: #unresolved-questions

- What other features does Bleatbot need?
- Does any command need to be renamed?

# Future possibilities

[future-possibilities]: #future-possibilities

- More FAQ entries
- Integration with the Caprine Operator