Repository navigation
🐛 fix: refresh tracker snapshots after hive-side unblocks - #14969
thatguywob wants to merge 3 commits into
Conversation
Queue targeted item reads after all five blocked-label removal paths, before posting unblock notes. Wire the client hook through boot to the dashboard refresher so the tracker and governor snapshot converge without an inbound webhook. Hive-Run: hivecommons#14964 Hive-Plan: hivecommons#14952/part-2b Hive-Spec: issue-14964#item-refresh-hook Signed-off-by: thatguywob <thatguywob@users.noreply.github.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 |
|
@thatguywob this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity. |
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
@thatguywob this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity. |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #14969 should land as a second, client-scoped refresh hook when #14957 (a748632, this PR's own merge base) already wires the process-wide hook that delivers #14964's prescription, or whether #14969 should be closed and #14964 closed as fixed by #14957.
Conclusion: the behaviour this PR adds is already on v5 at this PR's merge base, so the code is not wrong, but merging it adds a parallel path and makes the existing wiring dead. A maintainer should decide whether that is wanted.
What I verified in the tree (merge base a748632, #14957):
src/cmd/hive/main.go:3697—github.SetItemRefreshHook(b.dashSrv.RefreshSelfEditedItem)is already installed at boot, with the comment "The hive's own unblock (blocked sweep, review-backlog block lift) re-reads the issue … (#14952)".src/pkg/github/item_refresh_hook.go:50(ata748632) —unblockIssuealready callsnotifyItemRefresh(repo, number, false)after a successfulRemoveLabel, so all fiveblocked-removal sites that shareunblockIssuealready fire the hook.src/pkg/dashboard/webhook_tracker_refresh.go:275-284—RefreshSelfEditedItemalready doesinvalidateStageTrackerForWebhook()+trackerRefresher().enqueue(...)gated bywebhookTrackerRefreshEnabled(). The newRefreshHiveItem(src/pkg/dashboard/hive_item_refresh.go:9-18) is the same body withstrings.TrimSpace, a different tag string (hive-write:item-refreshvsself:edit— nothing consumes either, I greppedpkg/andcmd/), and without thes.deps.GHClient == nilguard, which is harmless because the refresher'sfetchatwebhook_tracker_refresh.go:218-220returnsErrNoGitHubClientitself.
Effect of merging as-is: unblockIssue (item_refresh_hook.go:65-69 in this PR) prefers the client hook when set, and applyGitHubClientDashboardHooks always sets it when a dashboard exists, so the SetItemRefreshHook call at main.go:3697 becomes dead code without being removed. Two mechanisms, one of them unreachable, for one event.
On the PR body: it says "Boot connects the hook to the dashboard's existing refresher" — accurate, but boot already did that at main.go:3697 before this branch was cut. Issue #14964 was written as "part 2b" of #14952 before #14957 merged the hook; it reads as already satisfied by #14957.
If the client-scoped hook is wanted anyway (e.g. for multi-client isolation), the one change I'd ask for is to delete the now-dead main.go:3697 line in the same PR so there is a single path. If not, I'd recommend closing this in favour of what #14957 already shipped. I have not closed or changed anything.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #14969 should land as a second, client-scoped ItemRefreshHook path on top of #14957 (which already fixes #14964 at this PR's base), or be closed as superseded.
Conclusion: the behaviour this PR describes already exists on v5 at this PR's own base commit, landed by #14957 six minutes after this PR opened. What is left in the diff is a parallel re-implementation that shadows the merged one, not a fix. I'd route this to a maintainer rather than nit it.
What is already on the base (a748632, read from the tree, not the diff):
src/pkg/github/item_refresh_hook.go:36-50— process-wideItemRefreshHook;unblockIssuefiresnotifyItemRefreshafterRemoveLabel(..., BlockedLabel).- All 5 hive-side unblock sites already route through
unblockIssue(issue_blocked.go:465,506,562,632,review_backlog_blocks.go:84). src/cmd/hive/main.go:3697—github.SetItemRefreshHook(b.dashSrv.RefreshSelfEditedItem).src/pkg/dashboard/webhook_tracker_refresh.go:275-284—RefreshSelfEditedIteminvalidates the tracker cache and enqueues the targeted read with delivery idself:edit.
That is exactly the mechanism #14964 asks for ("add a github.ItemRefreshHook fired by every hive-side blocked removal … invalidates the stage-tracker cache and queues the same targeted re-read"), and #14957's body documents it as shipped.
What this PR adds on top:
(*Client).SetItemRefreshHook(per-client, takes precedence over the global hook —item_refresh_hook.go:65-69in this branch).dashboard.RefreshHiveItem(hive_item_refresh.go:9-18), a near-copy ofRefreshSelfEditedItem.github_client_config.go:333installs (2) via (1).
In production both registrations run, the client hook wins, so #14957's RefreshSelfEditedItem becomes dead code while still being wired at main.go:3697. Two mechanisms, one event, and the one that actually runs is the undocumented one.
Small concrete differences, in case the per-client hook is wanted anyway:
RefreshHiveItemdrops thes.deps == nil || s.deps.GHClient == nilguard thatRefreshSelfEditedItem:280has. Not a crash — the refresher'sfetchatwebhook_tracker_refresh.go:218-220returnsErrNoGitHubClient— but it arms a debounce timer for a read that cannot happen. (low)- The delivery id changes from
self:edit(webhook_tracker_refresh.go:265, cited in #14957's body) tohive-write:item-refresh, reusing the prefixhive_write_evict.go:12reserves for closed-item evictions. Anyone grepping patches by prefix will now see reads under the eviction tag. (low) changelog.d/fixed-14964-unblock-item-refresh.mddescribes the behaviour #14957'sfixed-14952-tracker-blocked-on-pill.mdalready announces. (info)
Body vs diff: the body says "Boot connects the hook to the dashboard's existing refresher" — true, but boot already did that at main.go:3697; the PR body does not mention #14957 or that this is a second connection.
I have not closed or changed anything.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @c7030bf, 55/55 checks green, DCO yes, soak 0s of 30m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Closed as superseded by #14957 by @clubanderson from the Hive dashboard. |
Fixes #14964
The hive's own
blockedremovals now invalidate the stage-tracker cache and queue a targeted item re-read without waiting for an inboundunlabeledwebhook. All five removal paths shareunblockIssue, which fires the atomicItemRefreshHookafter successful removal and before the explanatory comment, so a failed comment cannot suppress the refresh.Boot connects the hook to the dashboard's existing refresher. Reads share its debounce, budget guards and configuration, then update the published status and governor snapshot through
ApplyWebhookItems. A disabled targeted-read setting still permits immediate tracker cache invalidation.Regression coverage pins all five unblock paths, failed removals, hook removal, comment failure, debounce coalescing, and an unblock-to-snapshot refresh without a webhook. Added a changelog fragment.
Validation:
gofmt -lon changed Go files andgit diff --checkpassed. Go tests were not run locally perAGENTS.md; CI runs the test matrix.— hive: backend=codex
🐝 Hive Agent:
contributor| SHA:d3a4edf06