From fbbf28d21c375e85c672604eeba318b6ed7ff801 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 22 Oct 2026 16:36:23 +0200 Subject: [PATCH] mesh-delivery-gate: read the queue's state word as the controller says it, in flight (issue 1274) --- .../cmd/mesh-delivery-gate/issue1274_test.go | 2 +- .../mesh-delivery-gate/cmd/mesh-delivery-gate/lostcheck.go | 6 ++++-- modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/issue1274_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/issue1274_test.go index 3a310842..170452c7 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/issue1274_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/issue1274_test.go @@ -69,7 +69,7 @@ func TestACheckTheQueueStillHoldsIsNotAskedAgain(t *testing.T) { id := IDOf("novox/app", head) w.h.PullUpdated(pr("novox/app", 7, head, "feat/x", "src/a.go")) w.settleAll() - w.ctl.queue[0].State = "in-flight" + w.ctl.queue[0].State = "in flight" w.later(3 * time.Hour) w.settleAll() if len(w.ctl.checks) != 1 { diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/lostcheck.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/lostcheck.go index 93e125b9..07725fa8 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/lostcheck.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/lostcheck.go @@ -61,10 +61,12 @@ func heldBy(d *Delivery, asks []QueuedAsk) *QueuedAsk { } func (a QueuedAsk) words() string { - if a.State == "in-flight" && a.Machine != "" { + // The controller's `queue` says the state "in flight", its table's word. + state := strings.ReplaceAll(a.State, "-", " ") + if state == "in flight" && a.Machine != "" { return a.ID + " is in flight on " + a.Machine } - return a.ID + " is " + strings.ReplaceAll(a.State, "-", " ") + " in the build queue" + return a.ID + " is " + state + " in the build queue" } // lostChecks are the asks again of proposed deliveries whose asked check the build queue holds no entry of, past the diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go index 5a03360b..c2af77b7 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go @@ -75,7 +75,7 @@ type Controller interface { // QueuedAsk is one ask of the build queue as the controller's `queue` answers it as data. type QueuedAsk struct { ID string `json:"id"` - State string `json:"state"` // waiting, in-flight or dead + State string `json:"state"` // waiting, in flight or dead Kind string `json:"kind"` // check or delivery Repository string `json:"repository"` Commit string `json:"commit,omitempty"`