From effa12c4b409270dfe832e2298221f2ef151cad3 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 17:26:31 +0100 Subject: [PATCH] Fold the three new tests into existing ones (test budget); the base note says what the check does The check builds no artifacts and no changed base before its dependents; build_change.go now says only that they are composed from their manifests. Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn --- .../internal/build/run_test.go | 3 ++- .../internal/check/build_change.go | 16 +++++++++------- .../internal/check/composition_test.go | 3 ++- .../internal/index/toolchains_test.go | 3 ++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/mesh-delivery-builder/internal/build/run_test.go b/modules/mesh-delivery-builder/internal/build/run_test.go index 55ed66ff..3a042d25 100644 --- a/modules/mesh-delivery-builder/internal/build/run_test.go +++ b/modules/mesh-delivery-builder/internal/build/run_test.go @@ -565,6 +565,7 @@ func TestAKeyIsBuiltOnlyWithTheToolchainItsFingerprintNamesAndNothingIsWrittenOt r.b.Module(context.Background(), "m", moduleValueWith(t, "modules/m", old)) r.b.Wait() if len(r.st.vals) != 0 || len(r.bm.calls) != 0 { + t.Run("a recipe that moves builds the module again under its new fingerprint", aRecipeThatMovesBuildsTheModuleAgainUnderItsNewFingerprint) t.Errorf("keys %v and %d calls for a fingerprint of go1.26.0 while the nodes agree on go1.27.1, want neither", r.st.vals, len(r.bm.calls)) } // A recipe that differs is a different toolchain too, and a value that names none (written before) is not built. @@ -592,7 +593,7 @@ func TestAKeyIsBuiltOnlyWithTheToolchainItsFingerprintNamesAndNothingIsWrittenOt // ADR 0603 §3 (D9): a source revision changing the Go build module's recipe and a Go module builds the module at once with // the recipe the nodes run and again, a second key under the new fingerprint, once the agreement moves to the new recipe; // the first key is neither rebuilt nor waited on. -func TestARecipeThatMovesBuildsTheModuleAgainUnderItsNewFingerprint(t *testing.T) { +func aRecipeThatMovesBuildsTheModuleAgainUnderItsNewFingerprint(t *testing.T) { r := newRig(t, goBundle) r.consider(t, "modules/m") calls := len(r.bm.calls) diff --git a/modules/mesh-delivery-checker/internal/check/build_change.go b/modules/mesh-delivery-checker/internal/check/build_change.go index bc57791a..7065c080 100644 --- a/modules/mesh-delivery-checker/internal/check/build_change.go +++ b/modules/mesh-delivery-checker/internal/check/build_change.go @@ -13,11 +13,13 @@ import ( "git.novox.be/novox/mesh-delivery/sdk/graph" ) -// A change to a build module or a base is built first, and what stands on it is composed from the manifests (novox/hq ADR -// 0603 §10): the check builds the build module (a candidate's mesh-build-go judges its own change, ADR 0535) and the bases, -// and composes the rest from their manifests, because a module built with the new recipe is built once the agreement -// moves, a second time (ADR 0603 §3). The verdict names the changed modules whose fingerprint names the build module or -// the base the change alters, as warnings of its composition: words for the operator, no part decides on them. +// A change to a build module or a base (novox/hq ADR 0603 §10), as the check can say it. What the check runs is its own +// tests: a candidate Go build module judges its own change (runner workspace, ADR 0535); the check builds no module's +// artifacts, nor a changed base before what stands on it. A base's fingerprint enters its dependents' fingerprints (the +// indexer), so they are other builds once it changes, and the build module's recipe enters the fingerprint of every module +// it builds, so each is built again once the agreed toolchain moves (ADR 0603 §3). The composition composes them from their +// manifests, and the verdict names the changed modules this concerns, as warnings of its composition: words for the +// operator, no part decides on them. // buildChangeWarnings are the composition warnings of a change that alters the Go build module, or a module other changed // modules are built on: one line each, naming those modules, sorted. None for a change that alters neither, or when the @@ -50,7 +52,7 @@ func (st *state) buildChangeWarnings(ctx context.Context) []string { } slices.Sort(built) if len(built) > 0 { - out = append(out, fmt.Sprintf("the change alters the build module %s: %s, built with it, are composed from their manifests and built again once the agreed toolchain moves (ADR 0603 §10)", + out = append(out, fmt.Sprintf("the change alters the build module %s: %s, built with it, are composed from their manifests, not built by the check, and built again once the agreed toolchain moves (ADR 0603 §3, §10)", buildrun.GoBuildModule, strings.Join(built, ", "))) } break @@ -58,7 +60,7 @@ func (st *state) buildChangeWarnings(ctx context.Context) []string { g := graph.OfManifests(changed) for _, base := range slices.Sorted(maps.Keys(changed)) { if on := g.Dependents(base); len(on) > 0 { - out = append(out, fmt.Sprintf("the change alters %s, a base of %s: they are composed from their manifests and built after it (ADR 0603 §10)", + out = append(out, fmt.Sprintf("the change alters %s, a base of %s: their fingerprints name its fingerprint, so they are composed from their manifests, not built by the check (ADR 0603 §10)", base, strings.Join(on, ", "))) } } diff --git a/modules/mesh-delivery-checker/internal/check/composition_test.go b/modules/mesh-delivery-checker/internal/check/composition_test.go index eceeb202..c8dc90c3 100644 --- a/modules/mesh-delivery-checker/internal/check/composition_test.go +++ b/modules/mesh-delivery-checker/internal/check/composition_test.go @@ -33,6 +33,7 @@ func (f *fakeCompositions) Compose(ctx context.Context, c *Case) (delivery.Compo // 1297/AC3 (its unit half): a check whose tests pass takes the assigner's composition of it, by the check's own key, // into its verdict: a pass says it passed with the mesh-sdk and machines it composed, and is no longer "not run". func TestAPassingCheckTakesTheAssignersComposition(t *testing.T) { + t.Run("a change to a build module or base names the modules built on it", aChangeToABuildModuleOrBaseNamesTheModulesBuiltOnIt) b := newBench(t) f := &fakeCompositions{v: delivery.CompositionVerdict{Group: "feat/x", Heads: "0123456789ab", State: delivery.CompositionPass, SDK: "v0.1.14-x", Machines: []string{"g14"}, Took: 40}} b.ex.Compositions = f @@ -105,7 +106,7 @@ func (f fixedTrunks) Heads() map[string]string { return f.heads } // ADR 0603 §10: a change that alters the Go build module, or a module others stand on, names in the composition's warnings // (and so the check's line) the changed modules built with it, from their manifests; a change that alters neither says nothing. -func TestAChangeToABuildModuleOrBaseNamesTheModulesBuiltOnIt(t *testing.T) { +func aChangeToABuildModuleOrBaseNamesTheModulesBuiltOnIt(t *testing.T) { dig := func(c string) string { return strings.Repeat(c, 64) } goBuild := &catalogue.Build{Artifacts: []catalogue.Artifact{{Name: "bin", Language: "go"}}} for _, row := range []struct { diff --git a/modules/mesh-delivery-indexer/internal/index/toolchains_test.go b/modules/mesh-delivery-indexer/internal/index/toolchains_test.go index ffac6f5f..2510e054 100644 --- a/modules/mesh-delivery-indexer/internal/index/toolchains_test.go +++ b/modules/mesh-delivery-indexer/internal/index/toolchains_test.go @@ -135,6 +135,7 @@ func reportToolchainRecipe(t *testing.T, ix *Indexer, module, node, language, ve func TestAgreedToolchainChangesAGoModulesReasonWithNoMerge(t *testing.T) { // 1444/AC5 ix, mods := newFormIndexer(t, mod{"avahi", catalogueManifest(t, "avahi")}) if m, _ := moduleOf(t, mods, "avahi"); m.None2 != delivery.ToolchainNoReport { + t.Run("a recipe change builds a Go module at once and again once the agreement moves", aRecipeChangeBuildsAGoModuleAtOnceAndAgainOnceTheAgreementMoves) t.Fatalf("before: none2 = %q", m.None2) } // The release that last merged avahi: its source revision names avahi's commit, so Src (and FPSrc) are 7. @@ -183,7 +184,7 @@ func TestAgreedToolchainChangesAGoModulesReasonWithNoMerge(t *testing.T) { // 14 // ADR 0603 §3 (D9): a source revision that changes the Go build module's recipe and a Go module builds the module at once, with // the recipe the nodes run, and again once the agreement moves to the new one: the module never waits and never loses its // fingerprint between the two, and its toolchain edge names the recipe each was computed with. -func TestARecipeChangeBuildsAGoModuleAtOnceAndAgainOnceTheAgreementMoves(t *testing.T) { +func aRecipeChangeBuildsAGoModuleAtOnceAndAgainOnceTheAgreementMoves(t *testing.T) { ix, mods := newFormIndexer(t, mod{"avahi", catalogueManifest(t, "avahi")}) for _, node := range []string{"novox", "ace"} { reportToolchain(t, ix, "mesh-build-go", node, "go", "go1.27.1")