Join 8: one-line join mismatches (builder stuck steps, republish test Built, indexer judge CatchUp pointer)

Builds: design 47 G join of rounds 4-8
This commit is contained in:
2026-11-12 00:17:24 +01:00
parent fcd849be7a
commit 938531cb10
4 changed files with 8 additions and 11 deletions
@@ -159,7 +159,7 @@ func (r *BuildReader) stepNode(v builds.BuilderBuild) string {
return ""
}
if r.index == nil {
idx, err := r.Steps.stepIndex()
idx, _, err := r.Steps.stepIndex()
if err != nil {
return ""
}
@@ -318,7 +318,7 @@ func (r StuckReader) Stuck(module string) (map[string]any, error) {
if r.Now != nil {
now = r.Now
}
stepKeys, err := r.stepIndex()
stepKeys, steps, err := r.stepIndex()
if err != nil {
return nil, err
}
@@ -420,7 +420,7 @@ func (r StuckReader) Stuck(module string) (map[string]any, error) {
// stepIndex finds the build modules' steps by the ask's id, which their key ends in: one index per build module, no value read
// until an ask names it.
func (r StuckReader) stepIndex() (map[string]map[string]string, error) {
func (r StuckReader) stepIndex() (map[string]map[string]string, map[string]StateRead, error) {
stepKeys := map[string]map[string]string{}
steps := r.Steps
if r.StepsOf != nil {
@@ -432,7 +432,7 @@ func (r StuckReader) stepIndex() (map[string]map[string]string, error) {
for bm, s := range steps {
ks, err := s.Keys()
if err != nil {
return nil, fmt.Errorf("the steps of %s: %w", bm, err)
return nil, nil, fmt.Errorf("the steps of %s: %w", bm, err)
}
byID := make(map[string]string, len(ks))
for _, k := range ks {
@@ -448,12 +448,9 @@ func (r StuckReader) stepIndex() (map[string]map[string]string, error) {
}
stepKeys[bm] = byID
}
return stepKeys, nil
return stepKeys, steps, nil
}
// StuckBuildModules are the build modules whose steps builder_stuck reads.
var StuckBuildModules = []string{buildrun.GoBuildModule, buildrun.NodeBuildModule, ImageBuildModule}
// idTime is when a step id was made (buildstep.NewID: the time in milliseconds in base 36, then six hex digits).
func idTime(id string) (time.Time, bool) {
if len(id) <= 6 {
@@ -71,7 +71,7 @@ func (b *republishBed) reserve(t *testing.T, module string) ReservedVersion {
t.Fatal(err)
}
for ref, d := range map[string]string{module + ":prog": "sha256:aa", module + ":lib": "sha256:bb"} {
if _, err := b.Reserved.Built(ctx, module, v.Version, ref, d); err != nil {
if _, err := b.Reserved.Built(ctx, module, v.Version, ref, d, nil); err != nil {
t.Fatal(err)
}
}
@@ -178,9 +178,9 @@ func BusStateProblems(m catalogue.Manifest) []string {
func KeptFormProblems(m catalogue.Manifest) []string {
var problems []string
for _, k := range catalogue.KeptDeclarations(m) {
if k.CatchUp != "" && !slices.Contains(m.Tools, k.CatchUp) {
if k.CatchUp != nil && !slices.Contains(m.Tools, k.CatchUp.Tool) {
problems = append(problems, fmt.Sprintf("%s's kept %s %q: its catch-up tool %q is not among the module's tools (%s); a "+
"restore of it is followed by a tool of the module's own (novox/hq design 47)", m.Module, k.Kind, k.Name, k.CatchUp,
"restore of it is followed by a tool of the module's own (novox/hq design 47)", m.Module, k.Kind, k.Name, k.CatchUp.Tool,
orNoneWords(m.Tools)))
}
}