Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/integration-governance.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 'b1b6477108b28bda15e93735f2f6723568d0281d';
const TRUSTED_SCRIPTS_TREE = '308d64dd1ac3bf1061a4dced3071647236327e51';
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()) =>
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/dashboard-mobile-shots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- 'src/pkg/dashboard/**'
- 'src/scripts/dashboard-mobile-shots.mjs'
- 'src/scripts/fixtures/dashboard-preparation-rail.mjs'
- '.github/workflows/dashboard-mobile-shots.yml'

concurrency:
Expand All @@ -30,18 +31,19 @@ jobs:
node-version: '22'

# The self-hosted fleet ships no browser (#11810): fetch Chrome for Testing
# into RUNNER_TEMP and hand it to the harness via CHROME_BIN. Best-effort —
# if the download fails the harness prints SKIP instead of crashing.
# with its Linux runtime dependencies and hand the working executable
# to the harness via CHROME_BIN. The minimal fleet lacks libnspr4.
- name: Install Chrome for Testing
id: chrome
continue-on-error: true
run: |
set -euo pipefail
out="$(npx --yes @puppeteer/browsers@2 install chrome@stable --path "$RUNNER_TEMP/chrome-for-testing" | tail -n 1)"
sudo apt-get update
out="$(sudo env "PATH=$PATH" npx --yes @puppeteer/browsers@2 install chrome@stable --install-deps --path "$RUNNER_TEMP/chrome-for-testing" | tail -n 1)"
bin="${out#* }"
test -x "$bin"
echo "CHROME_BIN=$bin" >> "$GITHUB_ENV"
"$bin" --version
echo "CHROME_BIN=$bin" >> "$GITHUB_ENV"

- name: Capture mobile screenshots and overflow report
run: node src/scripts/dashboard-mobile-shots.mjs --out dashboard-mobile-shots-out
Expand Down
1 change: 1 addition & 0 deletions changelog.d/fixed-preparation-continuous-connector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Group complete preparation issue/PR row units into a front-first FIFO block with an uninterrupted connector through captions and nested spacing; preserve unrelated rows and child associations, distinguish unverified recorded fronts, and validate geometry in Chrome with its required runtime dependencies.
13 changes: 13 additions & 0 deletions src/docs/dashboard-sections/activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ It counts under **Needs attention**. Before the merge gate only the held-workflo

#### Merge train

**Preparation is a separate, not-yet-ready train.** Its compact gold header and
original thin rail annotate actual preparation members without changing their
CI/review stages. Before pagination, complete issue/PR row units form a contiguous
block at the first preparation unit's position: the recorded front is first,
then waiters in durable ticket FIFO. Nonmember units retain their relative order.
Related PRs stay with their issue; nested preparation children follow FIFO while
nonmember siblings retain their relative order. Explicit ticket positions remain
the authority when one issue contains non-adjacent tickets. Adjacent members share
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.

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 "Merge queued · 1st of 4 · ~13m" (its own soak left plus the next pass); the others "Merge queued · 2nd of 4 · ~4m", "Merge queued · 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 — "Merge queued · 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".

The tooltip lists the PRs ahead and the overlapping files. Waiting siblings are never red, never `needs human`; a `needs-rebase` label on one is reported under `stale_labels`, the train repairs it. Each item carries `merge_gate.state` (`queued-behind` / `rebasing` / `rebase-exhausted` / `front`, with an honest `reason` such as `behind #15074 in merge train (3rd of 4, overlapping files: stage_tracker.go, index.html)`) and `merge_train{id, state, front, position, size, attempt, max_attempts, overlap_files, ahead, members}`; the id is `<base>#<front>` and `members` is the whole roster in merge order.
Expand Down
115 changes: 108 additions & 7 deletions src/pkg/dashboard/stage_tracker_preparation_visual.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,84 @@ test('original compact pill and connector decorate actual rows with FIFO help an
assert.deepEqual(plain(f.data), before);
});

test('actual custom sorts, pagination and stage ranges are unchanged; backwards order starts separate runs', () => {
test('preparation FIFO overrides custom row sort before pagination without mutating its input', () => {
const { ctx } = load(), f = fixture();
const ordered = ctx.stageTrackerSort(f.data.items, [], { sort: 'number', dir: 'asc' });
const page = ctx.stageTrackerPage(ordered, { size: 25, page: 1 });
const original = plain(ordered);
const prepared = ctx.stageTrackerPreparationOrderRows(f.data, ordered, []);
const page = ctx.stageTrackerPage(prepared, { size: 25, page: 1 });
const before = plain(page), rows = render(ctx, f, page.rows, ordered);
assert.deepEqual(plain(ordered), original);
assert.deepEqual(plain(page), before);
assert.deepEqual(rootKeys(rows), page.rows.map(it => ctx.stageTrackerItemKey(it)));
assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 3);
assert.match(content(rows), /continuation/);
for (const row of rows.filter(row => !row.key.startsWith('preparation:'))) assert.match(row.html, /ham-train-last/);
assert.deepEqual(rootKeys(rows), [45, 9, 2].map(n => REPO + '/pr#' + n));
assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 1);
assert.doesNotMatch(content(rows), /continuation/);
const members = rows.filter(row => !row.key.startsWith('preparation:'));
for (const row of members.slice(0, -1)) assert.doesNotMatch(row.html, /ham-train-last|ham-preparation-gap/);
assert.match(members.at(-1).html, /ham-train-last/);
assert.deepEqual(plain(model(ctx, f)[0].waiting.map(e => [e.ticket.number, e.position])), [[9, 1], [2, 2]]);
});

test('scrambled preparation units form one front-first block while nonmembers retain their relative order', () => {
const { ctx } = load(), f = fixture();
const others = [81, 82, 83].map(number => ({ ...f.first, number, preparation: null, head: 'other-' + number }));
const source = [others[0], f.second, others[1], f.owner, others[2], f.first];
f.data.items = source;
const before = plain(source);
const ordered = ctx.stageTrackerPreparationOrderRows(f.data, source, []);
assert.deepEqual(plain(ordered.map(it => it.number)), [81, 45, 9, 2, 82, 83]);
assert.equal(new Set(ordered).size, source.length);
assert.deepEqual(plain(source), before);
const rows = render(ctx, f, ordered);
assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 1);
for (const other of others) assert.doesNotMatch(rootRow(rows, other.number).html, /ham-preparation-member|ham-preparation-node/);
});

test('a nested front moves its complete issue unit and preserves unrelated children without duplicate PR rows', () => {
const { ctx } = load(), f = fixture();
const unrelated = { ...f.first, number: 84, head: 'unrelated', preparation: null };
const issue = { kind: 'issue', repo: REPO, number: 500, stage: 40, linked_prs: [unrelated, f.owner] };
f.data.items = [f.second, issue, f.first];
const before = plain(f.data);
const ordered = ctx.stageTrackerPreparationOrderRows(f.data, f.data.items, []);
assert.deepEqual(plain(ordered.map(it => [it.kind, it.number])), [['issue', 500], ['pr', 9], ['pr', 2]]);
assert.deepEqual(plain(issue.linked_prs.map(it => it.number)), [84, 45]);
assert.deepEqual(plain(f.data), before);
const rows = render(ctx, f, ordered), html = content(rows);
assert.deepEqual(rootKeys(rows), [REPO + '/issue#500', REPO + '/pr#9', REPO + '/pr#2']);
assert.equal((html.match(/data-ham-sub-key="hivecommons\/hive\/pr#45"/g) || []).length, 1);
assert.doesNotMatch(html, /data-ham-key="hivecommons\/hive\/pr#45"/);
});

test('nested preparation children follow FIFO as one block while nonmember siblings keep their original order', () => {
const { ctx } = load(), f = fixture();
const others = [85, 86].map(number => ({ ...f.first, number, preparation: null, head: 'other-' + number }));
const issue = { kind: 'issue', repo: REPO, number: 501, stage: 40,
linked_prs: [others[0], f.second, others[1], f.owner, f.first] };
f.data.items = [issue];
ctx.stageTrackerPreparationVisualSync(f.data, f.data.items, f.data.items, [], NOW);
const ordered = ctx.stageTrackerPreparationOrderLinked(issue.linked_prs, issue);
assert.deepEqual(plain(ordered.map(lp => lp.number)), [85, 45, 9, 2, 86]);
assert.deepEqual(plain(issue.linked_prs.map(lp => lp.number)), [85, 2, 86, 45, 9]);
});

test('missing, closed and stale recorded fronts never become verified owners or fabricated rows when ordering', () => {
for (const state of ['missing', 'closed', 'stale']) {
const { ctx } = load(), f = fixture();
if (state === 'missing') f.data.items = [f.second, f.first];
if (state === 'closed') f.owner.state = 'closed';
if (state === 'stale') f.owner.head = 'new-owner-head';
const ordered = ctx.stageTrackerPreparationOrderRows(f.data, f.data.items, []);
assert.equal(new Set(ordered).size, f.data.items.length, state);
if (state === 'missing') assert.deepEqual(plain(ordered.map(it => it.number)), [9, 2]);
const rows = render(ctx, f, ordered), html = content(rows);
assert.doesNotMatch(html, /ham-train-front/);
assert.match(rows.find(row => row.key.startsWith('preparation:')).html, /recorded front: #45/);
if (state === 'missing') assert.doesNotMatch(html, /data-ham-key="hivecommons\/hive\/pr#45"/);
if (state === 'stale') assert.match(rootRow(rows, 45).html, /ham-preparation-unverified/);
}
});

test('unrelated rows terminate rails; filtered FIFO gaps use dashed continuation without inventing adjacency', () => {
const { ctx } = load(), f = fixture();
const other = { ...f.first, number: 80, head: 'other', preparation: null };
Expand All @@ -148,6 +213,18 @@ test('off-page owner remains truthful in compact header/help with real waiting o
assert.equal(rootKeys(rows).length, 1);
});

test('preparation commentary deduplicates the exact canonical clause, not a different owner-number prefix', () => {
const { ctx } = load(), f = fixture();
f.first.caption = 'Review swarm requested; waiting for a verdict on the current head — queued for base refresh behind PR #45';
let html = rootRow(render(ctx, f, [f.owner, f.first, f.second]), 9).html;
let body = html.match(/ham-preparation-comment"><span class="cue-event-body">([^<]*)/)[1];
assert.equal((body.match(/queued for base refresh behind PR #45/g) || []).length, 1);
f.first.caption = 'Review pending — queued for base refresh behind PR #4';
html = rootRow(render(ctx, f, [f.owner, f.first, f.second]), 9).html;
body = html.match(/ham-preparation-comment"><span class="cue-event-body">([^<]*)/)[1];
assert.match(body, /behind PR #4 · queued for base refresh behind PR #45/);
});

test('release/handoff clears former owner decoration and pill suppression; readmission preserves durable FIFO', () => {
const { ctx } = load(), f = fixture();
render(ctx, f);
Expand Down Expand Up @@ -221,7 +298,7 @@ test('multiple/shared issue trees keep their actual nested rows and PR stages wi
assert.match(html, /data-ham-stage="70" data-ham-sub-key="hivecommons\/hive\/pr#2"/);
assert.match(html, /shown under issue #500/);
assert.deepEqual(plain(f.data), before);
assert.match(rootRow(rows, 500, 'issue').html, /ham-preparation-gap/);
assert.doesNotMatch(rootRow(rows, 500, 'issue').html, /ham-preparation-gap/);
});

test('mixed linked trees mark only preparation children and stop before an unrelated child', () => {
Expand Down Expand Up @@ -362,3 +439,27 @@ test('gold summary stays ready-only without the removed external region', () =>
assert.equal(count.textContent, '1');
assert.doesNotMatch(chip.title, /preparation|owner|waiting/);
});

test('expanded captions and adjacent nested members share a full-height connector without moving unrelated children', () => {
const { ctx } = load(), f = fixture();
f.owner.stage = 50; f.first.stage = 70;
f.first.caption = 'Expanded current-head CI and review detail. '.repeat(24);
f.q.waiting = [f.first.preparation];
const unrelated = { ...f.second, number: 80, stage: 90, preparation: null, head: 'other' };
const issue = { kind: 'issue', repo: REPO, number: 500, stage: 40, linked_prs: [f.owner, unrelated, f.first] };
f.data.items = [issue];
const before = plain(f.data), html = content(render(ctx, f));
assert.deepEqual(plain(f.data), before);
assert.equal((html.match(/ham-preparation-head/g) || []).length, 1);
assert.equal((html.match(/ham-train-last/g) || []).length, 1);
assert.doesNotMatch(html, /continuation/);
assert.match(html, /class="ham-sub" data-ham-kind="pr" data-ham-stage="90"/);
assert.match(html, /ham-preparation-member ham-train-last" data-ham-kind="pr" data-ham-stage="70"/);
assert.match(html, /ham-preparation-member ham-train-front" data-ham-kind="pr" data-ham-stage="50"/);
assert.match(html, /Expanded current-head CI and review detail\./);
const childKey = number => html.indexOf('data-ham-sub-key="' + REPO + '/pr#' + number + '"');
assert.ok(childKey(80) < childKey(45));
assert.ok(childKey(45) < childKey(9));
const css = fs.readFileSync(path.join(__dirname, 'static-src/css/tracker.css'), 'utf8');
assert.match(css, /\.ham-row\.ham-preparation-member::before \{ top: calc\(-1 \* var\(--line-width\)\)/);
});
16 changes: 11 additions & 5 deletions src/pkg/dashboard/static-src/css/tracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,30 @@
.ham-row.ham-train-front::after { background: var(--text); }
.ham-train-head + .ham-row.ham-train { border-top: 0; }
.ham-preparation-head { flex-wrap: wrap; }
.ham-row.ham-preparation-member::before { top: calc(-1 * var(--line-width)); }
.ham-row.ham-preparation-member.ham-train-last::before { bottom: 0; }
.ham-row.ham-preparation-member::after { display: none; }
.ham-preparation-head .ham-train-chip { white-space: normal; }
.ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); }
.ham-preparation-help::before { content: '?'; }
.config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: calc(50% - var(--sp-2)); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; }
.config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: 50%; transform: translateY(-50%); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; }
.ham-row.ham-preparation-member > .ham-strip-row > .ham-preparation-node { left: calc(var(--sp-2) - var(--sp-5) - 2px); }
.ham-preparation-node::before { content: none; }
.ham-preparation-node::after { content: ''; position: absolute; left: 1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); }
.ham-train-front > .ham-strip-row > .ham-preparation-node::after { background: var(--text); }
.ham-preparation-node:focus-visible { outline: var(--focus-ring-width) solid var(--ham-train-accent); outline-offset: var(--sp-1); }
.ham-row.ham-preparation-gap::before, .ham-sub.ham-preparation-member.ham-preparation-gap::before { border-left-style: dashed; }
.ham-row.ham-preparation-unverified::after, .ham-sub.ham-preparation-member.ham-preparation-unverified::after { background: var(--bg); box-shadow: 0 0 0 var(--line-width) var(--ham-train-accent); }
.ham-preparation-unverified > .ham-strip-row > .ham-preparation-node::after { background: var(--bg); box-shadow: 0 0 0 var(--line-width) var(--ham-train-accent); }
.ham-preparation-comment { animation: none; }
.ham-human-context { animation: none; }
/* Mixed issue trees keep their existing children; only actual prep PRs
receive a rail, at the original gutter offset minus the parent inset. */
.ham-row > .ham-preparation-head { margin-left: calc(-1 * var(--sp-2)); }
.ham-sub.ham-preparation-member { position: relative; --ham-train-accent: var(--amber); }
.ham-sub.ham-preparation-member::before { content: ''; position: absolute; left: 2px; top: calc(-1 * var(--sp-3) - var(--sp-2)); bottom: 0; border-left: var(--line-width) solid var(--ham-train-accent); }
.ham-sub.ham-preparation-member.ham-train-last::before { bottom: 50%; }
.ham-sub.ham-preparation-member::after { content: ''; position: absolute; left: -1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); }
.ham-sub.ham-preparation-member.ham-train-front::after { background: var(--text); }
.ham-sub.ham-preparation-member.ham-train-last::before { bottom: 0; }
.ham-sub .config-info.ham-preparation-node { left: calc(-1 * var(--sp-1)); }
.ham-sub .ham-preparation-node::after { left: 3px; }
.ham-group-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.ham-group-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.ham-group-toggle:focus-visible { outline: var(--focus-ring-width) solid var(--line-strong); outline-offset: 1px; }
Expand Down
3 changes: 2 additions & 1 deletion src/pkg/dashboard/static-src/js/tracker-filter-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
// Repo chips ride the setting against how many repos the payload spans.
if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo };
const visible = stageTrackerVisible(d.items, f, ctx);
const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f));
const sorted = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f));
const ordered = typeof stageTrackerPreparationOrderRows === 'function' ? stageTrackerPreparationOrderRows(d, sorted, stages) : sorted;
// A TV display (display=1&density=tv) shows the rows that fit the
// screen, ungrouped, with "+N more" in place of the pager.
const tv = typeof stageTrackerDisplayTv === 'function' && stageTrackerDisplayTv();
Expand Down
Loading
Loading