diff --git a/modules/mesh-delivery-checker/internal/check/beside.go b/modules/mesh-delivery-checker/internal/check/beside.go index d0fa103c..0b8a584d 100644 --- a/modules/mesh-delivery-checker/internal/check/beside.go +++ b/modules/mesh-delivery-checker/internal/check/beside.go @@ -50,8 +50,9 @@ var besideRules = map[string][]string{ "novox/mesh-delivery": {SDKRepository, catalogueRepository}, } -// besideFor are the siblings a pull request's tests read (ADR 0484 clause 4): the node-engine at the commit the mesh runs -// (the commit of the indexer's module mesh-host, its trunk head when none is known); any other sibling, the catalogue +// besideFor are the siblings a pull request's tests read (ADR 0484 clause 4): the node-engine at the head of the group's pull +// request for it when the group holds one, else at the commit the mesh runs (the commit of the indexer's module mesh-host, +// its trunk head when none is known); any other sibling, the catalogue // included, at the head of the group's pull request for it when the group holds one, else at its trunk, since a group's // check judges each member against the group's heads (ADR 0482 §2, ADR 0573 §4; issue 1126: a judge a group changed was // judged against the catalogue's trunk). And first, the change's own repository at the trunk it is merged onto, so a test @@ -68,6 +69,12 @@ func (j *Examiner) besideFor(ctx context.Context, c *Case, p Pull) ([]BesideRef, } for _, repo := range besideRules[p.Repository] { switch { + case repo == nodeEngineRepo && c.member(repo) != nil: + // A group's check judges each member against the group's heads (ADR 0573 §4, ADR 0482 §2), and the group's + // node-engine is what runs after its merge: it is placed at the member's head, as any member is. Neither atTrunk + // nor runs, so no move of the trunk or of the running commit puts the verdict out of date (besideAtTrunk). + member := c.member(repo) + out = append(out, BesideRef{Repository: repo, Commit: member.Head, Ref: refOf(member.Number)}) case repo == nodeEngineRepo: commit := "" if j.Runs != nil { diff --git a/modules/mesh-delivery-checker/internal/check/pins_test.go b/modules/mesh-delivery-checker/internal/check/pins_test.go index 31dc4577..d0ad069f 100644 --- a/modules/mesh-delivery-checker/internal/check/pins_test.go +++ b/modules/mesh-delivery-checker/internal/check/pins_test.go @@ -183,6 +183,18 @@ func TestACatalogueChangeHasTheCatalogueBesideItAtItsTrunk(t *testing.T) { if h := got[nodeEngineRepo]; h.Commit != hostRuns { t.Errorf("the node-engine beside a catalogue change = %+v, want the commit the mesh runs %s", h, hostRuns) } + // A group that holds the node-engine is judged against its head, which is what runs after its merge, never the commit + // the mesh runs now; the verdict names it in no carry (it is a member, not read at a trunk or a running commit). + b = newBench(t) + b.ex.Trunks = trunksOf(t, map[string]string{catalogueRepository: trunkA, SDKRepository: trunkS, nodeEngineRepo: trunkA2}) + b.ex.Runs = runsAt{nodeEngineModule: hostRuns} + out = b.judge(t, caseOf(t, pullOf(catalogueRepository, 12, head1), pullOf(nodeEngineRepo, 8, head2))) + if h := besideOf(t, b, catalogueRepository)[nodeEngineRepo]; h.Commit != head2 || h.Ref != "refs/pull/8/head" { + t.Errorf("the node-engine beside a catalogue change in a group holding it = %+v, want the member's head %s", h, head2) + } + if out.Beside[nodeEngineRepo] != "" { + t.Errorf("the verdict names the member node-engine in its carry: %v", out.Beside) + } } // 1887/A12: a mesh-lab head gets a check: with its trunk known it is judged like any repository, its Go fetch finding