From 3753d4d5dc6aa3e564d0b433f4f4ca7610d152c3 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:06:09 +0100 Subject: [PATCH] H5 names-no-version: a want naming no version is held as naming no version Builds: design 47 H2 H-A-673 (hq 6b8373ce) --- internal/selfcompose/entries.go | 7 ++++++- internal/selfcompose/versions_test.go | 11 +++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/internal/selfcompose/entries.go b/internal/selfcompose/entries.go index 0f964b9f..96a2ad72 100644 --- a/internal/selfcompose/entries.go +++ b/internal/selfcompose/entries.go @@ -766,7 +766,12 @@ func (c *Composer) entryHolds() map[string]string { agent.EntryMissing, w.Fp, module) default: if _, missing := c.partsOf(module, e, w); missing != "" { - out[module] = fmt.Sprintf("the want of %s names no digest for %s, so the node composes nothing new of it", module, missing) + if w.Version == "" { + // H-A-673: a want naming no version has no digests to resolve; its writer is at fault, not the registry. + out[module] = fmt.Sprintf("the want of %s names no version, so the node composes nothing new of it", module) + } else { + out[module] = fmt.Sprintf("the want of %s names no digest for %s, so the node composes nothing new of it", module, missing) + } } } } diff --git a/internal/selfcompose/versions_test.go b/internal/selfcompose/versions_test.go index e6741b33..131df219 100644 --- a/internal/selfcompose/versions_test.go +++ b/internal/selfcompose/versions_test.go @@ -71,6 +71,7 @@ func aWantNamingItsVersionIsResolvedThroughTheRegistrySeats(t *testing.T) { parts map[string]string missing string // a word the reason holds said []string + holds string // the words the module's hold says (entryHolds), when it is held // pkg names a package artifact the builder's done key carries with no reference beside what the build made: the key // frombus hands takein.Manifest (H-A-466). pkg string @@ -88,7 +89,11 @@ func aWantNamingItsVersionIsResolvedThroughTheRegistrySeats(t *testing.T) { refs: map[string]string{"mail:server": "artifact-store://mail/server/blobs/" + d("9"), "mail:files": "artifact-store://mail/files/blobs/" + d("1"), "mail:web": "container-image-registry/mail/web@" + d("3")}}, "a version a seat does not hold": {want: meshwants.WantsByWantNodeModuleValue{Fp: fp, Version: "2.0.0", Self: true}, - missing: "2.0.0", said: []string{"mail at version 2.0.0", "oci-artifact-registry", "container-image-registry"}}, + missing: "2.0.0", said: []string{"mail at version 2.0.0", "oci-artifact-registry", "container-image-registry"}, + holds: "names no digest for"}, + // Design 47 H2 H-A-673: a want with a fingerprint and no version is held as naming no version, not no digest. + "a want naming no version": {want: meshwants.WantsByWantNodeModuleValue{Fp: fp, Self: true}, + missing: "mail:", holds: "the want of mail names no version, so the node composes nothing new of it"}, "a seat that does not answer": {want: meshwants.WantsByWantNodeModuleValue{Fp: fp, Version: "1.2.3", Self: true}, down: "container-image-registry", missing: "mail:web", said: []string{"mail at version 1.2.3: the seat container-image-registry"}}, "a package artifact": {want: meshwants.WantsByWantNodeModuleValue{Fp: fpPkg, Version: "1.2.3", Self: true}, entry: &withPackage, @@ -139,8 +144,10 @@ func aWantNamingItsVersionIsResolvedThroughTheRegistrySeats(t *testing.T) { if parts != nil || b != nil || !strings.Contains(missing, row.missing) { t.Errorf("%s: parts %v, build %v, missing %q: want the module held whole, naming %s", name, parts, b, missing, row.missing) } - if c.entryHolds()["mail"] == "" { + if held := c.entryHolds()["mail"]; held == "" { t.Errorf("%s: the module is not held", name) + } else if !strings.Contains(held, row.holds) { + t.Errorf("%s: held as %q, want words naming %q", name, held, row.holds) } for _, w := range row.said { if !strings.Contains(strings.Join(said, "\n"), w) {