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
1 change: 1 addition & 0 deletions changelog.d/added-tracker-pr-in-progress-actor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor: the **PR in progress** chevron names who is working the PR, exactly like **Claimed** — `PR in progress · scanner ⬡`, `PR in progress · @odttlnt's clanker 🤖`, `PR in progress · @clubanderson 👤` — resolved from a live worker-ledger claim on the PR, else the PR author (a hive PR names its attribution-trailer agent); the name ellipsizes before the one-line sub-row wraps and the hover carries the full identity and source (hivecommons/hive#15541).
1 change: 1 addition & 0 deletions src/docs/dashboard-copy-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The new hover, verbatim (title line omitted):
| `stageTrackerTriageNeededCaption` (`stageTrackerCaption` 015, `stageTrackerNewState` hold text) | row caption, feed | 110 ("Actionable, but no maintainer has looked at it yet; waiting for triage — triage needed: carries needs triage": *triage* ×3 after the chevron word) / 84 ("New · waiting for a maintainer's triage (add `triage/accepted`); the hive's next pass in 7m") | 31 ("Triage needed — accept or close"; the next-mover and next-pass narration stay on the chevron hover) | `TestStageTracker_TriageNeededStage`, `TestStageTracker_ReporterTrustHoldReadsTriageNeeded`, `TestStageTrackerNewState` |
| `stageTrackerLeadActionHtml` (`tracker-actions.js`) | the row header's inline lead button (chip slot) | — (the lead sat in the ⋯ menu only) | the menu entry's label (1–4), its hint as the hover | `TestStageTrackerLeadActionInline`, `TestStageTrackerMaintainerRowsHaveLeadAction` |
| Toasts (`STAGE_TRACKER_ACTING_CAPTIONS`, acted labels) | toast | 2–4 each | unchanged | — |
| `stageTrackerStripItems` holder token + `stageTrackerClaimantIconKind` (`tracker-row.js`) on the PR in progress chevron ([#15541](https://github.com/hivecommons/hive/issues/15541)) | lit chevron word, chevron hover | *PR in progress* (bare; the holder token only reached PRs from review on) | *PR in progress · scanner ⬡*, *PR in progress · @odttlnt's clanker 🤖*, *PR in progress · @clubanderson 👤* — the same token and hover line as *Claimed ·*; the name ellipsizes before the one-line sub-row wraps; a detour word that already names them (*Returned to @bob's clanker*) does not repeat them | `TestStageTrackerClaimantChevronJS`, `TestStageTrackerPRClaimant`, `TestStageTrackerClaimantStage` |
| `stageTrackerSelectionTriage` (`tracker-actions.js`) | selection bar lead button / bulk ⋯ menu entry, summary toast | — (no bulk Accept triage; one row at a time) | *Accept triage (4 selected)* / *Accept triage (2 of 4)* with the hint *skips the 2 not waiting on triage*; one toast *Accepted 4 issues* | `TestStageTrackerBulkAcceptTriage` |
| Settings → Features → Auto-merge → "Merge only on current base" help (`renderGovFeatures`, `config-features.js`) and the Repos-tab override row / repo-card `current-base` chip ([#15335](https://github.com/hivecommons/hive/issues/15335)) | settingHelpMark popover, checkbox label, chip hover | — (new) | 56 (help), 5 (row label), 1 (chip) | `TestCurrentBaseSettingsMarkupNodeGuard` |

Expand Down
2 changes: 1 addition & 1 deletion src/docs/dashboard-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ Issues riding one covering PR take that PR's actor; nested PR sub-rows carry the

#### Who holds it (claimant)

The icon says what kind of actor holds the row; the `claimant` says *who*. On a claimed or in-progress issue and on a PR from review through its author's rework and adoption (050–074), the payload carries `claimant: {kind, login, agent, hive, since, source}` and the lit chevron appends one short token after its word: a hive lane name (**Claimed · quality**), the lane and a short hive name when the claim came from another hive (**Claimed · quality@alchemy**, the `hosted-ibm-` prefix dropped), a contributor's connected hive (**Claimed · @bob's clanker**) or a person (**Claimed · @alice**). `kind` is `hive-agent` (`agent` is the lane; `hive` is set only when it is not this hive), `clanker` (`login` is the contributor the hive acts for — a registered contributor with a connected hive) or `person`; `source` says where the identity was read: `claim-ledger` (the worker-claim ledger), `claim-comment` (the `hive:claim` marker, which carries the hive fingerprint), `assignee`, `kick-history` (the agent the status payload says is on it) or `author` (a PR's author or adopting agent). The chevron hover adds one line — *Held by: hive agent quality@hosted-ibm-alchemy since 3h ago (claim ledger)*. When nothing names a holder the field is absent and nothing is added. Nested covering-PR sub-rows carry their PR's `claimant`.
The icon says what kind of actor holds the row; the `claimant` says *who*. On a claimed or in-progress issue and on a PR from the moment it exists through its author's rework and adoption (any stage below the 080 merge gate — an unclassified or 030/040 PR lights **PR in progress** under its issue and names who is working it, [#15541](https://github.com/hivecommons/hive/issues/15541)), the payload carries `claimant: {kind, login, agent, hive, since, source}` and the lit chevron appends one short token after its word: a hive lane name (**Claimed · quality**), the lane and a short hive name when the claim came from another hive (**Claimed · quality@alchemy**, the `hosted-ibm-` prefix dropped), a contributor's connected hive (**Claimed · @bob's clanker**) or a person (**Claimed · @alice**). `kind` is `hive-agent` (`agent` is the lane; `hive` is set only when it is not this hive), `clanker` (`login` is the contributor the hive acts for — a registered contributor with a connected hive) or `person`; `source` says where the identity was read: `claim-ledger` (the worker-claim ledger), `claim-comment` (the `hive:claim` marker, which carries the hive fingerprint), `assignee`, `kick-history` (the agent the status payload says is on it) or `author` (a PR's author or adopting agent; a hive PR names the agent from its `— hive:` attribution trailer, else its `agent/<lane>` label). A PR row checks the worker ledger for a live claim on the PR itself before falling back to its author. The chevron hover adds one line — *Held by: hive agent quality@hosted-ibm-alchemy since 3h ago (claim ledger)*. When nothing names a holder the field is absent and nothing is added. Nested covering-PR sub-rows carry their PR's `claimant`. When the row's next mover is nobody (`stage_actor.kind: none`, the usual case for a PR still being worked), the chevron draws the holder's own kind icon in the actor slot — ⬡ hive agent, 🤖 clanker, 👤 person — so **PR in progress · scanner ⬡** reads exactly like **Claimed · scanner ⬡**; the holder token truncates with an ellipsis before the one-line PR sub-row wraps, and a detour word that already names the holder (**Returned to @bob's clanker**) does not repeat them after the dot.

#### One row per PR

Expand Down
3 changes: 2 additions & 1 deletion src/pkg/dashboard/stage_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,8 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto
if w, ok := stageTrackerWorkerOn(workers, repoName, pr.Number); ok {
worker = &w
}
it.Claimant = stageTrackerPRClaimant(stageTrackerClaimInputs{Worker: worker, Since: it.StageSince, Labels: pr.Labels, Author: it.Author, AuthorKind: it.AuthorKind})
it.Claimant = stageTrackerPRClaimant(stageTrackerClaimInputs{Ledger: s.stageTrackerLedgerClaim(repoName, pr.Number), HiveID: status.HiveID,
Worker: worker, Since: it.StageSince, Labels: pr.Labels, Author: it.Author, AuthorKind: it.AuthorKind, HiveAgent: pr.HiveAgent})
}
add(it)
}
Expand Down
33 changes: 23 additions & 10 deletions src/pkg/dashboard/stage_tracker_claimant.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ type stageTrackerClaimInputs struct {
Labels []string
Author string
AuthorKind string
// HiveAgent is the agent named by a hive PR's `— hive:` attribution
// trailer (github.PullRequest.HiveAgent), when the enumeration kept it.
HiveAgent string
// IsClankerOwner reports whether a GitHub login belongs to a registered
// contributor with a connected hive (a clanker owner). Nil means unknown.
IsClankerOwner func(login string) bool
Expand Down Expand Up @@ -117,12 +120,17 @@ func stageTrackerIssueClaimant(in stageTrackerClaimInputs) *StageTrackerClaimant
return nil
}

// stageTrackerPRClaimant derives who holds a PR row: the author, by the
// author kind the row already resolved. A hive PR names the agent on it
// (the status payload's busy agent, else the agent/<lane> label) and the
// adopting agent counts the same way. Nil for a foreign bot or an unknown
// author kind.
// stageTrackerPRClaimant derives who holds a PR row: a live worker-ledger
// claim on the PR first (source claim-ledger), else the author, by the author kind the row
// already resolved. A hive PR names the agent on it (the status payload's
// busy agent, else the attribution trailer's agent, else the agent/<lane>
// label) and the adopting agent counts the same way. Nil for a foreign bot
// or an unknown author kind (hivecommons/hive#15422; PR in progress rows
// too, hivecommons/hive#15541).
func stageTrackerPRClaimant(in stageTrackerClaimInputs) *StageTrackerClaimant {
if c := in.Ledger; c != nil && c.Holder != "" {
return stageTrackerIssueClaimant(stageTrackerClaimInputs{Ledger: c, Since: in.Since, HiveID: in.HiveID})
}
switch in.AuthorKind {
case authorKindHive:
out := &StageTrackerClaimant{Kind: claimantKindHiveAgent, Since: in.Since, Source: claimantSourceAuthor}
Expand All @@ -133,7 +141,10 @@ func stageTrackerPRClaimant(in stageTrackerClaimInputs) *StageTrackerClaimant {
}
return out
}
out.Agent = stageTrackerAgentLane(in.Labels)
out.Agent = strings.TrimSpace(in.HiveAgent)
if out.Agent == "" {
out.Agent = stageTrackerAgentLane(in.Labels)
}
if out.Agent == "" {
out.Login = in.Author
}
Expand Down Expand Up @@ -184,12 +195,14 @@ func stageTrackerForeignHive(hive, local string) string {
}

// stageTrackerClaimantStage says whether a row at this stage shows its
// holder: issues while claimed or with a PR under way; PRs from review
// through the author's rework and adoption, before the merge gate (where
// the gate word carries its own live detail).
// holder: issues while claimed or with a PR under way; PRs from the moment
// they exist (an unclassified or in-progress PR lights "PR in progress"
// under its issue, hivecommons/hive#15541) through review, the author's
// rework and adoption, before the merge gate (where the gate word carries
// its own live detail).
func stageTrackerClaimantStage(kind string, stage int) bool {
if kind == "pr" {
return stage >= trackerNumberReviewPending && stage < trackerNumberAwaitingMerge
return stage < trackerNumberAwaitingMerge
}
return stage == trackerNumberClaimed || stage == trackerNumberPRInProgress
}
Expand Down
40 changes: 38 additions & 2 deletions src/pkg/dashboard/stage_tracker_claimant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ func TestStageTrackerPRClaimant(t *testing.T) {
{"human PR", stageTrackerClaimInputs{Author: "alice", AuthorKind: authorKindHuman, Since: &since},
&StageTrackerClaimant{Kind: claimantKindPerson, Login: "alice", Since: &since, Source: claimantSourceAuthor}},
{"foreign bot", stageTrackerClaimInputs{Author: "dependabot[bot]", AuthorKind: "", Since: &since}, nil},
// PR in progress rows (hivecommons/hive#15541): the attribution
// trailer names the agent; a live ledger claim beats the author.
{"hive PR names its attribution trailer agent", stageTrackerClaimInputs{Author: "hive-bot[bot]", AuthorKind: authorKindHive, HiveAgent: "scanner", Labels: []string{"agent/quality"}, Since: &since},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "scanner", Since: &since, Source: claimantSourceAuthor}},
{"ledger claim on the PR beats the author", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "bob", Kind: claims.KindContributor, ClaimedAt: kickedAt}, Author: "hive-bot[bot]", AuthorKind: authorKindHive, HiveAgent: "scanner", Since: &since},
&StageTrackerClaimant{Kind: claimantKindClanker, Login: "bob", Since: &kickedAt, Source: claimantSourceClaimLedger}},
{"ledger agent from another hive on the PR", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "fixer", Kind: claims.KindAgent, Hive: "hosted-ibm-alchemy", ClaimedAt: kickedAt}, HiveID: "hosted-ibm-main", Author: "alice", AuthorKind: authorKindHuman, Since: &since},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "fixer", Hive: "hosted-ibm-alchemy", Since: &kickedAt, Source: claimantSourceClaimLedger}},
{"unknown author kind with no claim", stageTrackerClaimInputs{Author: "someone", Since: &since}, nil},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand All @@ -90,7 +99,9 @@ func TestStageTrackerClaimantStage(t *testing.T) {
}{
{"issue", trackerNumberClaimed, true}, {"issue", trackerNumberPRInProgress, true}, {"issue", trackerNumberActionable, false}, {"issue", trackerNumberCoveredByPR, false},
{"pr", trackerNumberReviewPending, true}, {"pr", trackerNumberFixing, true}, {"pr", trackerNumberReturned, true}, {"pr", trackerNumberAdopted, true},
{"pr", trackerNumberAwaitingMerge, false}, {"pr", trackerNumberNeedsDecision, false}, {"pr", 0, false},
{"pr", trackerNumberAwaitingMerge, false}, {"pr", trackerNumberNeedsDecision, false},
// A PR before classification or at 030/040 lights "PR in progress" under its issue and names its holder (hivecommons/hive#15541).
{"pr", 0, true}, {"pr", trackerNumberPRInProgress, true}, {"pr", trackerNumberCoveredByPR, true},
} {
if got := stageTrackerClaimantStage(tc.kind, tc.stage); got != tc.want {
t.Errorf("%s stage %d: got %v, want %v", tc.kind, tc.stage, got, tc.want)
Expand Down Expand Up @@ -162,9 +173,34 @@ assert.ok(!/hive-agent|kick-history|claim-comment|unknown/i.test(text(row)), 'no

// A returned-to-contributor PR names its author on the detour word.
const pr = stageTrackerRowHtml({ repo: 'hivecommons/hive', number: 8, kind: 'pr', title: 'docs', url: 'https://x/8', stage: 72, stage_since: since, caption: 'Returned', author: 'bob', author_kind: 'clanker', stage_actor: { kind: 'clanker', login: 'bob', why: '@bob must act' }, claimant: { kind: 'clanker', login: 'bob', since, source: 'author' } }, stages, ctx);
assert.ok(litWord(pr).endsWith("· @bob's clanker"), litWord(pr));
assert.ok(litWord(pr).endsWith("@bob's clanker"), litWord(pr));
assert.strictEqual((litWord(pr).match(/@bob's clanker/g) || []).length, 1, 'the detour word names the holder once: ' + litWord(pr));
assert.ok(heldLine(pr).startsWith("Held by: @bob's clanker since 3h ago (PR author)"), litTitle(pr));

// PR in progress (hivecommons/hive#15541): an unclassified PR under its
// issue names who is working it, with the holder's own kind icon, exactly
// like Claimed; nobody known keeps the bare word.
const subRow = (prExtra) => stageTrackerRowHtml(issue(10, { stage: 40, caption: 'Covered by PR', stage_actor: { kind: 'none', why: 'its PR' }, linked_prs: [
Object.assign({ number: 101, url: 'https://x/101', title: 'fix', stage: 0, stage_since: since, caption: 'PR in progress', stage_actor: { kind: 'none', why: '' } }, prExtra),
] }), stages, ctx);
let sub = subRow({ author: 'hive-bot', author_kind: 'hive', claimant: { kind: 'hive-agent', agent: 'scanner', since, source: 'author' } });
assert.strictEqual(litWord(sub), 'PR in progress · scanner', litWord(sub));
assert.ok(heldLine(sub).startsWith('Held by: hive agent scanner since 3h ago (PR author)'), litTitle(sub));
assert.ok(strip(sub).includes('class="ham-ico ham-actor-ico"'), 'the holder draws an icon when the next mover is nobody: ' + strip(sub));
assert.ok(/ham-seg-t ham-has-holder/.test(strip(sub)), 'the word carries the one-line holder class: ' + strip(sub));
const icoOf = (html) => { const m = /<li class="ham-seg active[^"]*"[^>]*>([\s\S]*?)<\/li>/.exec(strip(html)); return m ? m[1] : ''; };
const clankerRow = subRow({ author: 'bob', author_kind: 'clanker', claimant: { kind: 'clanker', login: 'bob', since, source: 'author' } });
const humanRow = subRow({ author: 'alice', author_kind: 'human', claimant: { kind: 'person', login: 'alice', since, source: 'author' } });
assert.strictEqual(litWord(clankerRow), "PR in progress · @bob's clanker", litWord(clankerRow));
assert.strictEqual(litWord(humanRow), 'PR in progress · @alice', litWord(humanRow));
const icoOnly = (html) => icoOf(html).replace(/<span class="ham-seg-t[\s\S]*?<\/span>/, '');
assert.ok(icoOnly(clankerRow).includes('ham-actor-ico') && icoOnly(humanRow).includes('ham-actor-ico'), 'all three holder kinds draw an icon');
assert.ok(icoOnly(sub) !== icoOnly(clankerRow) && icoOnly(clankerRow) !== icoOnly(humanRow), 'hive, clanker and person icons differ');
sub = subRow({ author: 'dependabot[bot]', author_kind: 'bot' });
assert.strictEqual(litWord(sub), 'PR in progress', 'nobody known keeps the bare word: ' + litWord(sub));
assert.ok(!strip(sub).includes('ham-actor-ico'), 'no icon without a holder');
assert.ok(!strip(sub).includes('ham-has-holder'), 'no holder class without a holder');

// The covering-PR sub-row carries its PR's holder.
const covered = stageTrackerRowHtml(issue(9, { stage: 40, caption: 'Covered by PR', stage_actor: { kind: 'hive', why: 'its PR' }, linked_prs: [
{ number: 91, url: 'https://x/91', title: 'fix', author: 'hive-bot', author_kind: 'hive', stage: 70, stage_since: since, caption: 'Fixing', stage_actor: { kind: 'hive', login: 'fixer', why: 'fixer is on it' }, claimant: { kind: 'hive-agent', agent: 'fixer', since, source: 'kick-history' } },
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/stage_tracker_merge_gate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestStageTrackerMergeGateNode(t *testing.T) {
`const STAGE_TRACKER_MERGE_GATE_WORD = { 'gate-pending': 'Review passed', ready: 'Ready for auto merge', soaking: 'Soaking', merging: 'Merging', merged: 'Merged', 'merge-failed': 'Merge failed' };`,
`60: 'Review passed', 80: 'Ready for auto merge', 95: 'Soaking', 100: 'Merging'`,
`const gateCue = gateWord && typeof stageTrackerGateCueHtml === 'function' ? stageTrackerGateCueHtml(item, nowMs) : '';`,
`else if (active) inner = gateCue + workIco + (decision ? stageTrackerDecisionTriggerHtml(decision, word, tip) : word) + actorIco;`,
`else if (active) inner = gateCue + workIco + (decision ? stageTrackerDecisionTriggerHtml(decision, word, tip) : word) + (actorIco || holderIco);`,
`if (gateInfo) tip = sg.label + ' — ' + gateInfo.tip;`,
`if (typeof stageTrackerGateCountdownSync === 'function') stageTrackerGateCountdownSync(el, nowMs);`,
`.ham-gate-ico { display: inline-flex;`, `.ham-gate-detail {`,
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/dashboard/stage_tracker_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ func stageTrackerRowsPreludeJS(t *testing.T, html string) string {
jsConstLine(t, html, "STAGE_TRACKER_CLAIMANT_SOURCE"),
jsFunc(t, html, "stageTrackerShortHive"),
jsFunc(t, html, "stageTrackerClaimant"),
jsConstLine(t, html, "STAGE_TRACKER_CLAIMANT_ICON"),
jsFunc(t, html, "stageTrackerClaimantIconKind"),
jsFunc(t, html, "stageTrackerClaimantShort"),
jsFunc(t, html, "stageTrackerClaimantLine"),
jsConstLine(t, html, "STAGE_TRACKER_MOTION_STATIC"),
Expand Down
5 changes: 5 additions & 0 deletions src/pkg/dashboard/static-src/css/tracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@
.ham-seg.active.merged .ham-ico { stroke-width: 2.5; }
.ham-seg-t { white-space: normal; overflow-wrap: anywhere; }
.ham-holder { font-weight: normal; }
/* A word with a holder ("PR in progress · @bob's clanker") stays on one
line: the stage word keeps its width and the name gives way with an
ellipsis before anything wraps (hivecommons/hive#15541). */
.ham-seg-t.ham-has-holder, .ham-detour.ham-has-holder { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; white-space: nowrap; }
.ham-has-holder > .ham-holder { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.ham-ico { width: 12px; height: 12px; flex: 0 0 auto; }
.ham-actor-ico { margin-left: var(--sp-1); stroke-width: 2; }
.ham-seg.done { background: var(--panel-strong); color: var(--text-faint); }
Expand Down
Loading
Loading