From fe2ee3936566528091af06b1113a80168e8bbbda Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 14 Oct 2026 09:26:01 +0200 Subject: [PATCH] Let the built bus module register with its events: the resolved manifest keeps bundles, not the build (hq issue 270) #326 allowed a bus module to emit when its build makes a tools bundle, but registration reads the resolved manifest, which drops the build and keeps the bundles it made. The merge gate found nats not registrable on that (mesh-catalog #293); the bundles now count too. --- internal/catalogue/bus_snapshot_test.go | 9 +++++++++ internal/catalogue/manifest.go | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/catalogue/bus_snapshot_test.go b/internal/catalogue/bus_snapshot_test.go index e9904350..57384996 100644 --- a/internal/catalogue/bus_snapshot_test.go +++ b/internal/catalogue/bus_snapshot_test.go @@ -30,6 +30,15 @@ func TestTheBussAccountSaysNothingOnTheBus(t *testing.T) { if _, err := ParseManifest(bundled); err != nil { t.Fatalf("a bus module whose tools bundle declares what it emits was refused: %v", err) } + // And as built: the resolved manifest registration reads keeps the bundles its build made and drops the + // build, and must be registrable just the same. + built := []byte(`{"module":"bus","version":"1","provides":[{"name":"mesh-bus","scope":"mesh"}], + "claims":[{"name":"mesh-broker","scope":"mesh"}],"own-secrets":{"broker":"/run/broker"}, + "emits":["bus.slow-consumer"],"tools":["bus_streams"], + "bundles":[{"name":"tools","source":"bundles/bus/tools","digest":"sha256:00","language":"go"}]}`) + if _, err := ParseManifest(built); err != nil { + t.Fatalf("the built bus module, its bundle made, is not registrable: %v", err) + } quiet := []byte(`{"module":"bus","version":"1","provides":[{"name":"mesh-bus","scope":"mesh"}], "claims":[{"name":"mesh-broker","scope":"mesh"}],"own-secrets":{"broker":"/run/broker"}, diff --git a/internal/catalogue/manifest.go b/internal/catalogue/manifest.go index 21ec6363..a4ea5073 100644 --- a/internal/catalogue/manifest.go +++ b/internal/catalogue/manifest.go @@ -2903,8 +2903,13 @@ func whileStoppedProblems(m Manifest, r map[string]any, scheduled bool) []string return problems } -// shipsABundle says the module builds a tools bundle, which the node's runtime carries and speaks for. +// shipsABundle says the module builds a tools bundle, which the node's runtime carries and speaks for: as +// written, by its build's artifacts; as built and registered, by the bundles its build made — the resolved +// manifest keeps those and drops the build (the merge gate found nats not registrable on that, review 274). func (m Manifest) shipsABundle() bool { + if len(m.Bundles) > 0 { + return true + } if m.Build == nil { return false }