Merge pull request 'assigner: a want held at an older build names that build's release by its parts' (#226) from fix/assigner-held-build-release into main

This commit was merged in pull request #226.
This commit is contained in:
2026-11-16 17:53:02 +00:00
2 changed files with 12 additions and 1 deletions
@@ -81,6 +81,14 @@ func TestATrunkEntryTakesItsVersionFromTheReleaseOfItsFingerprintsSource(t *test
if _, ok := named("other"); ok {
t.Error("another fingerprint names a release")
}
// A build held back at an older fingerprint names the release whose parts are exactly what it made.
heldRaw, _ := json.Marshal(builds.BuildEnded{Module: "mail", Fingerprint: "old", Made: map[string]string{"image": "sha256:9"}})
if err := w.ends.put(heldRaw); err != nil {
t.Fatal(err)
}
if k, ok := named("old"); !ok || k.Version != "1.2.3" {
t.Errorf("a held build whose parts were released = %+v, %v; want 1.2.3", k, ok)
}
p.graph.source = 8 // a later merge that did not rebuild mail
if k, ok := named("t"); !ok || k.Version != "1.2.3" {
t.Errorf("after a later merge the trunk entry = %+v, %v; want the release of its fingerprint's source", k, ok)
@@ -197,7 +197,10 @@ func (p *passer) namedBuild(module, trunkFP string, fpSrc int64, unreleased ...b
}
}
if fp != trunkFP {
return assign.KeptBuild{}, false
// A want held back at an older build (rule 2: no pipeline passed at the trunk's newer fingerprint) names that build's
// release when one names exactly the digests it made (novox 2026-11-16: mesh-hand-acts 0.1.13 held at 4eb3cf48 after
// the mesh-sdk merge moved its fingerprint).
return p.w.released.withParts(module, p.w.ends.madeOf(module, fp))
}
if p.graph == nil || !p.graph.ok {
p.unheardRelease(module, fp, "no assignment graph revision is kept yet, so no release is looked up")