Skip to content

πŸ› Show current preparation backlog without fabricating a ready train - #15887

Merged
hivecommons-hive[bot] merged 8 commits into
v5from
fix/preparation-visibility
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 8 commits into
v5from
fix/preparation-visibility

Conversation

@clubanderson

@clubanderson clubanderson commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Keep the Activity Monitor's existing Merge queue chip visible for durable base-preparation owners and FIFO tickets, even with no ready merge train.
  • Add truthful per-PR preparation annotations without changing CI / Review stages, ready-train membership, scheduler behavior, or native GitHub queue settings.
  • Distinguish exact admitted/current heads, pending pipeline captions, ticket age, expired/inactive tickets, and unknown/unreadable state. Changed owner heads remain explicitly unverified.
  • Reuse a typed, read-only snapshot of the existing durable store; no GitHub fanout, mutation, admission, expiry, new polling loop, settings, or deployment.
  • Wrap preparation metadata within the existing popover instead of overflowing it; count recorded owners, matching open waiting tickets, and unverified tickets separately from train PRs. Exclude known inactive tickets from the displayed queue and active count.

Independence

This standalone visibility fix does not depend on the priority/fairness implementation in #15886, integration rewrite #15885, or native queue PR #15853. It includes only the two additive shared snapshot-seam patches also consumed by those independent branches.

Review and validation

The owner explicitly authorized source merge after mandatory exact-head CI/build/lint is green. No deployment, runtime configuration, or native queue activation is authorized or performed by this PR.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@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 kellyaa 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

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 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
#15892 πŸ› fix: preserve merge notifications across reloads and show countdown same files src/pkg/dashboard/static-src/js/tracker-merged.js
src/pkg/dashboard/static/index.html
#15877 ✨ feature: show abandoned counts on contributor cards and status same files src/pkg/dashboard/static/index.html
#15885 ✨ Add integration-aware orchestration above preparation and native queues same files src/cmd/hive/main.go
src/pkg/dashboard/static/index.html
#15871 πŸ› fix: stage tracker gives immediate Let-hive-decide feedback and says why a human is wanted same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#15849 ✨ Show online ClankeR IDs on the Contributors count pill same files src/pkg/dashboard/static/index.html
#15890 πŸ› dashboard: point operator-reference help marks at the section sub-pages same files src/pkg/dashboard/static/index.html
#15853 ✨ Complete native GitHub queue CI and policy integration same files src/pkg/dashboard/static/index.html
#15859 ✨ feature: add abandoned counts to contributor leaderboards same files src/pkg/dashboard/static/index.html
#15865 ✨ feature: carry abandoned counts through the hub leaderboard same files src/cmd/hive/main.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy 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.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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.

Reviewed (correctness, delta 4980443β†’9d01259) β€” no blocking findings; one low-severity advisory.

