From d0e0519dbe286cc25e32bd0a5fd83f80468aab16 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 8 Oct 2026 13:35:10 +0200 Subject: [PATCH] Resolve the forge's manifest against both artifacts it now builds The catalogue's forge also builds its npm registry since hq ADR 0251, so the three forge tests resolved it against half its build and failed on main as on every branch. --- .../catalogue/foundation_manifests_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/internal/catalogue/foundation_manifests_test.go b/internal/catalogue/foundation_manifests_test.go index 49993e6a..a78fe472 100644 --- a/internal/catalogue/foundation_manifests_test.go +++ b/internal/catalogue/foundation_manifests_test.go @@ -177,11 +177,19 @@ func TestTheForgeHoldsTheNpmAndGitSeats(t *testing.T) { // wrong on every node whose assignment differs, and wrong for a second reason on a node given the // port (ADR 0100). Composed through the whole path, because what proves the placeholder resolves // in an `env` at all is a declaration, not a manifest. +// forgeBuilt is every artifact the forge's manifest builds: its code, and since hq ADR 0251 the npm +// registry it serves beside it. A manifest resolves only against all of what it asked to be built. +func forgeBuilt() []Built { + var out []Built + for _, name := range []string{"code", "npm-registry"} { + out = append(out, Built{Name: name, Kind: ArtifactBundle, + Reference: ArtifactStoreScheme + "gitea/" + name + "/blobs/" + bundleDigest, Digest: bundleDigest}) + } + return out +} + func TestTheForgesOwnAddressFollowsThePortTheNodeGaveIt(t *testing.T) { - forge, err := catalogueManifest(t, "gitea").Resolve([]Built{{ - Name: "code", Kind: ArtifactBundle, - Reference: ArtifactStoreScheme + "gitea/code/blobs/" + bundleDigest, Digest: bundleDigest, - }}) + forge, err := catalogueManifest(t, "gitea").Resolve(forgeBuilt()) if err != nil { t.Fatalf("the forge's manifest does not resolve against its own build: %v", err) } @@ -234,10 +242,7 @@ func TestTheForgesOwnAddressFollowsThePortTheNodeGaveIt(t *testing.T) { func declaredGiteaSsh(t *testing.T, given map[int]int) map[string]any { t.Helper() forge := catalogueManifest(t, "gitea") - resolved, err := forge.Resolve([]Built{{ - Name: "code", Kind: ArtifactBundle, - Reference: ArtifactStoreScheme + "gitea/code/blobs/" + bundleDigest, Digest: bundleDigest, - }}) + resolved, err := forge.Resolve(forgeBuilt()) if err != nil { t.Fatalf("the forge's manifest does not resolve against its own build: %v", err) }