The check that the catalogue package names no module reads the names from the catalogue's module directories alone, no list beside them (ADR 0601 §4)

This commit is contained in:
2026-11-03 16:41:06 +01:00
parent 189f28e4e1
commit 6655bdff50
+4 -10
View File
@@ -36,21 +36,15 @@ func TestNoCatalogueManifestNamesAmqp(t *testing.T) {
filepath.Base(filepath.Dir(path)))
}
}
// Nor does this package's code name any module (issue 774, the operator 2026-11-03): what a module is, its manifest
// says. Every string literal of its non-test files is read; a module's name is refused there unless it is also a
// seat's or a provision's name, or one of the words below, which name something else.
// Nor does this package's code name any module the catalogue holds (ADR 0601 §4): what a module is, its manifest
// says. The names are read from the catalogue's module directories, never from a list here; every string literal of
// the package's non-test files is read, and a module's name is refused unless it is also a seat's name or one of the
// words below, which name something else.
t.Run("the package names no module", func(t *testing.T) {
modules := map[string]bool{}
for _, path := range modules0 {
modules[filepath.Base(filepath.Dir(path))] = true
}
// The mesh's modules held outside the catalogue: the node-engine, the private network, the tool runner, the
// ended controller and the delivery's parts.
for _, m := range []string{"mesh-host", "mesh-wireguard", "node-tools", "mesh-controller", "mesh-delivery-assigner",
"mesh-delivery-builder", "mesh-delivery-checker", "mesh-delivery-forge-bridge", "mesh-delivery-indexer",
"mesh-delivery-teller", "mesh-delivery-view", "mesh-delivery-watchman", "mesh-enrolment", "mesh-grants"} {
modules[m] = true
}
// Words that are a module's name and name something else here: a language, an environment's rendering, a package.
elsewhere := map[string]bool{"go": true, "systemd": true, "nftables": true}
fset := token.NewFileSet()