diff --git a/modules/mesh-delivery-checker/internal/check/beside.go b/modules/mesh-delivery-checker/internal/check/beside.go index 43c0b8c..cfd0769 100644 --- a/modules/mesh-delivery-checker/internal/check/beside.go +++ b/modules/mesh-delivery-checker/internal/check/beside.go @@ -42,12 +42,13 @@ 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 catalogue at its trunk, always, even in a -// group holding a catalogue pull request; 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); mesh-sdk, for the controller's tests, at the commit the controller's go.mod -// pins; any other sibling at the head of the group's pull request for it when the group holds one, else at its trunk. And -// first, the change's own repository at the trunk it is merged onto, so a test comparing a shrink-only list with the -// trunk's copy reads it at $MESH_CHECK_BESIDE/ (issue 1887 A12, ADR 0529 §2). +// 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 +// 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 +// comparing a shrink-only list with the trunk's copy reads it at $MESH_CHECK_BESIDE/ (issue 1887 A12, ADR 0529 §2): +// that is where a catalogue change's own trunk copy is placed. func (j *Examiner) besideFor(ctx context.Context, c *Case, p Pull) ([]BesideRef, error) { var heads map[string]string if j.Trunks != nil { @@ -59,10 +60,6 @@ func (j *Examiner) besideFor(ctx context.Context, c *Case, p Pull) ([]BesideRef, } for _, repo := range besideRules[p.Repository] { switch { - case repo == catalogueRepository: - if head := heads[repo]; head != "" { - out = append(out, BesideRef{Repository: repo, Commit: head, atTrunk: c.member(repo) == nil}) - } 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 878d720..a3dece4 100644 --- a/modules/mesh-delivery-checker/internal/check/pins_test.go +++ b/modules/mesh-delivery-checker/internal/check/pins_test.go @@ -85,7 +85,8 @@ func TestTheSiblingsAreWhereTheTestsStateThem(t *testing.T) { // review D2, ADR b := newBench(t) b.ex.Trunks = trunksOf(t, map[string]string{controller: trunkA, catalogue: trunkS, host: trunkA2, SDKRepository: "9999999999999999999999999999999999999999"}) b.ex.Runs = runsAt{"mesh-host": hostRuns} - // A group of the controller and the catalogue: the controller's tests read the catalogue's trunk, not the group's head. + // A group of the controller and the catalogue: the controller's tests read the group's catalogue head, the heads the group + // merges (ADR 0482 §2, ADR 0573 §4; issue 1126: a judge in the group was judged against the catalogue's trunk). out := b.judge(t, caseOf(t, pullOf(controller, 7, head1), pullOf(catalogue, 12, head2))) // ADR 0548 §6, issue 568's own example: the verdict names the node-engine at the commit the mesh runs, and mesh-sdk at the // trunk the catalogue's tests read it at; the catalogue, a member here, is not named. @@ -93,8 +94,8 @@ func TestTheSiblingsAreWhereTheTestsStateThem(t *testing.T) { // review D2, ADR t.Errorf("the siblings named for the verdict = %v, want the node-engine at %s and mesh-sdk at its trunk", out.Beside, hostRuns[:12]) } got := besideOf(t, b, controller) - if c := got[catalogue]; c.Commit != trunkS || c.Ref != "" { - t.Errorf("the catalogue beside the controller = %+v, want its trunk %s", c, trunkS) + if c := got[catalogue]; c.Commit != head2 || c.Ref != "refs/pull/12/head" { + t.Errorf("the catalogue beside the controller in a group = %+v, want the member's head %s", c, head2) } if h := got[host]; h.Commit != hostRuns { t.Errorf("the node-engine beside the controller = %+v, want the commit the mesh runs %s", h, hostRuns) @@ -104,6 +105,15 @@ func TestTheSiblingsAreWhereTheTestsStateThem(t *testing.T) { // review D2, ADR if s := got[SDKRepository]; s.Commit != "9999999999999999999999999999999999999999" { t.Errorf("mesh-sdk beside the controller = %+v, want its trunk", s) } + // Alone, the controller's tests read the catalogue's trunk, and the verdict names it. + b = newBench(t) + b.ex.Trunks = trunksOf(t, map[string]string{controller: trunkA, catalogue: trunkS, host: trunkA2, SDKRepository: trunkS}) + if out := b.judge(t, caseOf(t, pullOf(controller, 7, head1))); out.Beside[catalogue] != trunkS { + t.Errorf("the siblings named for the verdict alone = %v, want the catalogue at its trunk %s", out.Beside, trunkS) + } + if c := besideOf(t, b, controller)[catalogue]; c.Commit != trunkS || c.Ref != "" { + t.Errorf("the catalogue beside the controller alone = %+v, want its trunk %s", c, trunkS) + } } // 1295/R4g: the node-engine's tests read the controller's manifest, so a mesh-host pull request has mesh-controller beside it: