feat: trace task sources to fixed workflow activations and rounds
This commit is contained in:
@@ -145,6 +145,28 @@ func run() error {
|
||||
case <-time.After(100 * time.Millisecond):
|
||||
}
|
||||
}
|
||||
steps, err := client.GetWorkflowSteps(ctx, accepted.Instance.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
verified := 0
|
||||
for _, step := range steps.Steps {
|
||||
if step.TaskID == nil {
|
||||
continue
|
||||
}
|
||||
source, err := client.GetTaskSource(ctx, *step.TaskID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if source.Workflow == nil || source.Workflow.WorkflowID != accepted.Instance.ID || source.Workflow.DefinitionVersionID != accepted.Instance.DefinitionVersionID || source.Workflow.StepID != step.ID || source.Workflow.ActivationID != *step.ActivationID || source.Workflow.ActivationSequence != 1 {
|
||||
return errors.New("workflow task source mismatch")
|
||||
}
|
||||
verified++
|
||||
}
|
||||
if verified != 3 {
|
||||
return errors.New("incomplete workflow task sources")
|
||||
}
|
||||
fmt.Printf("workflow_sources_verified=%d fixed_version=%s\n", verified, accepted.Instance.Version)
|
||||
stop()
|
||||
err = <-done
|
||||
waited = true
|
||||
|
||||
Reference in New Issue
Block a user