Repository navigation
π Evict a PR the hive merged itself from the tracker and cached snapshot at once - #14421
Conversation
β¦hot at once Every hive merge path (sweep, queue, relay, forge) ends in RecordPRMergedAudit, but nothing removed the PR from the dashboard status or the governor's cached ActionableResult: the row left only when the pull_request closed webhook came back round through the hub, when the closed-row sweep ran on the next status publish, or when a full enumeration replaced the snapshot. hivecommons/docs#469 was merged by the sweep at 18:25Z and still showed as Sentinel alert - needs human an hour later while the governor re-evaluated it as merge-eligible seven times. The attribution audit sink now applies the same closed snapshot a webhook delivery would for pr_merged and pr_closed records, patching both stores and remembering the patch for replay. Refs #14420 Signed-off-by: Andy 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 No conflicting open PRs or same-file overlaps were found. |
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this repository have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 87519ac. |
Problem
A PR the hive merges itself stays on the stage tracker ("Needs human" / "Sentinel alert") and in the governor's cached actionable snapshot until GitHub's
pull_request closedwebhook comes back round through the hub, the closed-row sweep runs on the next status publish, or a full enumeration replaces the snapshot. hivecommons/docs#469 onhosted-available-oke-11-placeholder-r05x:pr_merged(path=sweep) at 18:25:46Z, thenintent_evaluated lane=merge-eligiblefor the same PR at 18:31, 18:42, 18:47, 18:52, 18:59, 19:04 and 19:10Z; still listed at 19:25Z. The hub relay (single-shot, 30s timeout, no retry) was failing 921/2314 relays to this spoke while it thrashed before an OOM kill, so thecloseddelivery was lost, and the closed sweep did not run again after 18:13Z.Fix
Every merge path ends in
Client.RecordPRMergedAudit, which delivers apr_mergedaudit record to the attribution sink inconfigureGitHubClient. That sink now callsServer.EvictHiveClosedItem, which applies the same closed+mergedWebhookItemSnapshota webhook delivery would throughapplyWebhookItemSnapshots: the governor snapshot is patched (Dependencies.ApplyWebhookItems), the published status drops the row, the tracker cache is invalidated, and the patch is remembered for replay so an enumeration that began before the merge cannot resurrect it.pr_closedrecords take the same path withMerged=false. No GitHub call is made.Tests
TestHiveMergeEvictsTrackerRowWithoutWebhook: docs#469 fixture leaves the tracker, repo PR count recounts, governor receives one closed+merged patch with the hive-write audit marker, and a stale publish does not bring the row back.TestHiveMergeEvictIsIdempotentAndIgnoresUnlisted: second call, unknown repo, empty repo, number 0 and nil server are no-ops.TestEvictHiveClosedPRFromAuditRecord:pr_mergedandpr_closedevict via/api/status; other actions, missing target or missing repo are ignored.Refs #14420