Reopened PR in the recentlyClosed ring is projected as inactive even while present in the open snapshot (src/pkg/dashboard/stage_tracker_build.go:491-506, stage_tracker_preparation.go:81-84). The resolver is built with status=nil, so the "open" answer can only come from forgestate (stage_tracker_caption.go:235-247). When deps.GHClient/ForgeState() is nil, the resp.RecentlyClosed fallback wins and project returns inactive before the items loop at :88 ever sees the open row. recentlyClosed is only pruned by time (stage_tracker_recently_closed.go:60-71), and the hive does reopen PRs (hive#15135 flow, stage_tracker_caption.go:826), so a reopened ticket-holder would drop out of the displayed queue/active count until the ring ages out. Transient and low impact; a minimal fix is to let an open-snapshot row beat the closed-ledger answer:

			if len(state) > 0 && state[0] != nil && stageTrackerLinkedPRFinished(state[0](d.repo, m.Number)) && !slices.ContainsFunc(items, func(it StageTrackerItem) bool {
				return it.Kind == "pr" && strings.EqualFold(it.Repo, d.repo) && it.Number == m.Number
			}) {

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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.

Why:

  • the branch conflicts with the base and needs a rebase

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.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
…mantics

Signed-off-by: Andy 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.

Reviewed (intent-alignment) β€” diff matches the title/body; one small gap, advisory only.

Verified: cmd/hive/base_preparation_visibility.go:6 builds a fresh engine without Options.BasePreparation, which falls back to sharedBasePreparation (automerge_base_preparation.go:39-44, :25), the same durable store the sweep engine uses (main_sweeps.go:816-847 sets no override), so the dashboard reads the real tickets. ownerSnapshot (base_preparation_store.go:100-124) is read-only and never creates the dir.

Low / in-scope β€” chip stays visible for an empty observed queue. Body: chip is kept visible "for durable base-preparation owners and FIFO tickets". Diff: tracker-queue.js:107 chip.hidden = !trains.length && !_stageTrackerPreparationQueues.length, and stage_tracker_preparation.go:131-135 still appends a queue when Owner == nil && len(Waiting) == 0 ("No recorded preparation tickets"). Since the store file persists after the first ticket is ever written, every require-current-base repo with any open PR will show a permanent 0 train PRs Β· 0 owner Β· 0 waiting chip once its backlog drains β€” slightly wider than the stated intent (the prep unknown case is deliberately covered by the test at stage_tracker_preparation_test.go JS block, the observed-empty case is not). If the "unknown" chip is wanted but the empty one isn't:

      const prepVisible = _stageTrackerPreparationQueues.some(q => q.state !== 'observed' || (q.owner && q.owner.state !== 'inactive') || (q.waiting || []).some(p => p.state !== 'inactive'));
      chip.hidden = !trains.length && !prepVisible;

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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.

Style review (head 9d01259) β€” no blockers; two maintainability notes.

  1. Redundant state resolver + dead loop β€” src/pkg/dashboard/stage_tracker_build.go:491-506. preparationState is built with stageTrackerPRStateResolver(nil, resp.Merged24h), and that resolver already scans its merged argument (stage_tracker_caption.go:243-247), so the explicit for _, merged := range resp.Merged24h loop at 493-497 can never return anything the resolver call right below it would not. The same function also already holds prState (line 272). Suggest a named helper so the three-source lookup is readable and not duplicated inline:
-	preparationState := s.stageTrackerPRStateResolver(nil, resp.Merged24h)
-	resp.BasePreparation = s.stageTrackerPreparation(resp.Items, now, func(repo string, number int) string {
-		for _, merged := range resp.Merged24h {
-			if merged.Number == number && strings.EqualFold(merged.Repo, repo) {
-				return blockedOnPRStateMerged
-			}
-		}
-		if state := preparationState(repo, number); state != "" {
-			return state
-		}
-		for _, closed := range resp.RecentlyClosed {
-			if closed.Number == number && strings.EqualFold(closed.Repo, repo) {
-				return blockedOnPRStateClosed
-			}
-		}
-		return ""
-	})
+	resp.BasePreparation = s.stageTrackerPreparation(resp.Items, now, s.stageTrackerPreparationPRState(resp))

with stageTrackerPreparationPRState in stage_tracker_preparation.go wrapping stageTrackerPRStateResolver(nil, resp.Merged24h) and the RecentlyClosed fallback.

  1. Variadic used as an optional parameter β€” src/pkg/dashboard/stage_tracker_preparation.go:34: state ...func(string, int) string exists only so tests can omit it (stage_tracker_preparation_test.go:36,53,…); the single production caller always passes one func, and the body does len(state) > 0 && state[0] != nil. Make it a plain state func(string, int) string and pass nil in tests β€” same nil-check, no index gymnastics.

Minor: tracker-queue.js:74 guards typeof stageTrackerPreparationPopHtml === 'function' for a function defined in the same file at line 55; the typeof idiom in this SPA is for cross-file helpers (tracker-row.js:625), so this one can be a direct call.

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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:

  • build-and-test

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: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive
hivecommons-hive Bot merged commit cccbf34 into v5 Oct 30, 2026
76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/preparation-visibility branch October 30, 2026 22:18
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1588723621c8` sha256:30c01f717513526d118d907eabf8bbb30730e183d69eeb613642842ce58bb1a9 β€” download from the dashboard or `hivectl review evidence #15887`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 23621c8.

@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

@clubanderson

Copy link
Copy Markdown
Member Author

Standalone preparation visibility: delivered in v5 source

  • Tested immutable PR head: 23621c899bf5bb43ac1bb581f0638f84bdb61f9c.
  • Actual merge: cccbf34a4e86e7f7cde03be0d610a84ac0201aae, merged at 2026-10-30T22:18:16Z by hivecommons-hive[bot]. The bot performed this merge independently while the ARM64 image job was still running; I did not invoke an administrative merge or claim that job was already green.
  • Final exact-head verdict: all applicable workflows are now terminal SUCCESS, including the ARM64 image/freshness job. PR rollup: 63 passed, 15 scope-skipped, zero failures or pending. Required contexts, DCO, and squash attribution all pass; the actual squash commit preserves the author's DCO sign-off.

Evidence:

The existing Activity Monitor now exposes recorded preparation owners, exact-ticket waiting PRs, and explicitly unverified evidence even with no ready train. Known terminal/held/draft/expired tickets are excluded from active waiting counts/display; admitted-head evidence is never transferred to a refreshed owner head. CI / Review stages, sorting/filtering/pagination, ready trains, and native queue semantics remain unchanged.

Independent precommit review found observation-clock ETag churn; fixed with a copied hash projection and regressions. Real integration conflict with the landed tracker source split was resolved by preserving the split and moving the annotations to the new source files. Its one actual CI failure was a navigation-test loader pointing to the pre-split constant file; the real source path was corrected without deleting assertions, retrying failures, or weakening gates.

No local tests/build/lint/docs guards were run. No manual deployment, production configuration change, native queue enablement, or runtime rollout was performed. Source merge and green PR image checks are not a claim that the live hive runs this revision; publication and runtime attribution remain separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant