From e867a1218c3c273d71af55d62a855b55cc7b4748 Mon Sep 17 00:00:00 2001 From: Karibhou <157208370+Karibhou@users.noreply.github.com> Date: Thu, 29 Oct 2026 16:13:38 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20keep=20merge=20queue?= =?UTF-8?q?=20position=20visible=20during=20sweeps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hive-Run: hivecommons/hive#15395 Hive-Plan: merge-queue-label Hive-Spec: issue-15395#chip-wording Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com> --- changelog.d/fixed-15395-merge-queue-wording.md | 1 + .../dashboard/stage_tracker_merge_gate_test.go | 17 +++++++++++++++++ .../dashboard/static-src/js/tracker-words.js | 7 +++++++ src/pkg/dashboard/static/index.html | 7 +++++++ 4 files changed, 32 insertions(+) create mode 100644 changelog.d/fixed-15395-merge-queue-wording.md diff --git a/changelog.d/fixed-15395-merge-queue-wording.md b/changelog.d/fixed-15395-merge-queue-wording.md new file mode 100644 index 0000000000..5698fec201 --- /dev/null +++ b/changelog.d/fixed-15395-merge-queue-wording.md @@ -0,0 +1 @@ +- The Activity Monitor keeps a queued merge-train position visible while a merge sweep runs. diff --git a/src/pkg/dashboard/stage_tracker_merge_gate_test.go b/src/pkg/dashboard/stage_tracker_merge_gate_test.go index 90c5f1a36b..a150c5f316 100644 --- a/src/pkg/dashboard/stage_tracker_merge_gate_test.go +++ b/src/pkg/dashboard/stage_tracker_merge_gate_test.go @@ -180,6 +180,12 @@ func TestStageTrackerMergeGateNode(t *testing.T) { jsFunc(t, html, "stageTrackerMergeGateStateOf")+"\n"+ jsFunc(t, html, "stageTrackerShortLeft")+"\n"+ jsFunc(t, html, "stageTrackerGateReasonText")+"\n"+ + jsConstLine(t, html, "STAGE_TRACKER_TRAIN_STATE_FRONT")+"\n"+ + jsConstLine(t, html, "STAGE_TRACKER_TRAIN_STATE_REBASING")+"\n"+ + jsConstLine(t, html, "STAGE_TRACKER_TRAIN_STATE_EXHAUSTED")+"\n"+ + jsFunc(t, html, "stageTrackerTrain")+"\n"+ + jsFunc(t, html, "stageTrackerOrdinal")+"\n"+ + jsFunc(t, html, "stageTrackerTrainLines")+"\n"+ stageTrackerMergeGateInfoJS(t, html)+"\n"+ jsFunc(t, html, "stageTrackerMergeGateWordHtml")+"\n"+ jsFunc(t, html, "stageTrackerGateCueHtml")+"\n"+ @@ -203,6 +209,17 @@ const pr15044 = { repo: 'hivecommons/hive', number: 15044, kind: 'pr', base_ref: const ready = { repo: 'hivecommons/hive', number: 15060, kind: 'pr', stage: 80, merge_gate: { state: 'ready', last_sweep_at: iso(now - 10000), next_sweep_at: iso(now + 42000) } }; const merging = { repo: 'hivecommons/hive', number: 15061, kind: 'pr', stage: 100, merge_gate: { state: 'merging', last_sweep_at: iso(now - 1000) } }; +// Queue position stays visible while only the cue changes during a sweep. +const queued = { kind: 'pr', stage: 80, merge_gate: { state: 'queued-behind' }, merge_train: { state: 'queued-behind', id: 'v5#15315', front: 15315, position: 2, size: 3, ahead: [15315] } }; +const waiting = stageTrackerMergeGateInfo(queued, now); +queued.merge_gate.sweep_running = true; +const checking = stageTrackerMergeGateInfo(queued, now); +assert.strictEqual(waiting.word, 'In merge queue · 2 of 3'); +assert.strictEqual(checking.word, waiting.word); +assert.strictEqual(checking.detail, ''); +assert.strictEqual(waiting.cue, 'waiting'); assert.strictEqual(checking.cue, 'running'); +assert.ok(checking.tip.includes('Checking now…') && checking.tip.includes('#15315')); + // Both 060 rows read the same word — neither is "Ready for auto merge" with CI pending. let a = stageTrackerMergeGateInfo(pr15042, now), b = stageTrackerMergeGateInfo(pr15054, now); assert.strictEqual(a.word, 'Review passed'); assert.strictEqual(b.word, 'Review passed'); diff --git a/src/pkg/dashboard/static-src/js/tracker-words.js b/src/pkg/dashboard/static-src/js/tracker-words.js index eab7cd8d41..7149d94b96 100644 --- a/src/pkg/dashboard/static-src/js/tracker-words.js +++ b/src/pkg/dashboard/static-src/js/tracker-words.js @@ -705,6 +705,13 @@ if (dec) return dec; const laneReason = item && item.kind !== 'issue' && !stageTrackerCoverReasonText(item) ? item.reason : ''; nowMs = typeof nowMs === 'number' ? nowMs : Date.now(); + // Keep a queued member's label independent of the sweep clock. The + // sweep only changes the cue and tooltip, not its place in the train. + if (state === 'queued-behind' && src.merge_train) { + const train = src.merge_train; + const tip = stageTrackerTrainLines(src).join('. ') + (mg.sweep_running ? '. Checking now…' : ''); + return { state, word: 'In merge queue · ' + (Number(train.position) || 0) + ' of ' + (Number(train.size) || 0), detail: '', tip, cue: mg.sweep_running ? 'running' : 'waiting', until: 0 }; + } const word = stageTrackerMergeGateStateWord(state); const nextAt = mg.next_sweep_at ? Date.parse(mg.next_sweep_at) : 0; const lastAt = mg.last_sweep_at ? Date.parse(mg.last_sweep_at) : 0; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 9852ffdf98..e50f1919a5 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -14928,6 +14928,13 @@

Where to get help

if (dec) return dec; const laneReason = item && item.kind !== 'issue' && !stageTrackerCoverReasonText(item) ? item.reason : ''; nowMs = typeof nowMs === 'number' ? nowMs : Date.now(); + // Keep a queued member's label independent of the sweep clock. The + // sweep only changes the cue and tooltip, not its place in the train. + if (state === 'queued-behind' && src.merge_train) { + const train = src.merge_train; + const tip = stageTrackerTrainLines(src).join('. ') + (mg.sweep_running ? '. Checking now…' : ''); + return { state, word: 'In merge queue · ' + (Number(train.position) || 0) + ' of ' + (Number(train.size) || 0), detail: '', tip, cue: mg.sweep_running ? 'running' : 'waiting', until: 0 }; + } const word = stageTrackerMergeGateStateWord(state); const nextAt = mg.next_sweep_at ? Date.parse(mg.next_sweep_at) : 0; const lastAt = mg.last_sweep_at ? Date.parse(mg.last_sweep_at) : 0; From 16015b3685cebda0488c484be8df0b4e8f7642e6 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:45:03 -0400 Subject: [PATCH 2/2] fix: reconcile merge-queue chip wording with v5 tracker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v5 already ships the queue-position chip (#15427, #15449): 'Merge queued · 2nd', sweep-stable label, spinning cue and a tooltip naming the train and PRs ahead. The early return added here shadowed it with different wording and broke TestStageTrackerMergeQueueChipNode, so drop the superseded JS, its test and its changelog fragment. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- changelog.d/fixed-15395-merge-queue-wording.md | 1 - .../dashboard/stage_tracker_merge_gate_test.go | 17 ----------------- .../dashboard/static-src/js/tracker-words.js | 7 ------- src/pkg/dashboard/static/index.html | 7 ------- 4 files changed, 32 deletions(-) delete mode 100644 changelog.d/fixed-15395-merge-queue-wording.md diff --git a/changelog.d/fixed-15395-merge-queue-wording.md b/changelog.d/fixed-15395-merge-queue-wording.md deleted file mode 100644 index 5698fec201..0000000000 --- a/changelog.d/fixed-15395-merge-queue-wording.md +++ /dev/null @@ -1 +0,0 @@ -- The Activity Monitor keeps a queued merge-train position visible while a merge sweep runs. diff --git a/src/pkg/dashboard/stage_tracker_merge_gate_test.go b/src/pkg/dashboard/stage_tracker_merge_gate_test.go index a150c5f316..90c5f1a36b 100644 --- a/src/pkg/dashboard/stage_tracker_merge_gate_test.go +++ b/src/pkg/dashboard/stage_tracker_merge_gate_test.go @@ -180,12 +180,6 @@ func TestStageTrackerMergeGateNode(t *testing.T) { jsFunc(t, html, "stageTrackerMergeGateStateOf")+"\n"+ jsFunc(t, html, "stageTrackerShortLeft")+"\n"+ jsFunc(t, html, "stageTrackerGateReasonText")+"\n"+ - jsConstLine(t, html, "STAGE_TRACKER_TRAIN_STATE_FRONT")+"\n"+ - jsConstLine(t, html, "STAGE_TRACKER_TRAIN_STATE_REBASING")+"\n"+ - jsConstLine(t, html, "STAGE_TRACKER_TRAIN_STATE_EXHAUSTED")+"\n"+ - jsFunc(t, html, "stageTrackerTrain")+"\n"+ - jsFunc(t, html, "stageTrackerOrdinal")+"\n"+ - jsFunc(t, html, "stageTrackerTrainLines")+"\n"+ stageTrackerMergeGateInfoJS(t, html)+"\n"+ jsFunc(t, html, "stageTrackerMergeGateWordHtml")+"\n"+ jsFunc(t, html, "stageTrackerGateCueHtml")+"\n"+ @@ -209,17 +203,6 @@ const pr15044 = { repo: 'hivecommons/hive', number: 15044, kind: 'pr', base_ref: const ready = { repo: 'hivecommons/hive', number: 15060, kind: 'pr', stage: 80, merge_gate: { state: 'ready', last_sweep_at: iso(now - 10000), next_sweep_at: iso(now + 42000) } }; const merging = { repo: 'hivecommons/hive', number: 15061, kind: 'pr', stage: 100, merge_gate: { state: 'merging', last_sweep_at: iso(now - 1000) } }; -// Queue position stays visible while only the cue changes during a sweep. -const queued = { kind: 'pr', stage: 80, merge_gate: { state: 'queued-behind' }, merge_train: { state: 'queued-behind', id: 'v5#15315', front: 15315, position: 2, size: 3, ahead: [15315] } }; -const waiting = stageTrackerMergeGateInfo(queued, now); -queued.merge_gate.sweep_running = true; -const checking = stageTrackerMergeGateInfo(queued, now); -assert.strictEqual(waiting.word, 'In merge queue · 2 of 3'); -assert.strictEqual(checking.word, waiting.word); -assert.strictEqual(checking.detail, ''); -assert.strictEqual(waiting.cue, 'waiting'); assert.strictEqual(checking.cue, 'running'); -assert.ok(checking.tip.includes('Checking now…') && checking.tip.includes('#15315')); - // Both 060 rows read the same word — neither is "Ready for auto merge" with CI pending. let a = stageTrackerMergeGateInfo(pr15042, now), b = stageTrackerMergeGateInfo(pr15054, now); assert.strictEqual(a.word, 'Review passed'); assert.strictEqual(b.word, 'Review passed'); diff --git a/src/pkg/dashboard/static-src/js/tracker-words.js b/src/pkg/dashboard/static-src/js/tracker-words.js index 7149d94b96..eab7cd8d41 100644 --- a/src/pkg/dashboard/static-src/js/tracker-words.js +++ b/src/pkg/dashboard/static-src/js/tracker-words.js @@ -705,13 +705,6 @@ if (dec) return dec; const laneReason = item && item.kind !== 'issue' && !stageTrackerCoverReasonText(item) ? item.reason : ''; nowMs = typeof nowMs === 'number' ? nowMs : Date.now(); - // Keep a queued member's label independent of the sweep clock. The - // sweep only changes the cue and tooltip, not its place in the train. - if (state === 'queued-behind' && src.merge_train) { - const train = src.merge_train; - const tip = stageTrackerTrainLines(src).join('. ') + (mg.sweep_running ? '. Checking now…' : ''); - return { state, word: 'In merge queue · ' + (Number(train.position) || 0) + ' of ' + (Number(train.size) || 0), detail: '', tip, cue: mg.sweep_running ? 'running' : 'waiting', until: 0 }; - } const word = stageTrackerMergeGateStateWord(state); const nextAt = mg.next_sweep_at ? Date.parse(mg.next_sweep_at) : 0; const lastAt = mg.last_sweep_at ? Date.parse(mg.last_sweep_at) : 0; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index e50f1919a5..9852ffdf98 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -14928,13 +14928,6 @@

Where to get help

if (dec) return dec; const laneReason = item && item.kind !== 'issue' && !stageTrackerCoverReasonText(item) ? item.reason : ''; nowMs = typeof nowMs === 'number' ? nowMs : Date.now(); - // Keep a queued member's label independent of the sweep clock. The - // sweep only changes the cue and tooltip, not its place in the train. - if (state === 'queued-behind' && src.merge_train) { - const train = src.merge_train; - const tip = stageTrackerTrainLines(src).join('. ') + (mg.sweep_running ? '. Checking now…' : ''); - return { state, word: 'In merge queue · ' + (Number(train.position) || 0) + ' of ' + (Number(train.size) || 0), detail: '', tip, cue: mg.sweep_running ? 'running' : 'waiting', until: 0 }; - } const word = stageTrackerMergeGateStateWord(state); const nextAt = mg.next_sweep_at ? Date.parse(mg.next_sweep_at) : 0; const lastAt = mg.last_sweep_at ? Date.parse(mg.last_sweep_at) : 0;