Builders, the artifact store's tools and distribution read and write the registry reference form through the registry clients' reference package, and name the sweep seat from its contract (ADR 0634 §4, S-8; issue 1966)

catalogue's SeatReference, InRegistrySeat, Routed, Recorded, InArtifactStore and ArtifactSweepSeat leave mesh-sdk;
each package gives the two registry seats' names from their contracts (or the build step's copies of them).

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 17:26:32 +01:00
parent 2978dd5bed
commit 82d00aeb5e
17 changed files with 63 additions and 38 deletions
@@ -14,6 +14,7 @@ import (
"strings"
"git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep"
artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference"
builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
"git.novox.be/novox/mesh-sdk/go/catalogue"
)
@@ -179,7 +180,7 @@ func (m *Module) packInto(ctx context.Context, workspace, module, name, artifact
if err := m.publishArchive(ctx, name, artifact, kind, digest, archive); err != nil {
return BuildResult{}, fmt.Errorf("%s%s: %v", builds.NotStored, artifact, err)
}
return BuildResult{Artifact: artifact, Digest: digest, Size: len(archive), Reference: catalogue.SeatReference(ArtifactSeat, name, artifact, digest)}, nil
return BuildResult{Artifact: artifact, Digest: digest, Size: len(archive), Reference: artifactref.SeatReference(ArtifactSeat, name, artifact, digest)}, nil
}
// buildEnv is the environment of the compile: the build agent's (CGO_ENABLED=0, GOFLAGS) with the installed go
@@ -23,9 +23,10 @@ import (
"github.com/distribution/distribution/v3/registry/handlers"
_ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory"
"git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep"
artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference"
registry "git.novox.be/novox/mesh-delivery/contracts/go/seats/containerimageregistry"
builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
"git.novox.be/novox/mesh-sdk/go/catalogue"
)
// realStore starts the artifact store's own program (the distribution registry, modules/distribution) inside this
@@ -94,14 +95,14 @@ func uploadBlob(base, name, digest string, body []byte) error {
return nil
}
// resolve reads a done artifact's reference from the store as a node-engine does (catalogue.Routed): the seat's form
// resolve reads a done artifact's reference from the store as a node-engine does (registryForms.Routed): the seat's form
// oci-artifact-registry/<module>/<artifact>@<digest> is <store>/v2/<module>/<artifact>/blobs/<digest> (ADR 0605 §9).
func resolve(t *testing.T, addr string, a builds.BuiltArtifact) []byte {
t.Helper()
if _, _, ok := catalogue.InRegistrySeat(a.Reference); !ok {
if _, _, ok := registryForms.InRegistrySeat(a.Reference); !ok {
t.Fatalf("%s's reference %q is not in the form a registry seat answers", a.Name, a.Reference)
}
resp, err := http.Get(catalogue.Routed(a.Reference, addr))
resp, err := http.Get(registryForms.Routed(a.Reference, addr))
if err != nil {
t.Fatal(err)
}
@@ -161,3 +162,6 @@ func TestADoneBuildsArtifactsResolveInARealArtifactStore(t *testing.T) {
}
}
}
// registryForms reads a reference of the registry form, the two seats' names from the build step (their contracts).
var registryForms = artifactref.Seats{Image: buildstep.ImageSeat, Object: buildstep.ArtifactSeat}
+1
View File
@@ -3,6 +3,7 @@ module meshbuildgo
go 1.26.0
require (
git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient v0.0.0-00010101000000-000000000000
git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient v0.0.0-00010101000000-000000000000
git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog v0.0.0-00010101000000-000000000000
git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds v0.0.0-00010101000000-000000000000