diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr548_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr548_test.go index a10f167c..862b274f 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr548_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr548_test.go @@ -86,6 +86,12 @@ func TestOneCheckPerDeliveryAtTheGate(t *testing.T) { d.Ready.HeldSince == nil { t.Fatalf("the merge does not say what it waits for: %+v", d.Ready) } + // §9: deliveries says what it waits for. + for _, l := range w.h.Deliveries("", "", "", false) { + if l.ID == id && !strings.Contains(l.Waits, "approved; waits for the check of g") { + t.Errorf("deliveries says it waits for %q", l.Waits) + } + } // §4: past 30 minutes the held merge is a stalled line naming the check it waits for and since when. for _, l := range w.h.Stalled() { if l.ID == id { diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/verbs.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/verbs.go index 7d6caf09..166832cc 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/verbs.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/verbs.go @@ -26,6 +26,10 @@ type Line struct { // waitsFor is what a delivery waits for, in words. func (h *Holder) waitsFor(d *Delivery) string { + if r := d.Ready; r != nil && r.Merged == nil && strings.HasPrefix(r.Waits, "approved;") { + // Approved and waiting for another delivery's check, or for its own verdict's carry (ADR 0548 §2, §8, §9). + return r.Waits + } switch d.State { case Proposed: return "its check"