nats provides bus-state, so a module that keeps bus state has a provider to wait for (ADR 0614 §5, issue 774)

Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
This commit is contained in:
2026-11-03 23:09:59 +01:00
parent 5fe7e3e6ba
commit d632071317
2 changed files with 24 additions and 0 deletions
@@ -32,6 +32,13 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) {
} `json:"backup"`
} `json:"own"`
} `json:"data"`
Provides []struct {
Name string `json:"name"`
Scope string `json:"scope"`
Credential struct {
Form string `json:"form"`
} `json:"credential"`
} `json:"provides"`
Tools []string `json:"tools"`
Emits []string `json:"emits"`
Resources []map[string]any `json:"resources"`
@@ -43,6 +50,16 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) {
if err := json.Unmarshal(raw, &m); err != nil {
t.Fatal(err)
}
// The bus provides "bus-state" beside "mesh-bus" (ADR 0614 §5): a module whose manifest keeps bus state requires it.
provided := map[string]string{}
for _, p := range m.Provides {
provided[p.Name] = p.Scope + "/" + p.Credential.Form
}
for _, name := range []string{"mesh-bus", "bus-state"} {
if provided[name] != "mesh/none" {
t.Errorf("provision %q is %q: the bus provides it mesh-wide with no credential", name, provided[name])
}
}
if m.Build.On != nil {
t.Error("build.on is declared: nothing is built on a base image any more")
}
+7
View File
@@ -12,6 +12,13 @@
"credential": {
"form": "none"
}
},
{
"name": "bus-state",
"scope": "mesh",
"credential": {
"form": "none"
}
}
],
"claims": [