diff --git a/changelog.d/fixed-merge-queue-ci-rerun-flip.md b/changelog.d/fixed-merge-queue-ci-rerun-flip.md new file mode 100644 index 0000000000..fe52e153d8 --- /dev/null +++ b/changelog.d/fixed-merge-queue-ci-rerun-flip.md @@ -0,0 +1 @@ +- A human-gated (085) PR that is approved on its current head now stays in the Merge queue column while CI on that head is queued or re-running, instead of flipping to PR in progress and back as checks cycle; failing CI or an unapproved review still moves it out ([#16595](https://github.com/hivecommons/hive/issues/16595)). diff --git a/src/pkg/dashboard/stage_tracker_item_column_test.go b/src/pkg/dashboard/stage_tracker_item_column_test.go index 999ae23049..6404ddc4b7 100644 --- a/src/pkg/dashboard/stage_tracker_item_column_test.go +++ b/src/pkg/dashboard/stage_tracker_item_column_test.go @@ -167,6 +167,12 @@ func TestStageTrackerPersonActsOnPRColumn(t *testing.T) { {"decision with CI red, review approved", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("failing"), review("approved") }, trackerColumnPR}, + {"approved decision with CI running on the head keeps the gate", func(it *StageTrackerItem) { + it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("running"), review("approved") + }, trackerColumnMergeGate}, + {"approved decision with CI queued on the head keeps the gate", func(it *StageTrackerItem) { + it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("queued"), review("approved") + }, trackerColumnMergeGate}, {"bare 085 decision keeps the gate (#14821)", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", nil, nil }, trackerColumnMergeGate}, diff --git a/src/pkg/dashboard/stage_tracker_vocabulary.go b/src/pkg/dashboard/stage_tracker_vocabulary.go index 4d33e60cff..0dab37b723 100644 --- a/src/pkg/dashboard/stage_tracker_vocabulary.go +++ b/src/pkg/dashboard/stage_tracker_vocabulary.go @@ -133,10 +133,13 @@ func stageTrackerMergeReadyEvidence(it *StageTrackerItem) bool { } // stageTrackerNotMergeReadyEvidence: a track on the current head says the -// PR is short of merge-ready (review not approved, CI not green). +// PR is short of merge-ready (review not approved, CI not green). CI that +// is queued or running on the same head is a re-run, not a regression, so +// it does not count. func stageTrackerNotMergeReadyEvidence(it *StageTrackerItem) bool { return (stageTrackerActivityOnHead(it, it.ReviewActivity) && it.ReviewActivity.State != "approved") || - (stageTrackerActivityOnHead(it, it.CIActivity) && it.CIActivity.State != "passing") + (stageTrackerActivityOnHead(it, it.CIActivity) && it.CIActivity.State != "passing" && + it.CIActivity.State != "queued" && it.CIActivity.State != "running") } // stageTrackerStagePhrase is the stage as a lowercase clause for the