From 947d0b82eb549c637fd10e2ace4b715f978ff991 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 17:32:54 +0100 Subject: [PATCH] mesh-delivery-sdk: its package artifact leaves paths out for the module's whole directory, as the manifest validator requires (V1; issue 1966) Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- sdk/manifest_test.go | 37 +++++++++++++++++++++++++++++++++++++ sdk/module.json | 3 --- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 sdk/manifest_test.go diff --git a/sdk/manifest_test.go b/sdk/manifest_test.go new file mode 100644 index 00000000..eb6f37bc --- /dev/null +++ b/sdk/manifest_test.go @@ -0,0 +1,37 @@ +package sdk + +import ( + "encoding/json" + "os" + "testing" +) + +// The module's one package artifact is the module's whole directory, which it says by leaving `paths` out: the manifest +// validator refuses the word "." as a path (a package artifact naming one directory). +func TestThePackageArtifactNamesNoPathForTheWholeDirectory(t *testing.T) { + raw, err := os.ReadFile("module.json") + if err != nil { + t.Fatal(err) + } + var m struct { + Build struct { + Artifacts []struct { + Name string `json:"name"` + Paths []string `json:"paths"` + } `json:"artifacts"` + } `json:"build"` + } + if err := json.Unmarshal(raw, &m); err != nil { + t.Fatal(err) + } + if len(m.Build.Artifacts) != 1 { + t.Fatalf("artifacts are %+v: one", m.Build.Artifacts) + } + for _, a := range m.Build.Artifacts { + for _, p := range a.Paths { + if p == "." || p == "" { + t.Errorf("artifact %s names %q as a path: leave `paths` out for the module's whole directory", a.Name, p) + } + } + } +} diff --git a/sdk/module.json b/sdk/module.json index 45609240..85afe154 100644 --- a/sdk/module.json +++ b/sdk/module.json @@ -7,9 +7,6 @@ "name": "go-sdk", "kind": "package", "language": "go", - "paths": [ - "." - ], "series": "0.1" } ]