From 530a4ddfdee6347fe7e293ca6dc27015a323da53 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 14:35:45 +0100 Subject: [PATCH] Manifests of the builder, the view and the forge bridge: the package artifacts are read by their tests; the merge's duplicate keys (tools, invokes) joined into one (D-10, D-0; issue 1966) --- modules/mesh-delivery-builder/manifest_test.go | 10 ++++++++-- modules/mesh-delivery-forge-bridge/manifest_test.go | 10 ++++++++-- modules/mesh-delivery-forge-bridge/module.json | 4 +--- modules/mesh-delivery-view/manifest_test.go | 10 +++++++++- modules/mesh-delivery-view/module.json | 4 +--- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/modules/mesh-delivery-builder/manifest_test.go b/modules/mesh-delivery-builder/manifest_test.go index 3a4ddfcb..ba7e67f1 100644 --- a/modules/mesh-delivery-builder/manifest_test.go +++ b/modules/mesh-delivery-builder/manifest_test.go @@ -33,6 +33,8 @@ type artifact struct { From string `json:"from"` Binary string `json:"binary"` Loads []string `json:"loads"` + Paths []string `json:"paths"` + Series string `json:"series"` } type manifest struct { @@ -196,8 +198,12 @@ func TestManifestProcess(t *testing.T) { // 1607/AC1 if _, bus := p["bus"]; bus { t.Errorf("the process declares a bus: it runs on its own broker credential") } - if len(m.Build.Artifacts) != 2 { - t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts) + if len(m.Build.Artifacts) != 3 { + t.Fatalf("artifacts = %+v, want the program, the tools and the package builds", m.Build.Artifacts) + } + // ADR 0634 §1, ADR 0606 §4: the module's own package is published, so a module of another repository imports it by version. + if a := m.Build.Artifacts[2]; a.Name != "builds" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"builds"}) || a.Series != "0.1" { + t.Errorf("package artifact = %+v", a) } if a := m.Build.Artifacts[1]; a.Name != "tools" || a.Kind != "bundle" || a.Binary != "mesh-delivery-builder-tools" || !reflect.DeepEqual(a.Loads, []string{"mesh-delivery-builder-tools"}) { t.Errorf("tools artifact = %+v", a) // 1945 diff --git a/modules/mesh-delivery-forge-bridge/manifest_test.go b/modules/mesh-delivery-forge-bridge/manifest_test.go index e6688c85..1647c605 100644 --- a/modules/mesh-delivery-forge-bridge/manifest_test.go +++ b/modules/mesh-delivery-forge-bridge/manifest_test.go @@ -35,6 +35,8 @@ type artifact struct { From string `json:"from"` Binary string `json:"binary"` Loads []string `json:"loads"` + Paths []string `json:"paths"` + Series string `json:"series"` } type manifest struct { @@ -150,8 +152,12 @@ func TestManifestProcess(t *testing.T) { // 1235/AC1 if _, bus := p["bus"]; bus { t.Errorf("the process declares a bus: it runs on its own broker credential") } - if len(m.Build.Artifacts) != 2 || m.Build.Artifacts[1].Name != "tools" || m.Build.Artifacts[1].From != "cmd/mesh-delivery-forge-bridge-tools" { - t.Fatalf("artifacts = %+v, want the program and the tools bundle", m.Build.Artifacts) + if len(m.Build.Artifacts) != 3 || m.Build.Artifacts[1].Name != "tools" || m.Build.Artifacts[1].From != "cmd/mesh-delivery-forge-bridge-tools" { + t.Fatalf("artifacts = %+v, want the program, the tools bundle and the package forgemsg", m.Build.Artifacts) + } + // ADR 0573 §1: the gate requires forgemsg by a published version, so the module declares it as a package. + if a := m.Build.Artifacts[2]; a.Name != "forgemsg" || a.Kind != "package" || a.Language != "go" || len(a.Paths) != 1 || a.Paths[0] != "forgemsg" || a.Series != "0.1" { + t.Errorf("package artifact = %+v", a) } a := m.Build.Artifacts[0] if st, err := os.Stat(a.From); err != nil || !st.IsDir() || a.Binary != "mesh-delivery-forge-bridge" || !strings.HasSuffix(a.From, a.Binary) { diff --git a/modules/mesh-delivery-forge-bridge/module.json b/modules/mesh-delivery-forge-bridge/module.json index b958aea9..15ad7ee0 100644 --- a/modules/mesh-delivery-forge-bridge/module.json +++ b/modules/mesh-delivery-forge-bridge/module.json @@ -2,9 +2,6 @@ "module": "mesh-delivery-forge-bridge", "version": "1", "slug": "forge-bridge", - "tools": [ - "bridge_tags" - ], "consumes": [ "gitea.pull.updated", "gitea.pull.merged", @@ -21,6 +18,7 @@ { "name": "end-asks", "history": 1 } ], "tools": [ + "bridge_tags", "bridge_groups", "bridge_group_end_again", "bridge_merged_message" diff --git a/modules/mesh-delivery-view/manifest_test.go b/modules/mesh-delivery-view/manifest_test.go index 8e32d668..7c6bd266 100644 --- a/modules/mesh-delivery-view/manifest_test.go +++ b/modules/mesh-delivery-view/manifest_test.go @@ -29,6 +29,8 @@ type artifact struct { From string `json:"from"` Binary string `json:"binary"` Loads []string `json:"loads"` + Paths []string `json:"paths"` + Series string `json:"series"` Context *struct { Repository string `json:"repository"` } `json:"context"` @@ -150,13 +152,19 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7 func TestManifestIsWholeInItsRepository(t *testing.T) { // 1134/AC7 m, _ := load(t) - if len(m.Build.Artifacts) != 4 { + if len(m.Build.Artifacts) != 5 { t.Fatalf("artifacts = %+v", m.Build.Artifacts) } for _, a := range m.Build.Artifacts { if a.Name == "files" { continue } + if a.Name == "viewstate" { // ADR 0634 §1: the module's own package, published for the gate + if a.Kind != "package" || a.Language != "go" || len(a.Paths) != 1 || a.Paths[0] != "viewstate" || a.Series != "0.1" { + t.Errorf("package artifact = %+v", a) + } + continue + } if a.Context != nil { t.Errorf("artifact %s names a context of another repository", a.Name) } diff --git a/modules/mesh-delivery-view/module.json b/modules/mesh-delivery-view/module.json index dccb6fa0..35a95c3e 100644 --- a/modules/mesh-delivery-view/module.json +++ b/modules/mesh-delivery-view/module.json @@ -29,9 +29,6 @@ "view_first_view_again", "node_manifest_reads" ], - "invokes": [ - "mesh-delivery-indexer.indexer_pending" - ], "emits": [ "delivered", "moving", @@ -61,6 +58,7 @@ "mesh-delivery-indexer.indexer_read_config_candidates", "mesh-delivery-indexer.indexer_read_graph", "mesh-delivery-indexer.indexer_read_heard", + "mesh-delivery-indexer.indexer_pending", "mesh-delivery-indexer.indexer_read_modules", "mesh-delivery-indexer.indexer_read_packages", "mesh-delivery-indexer.indexer_read_predefined",