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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor chevrons follow the canonical spec ([#16599](https://github.com/hivecommons/hive/issues/16599)): a row always has 1–2 **active** chevrons (amber fill + counted caption) — the item's stage column, plus a CI/Review track only while it genuinely runs on the current head; every other chevron is an **icon only** (neutral not-yet-run, red failed/changes requested, green passed/approved) with its counts and the backend sentence in the tooltip. CI and Review icons are a tiny ring segmented into `checks_total` / `perspectives_total` steps that fills clockwise (pass green, fail red, newest step pulsing while running). When nothing moves the blocker column is filled in a still stalled style, e.g. `CI 1/11 · waiting on workflow approval` for heads whose workflow runs are `action_required` on GitHub (new `PRCIActivity.WorkflowApproval`, blocker `workflow-approval-required:N`). Review-pending rows never read `Review unknown` / a default `5/5`: with no verdict bundle on the head they are `Review N/5 · in progress` (N = verdicts actually posted) or `· adjudicating`.
2 changes: 1 addition & 1 deletion src/docs/scale-envelope.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ones to:
2. **Truncation must preserve the prioritization signal, not cut an arbitrary slice.**
This holds today and is easy to assume backwards:
- Issues are sorted by actionable rank tier, then **oldest first** within each tier before any cap is applied
(`RankActionableIssues`, `src/pkg/github/client.go:5122-5134`, descending `AgeMinutes` within each tier).
(`RankActionableIssues`, `src/pkg/github/client.go:5133-5145`, descending `AgeMinutes` within each tier).
- PRs are sorted by **review class then oldest-first within class**
(`SortPullRequestsForReview`, `src/pkg/github/review_priority.go:334`;
fixes → refactors/docs → tests).
Expand Down
75 changes: 75 additions & 0 deletions src/pkg/dashboard/stage_tracker_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,21 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA
out.Caption = "CI queued · " + check + " waiting for a runner"
out.Detail = "Required check " + check + " has been requested for the PR's current commit but has not started executing yet."
case "missing":
if wa := a.WorkflowApproval; wa != nil && wa.Pending > 0 {
// Unreported because GitHub holds the runs behind its
// approve-workflows gate: a person's click, not a push,
// moves it (hivecommons/hive#16599).
out.Blocker = stageTrackerWorkflowApprovalBlocker(wa.Pending)
out.Caption = fmt.Sprintf("CI waiting · %s %s approval on GitHub", plural(wa.Pending, "workflow run"), pluralVerb(wa.Pending, "needs", "need"))
out.Detail = fmt.Sprintf("%s for the PR's current commit %s waiting for a maintainer to approve workflows on GitHub (the gate GitHub applies to dependabot and first-time or fork contributors), so required check %s cannot report until someone approves them.", plural(wa.Pending, "workflow run"), pluralVerb(wa.Pending, "is", "are"), check)
if wa.Actor != "" {
out.Actor = wa.Actor
}
if wa.ObservedAt != nil {
out.Since = wa.ObservedAt
}
break
}
out.Caption = "CI waiting · required check " + check + " hasn't reported for this head yet"
out.Detail = "Branch protection requires a check named " + check + ", but no check run or commit status with that name exists for the PR's current commit. Usually the workflow that produces it has not been triggered; a push, re-run, or label can start it."
case "unknown":
Expand All @@ -223,6 +238,22 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA
return out
}

// stageTrackerWorkflowApprovalBlockerPrefix leads the CI blocker when the
// unreported checks are workflow runs waiting on GitHub's approve-workflows
// gate; the strip reads the count after the colon.
const stageTrackerWorkflowApprovalBlockerPrefix = "workflow-approval-required:"

func stageTrackerWorkflowApprovalBlocker(n int) string {
return fmt.Sprintf("%s%d", stageTrackerWorkflowApprovalBlockerPrefix, n)
}

func pluralVerb(n int, one, many string) string {
if n == 1 {
return one
}
return many
}

// stageTrackerCountHeadChecks fills the check counts from every check run
// observed on the head when the required set is not known: one entry per
// check name, red if any run of that name is red, green only if its latest
Expand Down Expand Up @@ -339,6 +370,50 @@ func stageTrackerCountPerspectives(out *StageTrackerActivity, pr github.PullRequ
}
}

// stageTrackerReviewPendingState resolves the Review track for a PR the
// stage itself says is under review (050) when no verdict settled it: the
// swarm is in progress, so the track is "reviewing" (active) with the
// count of perspectives that posted for the current head — never
// "unknown", which left review-pending rows with no lit chevron
// (hivecommons/hive#16599). Without a head bundle or aggregate no
// perspective has posted: done is 0, whatever earlier rounds left behind.
func stageTrackerReviewPendingState(out *StageTrackerActivity, stage int, stageSince *time.Time) {
if out == nil || out.State != "unknown" || stage != trackerNumberReviewPending {
return
}
bundleSeen := strings.Contains(out.Source, "verified-review-bundle")
if !bundleSeen {
out.PerspectivesDone = 0
}
total := out.PerspectivesTotal
done := out.PerspectivesDone
if total > 0 && done >= total && bundleSeen {
out.State = "adjudicating"
out.Caption = fmt.Sprintf("Review %d/%d · verdicts in · aggregating", done, total)
out.Detail = "Every perspective has posted a verdict for the PR's current commit; hive is combining them into the review decision."
} else {
out.State = "reviewing"
out.Caption = fmt.Sprintf("Review %d/%d · in progress", done, total)
out.Detail = fmt.Sprintf("The PR is at review pending: %d of %s have posted a verdict for the PR's current commit; the rest are still reviewing or waiting for a reviewer.", done, plural(total, "perspective"))
}
out.Active = true
// The stage label is the observation; its time is when the label
// landed (stable across rebuilds, so the payload ETag does not move).
if out.ObservedAt == nil && stageSince != nil {
at := *stageSince
out.ObservedAt = &at
}
if out.Since == nil && stageSince != nil {
at := *stageSince
out.Since = &at
}
if out.Source == "" || out.Source == "unavailable" {
out.Source = "stage-review-pending"
} else {
out.Source += "+stage-review-pending"
}
}

func trackerHeadMatches(repo string, number int, head, observedRepo string, observedNumber int, observedHead string) bool {
return number == observedNumber && head != "" && strings.EqualFold(head, observedHead) && strings.EqualFold(repo, observedRepo)
}
Expand Down
Loading
Loading