Skip to content

feat: announce issues on the beta milestone in Discord - #185

Draft
joostlek wants to merge 1 commit into
clanker/gallant-goodall-g0znqcfrom
clanker/gallant-goodall-g0znqc-discord
Draft

joostlek wants to merge 1 commit into
clanker/gallant-goodall-g0znqcfrom
clanker/gallant-goodall-g0znqc-discord

Conversation

@joostlek

Copy link
Copy Markdown
Member

Deployment notes

  • The bot now handles the issues.milestoned action. The app already subscribes to the Issues event, so no new webhook subscription is needed.
  • Nothing is posted until the beta channel's ID is added under notifications in src/discord/manifests/home-assistant.ts. That's why this PR is a draft.

Proposed change

Posts newly reported beta issues from core, frontend and home-assistant.io to the Discord beta channel.

This PR is stacked on #184, which adds the beta-milestone rule. Review and merge that one first. This PR's diff only shows the Discord part.

The rule (beta-issue-notify)

  • It runs on issues.milestoned and asks Discord to announce the issue when the new milestone belongs to the release currently in beta.
  • Because it keys off the milestone, it announces issues a maintainer milestones by hand as well as the ones beta-milestone sets.
  • Which release is in beta comes from core's newest release, prereleases included. If that's 2026.12.0b2, then 2026.12.0 is in beta. If the newest release is stable, no beta is running and nothing is announced. The source repo can be configured per manifest.
  • It does nothing for closed milestones and closed issues.
  • webhook.service.ts drops events caused by the bot's own writes. It now lets the bot's own issues.milestoned through, so milestones set by beta-milestone are announced too.

GitHub to Discord

  • This enables the notify effect that was sketched out in a comment in engine/types.ts. It now carries a typed Notification defined in src/notifications/types.ts, one variant per topic.
  • applyEffects publishes notifications on an in-process NotificationBus. With no subscriber, for example when Discord is disabled, a notification is dropped. A subscriber's failure is logged and never fails the GitHub dispatch.
  • The Discord gateway service subscribes once the client is up. Guild manifests get a notifications field that maps a topic to a channel ID.
  • src/discord/engine/notify.ts turns each notification into a sendMessage embed (issue title and link, repository, milestone, reporter). It sends each one only once per process.

Engine additions: the issues.milestoned event (with the milestone's number, title and state), Issue.title(), and RuleContext.latestRelease(), cached for the rest of the webhook event.

Type of change

  • Dependency upgrade
  • Bugfix
  • New rule or command
  • New repository manifest (enable the bot on another repo)
  • New feature (which adds functionality to an existing engine)
  • Code quality improvement or refactor (incl. tests)

Additional information

Open points for review:

  • Repeat announcements: each issue is announced only once, but that is only remembered in memory. After a restart, an issue taken off the beta milestone and put back would be announced again.
  • Frontend and docs: they only produce announcements if their milestones are named like core's (2026.12.0). I couldn't check that.

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass (mise run test). Your PR cannot be merged unless tests pass.
  • Lint and type checks pass (mise run check).
  • The code has been formatted (mise run format).
  • Tests have been added to verify that the new code works.
  • There is no commented out or debug code in this PR.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If behaviour, configuration, or environment variables changed:

  • README.md and .env.example have been updated accordingly.

Generated by Claude Code

Adds a beta-issue-notify rule for core, frontend and home-assistant.io. On
issues.milestoned it checks whether the milestone belongs to the release
currently in beta (read off core's latest release: a prerelease 2026.12.0b2
means 2026.12.0) and emits a notify effect. Because it keys off the
milestone, issues milestoned by hand are announced as well as ones the
beta-milestone rule sets; the webhook handler now lets the bot's own
issues.milestoned through for that.

Cross-engine plumbing: the notify effect publishes typed notifications on
an in-process bus (src/notifications). The Discord gateway subscribes,
routes each topic to the channel a guild manifest names for it, renders an
embed, and delivers each notification once per process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SLHDn67HcX8nfhH55Vz6YF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants