diff --git a/changelog.d/fixed-tracker-author-owned.md b/changelog.d/fixed-tracker-author-owned.md new file mode 100644 index 0000000000..7850c46046 --- /dev/null +++ b/changelog.d/fixed-tracker-author-owned.md @@ -0,0 +1 @@ +- Describe failing author-owned PRs with unknown work activity instead of inferring that nobody is working from an absent Hive stage actor, including inline and nested PRs while preserving known Hive and bot routing. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 7b750538ee..3a971b5bcb 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -82,6 +82,8 @@ At 090 the row explains why: `· workflow files`, `· tests removed`, `· manual A verified merge from the canonical merge ledger is terminal whether Hive, a maintainer or another bot performed it. The last known root or linked PR model reaches **Merged** during the existing short terminal/pin window, even without an earlier queue observation. The comment names the actual recorded merger; an unknown actor stays unknown. This does not invent an earlier queue/admission state or close a merely related issue. A stale open refresh cannot undo a verified merge, and repeated delivery or later actor enrichment does not replay the merge or restart its window. Terminal visibility does not re-enable closed-PR actions. +A failing external PR without a recorded Hive stage actor remains **CI failing · author-owned** when its PR author is known, **CI failing · owner recorded** for an observed claimant, or **CI failing · owner unknown** otherwise. Its work activity is unknown; missing internal worker evidence is not evidence that nobody is working. Inline and nested rows use the PR author or claimant, not the related issue's filer or holder. Explicit unclaimed Hive/bot routing and real CI failures remain unchanged. + - With no covering PR, an issue has a full strip lit at Open, Actionable or Claimed. - With exactly one covering PR, issue and PR share one continuous strip; early issue steps are passed and the PR supplies the current stage, chip, tooltip and age. - With several covering PRs, the issue's own strip stops at Claimed, with no current step lit. Indented PR sub-rows begin under *PR in progress*, each with its own stage and age, furthest along first. diff --git a/src/pkg/dashboard/stage_tracker_actor_icon_test.go b/src/pkg/dashboard/stage_tracker_actor_icon_test.go index a65d5b28a7..e87ea2d259 100644 --- a/src/pkg/dashboard/stage_tracker_actor_icon_test.go +++ b/src/pkg/dashboard/stage_tracker_actor_icon_test.go @@ -8,7 +8,7 @@ import ( // The actor icon on a lit stage pill comes from the server's stage_actor // kind, never from a guess on the login: hive → honeycomb, clanker → robot, // human → the same person glyph "Needs human decision" uses, bot → cog, -// none → no icon and a tooltip that says nobody is on it and why +// none → no icon; external PR activity remains unknown // (hivecommons/docs#500 drew "Fixing" with no icon and nobody fixing). func stageTrackerActorIconJS(t *testing.T, html string) string { t.Helper() @@ -23,7 +23,7 @@ func TestStageTrackerActorIconKindsJS(t *testing.T) { html := indexHTML(t) runStageTrackerRowActionsScript(t, stageTrackerRowsPreludeJS(t, html)+"\n"+stageTrackerActorIconJS(t, html)+stageTrackerRowsFixtureJS+` const actorSvg = (html) => (/]*aria-label="([^"]*)"[^>]*>([\s\S]*?)<\/svg>/.exec(strip(html)) || []); -const detour = (html) => (/([^<]*)<\/span>/.exec(strip(html)) || [])[1]; +const detour = (html) => (/([^<]*) (/
  • ]*title="([^"]*)"/.exec(strip(html)) || [])[1] || ''; const since = new Date(now - 10 * 3600000).toISOString(); const pr = (n, extra) => Object.assign({ repo: 'hivecommons/docs', number: n, kind: 'pr', title: 'docs: resync', url: 'https://x/' + n, stage: 70, stage_since: since, caption: 'Fixing', author: 'alice', author_kind: 'human' }, extra || {}); @@ -58,12 +58,19 @@ assert.strictEqual(detour(row), 'Conflicting · bot PR', 'nobody is fixing: the assert.ok(litTitle(row).includes('Next move: bot @github-actions[bot] — bot-authored PR'), litTitle(row)); assert.ok(text(row).includes('Conflicting · bot PR'), 'the compact caption carries the same words: ' + text(row)); -// none → no icon; the tooltip says nobody is on it and why. +// none is not abandonment evidence for an author-owned external PR. row = stageTrackerRowHtml(pr(504, { author_kind: '', stage_actor: { kind: 'none', why: 'the PR is red and no agent or author is on it' } }), stages, ctx); -assert.strictEqual(actorSvg(row).length, 0, 'no actor icon when nobody is working: ' + strip(row)); -assert.strictEqual(detour(row), 'Red · nobody on it'); -assert.ok(litTitle(row).includes('no one is working on this right now — the PR is red and no agent or author is on it'), litTitle(row)); -assert.ok(tooltip(row).includes('no one is working on this right now — the PR is red'), 'row tooltip too: ' + tooltip(row)); +assert.strictEqual(actorSvg(row).length, 0, 'no invented live actor: ' + strip(row)); +assert.strictEqual(detour(row), 'CI failing · author-owned'); +assert.ok(litTitle(row).includes('Author-owned PR @alice — current work activity is unknown'), litTitle(row)); +assert.ok(!tooltip(row).includes('no one is working'), tooltip(row)); +row = stageTrackerRowHtml(pr(504, { author:'', author_kind:'', stage_actor:{kind:'none'} }),stages,ctx); +assert.strictEqual(detour(row),'CI failing · owner unknown'); +assert.ok(litTitle(row).includes('ownership and current work activity are unknown')); +row = stageTrackerRowHtml(pr(504, {author:'',author_kind:'',stage_actor:{kind:'none'}, + claimant:{kind:'person',login:'recorded-owner',source:'assignee'}}),stages,ctx); +assert.strictEqual(detour(row),'CI failing · owner recorded'); +assert.ok(litTitle(row).includes('Recorded PR owner @recorded-owner — current work activity is unknown')); // No stage_actor (older server): the stage-table heuristic still applies and the word stays Fixing. row = stageTrackerRowHtml(pr(505, { author_kind: 'clanker' }), stages, ctx); @@ -75,7 +82,7 @@ assert.ok(litTitle(row).includes(' · Next move: clanker'), litTitle(row)); row = stageTrackerRowHtml(pr(506, { stage: 50, caption: 'CI running', stage_actor: { kind: 'none', why: 'CI is still running' } }), stages, ctx); assert.strictEqual(actorSvg(row).length, 0, strip(row)); assert.ok(strip(row).includes('CI / Review'), 'a path column keeps its name'); -assert.ok(litTitle(row).includes(STAGE_TRACKER_NOBODY_LEAD + ' — CI is still running')); +assert.ok(litTitle(row).includes('Author-owned PR @alice — current work activity is unknown')); // An issue riding its one covering PR takes the PR's actor. const lp = { number: 500, title: 'docs: resync', url: 'https://x/500', author: 'github-actions[bot]', author_kind: '', stage: 70, stage_since: since, modifiers: ['needs-rebase'], stage_actor: { kind: 'bot', login: 'github-actions[bot]', why: botWhy } }; @@ -86,12 +93,36 @@ assert.strictEqual(detour(row), 'Conflicting · bot PR'); // Sub-rows carry their own actor: one with an agent, one with nobody. row = stageTrackerRowHtml({ repo: 'hivecommons/docs', number: 497, kind: 'issue', title: 'Two', url: 'https://x/497', stage: 40, stage_since: since, linked_prs: [ Object.assign({}, lp, { number: 510, stage_actor: { kind: 'hive', login: 'fixer', why: 'fixer is on it' } }), - Object.assign({}, lp, { number: 511, modifiers: [], stage_actor: { kind: 'none', why: 'no agent is on it' } }), + Object.assign({}, lp, { number: 511, author:'hive-bot', author_kind:'hive', modifiers: [], stage_actor: { kind: 'none', why: 'no agent is on it' } }), ] }, stages, ctx); const subRows = subs(row); assert.strictEqual(subRows.length, 2); assert.ok(subRows[0].includes('aria-label="Next move: hive"') && subRows[0].includes('Fixing'), subRows[0]); assert.ok(!subRows[1].includes('ham-actor-ico') && subRows[1].includes('Red · nobody on it') && subRows[1].includes(STAGE_TRACKER_NOBODY_LEAD + ' — no agent is on it'), subRows[1]); +const externalLP={...lp,author:'clubanderson',author_kind:'',modifiers:[],stage_actor:{kind:'none',why:'author kind unknown'}}; +row=stageTrackerRowHtml({repo:'hivecommons/docs',number:600,kind:'issue',stage:40,author:'issue-filer',linked_prs:[externalLP]},stages,ctx); +assert.strictEqual(detour(row),'CI failing · author-owned'); +assert.ok(litTitle(row).includes('Author-owned PR @clubanderson'),litTitle(row)); +assert.ok(!litTitle(row).includes('@issue-filer')); +for(const kind of ['human','hive']){ + row=stageTrackerRowHtml({repo:'hivecommons/docs',number:600,kind:'issue',stage:40,author:'issue-filer',author_kind:kind, + linked_prs:[{...externalLP,author:''}]},stages,ctx); + assert.strictEqual(detour(row),'CI failing · owner unknown','an unknown inline PR author never inherits the issue filer'); + assert.ok(litTitle(row).includes('ownership and current work activity are unknown'),litTitle(row)); + assert.ok(!litTitle(row).includes('@issue-filer'),litTitle(row)); +} +row=stageTrackerRowHtml({repo:'hivecommons/docs',number:600,kind:'issue',stage:40,author:'issue-filer', + claimant:{kind:'person',login:'issue-holder',source:'assignee'},linked_prs:[{...externalLP,author:'', + claimant:{kind:'person',login:'pr-holder',source:'assignee'}}]},stages,ctx); +assert.strictEqual(detour(row),'CI failing · owner recorded'); +assert.ok(litTitle(row).includes('Recorded PR owner @pr-holder'),litTitle(row)); +assert.ok(!litTitle(row).includes('@issue-holder'),litTitle(row)); +row=stageTrackerRowHtml({repo:'hivecommons/docs',number:601,kind:'issue',stage:40,linked_prs:[externalLP,{...externalLP,number:512}]},stages,ctx); +for(const sub of subs(row)){ + assert.ok(sub.includes('CI failing · author-owned'),sub); + assert.ok(sub.includes('current work activity is unknown'),sub); + assert.ok(!sub.includes('nobody on it'),sub); +} `) } diff --git a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go index a421d05bbf..db8011ba3b 100644 --- a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go @@ -71,6 +71,7 @@ func stageTrackerRowsPreludeJS(t *testing.T, html string) string { jsConstLine(t, html, "STAGE_TRACKER_NOBODY_LEAD"), jsFunc(t, html, "stageTrackerStageActor"), jsFunc(t, html, "stageTrackerActorKind"), + jsFunc(t, html, "stageTrackerExternalPRWork"), jsFunc(t, html, "stageTrackerActorTip"), jsConstLine(t, html, "STAGE_TRACKER_HIVE_PREFIXES"), jsConstLine(t, html, "STAGE_TRACKER_CLAIMANT_SOURCE"), diff --git a/src/pkg/dashboard/static-src/js/tracker-row.js b/src/pkg/dashboard/static-src/js/tracker-row.js index 1bc5694a75..a7bedf5c05 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row.js +++ b/src/pkg/dashboard/static-src/js/tracker-row.js @@ -224,12 +224,31 @@ const r = String((sa && sa.human_reason) || stageTrackerHumanWhy(item, kind) || STAGE_TRACKER_HUMAN_REASON_FALLBACK).replace(/\s+/g, ' ').trim(); return r.length > STAGE_TRACKER_HUMAN_REASON_MAX ? r.slice(0, STAGE_TRACKER_HUMAN_REASON_MAX - 1).replace(/\s+\S*$/, '') + '…' : r; } + function stageTrackerExternalPRWork(item) { + if (!item || (item.kind !== 'pr' && !item.via_pr)) return null; + let source = item; + if (item.via_pr) { + const linked = (item.linked_prs || []).filter(lp => lp && stageTrackerLinkedDrawnHere(lp, item) && !stageTrackerLinkedSupersededGone(lp, item)); + source = linked.length === 1 ? linked[0] : {}; + } + const who = stageTrackerReturnedAuthor(source); + const holder = typeof stageTrackerClaimant === 'function' ? stageTrackerClaimant(item) : null; + if (holder && (!who.author || holder.source !== 'author')) return Object.assign({}, who, { owner: stageTrackerClaimantShort(holder) }); + return who.kind === 'hive' || who.kind === 'bot' ? null : who; + } function stageTrackerActorTip(item) { // Guarded: test harnesses lift this function by name without stageTrackerHumanWhy. const humanWhy = typeof stageTrackerHumanWhy === 'function' ? stageTrackerHumanWhy : () => ''; const sa = stageTrackerStageActor(item); if (!sa) { const k = stageTrackerActorKind(item); const w = humanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; } - if (sa.kind === STAGE_TRACKER_ACTOR_NONE) return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : ''; + if (sa.kind === STAGE_TRACKER_ACTOR_NONE) { + const external = typeof stageTrackerExternalPRWork === 'function' ? stageTrackerExternalPRWork(item) : null; + if (external) { + if (external.owner) return ' · Recorded PR owner ' + external.owner + ' — current work activity is unknown'; + return external.author ? ' · Author-owned PR @' + external.author + ' — current work activity is unknown' : ' · PR ownership and current work activity are unknown'; + } + return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : ''; + } const why = sa.why || humanWhy(item, sa.kind); return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (why ? ' — ' + why : ''); } @@ -278,6 +297,8 @@ const sa = stageTrackerStageActor(item); if (!sa || (sa.kind !== STAGE_TRACKER_ACTOR_NONE && sa.kind !== 'bot')) return fallback; const mods = Array.isArray(item.modifiers) ? item.modifiers : []; + const external = sa.kind === STAGE_TRACKER_ACTOR_NONE && typeof stageTrackerExternalPRWork === 'function' ? stageTrackerExternalPRWork(item) : null; + if (external) return (mods.indexOf('needs-rebase') >= 0 ? 'Conflicting' : 'CI failing') + (external.owner ? ' · owner recorded' : (external.author ? ' · author-owned' : ' · owner unknown')); const state = mods.indexOf('needs-rebase') >= 0 ? 'Conflicting' : 'Red'; return state + (sa.kind === 'bot' ? ' · bot PR' : ' · nobody on it'); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index dfb68a5099..a649a44e18 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -17145,12 +17145,31 @@

    Where to get help

    const r = String((sa && sa.human_reason) || stageTrackerHumanWhy(item, kind) || STAGE_TRACKER_HUMAN_REASON_FALLBACK).replace(/\s+/g, ' ').trim(); return r.length > STAGE_TRACKER_HUMAN_REASON_MAX ? r.slice(0, STAGE_TRACKER_HUMAN_REASON_MAX - 1).replace(/\s+\S*$/, '') + '…' : r; } + function stageTrackerExternalPRWork(item) { + if (!item || (item.kind !== 'pr' && !item.via_pr)) return null; + let source = item; + if (item.via_pr) { + const linked = (item.linked_prs || []).filter(lp => lp && stageTrackerLinkedDrawnHere(lp, item) && !stageTrackerLinkedSupersededGone(lp, item)); + source = linked.length === 1 ? linked[0] : {}; + } + const who = stageTrackerReturnedAuthor(source); + const holder = typeof stageTrackerClaimant === 'function' ? stageTrackerClaimant(item) : null; + if (holder && (!who.author || holder.source !== 'author')) return Object.assign({}, who, { owner: stageTrackerClaimantShort(holder) }); + return who.kind === 'hive' || who.kind === 'bot' ? null : who; + } function stageTrackerActorTip(item) { // Guarded: test harnesses lift this function by name without stageTrackerHumanWhy. const humanWhy = typeof stageTrackerHumanWhy === 'function' ? stageTrackerHumanWhy : () => ''; const sa = stageTrackerStageActor(item); if (!sa) { const k = stageTrackerActorKind(item); const w = humanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; } - if (sa.kind === STAGE_TRACKER_ACTOR_NONE) return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : ''; + if (sa.kind === STAGE_TRACKER_ACTOR_NONE) { + const external = typeof stageTrackerExternalPRWork === 'function' ? stageTrackerExternalPRWork(item) : null; + if (external) { + if (external.owner) return ' · Recorded PR owner ' + external.owner + ' — current work activity is unknown'; + return external.author ? ' · Author-owned PR @' + external.author + ' — current work activity is unknown' : ' · PR ownership and current work activity are unknown'; + } + return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : ''; + } const why = sa.why || humanWhy(item, sa.kind); return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (why ? ' — ' + why : ''); } @@ -17199,6 +17218,8 @@

    Where to get help

    const sa = stageTrackerStageActor(item); if (!sa || (sa.kind !== STAGE_TRACKER_ACTOR_NONE && sa.kind !== 'bot')) return fallback; const mods = Array.isArray(item.modifiers) ? item.modifiers : []; + const external = sa.kind === STAGE_TRACKER_ACTOR_NONE && typeof stageTrackerExternalPRWork === 'function' ? stageTrackerExternalPRWork(item) : null; + if (external) return (mods.indexOf('needs-rebase') >= 0 ? 'Conflicting' : 'CI failing') + (external.owner ? ' · owner recorded' : (external.author ? ' · author-owned' : ' · owner unknown')); const state = mods.indexOf('needs-rebase') >= 0 ? 'Conflicting' : 'Red'; return state + (sa.kind === 'bot' ? ' · bot PR' : ' · nobody on it'); }