Repository navigation
🐛 fix(automerge): route engine status-comment creates through the notification primitive - #16351
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
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: rebased onto v5; CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Looks correct to me; read against the tree at What I verified
Suggestion (not a defect): there is no test asserting the engine forge is actually canary-gated (a body containing a canary → create refused). The ratchets fail without this diff, which covers the routing, but a one-case test on the quiet path would pin the property the issue asked for. Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Evidence bundle `#1635141813bb` sha256:394c27eb4767fa757cbb80a1582b5a4b640383b09e48ae93e5070929346d6c18 — download from the dashboard or `hivectl review evidence #16351`. |
ccb61bb to
1cba30d
Compare
There was a problem hiding this comment.
Conclusion: the routing change is right, but CI is red for a reason this diff owns, and the fix is one baseline line.
What I verified (tree at ccb61bb):
engineStatusForge.CreateComment(src/pkg/github/automerge/automerge_stage_labels.go:1533-1539) now type-assertsf.e.transporttoissueCommenterand callsCreateIssueComment(ctx, "owner/repo", number, body). The production transport*github.Clienthas exactly that method (src/pkg/github/client.go:2938), so the canary gate / effects journal are now on this path as intended. The only caller iswriteStatusSection(automerge_stage_labels.go:1492-1499) viaprstatus.Write, which keepsCreatedsemantics unchanged.notification_write_sites.go+src/docs/notifications.mdadd the passthrough row, soTestNotificationWriteSitesInventoryis satisfied.
Finding — TestDirectWriteRatchet fails (high, blocks merge):
src/pkg/writeback/ratchet_test.go:33 classifies any .CreateIssueComment( call as a tier-2 wrap write, and ratchet_test.go:73-74 records it per file. The new call at automerge_stage_labels.go:1538 therefore adds wrap pkg/github/automerge/automerge_stage_labels.go 1, but src/pkg/writeback/testdata/direct-writes-baseline.txt only has the raw … 5 → 4 edit. CI job test (rest 2/4) reports exactly this: wrap pkg/github/automerge/automerge_stage_labels.go: 1 direct write call(s) in a file not in the baseline. The coverage and test failures are downstream of the same package failing.
Fix: add wrap pkg/github/automerge/automerge_stage_labels.go 1 to the baseline, following the precedent at line 110 (wrap pkg/github/pr_status_comment.go 2) set when clientStatusForge made the same move.
Also: mergeable=CONFLICTING — the conflict is confined to src/docs/notifications.md (the passthrough table; a neighbouring row landed on v5). A rebase resolves it; the Go side auto-merges cleanly.
No other defects found; the issueCommenter interface declaration itself does not match the ratchet regex (no leading .), so the count after the fix is exactly 1.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read at 206a6a2 against v5. Looks correct to me.
automerge_stage_labels.go:1549-1554:engineStatusForge.CreateCommentnow routes throughtransport.(issueCommenter).CreateIssueComment, which ishgithub.(*Client).CreateIssueComment(pkg/github/client.go:2941) — the canary scan,logscrub, andeffects.ExecuteReconcilingjournal all apply to the forge's create now. The type assertion fails closed with an error rather than falling back to the raw client.- Test coverage holds:
newStageEngine(automerge_stage_labels_test.go:264) wires a realhgithub.NewClientat the httptest URL, soTestQuietNotificationsStageNotesFoldIntoOneEditedCommentexercises the new path end-to-end againstapi.comments. - Baseline bookkeeping is consistent:
automerge_stage_labels.goraw 5→4 and wrap +1; the remaining rawIssues.CreateCommentat:1493(non-quiet path) is intentionally out of scope for #16344.
Minor open question, not a defect: the issueCommenter interface is declared in automerge rather than next to the existing optional transport hooks (reviewEvidenceStarter, alreadyLandedCloserTransport) — same pattern, so fine as-is.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
…ification primitive Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
206a6a2 to
11852a9
Compare
There was a problem hiding this comment.
Read the tree at 11852a9, not just the diff. This looks correct to me.
src/pkg/github/automerge/automerge_stage_labels.go:1549-1554now mirrorsclientStatusForge.CreateComment(pkg/github/pr_status_comment.go:66) exactly: sameowner/repojoin, sameCreateIssueCommentprimitive, so the canary gate,logscrub, the effects journal andrecordNotificationWrite(client.go:2945-2979) all apply to the engine's status-comment create.- The type assertion on
f.e.transportcannot fail in production (*hgithub.Clientis the transport) and the quiet-notification tests already drive this path through a realhgithub.NewClientagainsthttptest(automerge_stage_labels_test.go:264,automerge_quiet_notifications_test.go:29-60), so the "created once, then edited" assertion exercises the new code rather than a fake. - Baseline arithmetic checks out: one
raw→wrapindirect-writes-baseline.txt; inventory andnotifications.mdrows added with the same class/passthrough as the client-side forge.
Info only, not a defect and out of #16344's scope: the non-quiet branch of the same writer (automerge_stage_labels.go:1493) still calls c.gh.Issues.CreateComment directly and is one of the 4 remaining raw writes in the baseline. Same follow-up shape if someone wants the engine fully inventoried.
— 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 |
The automerge engine's status-comment create called the raw go-github client, bypassing the canary gate and effects journal of CreateIssueComment and hiding from TestNotificationWriteSitesInventory. It now goes through the transport's tagged CreateIssueComment, is inventoried as a status passthrough, and the raw-write baseline for automerge_stage_labels.go is lowered from 5 to 4.
Closes #16344
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88