From 04f54d777354e1203efc80a74b8947bd5bc57812 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 23:48:08 +0100 Subject: [PATCH] Design 47 H1 (7): a registry's published recomputes no module The indexer kept a registry's published in its series and then recomputed every module, moving fingerprints with no kept catalog revision beside the re-pin a release's package-published starts. It keeps the version in its series and recomputes nothing: a fingerprint moves only with a kept revision, one per module release, kept by the re-pin. The seat mesh-wants' pipeline-wanted subject names its last token revision, the number of the runner's key (its form unchanged). Builds: design 47 H H-A-211, H-A-213 (2), H-A-213 (4) (the subject's token), H-pins-spec-and-gaps leftover L3 --- .../go/seats/meshwants/contract.go | 6 ++-- .../seats/mesh-wants/seat.json | 2 +- .../ts/seats/meshwants/index.d.ts | 2 +- .../ts/seats/meshwants/index.js | 4 +-- .../cmd/mesh-delivery-indexer/series.go | 13 ++------ .../cmd/mesh-delivery-indexer/series_test.go | 33 +++++++------------ 6 files changed, 22 insertions(+), 38 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go b/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go index 44c5c076..0df94fed 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go @@ -83,9 +83,9 @@ const SubjectWantedAll = "mesh.seat.mesh-wants.event.wanted.*.*" // StreamPipelineWanted is the stream pipeline-wanted is kept in. const StreamPipelineWanted = "SEAT_mesh-wants_pipeline-wanted" -// SubjectPipelineWanted is where pipeline-wanted is published, on mesh.seat.mesh-wants.event.pipeline-wanted... -func SubjectPipelineWanted(branch, source string) string { - return "mesh.seat.mesh-wants.event.pipeline-wanted." + branch + "." + source +// SubjectPipelineWanted is where pipeline-wanted is published, on mesh.seat.mesh-wants.event.pipeline-wanted... +func SubjectPipelineWanted(branch, revision string) string { + return "mesh.seat.mesh-wants.event.pipeline-wanted." + branch + "." + revision } // SubjectPipelineWantedAll hears every pipeline-wanted. diff --git a/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json b/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json index e55cf587..b827436e 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json @@ -434,7 +434,7 @@ }, { "name": "pipeline-wanted", - "subject": "pipeline-wanted..", + "subject": "pipeline-wanted..", "keep": { "max-age-days": 30, "max-mib": 64 diff --git a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts index e7bf8b47..d4ef255a 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts @@ -50,7 +50,7 @@ export declare const wantedSubjectAll: "mesh.seat.mesh-wants.event.wanted.*.*"; export declare const pipelineWantedStream: "SEAT_mesh-wants_pipeline-wanted"; -export declare function pipelineWantedSubject(branch: string, source: string): string; +export declare function pipelineWantedSubject(branch: string, revision: string): string; export declare const pipelineWantedSubjectAll: "mesh.seat.mesh-wants.event.pipeline-wanted.*.*"; diff --git a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js index a544df9a..b0c21d4b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js +++ b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js @@ -52,8 +52,8 @@ export const wantedSubjectAll = "mesh.seat.mesh-wants.event.wanted.*.*"; export const pipelineWantedStream = "SEAT_mesh-wants_pipeline-wanted"; -export function pipelineWantedSubject(branch, source) { - return "mesh.seat.mesh-wants.event.pipeline-wanted." + branch + "." + source; +export function pipelineWantedSubject(branch, revision) { + return "mesh.seat.mesh-wants.event.pipeline-wanted." + branch + "." + revision; } export const pipelineWantedSubjectAll = "mesh.seat.mesh-wants.event.pipeline-wanted.*.*"; diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series.go index 8ac23cb9..bdfc2a5d 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series.go @@ -22,8 +22,9 @@ var ( ) // heardVersion reads one message of the consumer as a version, false for any other subject. A package's is kept in its -// series; one that does not decode is said and acknowledged; a write that fails, or the recompute of its users that a -// publish starts, is left unacknowledged, so the bus gives it again. +// series; one that does not decode is said and acknowledged; a write that fails is left unacknowledged, so the bus gives it +// again. It recomputes no module: a fingerprint moves only with a kept catalog revision, a release's by the re-pin its +// package-published starts, one revision per module release (design 47 H-A-211, H-A-213 (2)). func heardVersion(ctx context.Context, ix *index.Indexer, m jetstream.Msg, logf func(string, ...any)) bool { var h index.HeardVersion switch seat, ok := publishedSeats[m.Subject()]; { @@ -51,14 +52,6 @@ func heardVersion(ctx context.Context, ix *index.Indexer, m jetstream.Msg, logf if kept { logf("packages: %s %s kept in its series (published %v)", h.Package, h.Version, h.Published) } - if kept && h.Published { - // A series' newest moved: its users' fingerprints take it (DLV-I6), in the same turn as the publish is heard. - // A recompute that fails is not acknowledged, so the publish is offered again (design 47 H S15, H-A-167). - if err := ix.Recompute(ctx); err != nil { - logf("writing the modules again after %s %s was published failed, so the bus gives it again: %v", h.Package, h.Version, err) - return true - } - } _ = m.Ack() return true } diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series_test.go index 85ddbb54..c58fb27f 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/series_test.go @@ -32,30 +32,21 @@ func (unlistedStore) Keys(context.Context) ([]string, error) { return nil, errors.New("the bus does not answer") } -// TestHeardVersionRecomputeFailed: a publish whose recompute of its users fails is not acknowledged, so the bus gives -// it again (design 47 H S15, the pin specification's item 3); one whose recompute passes is. -func TestHeardVersionRecomputeFailed(t *testing.T) { +// TestHeardVersionMovesNoFingerprint: a registry's published is kept in its series and acknowledged, and recomputes no +// module: a fingerprint moves only with a kept revision, a release's by its re-pin on the package-published (design 47 +// H-A-211, H-A-213 (2); the pin specification's leftover L3). The modules state here fails any recompute. +func TestHeardVersionMovesNoFingerprint(t *testing.T) { data, err := json.Marshal(gopackageregistry.PublishedEvent{Kind: "package", Name: "git.example/novox/lib", Version: "0.1.4"}) if err != nil { t.Fatal(err) } - for _, c := range []struct { - name string - modules index.Store - acked int - }{ - {"recompute fails", &unlistedStore{memStore{vals: map[string][]byte{}}}, 0}, - {"recompute passes", &memStore{vals: map[string][]byte{}}, 1}, - } { - t.Run(c.name, func(t *testing.T) { - ix := &index.Indexer{Packages: &memStore{vals: map[string][]byte{}}, Modules: c.modules, Manifests: &memStore{vals: map[string][]byte{}}} - m := &ackedMsg{subject: gopackageregistry.SubjectPublished, data: data} - if !heardVersion(context.Background(), ix, m, t.Logf) { - t.Fatal("the registry's published is not taken as a version") - } - if m.acked != c.acked { - t.Errorf("acknowledged %d times, want %d", m.acked, c.acked) - } - }) + ix := &index.Indexer{Packages: &memStore{vals: map[string][]byte{}}, Modules: &unlistedStore{memStore{vals: map[string][]byte{}}}, + Manifests: &memStore{vals: map[string][]byte{}}} + m := &ackedMsg{subject: gopackageregistry.SubjectPublished, data: data} + if !heardVersion(context.Background(), ix, m, t.Logf) { + t.Fatal("the registry's published is not taken as a version") + } + if m.acked != 1 { + t.Errorf("acknowledged %d times, want once: a publish recomputes nothing that could fail", m.acked) } }