Carry the source fingerprint in the builds list, so builds can say it (issue 1208)
mesh/merge-gate head 3ac8657a49bf merged into trunk 230f0a1a18f2 — pass: builds build-agent, mesh-controller → ace, g14, novox, shanks; no bus step; every …
mesh/repo-check head 3ac8657a49bf merged into trunk 230f0a1a18f2 — pass: its merge-check.sh passed
mesh/delivery delivered

Issue 1204's line never showed: chainBuildList copied each build field by field and left the fingerprint out.
This commit is contained in:
2026-10-19 10:46:57 +02:00
parent 230f0a1a18
commit 3ac8657a49
2 changed files with 33 additions and 1 deletions
+30
View File
@@ -256,3 +256,33 @@ func TestAFailedNewerBuildLeavesTheBuildSourceStale(t *testing.T) {
t.Fatalf("after a newer failed build the proxy reads as %+v", got)
}
}
// novox/hq issue 1208: the list builds reads carries each build's source fingerprint, so the verb can say it.
func TestTheBuildsListCarriesTheSourceFingerprint(t *testing.T) {
inv := fresh(t)
ctx := context.Background()
pinned := aBuild("1", "shell", "")
pinned.SourceFingerprint = "src1:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
if err := inv.RecordBuild(ctx, pinned); err != nil {
t.Fatal(err)
}
if err := inv.RecordBuild(ctx, aBuild("2", "other", "")); err != nil {
t.Fatal(err)
}
got, err := inv.Builds(ctx, "", 10)
if err != nil {
t.Fatal(err)
}
says := map[string]string{}
for _, b := range got {
says[b.Module] = b.SourceFingerprint
}
// 1208/AC1
if says["shell"] != pinned.SourceFingerprint {
t.Errorf("the list says %q for shell; want %q", says["shell"], pinned.SourceFingerprint)
}
// 1208/AC2
if fp, listed := says["other"]; !listed || fp != "" {
t.Errorf("a build with no fingerprint is listed with %q (listed %v); want it listed with none", fp, listed)
}
}
+3 -1
View File
@@ -618,7 +618,9 @@ func (i *Inventory) chainBuildList(ctx context.Context, c *chain.Chain, module s
for _, b := range all {
if module == "" || b.Module == module {
out = append(out, Build{ID: b.ID, Repository: b.Repository, Ref: b.Ref, Module: b.Module, Commit: b.Commit,
On: b.On, Failed: b.Failed, Made: b.Made, Asked: b.Asked, At: b.At, ReuseKey: b.ReuseKey, Published: b.Published})
On: b.On, Failed: b.Failed, Made: b.Made, Asked: b.Asked, At: b.At, ReuseKey: b.ReuseKey, Published: b.Published,
// What it was made from, which builds says (novox/hq issue 1208).
SourceFingerprint: b.SourceFingerprint})
}
}
sort.SliceStable(out, func(a, b int) bool {