Repository navigation
✨ feat: render RFC notices as summary-card embeds when rfc_format: card - #15999
Conversation
|
[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
|
|
native-queue-policy red is a false positive — no code change needed. The failing check-run (job 124492613313) was a The run that actually evaluates #15999 is 41185928862 (bounded wait for the PR providers); the earlier same-SHA evaluation 41176410411 succeeded. Leaving the head as-is rather than pushing an empty commit. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Security perspective (head d53f1a9) — no blocker. The private/visibility gates run before any body-derived rendering (src/pkg/rfcnotify/sweeper.go:209-224), allowed_mentions: {parse: []} is forced unconditionally in the shared postMessage path (src/pkg/discord/bot.go postMessage) and asserted by TestSendEmbedTo_PayloadAndAllowedMentions, and the 429 retry is bounded to one attempt capped at 5s (maxDiscordRetryAfter).
One advisory, low:
- Masked links from the issue body render in the embed.
ParseRFCcopies the first## Summaryparagraph intoEmbed.Descriptionand theRelatedcell (rawvalfallback when the regex finds no#N/github URL) into a field value (src/pkg/rfcnotify/card.goParseRFCrelated-key branch;Card→Description/Related).logscrub.ScrubStringmasks secrets but does not neutralise[text](https://…), and Discord renders masked links in embed descriptions and field values. Line mode never emitted body text and wrapped URLs in<>; card mode is therefore a small new trust-boundary widening: whoever can edit anrfc-labelled issue body can place an arbitrary clickable link in the announcer channel. Suggested fix: escape]((or strip link syntax) in body-derived strings before truncation, mirroring the<url>convention inFormat.
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Intent alignment (#15927), head b6a3a55: the diff delivers the issue's four changes — Two PR-body statements describe work that is not in this diff (advisory, non-blocking):
Suggest trimming those two paragraphs from the body so the merge description matches the change. Review findings from docs-currency review (head Stale operator-reference row for Advisory (non-blocking): Review findings from Read the diff against v5 plus the callers ( Two things for the fix agent, neither a defect in the code:
Note for the body: factoring Review findings from Read
Two things worth knowing before this merges, neither a defect:
The behaviour note in the body is accurate: factoring Review findings from Style review (head b6a3a55) — approve, one advisory PR body describes a refactor this diff does not contain. The "Behaviour note" says Minor, non-blocking: Review findings from docs-currency (head One doc gap this PR introduces; the rest of the docs rows match the code (
Advisory (not a doc change): the PR body's "Behaviour note" about factoring |
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
Render an RFC event as a Discord summary card (embed) when rfc_format: card is configured on the designated announcer. Line mode is unchanged. - Add Body to github.IssueSnapshot and map it in rfcnotify.Issue. - Parse RFC target, status, scrubbed summary, and decisions count in rfcnotify.ParseRFC. - Render Discord embed with state-based color in rfcnotify.Card. - Fall back to plain Format when the RFC body is malformed. - Support SendEmbedTo and bounded 429 retries in pkg/discord. - Adapt Sweeper to Publisher interface. Hive-Run: #15927 Hive-Plan: summary-card-embeds Hive-Spec: rfc-publishing#summary-cards Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
… persistence test - Assign updated instead of since on fakeSource in card_test.go - Guard redirectTransport against nil httptest.Server in newTestBot - Provide statePath in TestRFCNotifyWire_CardFormatPostsEmbed to persist state across forcePoll - Point trigger persistence test storage paths to uncreatable locations Hive-Fix-Attempt: 1/6 Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Apply logscrub.ScrubString to embed field values extracted from contributor-controlled RFC tables and add TestCard_FieldScrubbing. Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
- Remove ineffectual newPoster assignment and unused discordRFCPoster in cmd/hive/rfcnotify_wire.go - Remove unreachable Poster case in rfcnotify.toPublisher type switch Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Send the formatted lifecycle event alongside cards so Discord and plain-poster fallbacks retain the transition, URL and linked RFC. Exclude checked numbered decisions, require Publisher at compile time, and cover lifecycle transitions in both publishing paths. Drop the unrelated dashboard persistence test change as requested in review. Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
CI at 146f530 fails TestEventTriggersRejectInvalidAndUnpersistedRules in both dashboard 2/4 and dashboard shuffle 2/3. Save removes the empty directory used as RuntimeConfigFile and retries successfully, returning HTTP 200 instead of the expected failure. Use paths beneath a missing parent so persistence still fails after the remove-and-retry recovery. Keep this base-test repair separate from RFC card changes for review and bisectability. Related: #15978. Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
…dy card post Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Hive-Fix-Attempt: 3/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Reconcile RFC summary cards with v5's threads mode and the shared discord.Bot.do helper: SendEmbedTo now rides do(), the sweeper keeps threads delivery and card publishing as separate branches, and the 429 tests use the rateLimitSleep hook. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Intent alignment (#15927) — reviewed at current head b6a3a557 (merge of v5; the dispatched head e34c5f85 has been superseded).
The diff covers every item in #15927: Body on IssueSnapshot (src/pkg/github/issue_snapshots.go:23,92) → rfcnotify.Issue (src/cmd/hive/rfcnotify_wire.go:430); ParseRFC/Card with fallback to Format when the body is empty of metadata (src/pkg/rfcnotify/sweeper.go:283-291); SendEmbedTo with allowed_mentions.parse: [] (src/pkg/discord/bot.go messagePayload); Publisher seam typed on Run; private gate still runs before publish (sweeper.go:245 vs :264); changelog + both docs rows. The unrelated dashboard fixture from #15973 is no longer in the file list. No scope creep found.
One advisory, no code change needed:
- The PR body's Behaviour note ("factoring
SendMessageTointopostMessage… one-shot 429 retry with up to a 5 s blocking sleep") is stale after the v5 merge. At head there is nopostMessage;SendEmbedTogoes through the pre-existingBot.do(src/pkg/discord/bot.go:462) which retries 429 up tomaxRateLimitRetries = 3(bot.go:40). Worth updating the body so maintainers aren't misled about retry semantics (issue asked for "at most one bounded retry"; the 3-retry bound is pre-existing v5 behaviour, not introduced here).
— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Hive-Fix-Attempt: 4/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the diff against merge-base de6127e0 with the tree checked out at 045c04dc; go build of pkg/rfcnotify, pkg/discord and cmd/hive is clean. This looks correct to me — the three findings carried over from #15973 are addressed in the code, not just the body:
- (a)
Sweeper.Run(ctx, src, pub Publisher)atsrc/pkg/rfcnotify/sweeper.go:179;PostersatisfiesPublishervia the two methods atsweeper.go:45-57, and the wiring passesstate.pub(src/cmd/hive/rfcnotify_wire.go:447). - (b)
publish()atsweeper.go:283-291always hands the formatted line ascontenttoPostCard, so the plain-Posterfallback keeps the transition text (sweeper.go:53). Covered byTestSweeperCardFormat_PreservesTransitions. - (c)
src/pkg/dashboard/api_event_triggers_test.gois not in the merge-base diff (15 files, matching the PR).
Two doc claims I checked rather than took on faith: SendEmbedTo (src/pkg/discord/bot.go:276) builds on messagePayload, which sets allowed_mentions.parse: [] (bot.go:266-271), so embeds cannot ping; and it goes through Bot.do, whose bounded 429 retry is at bot.go:490-491. The threads-mode branch (sweeper.go:251) is untouched, so "plain text with rfc_threads: true" in notifications.md matches the code.
Not a blocker, just an observation: ParseRFC (card.go:98-112) will take a | table row as the summary if it is the first non-empty line under ## Summary; TestParseRFC_MalformedBody covers the empty case but not that one. Fine to leave.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15973 (adopted after CI went red and the contributor was unavailable; original commits by @thatguywob preserved).
Closes #15927
This branch is #15973's head
d53f1a9ae43cas pushed by @thatguywob (forkthatguywob/hive), unchanged. Last lane reason on the original:reviewer-verdict:changes_requested.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.Open review finding carried over from #15973: the review swarm's latest verdict on
d53f1a9ae43crequested changes (changes_requested); read the swarm's review on #15973, address it here, and let the swarm re-review this PR. Green CI alone is not done.Thanks @hanthor for the request. Implements #15927 against RFC #15869.
Review asks addressed
Rebased onto
v5. Carried-over findings from #15973:Sweeper.Runtyped onPublisher:Run(ctx, src, pub Publisher)with noany/toPublisherindirection. Tests wrap bare funcs asrfcnotify.Poster(...); the production caller passesstate.pub.msg) ascontenttoPostCard, so a plainPosterpostsRFC opened: …/RFC closed (…)/ etc. instead of the bare card title. Covered byTestSweeperCardFormat_PreservesTransitions(fallback path).src/pkg/dashboard/api_event_triggers_test.gonow matchesv5exactly; that fix is tracked in [reviewer] Review backlog (style): Unrelated dashboard test change bundled into RFC card feature PR #15978 / 🌱 test: make the event-triggers storage-failure case order independent #15997.