From c80f1430a020b9a8520edd91e57d8e4a04b3f261 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 14:11:15 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20stage=20tracker:=20push=20detai?= =?UTF-8?q?l=20on=20adopted=20and=20CI/Review=20rows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The adopted suffix and plain-row pill landed with hivecommons/hive#15801; the pill still showed after the head moved past the pushed commit. Drop it then. Closes #15797 Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- changelog.d/added-15797-tracker-push-detail.md | 1 + src/pkg/dashboard/stage_tracker_push.go | 9 ++++++++- src/pkg/dashboard/stage_tracker_push_test.go | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog.d/added-15797-tracker-push-detail.md diff --git a/changelog.d/added-15797-tracker-push-detail.md b/changelog.d/added-15797-tracker-push-detail.md new file mode 100644 index 0000000000..0ec66b6186 --- /dev/null +++ b/changelog.d/added-15797-tracker-push-detail.md @@ -0,0 +1 @@ +- Stage tracker: the "pushed" pill on a CI / Review row now drops once the PR head moves past the pushed commit (hivecommons/hive#15797). diff --git a/src/pkg/dashboard/stage_tracker_push.go b/src/pkg/dashboard/stage_tracker_push.go index ad5bef8575..0923c88818 100644 --- a/src/pkg/dashboard/stage_tracker_push.go +++ b/src/pkg/dashboard/stage_tracker_push.go @@ -58,7 +58,7 @@ func stageTrackerPushFor(it StageTrackerItem, stage stagelabels.Stage, rec stage return nil } login := strings.TrimSpace(it.Author) - if rec.PushedSinceWaiting() && stageTrackerPushSettling(stage, rec) { + if rec.PushedSinceWaiting() && stageTrackerPushOnHead(it, rec) && stageTrackerPushSettling(stage, rec) { at := rec.LastPushAt if at.After(now) { at = now @@ -167,3 +167,10 @@ func (s *Server) stageTrackerWaitingPushStale() time.Duration { } return (*config.Config)(nil).StageTrackerWaitingPushStale() } + +// stageTrackerPushOnHead reports whether the row's head is still the pushed +// one; once the head moves on, the push is old news (hivecommons/hive#15797). +// A row that carries no head cannot say, so the push stands. +func stageTrackerPushOnHead(it StageTrackerItem, rec stagelabels.Record) bool { + return it.Head == "" || strings.EqualFold(it.Head, rec.LastPushSha) +} diff --git a/src/pkg/dashboard/stage_tracker_push_test.go b/src/pkg/dashboard/stage_tracker_push_test.go index 6a60021e64..628201f7b8 100644 --- a/src/pkg/dashboard/stage_tracker_push_test.go +++ b/src/pkg/dashboard/stage_tracker_push_test.go @@ -50,6 +50,7 @@ func TestStageTrackerPushFor(t *testing.T) { {name: "pushed, re-staged to 050, checks running", it: it, stage: stagelabels.ReviewPending, rec: stagelabels.Record{Stage: stagelabels.ReviewPending, Reason: "ci-pending", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222", WaitingOnHive: true}, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "re-review"}, {name: "pushed on an adopted row, hive working it", it: it, stage: stagelabels.AdoptedByHive, rec: stagelabels.Record{Stage: stagelabels.AdoptedByHive, Reason: "adopted:ci-red", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222"}, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "ci"}, {name: "pushed, enumerate has not seen the head yet", it: it, stage: stagelabels.Reviewed, rec: stagelabels.Record{Stage: stagelabels.Reviewed, Reason: "approved:ci-pending", ActivityHead: "aaa1111", LastPushAt: pushedAt, LastPushSha: "bbb2222"}, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "ci"}, + {name: "pushed, then the head moved on: the pill goes", it: StageTrackerItem{Kind: "pr", Repo: "hivecommons/hive", Number: 42, Author: "zoe", Head: "ccc3333", URL: "https://github.com/hivecommons/hive/pull/42"}, stage: stagelabels.ReviewPending, rec: stagelabels.Record{Stage: stagelabels.ReviewPending, Reason: "ci-pending", ActivityHead: "ccc3333", LastPushAt: pushedAt, LastPushSha: "bbb2222", WaitingOnHive: true}, hasRec: true, wantNil: true}, {name: "pushed head settled: the pill goes", it: it, stage: stagelabels.Reviewed, rec: stagelabels.Record{Stage: stagelabels.Reviewed, Reason: "approved", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222"}, hasRec: true, wantNil: true}, {name: "push before the wait began is history", it: it, stage: stagelabels.NeedsAuthor, rec: stagelabels.Record{Stage: stagelabels.NeedsAuthor, WaitingPushSince: now.Add(-10 * time.Minute), LastPushAt: now.Add(-20 * time.Minute), LastPushSha: "aaa1111"}, hasRec: true, stale: 4 * time.Hour, state: "waiting", since: now.Add(-10 * time.Minute)}, {name: "no commit link without a PR URL", it: StageTrackerItem{Kind: "pr", Number: 42, Author: "zoe", Head: "bbb2222"}, stage: stagelabels.NeedsAuthor, rec: pushed, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", next: "re-review"}, From 6d185b4f92d56f4852bb62bdc251608067854154 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 14:30:19 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20stage=20tracker:=20a=20pushe?= =?UTF-8?q?d=20row=20keeps=20its=20pill=20while=20the=20list=20shows=20the?= =?UTF-8?q?=20head=20pushed=20over?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The on-head check from the previous commit dropped the push whenever the listed head differed from the pushed sha; the webhook re-read books the push ahead of the enumerate, so the list still carries the pre-push head then. Treat that head as on-head too; only a third head means the push moved on. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/stage_tracker_push.go | 7 +++++-- src/pkg/dashboard/stage_tracker_push_test.go | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_push.go b/src/pkg/dashboard/stage_tracker_push.go index 0923c88818..e0a8471638 100644 --- a/src/pkg/dashboard/stage_tracker_push.go +++ b/src/pkg/dashboard/stage_tracker_push.go @@ -170,7 +170,10 @@ func (s *Server) stageTrackerWaitingPushStale() time.Duration { // stageTrackerPushOnHead reports whether the row's head is still the pushed // one; once the head moves on, the push is old news (hivecommons/hive#15797). -// A row that carries no head cannot say, so the push stands. +// A row that carries no head cannot say, so the push stands; so does one +// whose listed head is the one the enumerate last booked — the webhook +// re-read books the push ahead of the list, which still shows the head +// the author pushed over. func stageTrackerPushOnHead(it StageTrackerItem, rec stagelabels.Record) bool { - return it.Head == "" || strings.EqualFold(it.Head, rec.LastPushSha) + return it.Head == "" || strings.EqualFold(it.Head, rec.LastPushSha) || strings.EqualFold(it.Head, rec.ActivityHead) } diff --git a/src/pkg/dashboard/stage_tracker_push_test.go b/src/pkg/dashboard/stage_tracker_push_test.go index 628201f7b8..049c48294d 100644 --- a/src/pkg/dashboard/stage_tracker_push_test.go +++ b/src/pkg/dashboard/stage_tracker_push_test.go @@ -50,7 +50,8 @@ func TestStageTrackerPushFor(t *testing.T) { {name: "pushed, re-staged to 050, checks running", it: it, stage: stagelabels.ReviewPending, rec: stagelabels.Record{Stage: stagelabels.ReviewPending, Reason: "ci-pending", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222", WaitingOnHive: true}, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "re-review"}, {name: "pushed on an adopted row, hive working it", it: it, stage: stagelabels.AdoptedByHive, rec: stagelabels.Record{Stage: stagelabels.AdoptedByHive, Reason: "adopted:ci-red", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222"}, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "ci"}, {name: "pushed, enumerate has not seen the head yet", it: it, stage: stagelabels.Reviewed, rec: stagelabels.Record{Stage: stagelabels.Reviewed, Reason: "approved:ci-pending", ActivityHead: "aaa1111", LastPushAt: pushedAt, LastPushSha: "bbb2222"}, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "ci"}, - {name: "pushed, then the head moved on: the pill goes", it: StageTrackerItem{Kind: "pr", Repo: "hivecommons/hive", Number: 42, Author: "zoe", Head: "ccc3333", URL: "https://github.com/hivecommons/hive/pull/42"}, stage: stagelabels.ReviewPending, rec: stagelabels.Record{Stage: stagelabels.ReviewPending, Reason: "ci-pending", ActivityHead: "ccc3333", LastPushAt: pushedAt, LastPushSha: "bbb2222", WaitingOnHive: true}, hasRec: true, wantNil: true}, + {name: "pushed, then the head moved on: the pill goes", it: StageTrackerItem{Kind: "pr", Repo: "hivecommons/hive", Number: 42, Author: "zoe", Head: "ccc3333", URL: "https://github.com/hivecommons/hive/pull/42"}, stage: stagelabels.ReviewPending, rec: stagelabels.Record{Stage: stagelabels.ReviewPending, Reason: "ci-pending", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222", WaitingOnHive: true}, hasRec: true, wantNil: true}, + {name: "pushed, the list still shows the head pushed over", it: StageTrackerItem{Kind: "pr", Repo: "hivecommons/hive", Number: 42, Author: "zoe", Head: "aaa1111", URL: "https://github.com/hivecommons/hive/pull/42"}, stage: stagelabels.NeedsAuthor, rec: pushed, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", url: "https://github.com/hivecommons/hive/commit/bbb2222", next: "re-review"}, {name: "pushed head settled: the pill goes", it: it, stage: stagelabels.Reviewed, rec: stagelabels.Record{Stage: stagelabels.Reviewed, Reason: "approved", ActivityHead: "bbb2222", LastPushAt: pushedAt, LastPushSha: "bbb2222"}, hasRec: true, wantNil: true}, {name: "push before the wait began is history", it: it, stage: stagelabels.NeedsAuthor, rec: stagelabels.Record{Stage: stagelabels.NeedsAuthor, WaitingPushSince: now.Add(-10 * time.Minute), LastPushAt: now.Add(-20 * time.Minute), LastPushSha: "aaa1111"}, hasRec: true, stale: 4 * time.Hour, state: "waiting", since: now.Add(-10 * time.Minute)}, {name: "no commit link without a PR URL", it: StageTrackerItem{Kind: "pr", Number: 42, Author: "zoe", Head: "bbb2222"}, stage: stagelabels.NeedsAuthor, rec: pushed, hasRec: true, state: "pushed", since: pushedAt, sha: "bbb2222", next: "re-review"},