Repository navigation
✨ RFC lifecycle notices to Discord #architecture-rfcs: opened, closed, taken off hold - #14617
Conversation
#14616) Add pkg/rfcnotify, a transition detector over polled issue snapshots that posts one Discord line when an RFC issue (rfc label or RFC-prefixed title) is opened, closed (completed or not planned), or has its hold lifted or moves from held to stage/010-actionable. Per-issue records persist in /data/rfc-notify.json so restarts and the slack re-read never re-post. - notifications.discord.rfc_channel_id (env HIVE_DISCORD_RFC_CHANNEL_ID), default empty = off; posts with the existing bot token through a new discord.Bot.SendMessageTo without starting the command bot. - github.Client.ListIssueSnapshots lists issues (not PRs) across managed repos by state and since, the raw input the actionable enumeration cannot provide for closed or held issues. - Wired into the eval cycle's optional sweeps next to the RFC existing-coverage check; each post is audited as rfc-notify. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
The Settings parity test requires every hive.yaml leaf to have a Settings dialog control. Expose the RFC channel id in the Discord bot subgroup, round-trip it through the notifications settings handler, and cover it in the handler test. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at ccb3598. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Summary
pkg/rfcnotify: a transition detector over polled issue snapshots that posts one Discord line when an RFC issue is opened, closed (completed or not planned), or taken off hold so it can be implemented (theholdlabel comes off an open RFC, or a held RFC moves tostage/010-actionable). One notice per transition, one per hold episode.rfclabel, or a title that starts withRFCafter any leading emoji or[tag](RFC: ...,[RFC] ...,📝 RFC: [v6] ..., as on [RFC]: Evidence pipeline — measure Hive's effectiveness in the Throughput dashboard without touching auto-merge #12062). A parenthetical(RFC #13617 P1)later in a title does not count.notifications.discord.rfc_channel_id(env overrideHIVE_DISCORD_RFC_CHANNEL_ID), default empty = off. Posts with the existingnotifications.discord.bot_tokenthrough a newdiscord.Bot.SendMessageTo, sochannel_idand the command bot are not required.github.Client.ListIssueSnapshotslists issues (never PRs) by state andsinceacross managed repos. The first pass records the open RFCs as a baseline; later passes list issues updated since the watermark (minus 2 minutes of slack). Per-issue records persist in/data/rfc-notify.json(same pattern as the other/data/*.jsonstate files), so restarts and the overlap re-read never re-post. A failed post rolls back only the unposted issues so they retry on the next pass.RFC opened: #N <title> - <url> (by @author),RFC closed (completed|not planned): #N <title> - <url>,RFC ready to implement (hold removed): #N <title> - <url>. The URL is wrapped in<...>to suppress Discord preview cards; a hive managing more than one repo prefixes the number withowner/repo.runSweepsinrun_loop_deps.go); each post is written to the audit log asrfc-notify.src/docs/notifications.md(new "RFC lifecycle notices" section) andsrc/docs/operator-reference.md; changelog fragmentchangelog.d/added-14616-rfc-discord-notifications.md.Operator action (@clubanderson)
The notices are off until the channel is set. For the hive's own hive (and any other hive that should post), set:
or
HIVE_DISCORD_RFC_CHANNEL_ID=1540404487099777136in the environment. The bot token must be able to post in that channel. The first pass after enabling only records the baseline; transitions announce from the next pass (3 minutes later).Notes on fit with existing patterns
discord.rfc_channel_idlives under the existingnotifications.discordsection asnotifications.discord.rfc_channel_id..github/go-package-coverage-ratchet.txtdoes not exist onv5; the per-package floors live in.github/workflows/v2-tests.yml(default 90 for a new package).pkg/rfcnotifymeasures 97.6% locally;pkg/githubstays at 88.9% (floor 88),pkg/discord92.9%,pkg/config90.4%,cmd/hive76.3% (floor 42).notifications_settings.gonext todiscordChannelId.src/pkg/dashboard/server.gowas not touched, so the api-reference citation script was not needed.Related issues
Fixes #14616
Testing
go test -count=1 -cover ./pkg/rfcnotify/ ./pkg/discord/ ./pkg/config/ ./pkg/github/ ./cmd/hive/locally (all green; coverage above).go vetandgolangci-lint runon the touched packages: 0 issues.time.Sleepin any new_test.go.Contributor checklist
changelog.d/added-14616-rfc-discord-notifications.md.v5.git commit -s).