diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/pass.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/pass.go index 82df8bd4..657b1fb6 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/pass.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/pass.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "maps" "mesh-delivery-assigner/internal/buckets" "slices" @@ -324,6 +325,7 @@ func (p *passer) wants(ctx context.Context) { branches = []string{g.branch} } if fp != "" && !p.ends.mayWant(name, fp, branches, wantedOf[name]) { + p.sayNoWant(name, g.nodes, wantedOf[name], assign.Outcome{Rules: noPipelineRules(g.nodes, name, fp, branches)}) return } // A dependent's new version waits for its dependency's newest released version to be delivered (§376, A-189). @@ -1489,3 +1491,14 @@ func wantedHere(wanted map[string]mwc.Want, own []string, groups []group, first } return out } + +// noPipelineRules is why each node of module gets no want while no pipeline passed at fp on its branches (design 47 G §29): said as +// any rule's reason (sayNoWant), once. +func noPipelineRules(nodes []string, module, fp string, branches []string) map[string]assign.Holding { + out := map[string]assign.Holding{} + for _, node := range nodes { + out[node] = assign.Holding{Rule: mwc.RuleNotHeld, Words: fmt.Sprintf("no pipeline of %s passed at %s on %s, and a want follows a passed pipeline (design 47 G §29)", + module, shortHex(fp), strings.Join(branches, ", "))} + } + return out +} diff --git a/modules/mesh-delivery-assigner/internal/assign/put.go b/modules/mesh-delivery-assigner/internal/assign/put.go index 1c26bb7a..da2515f2 100644 --- a/modules/mesh-delivery-assigner/internal/assign/put.go +++ b/modules/mesh-delivery-assigner/internal/assign/put.go @@ -103,8 +103,13 @@ func StepPut(w PutWorld) PutNext { case "": if p.FP != w.Newest { // The builder builds the trunk's newest fingerprint and the candidates', and takes no ask for another yet (ADR 0546 - // clause 3): an older fingerprint it never built, or whose key it removed, cannot be put. - return say(puts.Refused, "the builder holds no build of %s at %s, and builds by itself only the trunk's newest (%s): put that, or a version it built", w.Module, fp, short(w.Newest)) + // clause 3): an older fingerprint it never built, or whose key it removed, cannot be put; the build the node runs now + // can (A-427), and the refusal names it. + runs := "states no running build of it" + if r := w.Running; r != nil && !r.Stopped && r.Fingerprint != "" { + runs = "runs " + short(r.Fingerprint) + } + return say(puts.Refused, "the builder holds no build of %s at %s, and builds by itself only the trunk's newest (%s), and %s %s by its running statement: put that, or a version the builder built", w.Module, fp, short(w.Newest), w.Node, runs) } return say(puts.Build, "waits for the builder's build of %s at %s, the trunk's newest, which it builds by itself", w.Module, fp) default: