Skip to content

fern-api/rooster

Repository files navigation

rooster

rooster is a maintenance slack app that performs various duties in the fern slack environment.

open customer threads

if a support thread in #customer-alerts has not been marked with ✅ by the end of the day, it will be included in a round-up of messages, all sent to the #customer-alerts channel, tagging the deployed engineer on-call.

setup

environment variables

rooster requires the following environment variables (see .env.example):

variable required description
SLACK_BOT_TOKEN yes slack bot token (xoxb-...)
SLACK_SIGNING_SECRET yes slack signing secret
SLACK_APP_TOKEN yes slack app-level token (xapp-...)
PYLON_API_TOKEN yes pylon api token
DEVIN_SLACK_USER_ID yes devin's slack user id
DEVIN_TRIAGE_CHANNEL yes channel id for #devin-triage-runs
PYLON_WEBHOOK_SECRET yes pylon webhook HMAC secret
WEBHOOK_PORT no webhook server port (default: 3000)
SLASH_COMMAND no slash command name (default: /rooster)

adding a new environment variable

  1. add it to .env.example with a placeholder value
  2. add it to src/config.ts (use requireEnv if required)
  3. add it as a repository secret in GitHub: Settings > Secrets and variables > Actions > New repository secret
  4. add it to the .env file on the EC2 instance:
    ssh -i /path/to/your-key.pem <EC2_USER>@<EC2_HOST>
    cd ~/rooster
    nano .env
    # add the new variable, save, then restart:
    docker restart rooster

run the app

pnpm install
pnpm run build
pnpm start

for development:

pnpm run dev

slack commands

  • /rooster status - check if rooster is running

  • /rooster check [days] - check for issues (default: 1 day)

    • by default, shows both new (unassigned) and waiting-on-you issues in separate sections
    • e.g. /rooster check 3 checks the last 3 days
    • add --new to show only new (unassigned) issues
    • add --open to show only waiting-on-you issues
    • add --channel to post results to #customer-alerts
    • add --remind to tag on-call engineers (implies --channel)
  • automatic triage via Pylon webhooks

    • when a new issue is created in Pylon, a webhook fires to rooster's /pylon/webhook endpoint
    • rooster posts the issue context to #devin-triage-runs, @mentioning Devin with triage instructions and on-call handles
    • Devin triages and tags the appropriate on-call team
    • if Slack thread info is available in the payload, rooster also replies in the original thread with a link to the triage run
    • requires PYLON_WEBHOOK_SECRET env var for HMAC signature verification

more functions coming soon...

  • triage can decide a thread is incident-worthy (integrate with incident.io, open an incident)
  • triage can check account subscription status (connect to supabase)
  • alert for stale PRs
  • alert for tagged, open issues
  • alert immediately for high-risk messages (e.g. "broken", "down", "inaccessible")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •