Skip to content

🐛 Activity Monitor: name the PR a blocked issue waits on; keep hive's own unblock live - #14957

Merged
clubanderson merged 3 commits into
v5from
fix/tracker-blocked-on-pill
Oct 28, 2026
Merged

clubanderson merged 3 commits into
v5from
fix/tracker-blocked-on-pill

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #14952

Observed 2026-10-28 13:18Z on hive's hive for the reviewer "Review backlog" spin-off issues (#14863 / #14867 / #14868 / #14869 / #14926).

Bug 1 — blocked pill never names the blocker

The issue body carries <!-- hive:blocked-on pr=owner/repo#N --> and the enumeration files reason blocked on owner/repo#N, but the row showed a bare grey blocked, "Open · blocked · since 7h", caption "No stage recorded yet".

  • pkg/github/issue_blocked.go: ParseBlockedOnReason / BlockedOnTarget (body marker, else the filtered reason, so sidelined rows that carry only the reason are covered).
  • pkg/dashboard/stage_tracker.go: new blocked_on_pr: {repo, number, url, state} (the blocked_on name was already taken by the GitHub "blocked by" list from 🐛 stage tracker: issues withheld for open GitHub blockers show as plain Actionable #14765). State comes from caches only — status snapshot open PRs → ForgeState → recent-merge audit ring → "" — never a GitHub call. Caption becomes Blocked on PR #N — lifts when it merges (or merged; the blocked sweep lifts the label next / closed unmerged; the blocked sweep re-triages it next); actor PR #N.
  • index.html: pill reads blocked on #N as a link to the PR, title/aria-label Blocked on PR owner/repo#N (open) — lifts when it merges; re-triage if closed unmerged; the chevron tip and the row tooltip carry it.

Bug 2 — stale blocked after hive's own unblock

The block sweep removed the label at 12:41Z and the webhook re-read patched the governor's cached snapshot within seconds (pod logs: issues 7→10). A reconcile enumeration that had started at 12:38Z finished at ~12:42Z and was published with lastActionable.Store(actionable), overwriting the patch with its pre-unblock copy (log snapshot_age 21m → 4m). Cached cycles then rebuilt status from it; once the dashboard's 30-min webhook replay window lapsed the rows reverted to blocked until the next pass (~66 min).

  • pkg/github/webhook_item_patch.go: ActionableResult.WebhookPatches (process-local, bounded 4096, copied by Clone) remembers applied re-reads; ReplayWebhookPatches(prev) replays onto a fresh result those with FetchedAt after its GeneratedAt, only when the result lists the item with an older updated_at (never moves an item backwards behind a newer listing; never resurrects an item the listing dropped).
  • cmd/hive/eval_cycle_source.go: publishEnumeratedSnapshot (CAS loop) replaces both Store sites (main.go, repos_rescan.go); snapshotPatcher.apply also uses CAS so neither side can overwrite the other.
  • pkg/github/item_refresh_hook.go: ItemRefreshHook + (*Client).unblockIssue, used at all 5 hive-side blocked removals (review_backlog_blocks.go, issue_blocked.go). main.go registers dashSrv.RefreshSelfEditedItem, which drops the tracker cache and queues the same targeted re-read an inbound label webhook gets (ItemPatches delivery self:edit), patching the status row and the governor snapshot.
  • ForgeState already has write-through for the hive's own label edits (forgeWriteThrough via removeLabelObserved), so no change at that level.

Tests

  • pkg/github: TestParseBlockedOnReason, TestUnblockIssue_FiresItemRefreshHook, TestReplayWebhookPatches_*.
  • cmd/hive: TestPublishEnumeratedSnapshotReplaysNewerWebhookReads.
  • pkg/dashboard: TestStageTrackerBlockedOnPRFromMarker (payload + caption + state resolution + JSON shape), TestRefreshSelfEditedItemPatchesRowLikeAWebhook (end-to-end through the refresher with an httptest GitHub), TestStageTrackerRows extended (rendered pill/link/tooltip), new stage_tracker_blocked_on.test.js.
  • No time.Sleep added. go build ./..., go test ./pkg/dashboard/... ./pkg/github/... ./cmd/hive/..., node --test pkg/dashboard/*.test.js, check-api-reference-citations.sh all green.

Docs

docs/dashboard-sections.md (Activity Monitor: Blocked pill, Hive's own unblock is live), docs/labels-and-control-signals.md (blocked row), changelog.d/fixed-14952-tracker-blocked-on-pill.md.

…wn unblock live

Two Activity Monitor bugs on the reviewer review-backlog spin-off issues:

1. The grey blocked pill never said what blocked the issue although the
   body carried <!-- hive:blocked-on pr=owner/repo#N --> and the
   enumeration already filed the reason "blocked on owner/repo#N". The
   tracker now parses the marker (body, else reason) into
   blocked_on_pr {repo, number, url, state}; state is resolved from the
   status snapshot's open PRs, the ForgeState cache and the recent-merge
   ring only, never a GitHub call. The SPA renders the pill as
   "blocked on #N" linking the PR, with a tooltip saying what lifts the
   block; the caption reads "Blocked on PR #N" instead of "No stage
   recorded yet" and the row title carries it.

2. Rows stayed blocked ~an hour after the hive itself removed the label.
   A reconcile enumeration that started before the unblock was stored
   with lastActionable.Store, overwriting the webhook re-read that had
   patched the cached snapshot; cached cycles then rebuilt status from
   the pre-unblock copy. The governor now remembers applied webhook
   re-reads on the snapshot and replays those newer than a pass's start
   onto its result before publishing (compare-and-swap). Every hive-side
   blocked removal also fires a github.ItemRefreshHook that drops the
   tracker cache and queues the same targeted re-read an inbound label
   webhook gets.

Fixes #14952

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 28, 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 nicholasjackson 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

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 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
#14968 ✨ dashboards: upgrade progress pill, history and Upgrade now (interrupt turns) same files src/cmd/hive/main.go
src/pkg/dashboard/static/index.html
#14821 🐛 fix: preserve supersession decisions across stage reconciliation same files src/cmd/hive/main.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14965 🐛 fix(dashboard): name the blocking PR on tracker rows and keep webhook unblocks from being overwritten CONFLICT src/cmd/hive/eval_cycle_source.go
src/cmd/hive/main.go
src/cmd/hive/repos_rescan.go
src/docs/scale-envelope.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
src/pkg/github/client.go
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#14953 ✨ hub+spoke: expose scheduled-upgrade progress, drain countdown and upgrade history same files src/cmd/hive/main.go
#14524 ✨ feat(hub,agent): Hub-coordinated live CLI session pool for multi-tenant runner capacity same files src/cmd/hive/main.go
#14921 ✨ feature: inline the linked Linear issue into review kicks same files src/cmd/hive/main.go

@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/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 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:

  • relative links and anchors resolve

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.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with #14965 (scanner's PR for the same issue #14952): both add StageTrackerItem.BlockedOnPR with the same blocked_on_pr JSON shape, the same caption/pill text, and the same CompareAndSwap rewrite of snapshotPatcher.apply plus a replay-before-publish helper at the two lastActionable.Store sites. Both cannot merge; I have recommended on #14965 that it be closed in favour of this one, since this PR is a superset (ItemRefreshHook + unblockIssue, closed state via ForgeState, docs, JS test).

What I read here and found correct: finish() sets the blocked modifier before stageTrackerBlockedOnPR is called (stage_tracker.go hunk @1571), so the slices.Contains(it.Modifiers, modBlocked) guard sees the label; resp.RecentlyMerged is populated at stage_tracker.go:1328 ahead of stageTrackerPRStateResolver capturing it; publishEnumeratedSnapshot re-runs ReplayWebhookPatches on each CAS retry, which is safe because listedUpdatedAt refuses to move an already-patched copy backwards. I did not read the 966-line diff exhaustively — this is a targeted read of the two fix paths, not a full sign-off.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@clubanderson
clubanderson merged commit a748632 into v5 Oct 28, 2026
78 of 80 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/tracker-blocked-on-pill branch October 28, 2026 14:37
@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 Bot pushed a commit that referenced this pull request Oct 28, 2026
…als out of the merge gate (#15011)

* Close superseded hive PRs automatically and re-stage adopted originals out of the merge gate

A hive-authored PR whose closing targets are all closed, one of them by a
different merged PR, and whose head conflicts with the base (or whose files
that PR already covers) is now closed by the hive itself as hive/superseded
with a notice naming the superseding PR: in the self-authored auto-merge
lane before any review is dispatched, in the supersession sweep when the
rebase is refused for a conflict, and in close-on-merge of the superseding
PR. New knob governor.auto_close_superseded (default on); human-authored PRs
are never auto-closed.

A contributor PR adopted in supersede mode leaves stage/085-needs-decision
in the adopting pass when the park was only the review swarm's
requires_human verdict, renders in the CI/Review column with an
'Adopted -> #N' pill, and the duplicate-fix sweep no longer closes the
superseding App PR as a duplicate of the PR it supersedes.

Evidence: #14965 (closed by #14957 for #14952), #14975 -> #14980,
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
#14947 -> #14977.

* Move changelog fragment to repo-root changelog.d

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
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 conflicts-with-open-pr Open PR has a merge conflict with another open PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activity Monitor: blocked pill never names the blocking PR, and hive's own unblock leaves rows blocked until the next enumeration

1 participant