From 7d7a89411c6532ce178f3d41546ff92a6b5fdae7 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 22 Nov 2026 02:24:49 +0100 Subject: [PATCH] M1 check-needs: a manifest names at its top level the seats a package outside every artifact's from needs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A package no artifact's from holds (the forge module's seatgit whole test) has no artifact to carry its check-needs, so the module says it once at its level, in the artifact's form (H-A-453 (2)). Builds: design 47 H2 §800, H-A-453 (2) --- go/catalogue/config_test.go | 8 ++++++-- go/catalogue/manifest.go | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/go/catalogue/config_test.go b/go/catalogue/config_test.go index 1b70d64b..b8825344 100644 --- a/go/catalogue/config_test.go +++ b/go/catalogue/config_test.go @@ -136,7 +136,7 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) { // The registry milestone's words round-trip the same (design 32): a config value's old name, an artifact's series // and contracts marker, the series a module accepts of a package; absent, a series is 0.1. - declared := []byte(`{"module":"c","version":"1","config":{"font":{"type":"string","renamed-from":"font-name"}}, + declared := []byte(`{"module":"c","version":"1","check-needs":["node-build-node"],"config":{"font":{"type":"string","renamed-from":"font-name"}}, "packages":{"mesh-sdk":"0.2"}, "build":{"artifacts":[{"name":"go","kind":"package","language":"go","paths":["go"],"series":"0.2", "generated-from":"seats","check-needs":["node-build-node"]},{"name":"lib","kind":"package","language":"typescript"}]}}`) @@ -148,7 +148,8 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) { m.AcceptedSeries("mesh-contracts") != DefaultSeries || m.Build.Artifacts[0].SeriesOf() != "0.2" || m.AcceptedSeries("mesh-sdk", "0.1") != "0.2" || m.AcceptedSeries("mesh-contracts", "0.10", "x", "0.3", "1.0") != "0.3" || m.Build.Artifacts[0].GeneratedFrom != "seats" || m.Build.Artifacts[1].SeriesOf() != "0.1" || - !slices.Equal(m.Build.Artifacts[0].CheckNeeds, []string{"node-build-node"}) || m.Build.Artifacts[1].CheckNeeds != nil { + !slices.Equal(m.Build.Artifacts[0].CheckNeeds, []string{"node-build-node"}) || m.Build.Artifacts[1].CheckNeeds != nil || + !slices.Equal(m.CheckNeeds, []string{"node-build-node"}) { t.Fatalf("read %+v", m) } raw, _ = json.Marshal(m) @@ -158,6 +159,9 @@ func TestAConfigManifestIsWrittenBackInItsOwnForm(t *testing.T) { t.Errorf("written back without %s: %s", said, raw) } } + if strings.Count(string(raw), `"check-needs":["node-build-node"]`) != 2 { // H-A-453 (2): the module's own and the artifact's + t.Errorf("the module's check-needs is not written back: %s", raw) + } if strings.Count(string(raw), `"series"`) != 1 { t.Errorf("a series nobody said is written: %s", raw) } diff --git a/go/catalogue/manifest.go b/go/catalogue/manifest.go index ec2d485e..9c4d5855 100644 --- a/go/catalogue/manifest.go +++ b/go/catalogue/manifest.go @@ -746,6 +746,11 @@ type Manifest struct { // wrong the moment anybody edits anything. Build *Build `json:"build,omitempty"` + // CheckNeeds are the seats the integration tests of a package outside every artifact's `from` need the node to hold, by + // name, in an artifact's form (Artifact.CheckNeeds): the Go build module reads them for the packages no artifact's + // `from` holds (design 47 H2 H-A-453 (2)). Empty needs nothing. + CheckNeeds []string `json:"check-needs,omitempty"` + // Templates is the module's directory its template files are kept in, and its build packs into its templates // archive: files/ when it says none (DefaultTemplatesDir; novox/hq ADR 0349 §2, issue 731). A module whose files/ // is already an archive unpacked onto the machine names another, so its templates neither land beside what it