mesh/delivery-group group feat/sdk1 rejected: composed together: the checker's verdict at the members' heads (428d048dd50a): unit: git.novox.be/novox/mesh-sdk/…
mesh/delivery closed: a newer head of the same pull request
mesh/check failed: unit: git.novox.be/novox/mesh-sdk/go/process.TestStatePutWritesAKeyWhole: a Put through a short blackout: 0, mesh-mail's state send…
Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
38 lines
1.4 KiB
Go
38 lines
1.4 KiB
Go
package catalogue
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// Defends novox/hq ADR 0477 §4 (issue 1573): the go and nodejs modules own the toolchain packages and provide
|
|
// them with the machine's reach, so a node without one refuses the module that needs it at resolution, naming
|
|
// the provision, and does not find out at its first build. The manifests are the catalogue's, as they are.
|
|
|
|
func toolchainShelf(t *testing.T) map[string]Manifest {
|
|
t.Helper()
|
|
m := map[string]Manifest{
|
|
"forge": {Module: "forge", Version: "1", Provides: []Offer{{Name: "forge-account"}, {Name: "npm-package-registry"}, {Name: "artifact-store"}, {Name: "node-tools"}}},
|
|
}
|
|
for _, name := range []string{"go", "nodejs", "mesh-build-go", "mesh-build-node", "dev-tools"} {
|
|
m[name] = catalogueManifest(t, name)
|
|
}
|
|
return m
|
|
}
|
|
|
|
// Only the owners declare the packages: a build module that declared go again would compose without the
|
|
// owner's provision being met by anything, which is the gap the provision closes.
|
|
func TestOnlyTheToolchainModulesDeclareTheToolchainPackages(t *testing.T) {
|
|
owner := map[string]string{"go": "go", "nodejs": "nodejs", "npm": "nodejs"}
|
|
for name, m := range toolchainShelf(t) {
|
|
for _, r := range m.Resources {
|
|
if r["type"] != "package" {
|
|
continue
|
|
}
|
|
pkg, _ := r["package"].(string)
|
|
if o, ok := owner[pkg]; ok && o != name {
|
|
t.Errorf("%s declares the package %s, which only %s may", name, pkg, o)
|
|
}
|
|
}
|
|
}
|
|
}
|