From 4d037bfe20959d1153874e14ebce4d082cd6205f Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 19:52:51 -0700 Subject: [PATCH 1/2] fix(dashboard): hide preparation train header for a lone ticket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A single base-preparation ticket is the update-branch lock holder, not a train. After its refresh moves the head the ticket is unverified, so the header read 'Preparation train · 0 confirmed PRs · recorded front: #N' above one row (hive #17151). Draw the header only when two or more tickets are recorded; the row comment keeps the owner/unverified state. Signed-off-by: Andrew Anderson --- ...ed-preparation-train-lone-ticket-header.md | 1 + .../dashboard-sections/activity-monitor.md | 6 +++++ src/docs/dashboard.md | 4 +++- .../stage_tracker_preparation_visual.test.js | 23 +++++++++++++++++++ .../static-src/js/tracker-preparation.js | 13 ++++++++--- src/pkg/dashboard/static/index.html | 13 ++++++++--- 6 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 changelog.d/fixed-preparation-train-lone-ticket-header.md diff --git a/changelog.d/fixed-preparation-train-lone-ticket-header.md b/changelog.d/fixed-preparation-train-lone-ticket-header.md new file mode 100644 index 0000000000..dbba63ba8e --- /dev/null +++ b/changelog.d/fixed-preparation-train-lone-ticket-header.md @@ -0,0 +1 @@ +- Activity Monitor no longer draws a "Preparation train · 0 confirmed PRs" header over a single base-preparation ticket; one owner is the refresh lock holder, not a train, and its row comment already carries its state. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index b0cd8515cf..79dd05318f 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -261,6 +261,12 @@ one header and a continuous connector through expanded captions, row padding and nested PR spacing. An unrelated row or child ends the rail rather than acquiring misleading membership. A missing, closed or stale front is never synthesized as a verified owner; recorded/unverified metadata remains explicit. +A lone ticket draws no header: one owner (or one waiter) is the base-refresh lock +holder, not a train, so its row comment carries the role and verification state and +the header's count and front only appear once two recorded tickets share the base. +A refreshed owner is the usual lone ticket — `update-branch` moves its head, so the +ticket reads *Recorded preparation owner · unverified · Head changed* until it merges +or is released; that is expected, not a dropped batch. When several approved PRs to the same base touch the same files, the automerge lanes merge them one at a time ([#15117](https://github.com/hivecommons/hive/issues/15117)). The tracker renders every train contiguously, in merge order, with a thin left rail linking the rows and a header chip `🚆 merge train · 4 PRs · 1st: #15074` — the glyph is an inline-SVG railcar (14px, currentColor, hover *Merge queue*), the same icon the **Merge queue** column header and its chevrons wear; overlapping files are listed beside it. Pill wording per state is the PR's place in the queue (the owner's words — `front` and `queued-behind` appear nowhere a person reads): the head reads "Queued for merge · 1st of 4 · ~13m" (its own soak left plus the next pass); the others "Queued for merge · 2nd of 4 · ~4m", "Queued for merge · 3rd of 4", … (`1st 2nd 3rd 4th … 11th 12th 13th 21st`, always with the queue length, countdown to its turn); when the page draws more than one train each queue word ends with its train's tag — "Queued for merge · 1st of 2 · train main.go" (the first overlapping file's basename, else the head `#N`) — and the hover leads *Train of 2 PRs overlapping main.go; merges after #15567.*, so two "1st"s on one page tell apart (one train → no tag); the header and every member row of a train share one rail accent (`.ham-train-k0…k3`, cycling in page order); once the front merged and the hive is rebasing a conflicting sibling, "Rebasing · attempt 1/2"; when the loop guard (`auto_merge.merge_train.max_rebase_attempts`) is spent, "Needs human decision · rebase failed twice" at stage/085 with the decision option "Rebase, then merge as maintainer". diff --git a/src/docs/dashboard.md b/src/docs/dashboard.md index 42d04af111..6cc58c1362 100644 --- a/src/docs/dashboard.md +++ b/src/docs/dashboard.md @@ -17,7 +17,9 @@ the actual tracker items and the original train's thin gold side rail through their rows. Existing train styling and theme tokens supply its spacing, border, markers and font. A white marker identifies an exact-current preparation owner; an outlined marker identifies unverified observations. Neither changes CI / -Review chevrons or creates a ready or native queue seat. +Review chevrons or creates a ready or native queue seat. The pill is drawn only +when two or more tickets are recorded for a base; a lone owner shows its state +in its row comment instead. Subdued comments inside the corresponding PR row retain the current pipeline caption and add base-refresh context, known ticket age, and the hosting issue diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index f7a0b9a932..0cbdcd91b5 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -371,6 +371,29 @@ test('comments dedupe current captions, retain current event detail, and use no assert.match(actionHtml, /CI · failing current check · queued for base refresh/); }); +test('a lone ticket draws no train header: the owner row keeps its comment and rail, a second ticket brings the header back', () => { + const { ctx } = load(), f = fixture(); + // hive #17151: the owner's base refresh moved its head, so the ticket is unverified and the only member. + f.owner.head = 'refreshed-45'; + f.q.waiting = []; + f.data.items = [f.owner]; + let rows = render(ctx, f), html = content(rows); + assert.deepEqual(rootKeys(rows), [REPO + '/pr#45']); + assert.doesNotMatch(html, /ham-preparation-head|Preparation train|0 confirmed PRs/); + assert.match(html, /ham-preparation-member/); + assert.match(html, /Recorded preparation owner · unverified/); + rows = render(ctx, f, [], []); + assert.doesNotMatch(content(rows), /ham-preparation-head/); + f.q.waiting = [f.first.preparation]; + f.data.items = [f.owner, f.first]; + html = content(render(ctx, f)); + assert.equal((html.match(/ham-preparation-head/g) || []).length, 1); + assert.match(html, /Preparation train · 1 confirmed PRs · recorded front: #45/); + const issue = { kind: 'issue', repo: REPO, number: 500, stage: 40, linked_prs: [f.owner] }; + f.q.waiting = []; f.data.items = [issue]; + assert.doesNotMatch(content(render(ctx, f)), /ham-preparation-head/); +}); + test('policy omission adds no preparation; read errors and missing snapshots explicitly say unavailable, not zero', () => { const { ctx } = load(), f = fixture(); render(ctx, f); diff --git a/src/pkg/dashboard/static-src/js/tracker-preparation.js b/src/pkg/dashboard/static-src/js/tracker-preparation.js index b810e82e40..167deb6022 100644 --- a/src/pkg/dashboard/static-src/js/tracker-preparation.js +++ b/src/pkg/dashboard/static-src/js/tracker-preparation.js @@ -181,9 +181,15 @@ const id = 'ham-prep-head-' + encodeURIComponent((q.repo || '') + '|' + (q.base_ref || '') + '|' + suffix); return `
${stageTrackerTrainIconHtml('ham-train-icon', 'Preparation train')} ${esc(text)}${stageTrackerPreparationTooltip(id, stageTrackerPreparationHelp(group), 'ham-preparation-help')}
`; } + // A lone ticket is the base-refresh lock holder, not a train: its row + // comment already says owner/waiting and verified/unverified. The header + // (count + front) only earns its line once two recorded tickets share it. + function stageTrackerPreparationHeaderShown(group) { + return group.queue.state !== 'observed' || group.members.length >= 2; + } function stageTrackerPreparationMissingRows() { - return _stageTrackerPreparationInline.flatMap((group, index) => group.queue.state !== 'observed' - || (group.members.length && !group.members.some(e => e.location === 'page')) + return _stageTrackerPreparationInline.flatMap((group, index) => stageTrackerPreparationHeaderShown(group) + && (group.queue.state !== 'observed' || !group.members.some(e => e.location === 'page')) ? [{ key: 'preparation-missing:' + index, html: stageTrackerPreparationHeaderHtml(group, 'missing', false) }] : []); } function stageTrackerPreparationInlineRows(rows, pageItems, stages) { @@ -193,7 +199,7 @@ for (const row of rows) { const item = byKey.get(row.key); const info = stageTrackerPreparationRowInfo(item, stages); - if (info && !stageTrackerPreparationAdjacent(prev, info)) { + if (info && !stageTrackerPreparationAdjacent(prev, info) && stageTrackerPreparationHeaderShown(_stageTrackerPreparationInline[info.groupIndex])) { out.push({ key: 'preparation:' + row.key, html: stageTrackerPreparationHeaderHtml( _stageTrackerPreparationInline[info.groupIndex], row.key, seen.has(info.groupIndex)) }); } @@ -258,6 +264,7 @@ const near = Object.assign({}, ctx, { preparationParent: parent, preparationInfo: info, preparationPrev: infos[i - 1] || null, preparationNext: infos[i + 1] || null }); const heading = !parent && info && !stageTrackerPreparationAdjacent(infos[i - 1], info) + && stageTrackerPreparationHeaderShown(_stageTrackerPreparationInline[info.groupIndex]) ? stageTrackerPreparationHeaderHtml(_stageTrackerPreparationInline[info.groupIndex], 'nested-' + issue.number + '-' + lp.number, seen.has(info.groupIndex)) : ''; if (info) seen.add(info.groupIndex); return heading + stageTrackerSubRowHtml(lp, issue, stages, nowMs, near); diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 15d86d6c04..3d5bea1c5c 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -21907,9 +21907,15 @@

All labels

const id = 'ham-prep-head-' + encodeURIComponent((q.repo || '') + '|' + (q.base_ref || '') + '|' + suffix); return `
${stageTrackerTrainIconHtml('ham-train-icon', 'Preparation train')} ${esc(text)}${stageTrackerPreparationTooltip(id, stageTrackerPreparationHelp(group), 'ham-preparation-help')}
`; } + // A lone ticket is the base-refresh lock holder, not a train: its row + // comment already says owner/waiting and verified/unverified. The header + // (count + front) only earns its line once two recorded tickets share it. + function stageTrackerPreparationHeaderShown(group) { + return group.queue.state !== 'observed' || group.members.length >= 2; + } function stageTrackerPreparationMissingRows() { - return _stageTrackerPreparationInline.flatMap((group, index) => group.queue.state !== 'observed' - || (group.members.length && !group.members.some(e => e.location === 'page')) + return _stageTrackerPreparationInline.flatMap((group, index) => stageTrackerPreparationHeaderShown(group) + && (group.queue.state !== 'observed' || !group.members.some(e => e.location === 'page')) ? [{ key: 'preparation-missing:' + index, html: stageTrackerPreparationHeaderHtml(group, 'missing', false) }] : []); } function stageTrackerPreparationInlineRows(rows, pageItems, stages) { @@ -21919,7 +21925,7 @@

All labels

for (const row of rows) { const item = byKey.get(row.key); const info = stageTrackerPreparationRowInfo(item, stages); - if (info && !stageTrackerPreparationAdjacent(prev, info)) { + if (info && !stageTrackerPreparationAdjacent(prev, info) && stageTrackerPreparationHeaderShown(_stageTrackerPreparationInline[info.groupIndex])) { out.push({ key: 'preparation:' + row.key, html: stageTrackerPreparationHeaderHtml( _stageTrackerPreparationInline[info.groupIndex], row.key, seen.has(info.groupIndex)) }); } @@ -21984,6 +21990,7 @@

All labels

const near = Object.assign({}, ctx, { preparationParent: parent, preparationInfo: info, preparationPrev: infos[i - 1] || null, preparationNext: infos[i + 1] || null }); const heading = !parent && info && !stageTrackerPreparationAdjacent(infos[i - 1], info) + && stageTrackerPreparationHeaderShown(_stageTrackerPreparationInline[info.groupIndex]) ? stageTrackerPreparationHeaderHtml(_stageTrackerPreparationInline[info.groupIndex], 'nested-' + issue.number + '-' + lp.number, seen.has(info.groupIndex)) : ''; if (info) seen.add(info.groupIndex); return heading + stageTrackerSubRowHtml(lp, issue, stages, nowMs, near); From 8ea699d87d0ea852567a6b860097aa1fd57dd7d2 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 19:58:31 -0700 Subject: [PATCH 2/2] fix(dashboard): mobile-shots fixture expects no header over a lone preparation ticket Re-pin TRUSTED_SCRIPTS_TREE for the fixture change. Signed-off-by: Andrew Anderson --- .github/scripts/integration-governance.cjs | 2 +- src/scripts/fixtures/dashboard-preparation-rail.mjs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/integration-governance.cjs b/.github/scripts/integration-governance.cjs index c9a1236bda..c395622f9f 100644 --- a/.github/scripts/integration-governance.cjs +++ b/.github/scripts/integration-governance.cjs @@ -9,7 +9,7 @@ const MAX_COMMITS = 1000; const MAX_AUTHOR_BATCH = 50; // This literal is inside the enrolled .github closure. A caller-supplied // preparedBy.sourceSHA must never choose a new executable verifier tree. -const TRUSTED_SCRIPTS_TREE = '9204e9706f4019d5be4010ae939812f00133a146'; +const TRUSTED_SCRIPTS_TREE = '8cf9edcab6cfbe4e8a847b03209cbca0c604889f'; const SOURCE = 'https://github.com/kubernetes-sigs/kubebuilder-release-tools/tree/012269a88fa4c034a0acf1ba84c26b195c0dbab4'; const sha = value => crypto.createHash('sha256').update(value).digest('hex'); const git = (args, cwd = process.cwd()) => diff --git a/src/scripts/fixtures/dashboard-preparation-rail.mjs b/src/scripts/fixtures/dashboard-preparation-rail.mjs index 648c512df9..4a93f25c5d 100644 --- a/src/scripts/fixtures/dashboard-preparation-rail.mjs +++ b/src/scripts/fixtures/dashboard-preparation-rail.mjs @@ -38,7 +38,8 @@ export function preparationRailLayoutFixture() { const inspect = (block, selector, name, count) => { const members = [...block.querySelectorAll(selector)]; check(members.length === count, name + ': exact member count'); - check(block.querySelectorAll('.ham-preparation-head').length === 1, name + ': one header'); + // A lone ticket is the refresh lock holder, not a train: rail and comment only, no header. + check(block.querySelectorAll('.ham-preparation-head').length === (count >= 2 ? 1 : 0), name + (count >= 2 ? ': one header' : ': no header for a lone ticket')); check(!block.textContent.includes('continuation'), name + ': no repeated continuation'); const lines = members.map(rail); geometry.push({ name, lines }); @@ -80,7 +81,7 @@ export function preparationRailLayoutFixture() { inspect(roots, '.ham-row.ham-preparation-member', 'root reverse-FIFO rows', 3); check(roots.querySelector('.ham-preparation-member')?.dataset.hamKey === stageTrackerItemKey(owner), 'verified front is first despite scrambled source sort'); inspect(nested, '.ham-sub.ham-preparation-member', 'nested PRs with expanded captions', 2); - inspect(single, '.ham-row.ham-preparation-member', 'single-member train with multiline caption', 1); + inspect(single, '.ham-row.ham-preparation-member', 'single ticket with multiline caption', 1); for (const [block, selector, name, count] of [ [roots, '.ham-row.ham-preparation-member', 'last root dynamic comment', 3], [nested, '.ham-sub.ham-preparation-member', 'last nested dynamic comment', 2],