From b7b3891a4a823a122ef652f5345532be83faabe7 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 23 Nov 2026 21:55:02 +0100 Subject: [PATCH] T1 indexer: blank only a mover's entry (issue 1984) The take-in blanked a package's pin in every import-form entry, the node-engine's among them though it was no mover, and nothing filled it: every composition of main.506 could not run. A module that is no mover of the take-in keeps its pins, since no step of that pipeline builds it. Tests: TestMoversOf gains the subcase "an import-form importer that is no mover keeps its pin of a package a mover publishes" (1984/AC7); I12's subcase is kept as 1984/AC8. TestASourceRevisionMovingMeshSDKNamesItAndItsImporters (integration) asserted the old blank for importer at m3's take-in, where the take-in makes importer no mover (its fingerprint does not move, noted on issue 1984 as note 24); its assertion now follows H-A-628 (1): blank where importer is a mover of that take-in, its pin kept where not. Builds: design 47 H2 H-A-628 (1) (hq cea6404c); D1 H-A-532 DMC-1; D2 H-A-547 (2) --- .../packages_integration_test.go | 13 +++++++++---- .../internal/index/movers.go | 12 ++++++++---- .../internal/index/movers_test.go | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/packages_integration_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/packages_integration_test.go index 36e635a1a..f7d3e2f0f 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/packages_integration_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/packages_integration_test.go @@ -400,9 +400,10 @@ func TestASourceRevisionMovingMeshSDKNamesItAndItsImporters(t *testing.T) { } untilModule(t, ctx, js, "legacy", func(m meshcatalog.ModulesByModuleValue) bool { return m.Packages[sdkGo] == "v0.1.29" }) - // DMC-1, H-A-547 (2): the next take-in moving mesh-sdk (m3 changes buildstep again) names it with no version in the - // import-form importer's entry of that take-in's revision, so the importer's build waits for this pipeline's publish; - // legacy, of the version line, keeps its pin. + // DMC-1, H-A-547 (2), H-A-628 (1): the next take-in moving mesh-sdk (m3 changes buildstep again) names it with no version + // in the import-form importer's entry of that take-in's revision where importer is a mover of it, so the importer's build + // waits for this pipeline's publish, and keeps its pin where it is no mover, since no step of that pipeline builds it + // (1984/AC7, AC8); legacy, of the version line, keeps its pin. heard.acked(t, "main") say(13, false, meshdelivery.SourceMovedEventHeadsItem{Repository: "novox/mesh-sdk", Commit: m3}) taken = heard.next(t, "main", 13) @@ -411,7 +412,11 @@ func TestASourceRevisionMovingMeshSDKNamesItAndItsImporters(t *testing.T) { if err != nil { t.Fatal(err) } - for module, want := range map[string]string{"importer": "", "legacy": "v0.1.29"} { + importerWants := "v0.1.29" + if slices.ContainsFunc(taken.Entries, func(m meshcatalog.TakeInEntry) bool { return m.Module == "importer" }) { + importerWants = "" + } + for module, want := range map[string]string{"importer": importerWants, "legacy": "v0.1.29"} { i := slices.IndexFunc(entries, func(e meshcatalog.CatalogEntry) bool { return e.Module == module }) if i < 0 { t.Fatalf("main.%d holds no entry of %s", taken.Revision, module) diff --git a/modules/mesh-delivery-indexer/internal/index/movers.go b/modules/mesh-delivery-indexer/internal/index/movers.go index 3c89bda16..e9072f398 100644 --- a/modules/mesh-delivery-indexer/internal/index/movers.go +++ b/modules/mesh-delivery-indexer/internal/index/movers.go @@ -64,12 +64,16 @@ func moversOf(before []meshcatalog.CatalogEntry, after map[string]meshcatalog.Ca // unpinnedByMovers are the entries of a take-in with no version named, in an importer's packages, for a package a mover of // the same take-in publishes (design 47 H2 H-A-532 DMC-1, H-A-547 Q5): the version that pipeline publishes is not released // at the take-in, so the importer's build waits for that package's publish and is made against it (H-A-165, H-A-521). Only -// an entry on the import form is touched (its import set reported, H-A-538): a version-line entry's fingerprint takes its -// pins (H-A-167, H-A-530), so it keeps them. A mover's own packages are left as they are. The entries are written anew where -// one changes; the others are the same values. +// the entry of a mover of the take-in is touched (H-A-628 (1)): a module that is no mover keeps its pins, since no step of +// that pipeline builds it, so no build waits for the publish the blank serves. Of a mover, only an entry on the import form +// is touched (its import set reported, H-A-538): a version-line entry's fingerprint takes its pins (H-A-167, H-A-530), so +// it keeps them. A mover's own packages are left as they are. The entries are written anew where one changes; the others +// are the same values. func unpinnedByMovers(entries map[string]meshcatalog.CatalogEntry, movers []meshcatalog.TakeInEntry) map[string]meshcatalog.CatalogEntry { published := map[string]string{} // package name to the mover that publishes it + moving := make(map[string]bool, len(movers)) for _, m := range movers { + moving[m.Module] = true for _, a := range entries[m.Module].Artifacts { if a.Package != nil && a.Package.Name != "" { published[a.Package.Name] = m.Module @@ -82,7 +86,7 @@ func unpinnedByMovers(entries map[string]meshcatalog.CatalogEntry, movers []mesh out := make(map[string]meshcatalog.CatalogEntry, len(entries)) for name, e := range entries { out[name] = e - if _, reported := importSetOf(e); !reported { + if _, reported := importSetOf(e); !reported || !moving[name] { continue } var pkgs map[string]string diff --git a/modules/mesh-delivery-indexer/internal/index/movers_test.go b/modules/mesh-delivery-indexer/internal/index/movers_test.go index 1a860e13f..799999ee5 100644 --- a/modules/mesh-delivery-indexer/internal/index/movers_test.go +++ b/modules/mesh-delivery-indexer/internal/index/movers_test.go @@ -74,6 +74,7 @@ func TestMoversOf(t *testing.T) { // I12 (design 47 H2 H-A-532 DMC-1, H-A-547 Q5): an import-form importer of a package a mover of the take-in publishes names // no version for it in the revision's entry, so its build waits for that pipeline's publish; a version-line importer keeps // its pin (its fingerprint takes it), and a take-in that moves no publisher touches nothing. + // 1984/AC8: the import-form importer here is a mover (its fingerprint moved), so its entry is blanked. t.Run("an import-form importer names no version for a package a mover publishes", func(t *testing.T) { after := entries(sdk("2"), importer, reported("a2")) got := unpinnedByMovers(after, moversOf([]meshcatalog.CatalogEntry{sdk("1"), importer, reported("a")}, after, []string{"novox/mesh-sdk"})) @@ -88,4 +89,19 @@ func TestMoversOf(t *testing.T) { t.Errorf("a take-in moving no publisher unpinned %v", got["avahi"].Packages) } }) + // 1984/AC7 (design 47 H2 H-A-628 (1)): an import-form importer that is no mover of the take-in (its fingerprint did not + // move: no package it imports changed) keeps its pin of a package a mover publishes, since no step of that pipeline + // builds it and so no build waits for the publish. + t.Run("an import-form importer that is no mover keeps its pin of a package a mover publishes", func(t *testing.T) { + after := entries(sdk("2"), importer, reported("a")) + movers := moversOf([]meshcatalog.CatalogEntry{sdk("1"), importer, reported("a")}, after, []string{"novox/mesh-sdk"}) + for _, m := range movers { + if m.Module == "avahi" { + t.Fatalf("movers %v hold the importer whose fingerprint did not move", movers) + } + } + if got := unpinnedByMovers(after, movers); got["avahi"].Packages["git.novox.be/novox/mesh-sdk/go"] != "v0.1.20" { + t.Errorf("the import-form non-mover's packages = %v, want mesh-sdk/go pinned at v0.1.20 as it was", got["avahi"].Packages) + } + }) }