Skip to content

✨ RFC lifecycle notices to Discord #architecture-rfcs: opened, closed, taken off hold - #14617

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
feat/rfc-discord-notifications
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
feat/rfc-discord-notifications

Conversation

@clubanderson

@clubanderson clubanderson commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • New 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 (the hold label comes off an open RFC, or a held RFC moves to stage/010-actionable). One notice per transition, one per hold episode.
  • RFC detection follows the repo's existing convention: the rfc label, or a title that starts with RFC after 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.
  • Config: notifications.discord.rfc_channel_id (env override HIVE_DISCORD_RFC_CHANNEL_ID), default empty = off. Posts with the existing notifications.discord.bot_token through a new discord.Bot.SendMessageTo, so channel_id and the command bot are not required.
  • Polling, not webhooks: the hive's enumeration only carries actionable open issues, so github.Client.ListIssueSnapshots lists issues (never PRs) by state and since across 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/*.json state 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.
  • Messages: 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 with owner/repo.
  • Wired into the eval cycle's optional sweeps next to the RFC existing-coverage check (runSweeps in run_loop_deps.go); each post is written to the audit log as rfc-notify.
  • Docs: src/docs/notifications.md (new "RFC lifecycle notices" section) and src/docs/operator-reference.md; changelog fragment changelog.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:

notifications:
  discord:
    bot_token: <existing bot token>
    rfc_channel_id: "1540404487099777136"   # #architecture-rfcs (DESIGN/RESEARCH)

or HIVE_DISCORD_RFC_CHANNEL_ID=1540404487099777136 in 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

  • The issue's suggested key discord.rfc_channel_id lives under the existing notifications.discord section as notifications.discord.rfc_channel_id.
  • .github/go-package-coverage-ratchet.txt does not exist on v5; the per-package floors live in .github/workflows/v2-tests.yml (default 90 for a new package). pkg/rfcnotify measures 97.6% locally; pkg/github stays at 88.9% (floor 88), pkg/discord 92.9%, pkg/config 90.4%, cmd/hive 76.3% (floor 42).
  • The key also has a Settings dialog control (Notifications > Discord bot > RFC channel id), required by the Settings parity test; it round-trips through notifications_settings.go next to discordChannelId.
  • src/pkg/dashboard/server.go was 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 vet and golangci-lint run on the touched packages: 0 issues.
  • No time.Sleep in any new _test.go.

Contributor checklist

  • Changelog fragment added at changelog.d/added-14616-rfc-discord-notifications.md.
  • PR targets v5.
  • Title uses the repo emoji convention.
  • Commits include DCO sign-off (git commit -s).
  • Docs updated.
  • No secrets, credentials, or local runtime state are committed.

#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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14651 🌱 dashboard: defer merge-gate pills until the PR reaches the gate same files src/pkg/dashboard/static/index.html
#14622 ✨ review: delta re-review mode for PRs already judged at an earlier head same files src/pkg/config/config.go
#14648 🐛 fix(stage): clear needs-triage once an issue is actionable or claimed same files src/pkg/dashboard/static/index.html
#14573 ✨ feat(dashboard): show a draft pill in the activity tracker same files src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@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.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard 3/4)
  • test (dashboard shuffle 3/3)

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>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 27, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit ee64433 into v5 Oct 27, 2026
81 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/rfc-discord-notifications branch October 27, 2026 18:15
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#14617ccb3598` sha256:f0faaf7f5c922496d87e76f3ffd0605a6f770b7e23d499192f642c4b6c341b50 — download from the dashboard or `hivectl review evidence #14617`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at ccb3598.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC lifecycle notifications to Discord #architecture-rfcs

1 participant