Register the build and delivery modules as issue owners, and test that every code module is one (issue 1815)
mesh/merge-gate head e2220df5e851 merged into trunk 97a111e70abf — pass: builds mesh-issues → novox; no bus step; every machine composes with the change as…
mesh/repo-check head e2220df5e851 merged into trunk 97a111e70abf — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-…
mesh/delivery delivered
mesh/check failed: unit: modules/gitea.test: ✔ the same merge, head or close announced twice has the same id, and another has another (9.586412ms) | e…

This commit is contained in:
2026-10-22 09:54:51 +02:00
parent 97a111e70a
commit e2220df5e8
3 changed files with 94 additions and 2 deletions
@@ -222,3 +222,51 @@ func TestTheOwnersDefaultIsTheTemplatesOwners(t *testing.T) {
t.Fatalf("the owners default (%d) and the template's owners (%d) differ", len(m.Config.Owners.Default), len(s.Owners))
}
}
// Every module folder of the catalogue that holds code the mesh builds (a go.mod or a package.json) is a
// registered owner, so an issue is located where it lives and the next new module cannot be missed
// (novox/hq issue 1815: mesh-build-go and mesh-build-node were not on the list).
// 1815/AC1
func TestEveryCodeModuleOfTheCatalogueIsAnOwner(t *testing.T) {
_, _ = readManifest(t)
tmpl, err := os.ReadFile(filepath.Join("..", "..", "files", "settings.json"))
if err != nil {
t.Fatal(err)
}
var s Settings
if err := json.Unmarshal(tmpl, &s); err != nil {
t.Fatal(err)
}
modules := filepath.Join("..", "..", "..")
dirs, err := os.ReadDir(modules)
if err != nil {
t.Fatal(err)
}
found := 0
for _, d := range dirs {
if !d.IsDir() {
continue
}
for _, marker := range []string{"go.mod", "package.json"} {
if _, err := os.Stat(filepath.Join(modules, d.Name(), marker)); err != nil {
continue
}
found++
if !slices.Contains(s.Owners, "mesh-catalog modules/"+d.Name()) {
t.Errorf("modules/%s holds code (%s) but %q is not among the owners: add it to module.json and files/settings.json",
d.Name(), marker, "mesh-catalog modules/"+d.Name())
}
break
}
}
if found < 10 {
t.Fatalf("only %d code modules found under %s: the test looks in the wrong place", found, modules)
}
// 1815/AC2: the delivery repository's modules cannot ride on its repository entry (owns refuses a folder
// of a repository that is registered only as a whole), so each is named.
for _, m := range []string{"builder", "checker", "indexer"} {
if Owners(s.Owners).owns("mesh-delivery modules/mesh-delivery-"+m) == "" {
t.Errorf("mesh-delivery-%s is not an owner", m)
}
}
}