BL5 (version half): a build whose catalog entry's version is not MAJOR.MINOR reserves nothing and says so in the journal

The first-watched-branch half (§371) waits for BL6's revision view, which names a build's branch.

Builds: design 47 G §505

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 15:48:04 +01:00
parent 689947bec5
commit 2c8d3f5b40
2 changed files with 9 additions and 0 deletions
@@ -165,6 +165,8 @@ func (b *Builder) reserves(ctx context.Context, module string, m meshcatalog.Mod
return false
}
if strings.Count(plan.Series, ".") != 1 {
// G §505: such an entry (a manifest from before G, "1") reserves nothing and is built as a build without a version.
b.logf("%s: the catalog entry's version %q is not MAJOR.MINOR: no version is reserved, and the build is made and delivered without one", module, plan.Series)
return false
}
return b.doneDigests(ctx, module, m.Fp2) == nil
@@ -2,6 +2,7 @@ package build
import (
"context"
"fmt"
"slices"
"strings"
"testing"
@@ -80,9 +81,15 @@ func TestABuildReservesItsVersionAtItsStartOnceTheCatalogFilled(t *testing.T) {
r2 := newRig(t, goBundle)
res2 := &fakeReservations{filled: true}
r2.b.Reserved = res2
var journal []string
r2.b.Logf = func(f string, a ...any) { journal = append(journal, fmt.Sprintf(f, a...)) }
if v := r2.consider(t, "modules/m"); v.State != builds.BuildDone || len(res2.reserved) != 0 {
t.Errorf("a manifest with no MAJOR.MINOR: state %s, reserved %v", v.State, res2.reserved)
}
// G §505: the builder writes in its journal, naming the module, that it reserved nothing.
if !slices.ContainsFunc(journal, func(l string) bool { return strings.HasPrefix(l, "m: ") && strings.Contains(l, "not MAJOR.MINOR") }) {
t.Errorf("journal %q, want a line naming m and saying its version is not MAJOR.MINOR", journal)
}
}
// TestADropOfAReservationIsAReasksValueOfItsOwnKey: design 47 G §369 — builder_reserved_drop asks the builder through