refactor(workflow): keep the call key change inside the lint gate

golangci-lint failed on the change and had not before: gofumpt wants
StartCall's same-typed parameters grouped, and runWorkflowCall reached a
cyclomatic complexity of 16. The unwaited call's early close moves into
closeUnwaitedCall on *TaskContext -- it needs only the call step, the
callee and the settings -- which leaves runWorkflowCall below the limit
with its behaviour unchanged.

The walk's id-less call case is deleted: ParseDefinition now refuses that
definition before validateWorkflowCalls runs, so it passed for the wrong
reason. The refusal is pinned where it happens instead, by the compile
case in TestWorkflowCallKeyIsTheDeclaredPath, now asserting the whole
message so it still names the step it refused.
This commit is contained in:
sam committed 2026-10-08 22:31:07 +11:00
1 parent 592acf20de
commit bd0cd3c2ef
3 files changed
+15 -25

No files matched your search

+1 -1
View File
@@ -786,7 +786,7 @@ func (s *Store) TaskByID(ctx context.Context, taskID int64) (*workflow.Task, err
// callerTaskID and callKey when there is one. A child that ended dead or
// declined freed its key, so such a call starts a fresh child. The caller must
// be running and within workflow.MaxCallDepth.
func (s *Store) StartCall(ctx context.Context, callerTaskID int64, callKey string, wf string, inputs map[string]any) (*workflow.Task, error) {
func (s *Store) StartCall(ctx context.Context, callerTaskID int64, callKey, wf string, inputs map[string]any) (*workflow.Task, error) {
encoded, err := task.EncodeInputs(inputs)
if err != nil {
return nil, err