diff --git a/changelog.d/added-tracker-inline-lead-action.md b/changelog.d/added-tracker-inline-lead-action.md new file mode 100644 index 0000000000..97c7f53fa8 --- /dev/null +++ b/changelog.d/added-tracker-inline-lead-action.md @@ -0,0 +1 @@ +- The Activity Monitor renders a row's lead action inline — `[Accept triage]`, `[Let hive decide]`, `[Merge now]`, `[Adopt…]` — as a button beside the chips whenever the next move is the viewer's, the same entry the ⋯ menu leads with, with its hint as the hover and greyed with the reason when the viewer lacks write access; a sidelined issue (reporter triage, filtered) now keeps its author kind in the row payload ([#15456](https://github.com/hivecommons/hive/issues/15456)). diff --git a/src/docs/dashboard-copy-inventory.md b/src/docs/dashboard-copy-inventory.md index b16d4052a1..0906df3a66 100644 --- a/src/docs/dashboard-copy-inventory.md +++ b/src/docs/dashboard-copy-inventory.md @@ -62,6 +62,7 @@ The new hover, verbatim (title line omitted): | Confirm: Approve & merge as maintainer | dialog | 76 | 53 | same | | Confirm: Approve — let hive merge | dialog | 62 | 49 | same | | ⋯ menu hints (`stageTrackerLeadActions` → `ham-menu-hint`) | ⋯ menu | server consequences (11–31 each) | server consequences (≤ 12 each) | Go budget test | +| `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 | — | ## Totals diff --git a/src/docs/dashboard-sections.md b/src/docs/dashboard-sections.md index 1b76bee651..4ef74b2068 100644 --- a/src/docs/dashboard-sections.md +++ b/src/docs/dashboard-sections.md @@ -1060,6 +1060,10 @@ The *state pill* says where the item is and what it is waiting on (`hold`, `need Plain words throughout — working / waiting on X / set back by Y / merged — nothing else blinks. +#### The row's lead action, inline + +A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real ``; + } // Pure: the actions for a row parked on a blocker (hivecommons/hive#15099): // the server lists them in decision_needed.options (a capability gap // offers the App settings link, a permission re-check and the disabled @@ -635,6 +684,20 @@ stageTrackerSelect(row.dataset.hamKey, { shift: e.shiftKey, meta: e.metaKey || e.ctrlKey }); } }); + // The row's inline lead button runs the same path as its ⋯ entry. + el.addEventListener('click', e => { + const b = e.target.closest ? e.target.closest('.ham-lead-act[data-ham-act]') : null; + if (!b) return; + e.preventDefault(); e.stopPropagation(); + if (b.getAttribute('aria-disabled') === 'true') return; + // The one row (or nested PR) the button sits on, never the selection. + const sub = b.closest('[data-ham-sub-key]'); + const row = b.closest('.ham-row[data-ham-key]'); + const key = sub ? sub.dataset.hamSubKey : (row ? row.dataset.hamKey : ''); + const item = key ? stageTrackerItemByKey(_stageTracker, key) : null; + if (!item) return; + stageTrackerDecisionRun(item, b.dataset.hamAct); + }); // Cmd/Ctrl- or Shift-click anywhere on a row (not on its links or // buttons) selects it too. el.addEventListener('click', e => { diff --git a/src/pkg/dashboard/static-src/js/tracker-row.js b/src/pkg/dashboard/static-src/js/tracker-row.js index 1ce5f1cfb4..277151e0bd 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row.js +++ b/src/pkg/dashboard/static-src/js/tracker-row.js @@ -976,6 +976,17 @@ const tip = 'Hive re-authored #' + af.number + (af.author ? ' (by @' + af.author + ')' : '') + ' as this PR with the same commits and sign-off' + (af.decided_by ? '; the decision on #' + af.number + ' was ' + (af.decided_action || 'yours') + ' by @' + af.decided_by : '') + '. #' + af.number + ' is closed as superseded when this merges.'; return `${esc(text)}`; } + // The row's inline lead action (tracker-actions.js + // stageTrackerLeadActionHtml), computed against the viewer's own + // permissions on the item's repo; '' where the actions module or a + // viewer context is absent (the node harness lifts this file alone). + function stageTrackerLeadButtonHtml(item, nowMs) { + if (typeof stageTrackerLeadActionHtml !== 'function' || typeof stageTrackerActionCtx !== 'function' || !item) return ''; + const ctx = stageTrackerActionCtx(item.repo); + if (!ctx) return ''; + ctx.nowMs = typeof nowMs === 'number' ? nowMs : Date.now(); + return stageTrackerLeadActionHtml(item, ctx); + } function stageTrackerSubRowHtml(lp, issue, stages, nowMs, ctx) { const pr = stageTrackerLinkedPRItem(issue, lp); const superseded = typeof stageTrackerLinkedSupersededText === 'function' ? stageTrackerLinkedSupersededText(lp, issue) : ''; @@ -996,7 +1007,7 @@ return `
${typeof stageTrackerRowToolsHtml === 'function' ? stageTrackerRowToolsHtml(pr) : ''}
- ${stageTrackerHeadColsHtml([ref], '', stageTrackerActedBadgeHtml(pr, nowMs) + ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : '')) + stageTrackerChipsHtml(pr))} + ${stageTrackerHeadColsHtml([ref], '', stageTrackerActedBadgeHtml(pr, nowMs) + ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : '')) + stageTrackerChipsHtml(pr) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(pr, nowMs) : ''))}
    ${stageTrackerStripItems(pr, stages, { from: STAGE_TRACKER_PR_COLUMN }, nowMs, ctx)}
@@ -1259,7 +1270,7 @@ return `
${stageTrackerRowToolsHtml(item)}
- ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown))} + ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs) : ''))}
    ${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 0df4731e5e..8a490e8cbe 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1907,6 +1907,15 @@ .ham-decision-act[aria-disabled="true"] { color: var(--text-faint); border-style: dashed; cursor: default; opacity: 0.6; } .ham-decision-act[aria-disabled="true"]:hover { background: transparent; border-color: var(--line-subtle); } .ham-decision-act.ham-decision-more { color: var(--text-muted); } + /* The row's inline lead action (the ⋯ menu's lead entry, in sight): a + small primary pill in the chip slot, the popover lead's recipe, the + row's cue colour; dashed and faint with its reason when the viewer + may not take it. */ + .ham-lead-act { padding: 0 var(--sp-3); border: var(--line-width) solid var(--cue-state, var(--accent)); border-radius: var(--r-pill); background: color-mix(in srgb, var(--cue-state, var(--accent)) 10%, transparent); color: var(--cue-state, var(--accent)); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; cursor: pointer; white-space: nowrap; } + .ham-lead-act:hover, .ham-lead-act:focus-visible { background: color-mix(in srgb, var(--cue-state, var(--accent)) 22%, transparent); outline: none; } + .ham-lead-act:focus-visible { box-shadow: 0 0 0 var(--line-width) var(--accent); } + .ham-lead-act.ham-menu-danger { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); } + .ham-lead-act[aria-disabled="true"] { color: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; } /* The technical background folds behind one collapsed Details. */ .ham-decision-details { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--text-muted); } .ham-decision-details > summary { cursor: pointer; color: var(--text-faint); } @@ -16473,6 +16482,17 @@

Where to get help

const tip = 'Hive re-authored #' + af.number + (af.author ? ' (by @' + af.author + ')' : '') + ' as this PR with the same commits and sign-off' + (af.decided_by ? '; the decision on #' + af.number + ' was ' + (af.decided_action || 'yours') + ' by @' + af.decided_by : '') + '. #' + af.number + ' is closed as superseded when this merges.'; return `${esc(text)}`; } + // The row's inline lead action (tracker-actions.js + // stageTrackerLeadActionHtml), computed against the viewer's own + // permissions on the item's repo; '' where the actions module or a + // viewer context is absent (the node harness lifts this file alone). + function stageTrackerLeadButtonHtml(item, nowMs) { + if (typeof stageTrackerLeadActionHtml !== 'function' || typeof stageTrackerActionCtx !== 'function' || !item) return ''; + const ctx = stageTrackerActionCtx(item.repo); + if (!ctx) return ''; + ctx.nowMs = typeof nowMs === 'number' ? nowMs : Date.now(); + return stageTrackerLeadActionHtml(item, ctx); + } function stageTrackerSubRowHtml(lp, issue, stages, nowMs, ctx) { const pr = stageTrackerLinkedPRItem(issue, lp); const superseded = typeof stageTrackerLinkedSupersededText === 'function' ? stageTrackerLinkedSupersededText(lp, issue) : ''; @@ -16493,7 +16513,7 @@

Where to get help

return `
${typeof stageTrackerRowToolsHtml === 'function' ? stageTrackerRowToolsHtml(pr) : ''}
- ${stageTrackerHeadColsHtml([ref], '', stageTrackerActedBadgeHtml(pr, nowMs) + ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : '')) + stageTrackerChipsHtml(pr))} + ${stageTrackerHeadColsHtml([ref], '', stageTrackerActedBadgeHtml(pr, nowMs) + ((typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(pr, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(pr, nowMs) : '')) + stageTrackerChipsHtml(pr) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(pr, nowMs) : ''))}
    ${stageTrackerStripItems(pr, stages, { from: STAGE_TRACKER_PR_COLUMN }, nowMs, ctx)}
@@ -16756,7 +16776,7 @@

Where to get help

return `
${stageTrackerRowToolsHtml(item)}
- ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown))} + ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs) : ''))}
    ${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}
@@ -18659,6 +18679,55 @@

All labels

out.push({ id: 'copy', label: 'Copy link', enabled: !!item.url, why: item.url ? '' : 'No GitHub link' }); return out; } + // Pure: the one action a row leads with, rendered inline on the row + // header so the ask the caption makes has its answer in sight + // (hivecommons/hive#15456: "waiting for a maintainer's triage" with + // Accept triage hidden behind ⋯). The ⋯ menu's `lead` entry first + // (Accept triage, the server's lead answer such as Merge now, Close + // (read)); else the first Decide… option (Let hive decide, carrying the + // decide target); else Adopt, Adopt now or Let hive decide — all N + // PRs. null when the row asks nothing of the viewer here. Disabled + // entries are returned as-is so the button can say why. + function stageTrackerLeadAction(item, ctx) { + if (!item) return null; + const actions = stageTrackerRowActions(item, ctx); + const lead = actions.find(a => a.lead); + if (lead) return lead; + const decide = actions.find(a => a.id === 'decide'); + if (decide && Array.isArray(decide.submenu) && decide.submenu.length) { + const o = decide.submenu.find(x => x.enabled) || decide.submenu[0]; + const enabled = !!decide.enabled && !!o.enabled; + return Object.assign({}, o, { target: decide.target, enabled, why: enabled ? '' : (decide.enabled ? o.why : decide.why) }); + } + for (const id of ['decide:adopt', 'decide:adopt-now', 'decide:delegate-all']) { + const a = actions.find(x => x.id === id); + if (a && (a.enabled || id !== 'decide:adopt-now')) return a; + } + if (typeof stageTrackerDevWarn === 'function' && stageTrackerMaintainerMoved(item)) stageTrackerDevWarn('row ' + stageTrackerRefOf(item) + ' waits on the maintainer but offers no lead action'); + return null; + } + // Pure: whether the server says the next move is the maintainer's. + function stageTrackerMaintainerMoved(item) { + return !!item && (item.actor === 'maintainer' || !!(item.new && item.new.next_mover === 'maintainer')); + } + // A console warning on a development host only (localhost, 127.0.0.1). + function stageTrackerDevWarn(msg) { + const host = typeof window !== 'undefined' && window.location ? String(window.location.hostname || '') : ''; + if ((host === 'localhost' || host === '127.0.0.1') && typeof console !== 'undefined' && console.warn) console.warn('[tracker] ' + msg); + } + // The inline lead button for a row: a real `; + } // Pure: the actions for a row parked on a blocker (hivecommons/hive#15099): // the server lists them in decision_needed.options (a capability gap // offers the App settings link, a permission re-check and the disabled @@ -18877,6 +18946,20 @@

