Merge pull request 'Manifests name their packages by full module path (issue 1966, bootstrap recovery)' (#631) from fix/1966-packages-by-module-path into main

This commit was merged in pull request #631.
This commit is contained in:
2026-11-08 00:01:29 +00:00
28 changed files with 45 additions and 43 deletions
@@ -43,7 +43,7 @@ func TestEveryFileTakesItsTextFromATemplate(t *testing.T) {
t.Fatal(err)
}
// The builder's keys are read through its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
for _, r := range m.Resources {
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "artifact-store-tools",
"version": "1",
"packages": {
"builds": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1"
},
"claims": [
{
@@ -840,13 +840,15 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) {
t.Fatal(err)
}
// The builder's question is its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
// E15: the provision artifact-store retired (ADR 0632 §3): distribution provides and serves nothing, and the
// store is found by its seats' holder and the listen it opens to the mesh.
if len(m.Provides) != 0 || len(m.Serves) != 0 {
t.Errorf("provides = %+v, serves = %v, want neither: the provision artifact-store retired", m.Provides, m.Serves)
// E15: the provision artifact-store retires (ADR 0632 §3); the bootstrap keeps it as an alias on port 5100 while
// the running node-engines still find the store by it (issue 1966), and nothing else is provided or served.
alias, _ := m.Serves["artifact-store"].(map[string]any)
port, _ := alias["port"].(float64)
if len(m.Provides) != 1 || m.Provides[0].Name != "artifact-store" || len(m.Serves) != 1 || port != 5100 {
t.Errorf("provides = %+v, serves = %v, want only the artifact-store alias on port 5100", m.Provides, m.Serves)
}
claims := map[string][]string{}
for _, c := range m.Claims {
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "distribution",
"version": "2",
"packages": {
"builds": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1"
},
"provides": [
{
@@ -451,7 +451,7 @@ func TestToolsAreTheOnesTheReadmeNamesAndSayWhatTheyDo(t *testing.T) {
t.Fatal(err)
}
// The builder's question is its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
// Both package seats are claimed serving the four verbs this bundle answers as <seat>.<verb>, over its own incoming
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "gitea",
"version": "1",
"packages": {
"builds": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1"
},
"moved": true,
"requires": [
@@ -53,10 +53,10 @@ func TestManifestDeclaresTheAccountTheCapabilityAndThePackages(t *testing.T) {
m := readManifest(t)
// The key keeper is ssh-client's published package, taken by its series (ADR 0634 §1).
// The builder's step, answer and key forms are read through its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
if m.Packages["sshkeys"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-catalog/modules/ssh-client/sshkeys"] != "0.1" {
t.Errorf("packages %v: want sshkeys of series 0.1", m.Packages)
}
if m.Module != "mesh-build-go" || m.RunsAs != "mesh-build-go" {
+2 -2
View File
@@ -2,8 +2,8 @@
"module": "mesh-build-go",
"version": "1",
"packages": {
"builds": "0.1",
"sshkeys": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1",
"git.novox.be/novox/mesh-catalog/modules/ssh-client/sshkeys": "0.1"
},
"moved": true,
"runs-as": "mesh-build-go",
@@ -55,10 +55,10 @@ func TestManifestDeclaresTheAccountTheCapabilityAndThePackages(t *testing.T) {
m := readManifest(t)
// The key keeper is ssh-client's published package, taken by its series (ADR 0634 §1).
// The builder's step, answer and key forms are read through its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
if m.Packages["sshkeys"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-catalog/modules/ssh-client/sshkeys"] != "0.1" {
t.Errorf("packages %v: want sshkeys of series 0.1", m.Packages)
}
if m.Module != "mesh-build-image" || m.RunsAs != "mesh-build-image" {
+2 -2
View File
@@ -2,8 +2,8 @@
"module": "mesh-build-image",
"version": "1",
"packages": {
"builds": "0.1",
"sshkeys": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1",
"git.novox.be/novox/mesh-catalog/modules/ssh-client/sshkeys": "0.1"
},
"moved": true,
"runs-as": "mesh-build-image",
@@ -48,10 +48,10 @@ func TestManifestDeclaresTheAccountTheCapabilityAndThePackages(t *testing.T) {
m := readManifest(t)
// The key keeper is ssh-client's published package, taken by its series (ADR 0634 §1).
// The builder's step, answer and key forms are read through its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
if m.Packages["sshkeys"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-catalog/modules/ssh-client/sshkeys"] != "0.1" {
t.Errorf("packages %v: want sshkeys of series 0.1", m.Packages)
}
if m.Module != "mesh-build-node" || m.RunsAs != "mesh-build-node" {
@@ -191,7 +191,7 @@ func TestNoResourceCarriesContentNamingAHost(t *testing.T) {
}
}
raw, _ := os.ReadFile(filepath.Join(moduleDir, "module.json"))
if h := host.FindString(string(raw)); h != "" {
if h := host.FindString(strings.ReplaceAll(string(raw), "git.novox.be/novox/", "")); h != "" {
t.Errorf("module.json names %q", h)
}
}
+2 -2
View File
@@ -2,8 +2,8 @@
"module": "mesh-build-node",
"version": "1",
"packages": {
"builds": "0.1",
"sshkeys": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1",
"git.novox.be/novox/mesh-catalog/modules/ssh-client/sshkeys": "0.1"
},
"moved": true,
"runs-as": "mesh-build-node",
@@ -33,7 +33,7 @@ func TestEveryStateAndActHasItsTool(t *testing.T) {
t.Fatal(err)
}
// The builder's keys are read through its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
via := map[string]string{
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "mesh-config",
"version": "1",
"packages": {
"builds": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1"
},
"runs-as": "mesh-config",
"claims": [
@@ -79,7 +79,7 @@ func TestItClaimsTheDeliverySeatAndFollowsWhatItHandles(t *testing.T) {
t.Fatalf("serves %v, wanted %v", m.Claims[0].Serves, want)
}
// The forge messages' layout is the bridge's published package forgemsg, taken by its series (ADR 0634 §3, design 32).
if m.Packages["forgemsg"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-forge-bridge/forgemsg"] != "0.1" {
t.Errorf("packages %v: the gate accepts forgemsg of series 0.1", m.Packages)
}
// R6-C1: no controller verb is invoked and no plan event is consumed.
@@ -121,7 +121,7 @@ func TestItClaimsTheDeliverySeatAndFollowsWhatItHandles(t *testing.T) {
t.Fatalf("invokes %v, wanted %v", m.Invokes, want)
}
for _, never := range []string{"/home/", "jochen", "g14", "shanks", "novox", "zurag", "anchor"} {
if strings.Contains(strings.ToLower(raw), never) {
if strings.Contains(strings.ToLower(strings.ReplaceAll(raw, "git.novox.be/novox/", "")), never) {
t.Errorf("module.json names %q", never)
}
}
+1 -1
View File
@@ -39,7 +39,7 @@
"operator-channel"
],
"packages": {
"forgemsg": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-forge-bridge/forgemsg": "0.1"
},
"invokes": [
"gitea.gitea_commit_statuses",
@@ -302,7 +302,7 @@ func TestTheManifestDeclaresWhatTheCodeKeeps(t *testing.T) {
t.Fatal(err)
}
// The builder's keys are read through its published package, taken by its series (ADR 0634 §1).
if m.Packages["builds"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"] != "0.1" {
t.Errorf("packages %v: want builds of series 0.1", m.Packages)
}
if m.Module != "mesh-provisioner" || m.RunsAs != "mesh-provisioner" || m.OwnSecrets["broker"] == "" {
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "mesh-provisioner",
"version": "2",
"packages": {
"builds": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds": "0.1"
},
"runs-as": "mesh-provisioner",
"claims": [
@@ -47,7 +47,7 @@ func readManifest(t *testing.T) manifest {
func TestTheManifestSaysWhatTheCodeDoes(t *testing.T) {
m := readManifest(t)
// The readings' layouts are the owners' published packages, taken by their series (ADR 0634 §4).
for _, pk := range []string{"diskreadings", "backupgood"} {
for _, pk := range []string{"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings", "git.novox.be/novox/mesh-catalog/modules/restic/backupgood"} {
if m.Packages[pk] != "0.1" {
t.Errorf("packages %v: want %s of series 0.1", m.Packages, pk)
}
+2 -2
View File
@@ -2,8 +2,8 @@
"module": "mesh-self-check",
"version": "1",
"packages": {
"backupgood": "0.1",
"diskreadings": "0.1"
"git.novox.be/novox/mesh-catalog/modules/restic/backupgood": "0.1",
"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings": "0.1"
},
"runs-as": "mesh-self-check",
"claims": [
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "mesh-vault",
"version": "1",
"packages": {
"grantsstate": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-grants/grantsstate": "0.1"
},
"runs-as": "mesh-vault",
"provides": [
+2 -2
View File
@@ -48,7 +48,7 @@ func readManifest(t *testing.T) (manifest, string) {
func TestTheManifestNamesWhatTheBundleServesAndWhatItNeeds(t *testing.T) {
m, raw := readManifest(t)
// The readings' layouts are the owners' published packages, taken by their series (ADR 0634 §4).
for _, pk := range []string{"diskreadings"} {
for _, pk := range []string{"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings"} {
if m.Packages[pk] != "0.1" {
t.Errorf("packages %v: want %s of series 0.1", m.Packages, pk)
}
@@ -115,7 +115,7 @@ func TestTheManifestNamesWhatTheBundleServesAndWhatItNeeds(t *testing.T) {
}
}
// A machine's or a person's name, as a word: "novox/hq" names the record, not the machine.
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen|recalbox)\b|/home/|/storage`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen|recalbox)\b|/home/|/storage`).FindString(strings.ReplaceAll(strings.ReplaceAll(raw, "novox/hq", ""), "git.novox.be/novox/", "")); hit != "" {
t.Errorf("the manifest says %q", hit)
}
if strings.Contains(raw, "/etc/fstab") {
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "mounts",
"version": "1",
"packages": {
"diskreadings": "0.1"
"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings": "0.1"
},
"requires": [
"nfs-share"
+1 -1
View File
@@ -55,7 +55,7 @@ func TestTheBussManifestMountsItsProgramsIntoTheUpstreamImage(t *testing.T) {
}
// The removal grant the tests compose is the grants part's published package busgrants (series 0.1), which the
// manifest names so the build resolves it (ADR 0634 §4).
if m.Packages["busgrants"] != "0.1" {
if m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-grants/busgrants"] != "0.1" {
t.Errorf("packages = %v, want busgrants at 0.1", m.Packages)
}
// The bus provides "bus-state" beside "mesh-bus" (ADR 0614 §5): a module whose manifest keeps bus state requires it.
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "nats",
"version": "1",
"packages": {
"busgrants": "0.1"
"git.novox.be/novox/mesh-delivery/modules/mesh-grants/busgrants": "0.1"
},
"upgrade": {
"policy": "record",
@@ -47,7 +47,7 @@ func readManifest(t *testing.T) (manifest, string) {
func TestTheSeatsVerbsAreAllServedAndTheHealthToolListed(t *testing.T) {
m, _ := readManifest(t)
// The readings' layouts are the owners' published packages, taken by their series (ADR 0634 §4).
for _, pk := range []string{"diskreadings"} {
for _, pk := range []string{"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings"} {
if m.Packages[pk] != "0.1" {
t.Errorf("packages %v: want %s of series 0.1", m.Packages, pk)
}
@@ -107,7 +107,7 @@ func TestItListensOnTwoThousandFortyNineFromTheMeshOnlyAndProvidesTheShare(t *te
// assignment's config value, required and with no default (ADR 0348 §4), and the range the mesh's.
func TestTheDefinitionNamesNoFolderNoMachineAndGivesTheSharesNoDefault(t *testing.T) {
m, raw := readManifest(t)
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen)\b|/home/|/storage|/srv/`).FindString(strings.ReplaceAll(raw, "novox/hq", "")); hit != "" {
if hit := regexp.MustCompile(`\b(g14|novox|ace|shanks|jochen)\b|/home/|/storage|/srv/`).FindString(strings.ReplaceAll(strings.ReplaceAll(raw, "novox/hq", ""), "git.novox.be/novox/", "")); hit != "" {
t.Errorf("the manifest says %q", hit)
}
if s := m.Config["shares"]; s["required"] != true || s["default"] != nil || s["type"] != "string" {
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "nfs-server",
"version": "1",
"packages": {
"diskreadings": "0.1"
"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings": "0.1"
},
"upgrade": {
"policy": "record",
+1 -1
View File
@@ -2,7 +2,7 @@
"module": "restic",
"version": "1",
"packages": {
"diskreadings": "0.1"
"git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings": "0.1"
},
"moved": true,
"claims": [