From be749c9513f97fe5424e8eb47141e87f53b2e500 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 23:11:32 +0100 Subject: [PATCH] =?UTF-8?q?The=20old=20catalog=20module=20drops=20its=20cl?= =?UTF-8?q?aim=20of=20the=20seat=20mesh-catalog=20and=20is=20deprecated;?= =?UTF-8?q?=20a=20check=20refuses=20a=20second=20claimant=20(ADR=200604=20?= =?UTF-8?q?=C2=A76,=20issue=20774)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn --- checks/manifests/main_test.go | 44 ++++++++++++++++++++++++++++++++ modules/mesh-catalog/README.md | 2 +- modules/mesh-catalog/module.json | 6 ----- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/checks/manifests/main_test.go b/checks/manifests/main_test.go index 0cee3e20..252fa559 100644 --- a/checks/manifests/main_test.go +++ b/checks/manifests/main_test.go @@ -5,6 +5,8 @@ import ( "path/filepath" "strings" "testing" + + "git.novox.be/novox/mesh-sdk/go/catalogue" ) // The tree's manifests are ones a judge can read, and no module is named twice. A row is a catalogue of its own: a @@ -48,3 +50,45 @@ func TestEveryManifestDecodesAndNamesOneModule(t *testing.T) { t.Fatalf("the catalogue holds manifests no judge can read:\n%s", strings.Join(real, "\n")) } } + +// No manifest of this catalogue claims the seat mesh-catalog: the indexer of the delivery holds it, and the module that +// held it before has dropped its claim (ADR 0604 ยง6). A row is a tree of its own: a manifest claiming it is named. +func TestNoManifestClaimsTheSeatMeshCatalog(t *testing.T) { + claimants := func(root string) []string { + files, err := filepath.Glob(filepath.Join(root, "modules", "*", "module.json")) + if err != nil { + t.Fatal(err) + } + var out []string + for _, f := range files { + raw, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + m, err := catalogue.Decode(raw) + if err != nil { + continue // Problems names it + } + for _, c := range m.Claims { + if c.Name == "mesh-catalog" { + out = append(out, m.Module) + } + } + } + return out + } + row := t.TempDir() + if err := os.MkdirAll(filepath.Join(row, "modules", "a"), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(row, "modules", "a", "module.json"), + []byte(`{"module":"a","version":"1","claims":[{"name":"mesh-catalog","scope":"mesh"}]}`), 0o644); err != nil { + t.Fatal(err) + } + if got := claimants(row); len(got) != 1 || got[0] != "a" { + t.Fatalf("a manifest claiming the seat is named, got %v", got) + } + if got := claimants(filepath.Join("..", "..")); len(got) != 0 { + t.Errorf("the catalogue's manifests %v claim the seat mesh-catalog: the indexer of the delivery holds it", got) + } +} diff --git a/modules/mesh-catalog/README.md b/modules/mesh-catalog/README.md index 32e34d2f..a058f007 100644 --- a/modules/mesh-catalog/README.md +++ b/modules/mesh-catalog/README.md @@ -1,6 +1,6 @@ # mesh-catalog -The `mesh-catalog` module of the mesh catalogue: claims the seat `mesh-catalog`. +The `mesh-catalog` module of the mesh catalogue: deprecated. It no longer claims the seat `mesh-catalog`: the indexer of the delivery claims it and serves its verbs from the bus (ADR 0604). This module stays, with its tools, until it is retired. ## Files it does not know diff --git a/modules/mesh-catalog/module.json b/modules/mesh-catalog/module.json index c5ad61a4..fe30560e 100644 --- a/modules/mesh-catalog/module.json +++ b/modules/mesh-catalog/module.json @@ -5,12 +5,6 @@ "capabilities": [ "container-runtime" ], - "claims": [ - { - "name": "mesh-catalog", - "scope": "mesh" - } - ], "requires": [ "postgres-database" ],