All labels

stageTrackerSelect(row.dataset.hamKey, { shift: e.shiftKey, meta: e.metaKey || e.ctrlKey }); } }); + // The row's inline lead button runs the same path as its ⋯ entry. + el.addEventListener('click', e => { + const b = e.target.closest ? e.target.closest('.ham-lead-act[data-ham-act]') : null; + if (!b) return; + e.preventDefault(); e.stopPropagation(); + if (b.getAttribute('aria-disabled') === 'true') return; + // The one row (or nested PR) the button sits on, never the selection. + const sub = b.closest('[data-ham-sub-key]'); + const row = b.closest('.ham-row[data-ham-key]'); + const key = sub ? sub.dataset.hamSubKey : (row ? row.dataset.hamKey : ''); + const item = key ? stageTrackerItemByKey(_stageTracker, key) : null; + if (!item) return; + stageTrackerDecisionRun(item, b.dataset.hamAct); + }); // Cmd/Ctrl- or Shift-click anywhere on a row (not on its links or // buttons) selects it too. el.addEventListener('click', e => { diff --git a/src/pkg/github/client.go b/src/pkg/github/client.go index 3dc4e94bbe..8a740604a6 100644 --- a/src/pkg/github/client.go +++ b/src/pkg/github/client.go @@ -1769,11 +1769,11 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re switch standingMetaIssueKindFor(issue.GetTitle(), safeGetLogin(issue.GetUser()), labels) { case standingMetaHiveAdvisory: breakdown.HiveAdvisory++ - details = append(details, repoWorkIssue(repo, issue, labels, "hive_advisory", "Hive advisory report")) + details = append(details, c.workIssue(repo, issue, labels, "hive_advisory", "Hive advisory report")) continue case standingMetaDependencyDashboard: breakdown.DependencyDashboard++ - details = append(details, repoWorkIssue(repo, issue, labels, "dependency_dashboard", "Dependency dashboard control panel")) + details = append(details, c.workIssue(repo, issue, labels, "dependency_dashboard", "Dependency dashboard control panel")) continue } @@ -1805,7 +1805,7 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re if c.isExempt(labels) { breakdown.Filtered++ breakdown.Exempt++ - details = append(details, repoWorkIssue(repo, issue, labels, "filtered", "Exempt label")) + details = append(details, c.workIssue(repo, issue, labels, "filtered", "Exempt label")) continue } // A tracking/archive issue (hive/tracking label, hive:tracking @@ -1815,7 +1815,7 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re if _, tracking := isTrackingIssue(issue); tracking { breakdown.Filtered++ breakdown.Tracking++ - details = append(details, repoWorkIssue(repo, issue, labels, "filtered", trackingFilterReason)) + details = append(details, c.workIssue(repo, issue, labels, "filtered", trackingFilterReason)) continue } // Blocked on an unmerged PR (hivecommons/hive#13093): out of the @@ -1826,7 +1826,7 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re if hasBlockedLabel(labels) { breakdown.Filtered++ breakdown.Blocked++ - row := repoWorkIssue(repo, issue, labels, "filtered", blockedFilterReason(issue.GetBody())) + row := c.workIssue(repo, issue, labels, "filtered", blockedFilterReason(issue.GetBody())) row.RecheckAfter, row.OpsTracking = blockedRecheck(issue.GetBody()) row.RecheckDone = blockedRecheckDone(issue.GetBody()) details = append(details, row) @@ -1835,13 +1835,13 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re if labelPresent(labels, issueNeedsReporterConfirmationLabel) { breakdown.Filtered++ breakdown.ReporterConfirmation++ - details = append(details, repoWorkIssue(repo, issue, labels, "filtered", issueNeedsReporterConfirmationLabel)) + details = append(details, c.workIssue(repo, issue, labels, "filtered", issueNeedsReporterConfirmationLabel)) continue } if suppress := hardSuppressIssueBucket(issueFilter, labels); suppress != "" { breakdown.Filtered++ breakdown.addHardSuppress(suppress) - details = append(details, repoWorkIssue(repo, issue, labels, "filtered", suppress)) + details = append(details, c.workIssue(repo, issue, labels, "filtered", suppress)) continue } @@ -1866,7 +1866,7 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re if !ra.AdmitsReporter(labels, safeGetLogin(issue.GetUser()), issue.GetAuthorAssociation()) { c.markReporterTrustAwaiting(ctx, repo, issue, labels, ra, reporterTrustWaitBudget) breakdown.ReporterTriage++ - details = append(details, repoWorkIssue(repo, issue, labels, workBucketReporterTriage, reporterTriageAwaitingReason)) + details = append(details, c.workIssue(repo, issue, labels, workBucketReporterTriage, reporterTriageAwaitingReason)) continue } labels = c.clearReporterTrustAwaiting(ctx, repo, issue, labels, ra) @@ -1874,7 +1874,7 @@ func (c *Client) fetchIssues(ctx context.Context, repo string, now time.Time, re if !issueFilter.Admits(labels) { breakdown.Filtered++ - details = append(details, repoWorkIssue(repo, issue, labels, "filtered", "Project issue filter")) + details = append(details, c.workIssue(repo, issue, labels, "filtered", "Project issue filter")) continue } @@ -4598,17 +4598,22 @@ func (c *Client) repoWorkPR(repo string, pr *gh.PullRequest, labels []string, hi } type RepoWorkIssue struct { - Repo string `json:"repo"` - Number int `json:"number"` - Title string `json:"title"` - Author string `json:"author,omitempty"` - Labels []string `json:"labels,omitempty"` - Assignees []string `json:"assignees,omitempty"` - CreatedAt time.Time `json:"created_at,omitzero"` - UpdatedAt time.Time `json:"updated_at,omitzero"` - URL string `json:"url,omitempty"` - Bucket string `json:"bucket"` - Reason string `json:"reason,omitempty"` + Repo string `json:"repo"` + Number int `json:"number"` + Title string `json:"title"` + Author string `json:"author,omitempty"` + // AuthorIsHuman is Issue.AuthorIsHuman for a sidelined issue, so the + // tracker can still classify the reporter of a row parked in a work + // bucket (reporter triage, filtered, …) instead of rendering it with an + // unknown author kind. + AuthorIsHuman bool `json:"author_is_human,omitempty"` + Labels []string `json:"labels,omitempty"` + Assignees []string `json:"assignees,omitempty"` + CreatedAt time.Time `json:"created_at,omitzero"` + UpdatedAt time.Time `json:"updated_at,omitzero"` + URL string `json:"url,omitempty"` + Bucket string `json:"bucket"` + Reason string `json:"reason,omitempty"` // ClaimKind, ClaimedBy and ClaimPRStarted are Issue.ClaimKind / // Issue.ClaimedBy / Issue.ClaimPRStarted, copied for the issue stage // reconciler. @@ -4650,6 +4655,7 @@ func repoWorkIssueFromIssue(issue Issue, bucket, reason string) RepoWorkIssue { Number: issue.Number, Title: issue.Title, Author: issue.Author, + AuthorIsHuman: issue.AuthorIsHuman, Labels: append([]string(nil), issue.Labels...), Assignees: append([]string(nil), issue.Assignees...), CreatedAt: issue.CreatedAt, @@ -4682,6 +4688,16 @@ func appendRepoWorkIssueDetail(result *ActionableResult, issue Issue, bucket, re result.WorkDetailsByRepo[issue.Repo] = details } +// workIssue is repoWorkIssue with the client's author classification, so a +// sidelined issue carries AuthorIsHuman the way an actionable one does. +func (c *Client) workIssue(repo string, issue *gh.Issue, labels []string, bucket, reason string) RepoWorkIssue { + row := repoWorkIssue(repo, issue, labels, bucket, reason) + if issue != nil { + row.AuthorIsHuman = c.isHumanAuthor(issue.GetUser()) + } + return row +} + func repoWorkIssue(repo string, issue *gh.Issue, labels []string, bucket, reason string) RepoWorkIssue { if issue == nil { return RepoWorkIssue{Repo: repo, Labels: append([]string(nil), labels...), Bucket: bucket, Reason: reason} diff --git a/src/pkg/github/webhook_item_patch.go b/src/pkg/github/webhook_item_patch.go index 4114deff45..f9b5956ce1 100644 --- a/src/pkg/github/webhook_item_patch.go +++ b/src/pkg/github/webhook_item_patch.go @@ -53,7 +53,7 @@ func (c *Client) classifyWebhookIssue(repo string, issue *gh.Issue, labels []str issueFilter := c.getIssueFilter() author := safeGetLogin(issue.GetUser()) sidelined := func(bucket, reason string) WebhookItemPatch { - row := repoWorkIssue(repo, issue, labels, bucket, reason) + row := c.workIssue(repo, issue, labels, bucket, reason) return WebhookItemPatch{Bucket: WebhookBucketSidelined, WorkIssue: &row} } switch standingMetaIssueKindFor(issue.GetTitle(), author, labels) { @@ -85,7 +85,7 @@ func (c *Client) classifyWebhookIssue(repo string, issue *gh.Issue, labels []str return sidelined("filtered", trackingFilterReason) } if hasBlockedLabel(labels) { - row := repoWorkIssue(repo, issue, labels, "filtered", blockedFilterReason(issue.GetBody())) + row := c.workIssue(repo, issue, labels, "filtered", blockedFilterReason(issue.GetBody())) row.RecheckAfter, row.OpsTracking = blockedRecheck(issue.GetBody()) row.RecheckDone = blockedRecheckDone(issue.GetBody()) return WebhookItemPatch{Bucket: WebhookBucketSidelined, WorkIssue: &row} @@ -105,7 +105,7 @@ func (c *Client) classifyWebhookIssue(repo string, issue *gh.Issue, labels []str // reporter_triage bucket) rides along so a brand-new issue // is visible from its `opened` delivery rather than from the // next enumeration (hivecommons/hive#15094). - row := repoWorkIssue(repo, issue, labels, workBucketReporterTriage, reporterTriageAwaitingReason) + row := c.workIssue(repo, issue, labels, workBucketReporterTriage, reporterTriageAwaitingReason) return WebhookItemPatch{Bucket: WebhookBucketUnknown, WorkIssue: &row} } } diff --git a/src/pkg/github/webhook_item_patch_new_test.go b/src/pkg/github/webhook_item_patch_new_test.go index 6c3b73fa41..e207a33c2d 100644 --- a/src/pkg/github/webhook_item_patch_new_test.go +++ b/src/pkg/github/webhook_item_patch_new_test.go @@ -28,6 +28,9 @@ func TestClassifyWebhookIssue_UnadmittedReporterCarriesTriageRow(t *testing.T) { if p.WorkIssue == nil || p.WorkIssue.Bucket != workBucketReporterTriage || p.WorkIssue.Reason != reporterTriageAwaitingReason || p.WorkIssue.Number != 15092 { t.Fatalf("work row = %+v, want a reporter_triage row for #15092", p.WorkIssue) } + if !p.WorkIssue.AuthorIsHuman { + t.Fatalf("work row AuthorIsHuman = false, want the reporter's kind carried on the sidelined row") + } } // An unknown-bucket read for an item no list carries inserts the row the