diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline.go index 3564fc753..c9b4840f0 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline.go @@ -47,9 +47,12 @@ func strictly(body json.RawMessage, into any) error { return dec.Decode(into) } +// decodePipelineStarted reads a pipeline-started with the contract's decoder, so a field of the runner's other form that this +// reader does not know is left unread and the movers of the earlier form and of the new are taken alike (design 47 H2 +// H-A-709 (3)). func decodePipelineStarted(body json.RawMessage, _ time.Time) ([]StepOutcome, error) { - var p runner.PipelineStartedEvent - if err := strictly(body, &p); err != nil { + p, _, err := runner.DecodePipelineStartedEvent(body) + if err != nil { return nil, err } return nil, namesSource(p.Branch, p.Source, p.Run) diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline_test.go index aee6ed2a7..33b3367fc 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/recordpipeline_test.go @@ -62,6 +62,14 @@ func TestARecordFollowsItsPipelineToTheMachines(t *testing.T) { if _, ok := r.Entries[EntryKey("app", "f", "")]; !ok || len(r.Entries) != 1 { t.Fatalf("entries %v: the mover is one, a run's none", r.Entries) } + // Design 47 H2 H-A-709 (3): a pipeline-started of the earlier form, whose movers carry fields the new form's StartedMover + // leaves out, is taken as the new form is: its movers are entries. + hear(t, c, "mesh-pipeline-runner.pipeline-started.main.1", "", + `{"v":1,"branch":"main","source":1,"pipeline":"main.1","call":"0000000000000001","movers":[{"module":"older","commit":"c","fingerprint":"o","repository":"novox/older","tier":1,"published":true,"widens":["x"],"tests":{"passed":3},"over-budget":false}]}`) + if _, ok := r.Entries[EntryKey("older", "o", "")]; !ok || len(r.Entries) != 2 { + t.Fatalf("entries %v: the earlier form's mover is one too", r.Entries) + } + delete(r.Entries, EntryKey("older", "o", "")) hear(t, c, "mesh-pipeline-runner.wait-held.main.1", "", `{"v":1,"branch":"main","source":1,"pipeline":"main.1","module":"app","fingerprint":"f","step":"approval","on":"person","who":"the operator","since":"2026-11-20T03:01:00Z"}`) held := r.Outcomes[OutcomeKey("app", "f", "", "approval")]