diff --git a/modules/mesh-delivery-builder/buildrun/asks.go b/modules/mesh-delivery-builder/buildrun/asks.go index 9d0f93c81..44f6cfe22 100644 --- a/modules/mesh-delivery-builder/buildrun/asks.go +++ b/modules/mesh-delivery-builder/buildrun/asks.go @@ -57,8 +57,8 @@ type Asker struct { Expiry *Expiry // Logf says a drop that failed (the log's Printf when unset): the ask then stays on its stream, and it is said. Logf func(format string, args ...any) - // Outputs reads the answer a step's key names as its output-object, being over what the steps state holds (design 47 G - // A-290), through the build seat's verb output on the step's node (buildstep.Step.Whole); Wait answers the step whole. + // Outputs reads the answer a step's key names as its answer-object, being over what the steps state holds (design 47 G + // A-290), through the build seat's verb answer on the step's node (buildstep.Step.Whole; H-A-412); Wait answers the step whole. // Nil reads none: such a step's wait is an error saying so. Outputs buildstep.AskVerb } @@ -337,7 +337,7 @@ func (k Asker) Wait(ctx context.Context, a buildstep.StepAsk) (buildstep.Step, e } whole, err := step.Whole(a.Language, a.Run != nil, k.Outputs) if err != nil { - return buildstep.Step{}, fmt.Errorf("the ask %s's step on %s ended %s, and its answer %s cannot be read: %w", a.ID, step.Node, step.State, step.OutputObject, err) + return buildstep.Step{}, fmt.Errorf("the ask %s's step on %s ended %s, and its answer %s cannot be read: %w", a.ID, step.Node, step.State, step.AnswerObject, err) } return whole, nil } diff --git a/modules/mesh-delivery-builder/buildrun/asks_test.go b/modules/mesh-delivery-builder/buildrun/asks_test.go index fb8e1c83c..ce859484a 100644 --- a/modules/mesh-delivery-builder/buildrun/asks_test.go +++ b/modules/mesh-delivery-builder/buildrun/asks_test.go @@ -55,17 +55,17 @@ func TestAnAskerPutsOnceAndReadsTheStep(t *testing.T) { if _, err := k.Ask(context.Background(), goAsk("mvl0frv18d1958")); err == nil || !strings.Contains(err.Error(), "shanks refused: go 1.27 installed") { t.Fatalf("a refused step: %v", err) } - // Design 47 G A-290: a step whose key names its answer as the object output. is answered whole, read through the - // build seat's verb output on the step's node; with no verb to read it the wait says so, never the step without its answer. + // Design 47 G A-290, H-A-412: a step whose key names its answer as the object answer. is answered whole, read through the + // build seat's verb answer on the step's node; with no verb to read it the wait says so, never the step without its answer. f.Answer = func(a buildstep.StepAsk) buildstep.Step { - return buildstep.Step{ID: a.ID, Node: "ace", State: buildstep.StepPassed, OutputObject: buildstep.OutputObjectName(a.ID)} + return buildstep.Step{ID: a.ID, Node: "ace", State: buildstep.StepPassed, AnswerObject: buildstep.AnswerObjectName(a.ID)} } var asked string k.Outputs = func(key string, body any) (json.RawMessage, error) { asked = key return json.RawMessage(`{"ask":"` + body.(map[string]any)["ask"].(string) + `","file":"eyJhcnRpZmFjdHMiOltdfQ=="}`), nil } - if step, err := k.Ask(context.Background(), goAsk("mvl0frv18d1961")); err != nil || string(step.Result) != `{"artifacts":[]}` || step.OutputObject != "" || asked != "seat:node-build-go.output@ace" { + if step, err := k.Ask(context.Background(), goAsk("mvl0frv18d1961")); err != nil || string(step.Result) != `{"artifacts":[]}` || step.AnswerObject != "" || asked != "seat:node-build-go.answer@ace" { t.Fatalf("a step whose answer is an object: %+v, %v, asked %q", step, err, asked) } k.Outputs = nil