From 0de195c5aacf5f53aac51b9931460fc0ef0b79f7 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 21 Nov 2026 13:20:54 +0100 Subject: [PATCH] Design 47 H1: test that a module entering the graph watches its siblings' alike branch Review round 2. The siblings watched main, which is also the default branch, so no test held the alike rule; they now watch stable and the entering module is asserted to watch it. Builds: design 47 H H-A-265, H-A-266 --- .../internal/index/graph_registrations_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-indexer/internal/index/graph_registrations_test.go b/modules/mesh-delivery-indexer/internal/index/graph_registrations_test.go index 6df8be27..bceedf9f 100644 --- a/modules/mesh-delivery-indexer/internal/index/graph_registrations_test.go +++ b/modules/mesh-delivery-indexer/internal/index/graph_registrations_test.go @@ -77,9 +77,9 @@ func TestAModuleEnteringTheTrunkGraphIsRegistered(t *testing.T) { other := steps other.Lint = "optional" held := []meshcatalog.Registration{ - {Module: "core", Origin: "novox/c", Path: "go/core/module.json", Branches: []string{"main"}, Policy: meshcatalog.Policy{Steps: steps, + {Module: "core", Origin: "novox/c", Path: "go/core/module.json", Branches: []string{"stable"}, Policy: meshcatalog.Policy{Steps: steps, Artifacts: map[string]meshcatalog.StepStatuses{"lib": {Integration: "bypass"}, "files": {Lint: "bypass", Unit: "bypass"}}}}, - {Module: "tools", Origin: "novox/c", Path: "go/tools/module.json", Branches: []string{"main"}, Policy: meshcatalog.Policy{Steps: steps, + {Module: "tools", Origin: "novox/c", Path: "go/tools/module.json", Branches: []string{"stable"}, Policy: meshcatalog.Policy{Steps: steps, Artifacts: map[string]meshcatalog.StepStatuses{"lib": {Integration: "bypass"}, "files": {Unit: "bypass"}}}}, {Module: "x1", Origin: "novox/mixed", Path: "x1/module.json", Branches: []string{"main"}, Policy: meshcatalog.Policy{Steps: steps}}, {Module: "x2", Origin: "novox/mixed", Path: "x2/module.json", Branches: []string{"beta"}, Policy: meshcatalog.Policy{Steps: other}}, @@ -112,8 +112,8 @@ func TestAModuleEnteringTheTrunkGraphIsRegistered(t *testing.T) { return r } lib2 := got("lib2") - if lib2.Version != 1 || lib2.Origin != "novox/c" || lib2.Path != "go/lib2/module.json" || !slices.Equal(lib2.Branches, []string{TrunkBranch}) { - t.Errorf("lib2 registered as %+v, want version 1 from novox/c, go/lib2/module.json, watching main", lib2) + if lib2.Version != 1 || lib2.Origin != "novox/c" || lib2.Path != "go/lib2/module.json" || !slices.Equal(lib2.Branches, []string{"stable"}) { + t.Errorf("lib2 registered as %+v, want version 1 from novox/c, go/lib2/module.json, watching stable, the branch its siblings watch first alike (H-A-266), not its default branch main", lib2) } if lib2.Policy.Steps != steps { t.Errorf("lib2's steps %+v, want its repository's modules' alike steps %+v (H-A-263)", lib2.Policy.Steps, steps)