S9 raises a dead bus watch, and the built bus module registers with its events (hq issue 270, review 274) #327

Open
mesh-admin wants to merge 2 commits from fix/270-a-dead-bus-watch-is-heard into main
2 changed files with 15 additions and 1 deletions
Showing only changes of commit fe2ee39365 - Show all commits
+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
}