Let the built bus module register with its events: the resolved manifest keeps bundles, not the build (hq issue 270)
mesh/merge-gate out of date: judged against trunk 04730b54a8f2, the trunk is now 535c7641ac41; judged again on a recheck or when it is merged
mesh/repo-check out of date: judged against trunk 04730b54a8f2, the trunk is now 535c7641ac41; judged again on a recheck or when it is merged
mesh/delivery checking

#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.
This commit is contained in:
jochen
2026-10-14 09:26:01 +02:00
parent d24132d54f
commit fe2ee39365
2 changed files with 15 additions and 1 deletions
+9
View File
@@ -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"},
+6 -1
View File
@@ -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
}