From 950fb8b0dc1f81f12bac90e0b5f3f0a7d9db04f6 Mon Sep 17 00:00:00 2001 From: Albert Callarisa Date: Thu, 9 Apr 2026 16:41:56 +0200 Subject: [PATCH 1/5] Add timer origin to the history information Signed-off-by: Albert Callarisa --- go.mod | 11 +- go.sum | 18 +++ pkg/workflow/history.go | 31 +++++ pkg/workflow/history_test.go | 180 ++++++++++++++++++++++++++ tests/apps/workflow/app.go | 45 +++++++ tests/e2e/standalone/workflow_test.go | 128 ++++++++++++++++++ 6 files changed, 411 insertions(+), 2 deletions(-) create mode 100644 pkg/workflow/history_test.go diff --git a/go.mod b/go.mod index 6745077c9..ff72dc80f 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/Pallinder/sillyname-go v0.0.0-20130730142914-97aeae9e6ba1 github.com/briandowns/spinner v1.19.0 github.com/dapr/dapr v1.17.0-rc.8 - github.com/dapr/durabletask-go v0.11.0 + github.com/dapr/durabletask-go v0.11.4-0.20260408193502-7e0554e3883e github.com/dapr/go-sdk v1.13.0 - github.com/dapr/kit v0.16.2-0.20251124175541-3ac186dff64d + github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b github.com/diagridio/go-etcd-cron v0.12.3 github.com/docker/docker v28.5.2+incompatible github.com/evanphx/json-patch/v5 v5.9.0 @@ -104,6 +104,7 @@ require ( github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-events v0.0.0-20250808211157-605354379745 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect @@ -189,6 +190,7 @@ require ( github.com/montanaflynn/stats v0.7.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect @@ -204,6 +206,7 @@ require ( github.com/prometheus/common v0.64.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rubenv/sql-migrate v1.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect @@ -269,6 +272,10 @@ require ( k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/kubectl v0.33.3 // indirect k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect + modernc.org/libc v1.61.9 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.8.2 // indirect + modernc.org/sqlite v1.34.5 // indirect oras.land/oras-go/v2 v2.6.0 // indirect sigs.k8s.io/controller-runtime v0.19.0 // indirect sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect diff --git a/go.sum b/go.sum index 86d37d1fb..1b64d2881 100644 --- a/go.sum +++ b/go.sum @@ -166,10 +166,14 @@ github.com/dapr/dapr v1.17.0-rc.8 h1:CZTPQRwX7sO9H4wKrVnnV6w1foKWLP89wtAJY/bL5KQ github.com/dapr/dapr v1.17.0-rc.8/go.mod h1:GZq8BjQaX3BbMmZET4HDe6Rrv58yC1pHNVQod3bIAVk= github.com/dapr/durabletask-go v0.11.0 h1:e9Ns/3a2b6JDKGuvksvx6gCHn7rd+nwZZyAXbg5Ley4= github.com/dapr/durabletask-go v0.11.0/go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q= +github.com/dapr/durabletask-go v0.11.4-0.20260408193502-7e0554e3883e h1:/ZE9swGMPaaaoo2wJNjC4xzDaQRaAk0m9yddSo7YRlo= +github.com/dapr/durabletask-go v0.11.4-0.20260408193502-7e0554e3883e/go.mod h1:nElJPTX9FmveqErAmvTXZrAmt2nnyTQ7Glj0ahPphSY= github.com/dapr/go-sdk v1.13.0 h1:Qw2BmUonClQ9yK/rrEEaFL1PyDgq616RrvYj0CT67Lk= github.com/dapr/go-sdk v1.13.0/go.mod h1:RsffVNZitDApmQqoS68tNKGMXDZUjTviAbKZupJSzts= github.com/dapr/kit v0.16.2-0.20251124175541-3ac186dff64d h1:csljij9d1IO6u9nqbg+TuSRmTZ+OXT8G49yh6zie1yI= github.com/dapr/kit v0.16.2-0.20251124175541-3ac186dff64d/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM= +github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b h1:hXbRlNKvmMGbiMSRy3MX04kH5OiMgH82PRuLN7adtwE= +github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b/go.mod h1:2v02LZdXzPmOadxoT6EMEt0bsEYe6h1fn2ndYWmylCg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -202,6 +206,8 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -540,6 +546,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAmxBiA= github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -617,6 +625,8 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= @@ -1167,6 +1177,14 @@ k8s.io/kubectl v0.33.3 h1:r/phHvH1iU7gO/l7tTjQk2K01ER7/OAJi8uFHHyWSac= k8s.io/kubectl v0.33.3/go.mod h1:euj2bG56L6kUGOE/ckZbCoudPwuj4Kud7BR0GzyNiT0= k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 h1:jgJW5IePPXLGB8e/1wvd0Ich9QE97RvvF3a8J3fP/Lg= k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +modernc.org/libc v1.61.9 h1:PLSBXVkifXGELtJ5BOnBUyAHr7lsatNwFU/RRo4kfJM= +modernc.org/libc v1.61.9/go.mod h1:61xrnzk/aR8gr5bR7Uj/lLFLuXu2/zMpIjcry63Eumk= +modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= +modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= +modernc.org/memory v1.8.2 h1:cL9L4bcoAObu4NkxOlKWBWtNHIsnnACGF/TbqQ6sbcI= +modernc.org/memory v1.8.2/go.mod h1:ZbjSvMO5NQ1A2i3bWeDiVMxIorXwdClKE/0SZ+BMotU= +modernc.org/sqlite v1.34.5 h1:Bb6SR13/fjp15jt70CL4f18JIN7p7dnMExd+UFnF15g= +modernc.org/sqlite v1.34.5/go.mod h1:YLuNmX9NKs8wRNK2ko1LW1NGYcc9FkBO69JOt1AR9JE= oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc= oras.land/oras-go/v2 v2.6.0/go.mod h1:magiQDfG6H1O9APp+rOsvCPcW1GD2MM7vgnKY0Y+u1o= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/pkg/workflow/history.go b/pkg/workflow/history.go index a19ec7323..5c5020aea 100644 --- a/pkg/workflow/history.go +++ b/pkg/workflow/history.go @@ -230,6 +230,19 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide row.addAttr("timerName", *t.TimerCreated.Name) } row.addAttr("fireAt", t.TimerCreated.FireAt.AsTime().Format(time.RFC3339)) + switch x := t.TimerCreated.GetOrigin().(type) { + case *protos.TimerCreatedEvent_CreateTimer: + row.addAttr("origin", "createTimer") + case *protos.TimerCreatedEvent_ExternalEvent: + row.addAttr("origin", "externalEvent") + row.addAttr("eventName", x.ExternalEvent.GetName()) + case *protos.TimerCreatedEvent_ActivityRetry: + row.addAttr("origin", "activityRetry") + row.addAttr("taskExecId", x.ActivityRetry.GetTaskExecutionId()) + case *protos.TimerCreatedEvent_ChildWorkflowRetry: + row.addAttr("origin", "childWorkflowRetry") + row.addAttr("instanceId", x.ChildWorkflowRetry.GetInstanceId()) + } case *protos.HistoryEvent_TimerFired: row.addAttr("timerId", fmt.Sprintf("%d", t.TimerFired.TimerId)) row.addAttr("fireAt", t.TimerFired.FireAt.AsTime().Format(time.RFC3339)) @@ -382,6 +395,9 @@ func deriveDetails(first *protos.HistoryEvent, h *protos.HistoryEvent) *string { if in := t.TimerCreated.RerunParentInstanceInfo; in != nil { det += fmt.Sprintf(",rerunParent=%s", in.InstanceID) } + if o := timerOriginString(t.TimerCreated); o != "" { + det += ",origin=" + o + } return ptr.Of(det) case *protos.HistoryEvent_EventRaised: return ptr.Of(fmt.Sprintf("event=%s", t.EventRaised.Name)) @@ -450,6 +466,21 @@ func flatTags(tags map[string]string, max int) string { return s } +func timerOriginString(tc *protos.TimerCreatedEvent) string { + switch x := tc.GetOrigin().(type) { + case *protos.TimerCreatedEvent_CreateTimer: + return "createTimer" + case *protos.TimerCreatedEvent_ExternalEvent: + return "externalEvent(" + x.ExternalEvent.GetName() + ")" + case *protos.TimerCreatedEvent_ActivityRetry: + return "activityRetry(" + x.ActivityRetry.GetTaskExecutionId() + ")" + case *protos.TimerCreatedEvent_ChildWorkflowRetry: + return "childWorkflowRetry(" + x.ChildWorkflowRetry.GetInstanceId() + ")" + default: + return "" + } +} + func trim(ww *wrapperspb.StringValue, limit int) string { if ww == nil { return "" diff --git a/pkg/workflow/history_test.go b/pkg/workflow/history_test.go new file mode 100644 index 000000000..5d93e9ae0 --- /dev/null +++ b/pkg/workflow/history_test.go @@ -0,0 +1,180 @@ +/* +Copyright 2026 The Dapr Authors +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package workflow + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/dapr/durabletask-go/api/protos" +) + +func TestTimerOriginString(t *testing.T) { + tests := []struct { + name string + event *protos.TimerCreatedEvent + expect string + }{ + { + name: "nil origin", + event: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + }, + expect: "", + }, + { + name: "createTimer", + event: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + Origin: &protos.TimerCreatedEvent_CreateTimer{ + CreateTimer: &protos.TimerOriginCreateTimer{}, + }, + }, + expect: "createTimer", + }, + { + name: "externalEvent", + event: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + Origin: &protos.TimerCreatedEvent_ExternalEvent{ + ExternalEvent: &protos.TimerOriginExternalEvent{ + Name: "myEvent", + }, + }, + }, + expect: "externalEvent(myEvent)", + }, + { + name: "activityRetry", + event: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + Origin: &protos.TimerCreatedEvent_ActivityRetry{ + ActivityRetry: &protos.TimerOriginActivityRetry{ + TaskExecutionId: "exec-123", + }, + }, + }, + expect: "activityRetry(exec-123)", + }, + { + name: "childWorkflowRetry", + event: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + Origin: &protos.TimerCreatedEvent_ChildWorkflowRetry{ + ChildWorkflowRetry: &protos.TimerOriginChildWorkflowRetry{ + InstanceId: "wf-456", + }, + }, + }, + expect: "childWorkflowRetry(wf-456)", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + got := timerOriginString(tc.event) + assert.Equal(t, tc.expect, got) + }) + } +} + +func TestDeriveDetails_TimerCreated(t *testing.T) { + first := &protos.HistoryEvent{ + Timestamp: timestamppb.Now(), + } + + tests := []struct { + name string + event *protos.HistoryEvent + contains []string + excludes []string + }{ + { + name: "timer with no origin", + event: &protos.HistoryEvent{ + EventType: &protos.HistoryEvent_TimerCreated{ + TimerCreated: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + }, + }, + }, + contains: []string{"fireAt="}, + excludes: []string{"origin="}, + }, + { + name: "timer with createTimer origin", + event: &protos.HistoryEvent{ + EventType: &protos.HistoryEvent_TimerCreated{ + TimerCreated: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + Origin: &protos.TimerCreatedEvent_CreateTimer{ + CreateTimer: &protos.TimerOriginCreateTimer{}, + }, + }, + }, + }, + contains: []string{"fireAt=", "origin=createTimer"}, + }, + { + name: "timer with activityRetry origin", + event: &protos.HistoryEvent{ + EventType: &protos.HistoryEvent_TimerCreated{ + TimerCreated: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + Origin: &protos.TimerCreatedEvent_ActivityRetry{ + ActivityRetry: &protos.TimerOriginActivityRetry{ + TaskExecutionId: "exec-abc", + }, + }, + }, + }, + }, + contains: []string{"fireAt=", "origin=activityRetry(exec-abc)"}, + }, + { + name: "timer with rerunParent and origin", + event: &protos.HistoryEvent{ + EventType: &protos.HistoryEvent_TimerCreated{ + TimerCreated: &protos.TimerCreatedEvent{ + FireAt: timestamppb.Now(), + RerunParentInstanceInfo: &protos.RerunParentInstanceInfo{ + InstanceID: "parent-123", + }, + Origin: &protos.TimerCreatedEvent_ExternalEvent{ + ExternalEvent: &protos.TimerOriginExternalEvent{ + Name: "approval", + }, + }, + }, + }, + }, + contains: []string{"fireAt=", "rerunParent=parent-123", "origin=externalEvent(approval)"}, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + details := deriveDetails(first, tc.event) + assert.NotNil(t, details) + for _, s := range tc.contains { + assert.Contains(t, *details, s) + } + for _, s := range tc.excludes { + assert.NotContains(t, *details, s) + } + }) + } +} diff --git a/tests/apps/workflow/app.go b/tests/apps/workflow/app.go index a070c3fad..02e1e1ba5 100644 --- a/tests/apps/workflow/app.go +++ b/tests/apps/workflow/app.go @@ -49,12 +49,16 @@ func register(ctx context.Context) { RecursiveChildWorkflow, FanOutWorkflow, DataWorkflow, + ActivityRetryWorkflow, + ChildWorkflowRetryWorkflow, + FailingChildWorkflow, } activities := []workflow.Activity{ ANoOP, SimpleActivity, LongRunningActivity, DataProcessingActivity, + FailingActivity, } for _, w := range workflows { @@ -368,3 +372,44 @@ func FanOutWorkflow(ctx *workflow.WorkflowContext) (any, error) { "results": results, }, nil } + +// FailingActivity always returns an error so that retry policies create +// timer events with origin=activityRetry. +func FailingActivity(ctx workflow.ActivityContext) (any, error) { + return nil, fmt.Errorf("intentional failure") +} + +// ActivityRetryWorkflow calls FailingActivity with a retry policy. +// The activity always fails, producing TimerCreated events with +// origin=activityRetry. The workflow itself will eventually fail +// after max attempts, but the history will contain the retry timers. +func ActivityRetryWorkflow(ctx *workflow.WorkflowContext) (any, error) { + var result any + err := ctx.CallActivity(FailingActivity, workflow.WithActivityRetryPolicy(&workflow.RetryPolicy{ + MaxAttempts: 3, + InitialRetryInterval: time.Second, + BackoffCoefficient: 1, + MaxRetryInterval: time.Second, + })).Await(&result) + return result, err +} + +// FailingChildWorkflow always returns an error so that retry policies create +// timer events with origin=childWorkflowRetry. +func FailingChildWorkflow(ctx *workflow.WorkflowContext) (any, error) { + return nil, fmt.Errorf("intentional child failure") +} + +// ChildWorkflowRetryWorkflow calls FailingChildWorkflow with a retry policy. +// The child always fails, producing TimerCreated events with +// origin=childWorkflowRetry. +func ChildWorkflowRetryWorkflow(ctx *workflow.WorkflowContext) (any, error) { + var result any + err := ctx.CallChildWorkflow(FailingChildWorkflow, workflow.WithChildWorkflowRetryPolicy(&workflow.RetryPolicy{ + MaxAttempts: 3, + InitialRetryInterval: time.Second, + BackoffCoefficient: 1, + MaxRetryInterval: time.Second, + })).Await(&result) + return result, err +} diff --git a/tests/e2e/standalone/workflow_test.go b/tests/e2e/standalone/workflow_test.go index 682bfe42f..7fd93c6d6 100644 --- a/tests/e2e/standalone/workflow_test.go +++ b/tests/e2e/standalone/workflow_test.go @@ -732,6 +732,134 @@ func TestWorkflowHistory(t *testing.T) { require.NoError(t, json.Unmarshal([]byte(output), &history)) assert.GreaterOrEqual(t, len(history), 1) }) + + t.Run("timer origin createTimer in details", func(t *testing.T) { + // WTimer calls ctx.CreateTimer which produces origin=createTimer. + _, err := cmdWorkflowRun(appID, "WTimer", "--instance-id=timer-origin-test") + require.NoError(t, err) + time.Sleep(2 * time.Second) + + output, err := cmdWorkflowHistory(appID, "timer-origin-test") + require.NoError(t, err) + assert.Contains(t, output, "origin=createTimer") + }) + + t.Run("timer origin createTimer in json attrs", func(t *testing.T) { + output, err := cmdWorkflowHistory(appID, "timer-origin-test", "-o", "json") + require.NoError(t, err) + + var history []map[string]interface{} + require.NoError(t, json.Unmarshal([]byte(output), &history)) + + found := false + for _, ev := range history { + if ev["type"] == "TimerCreated" { + if attrs, ok := ev["attrs"].(string); ok { + assert.Contains(t, attrs, "origin=createTimer") + found = true + } + } + } + assert.True(t, found, "expected TimerCreated event with origin=createTimer in attrs") + }) + + t.Run("timer origin externalEvent in details", func(t *testing.T) { + // EventWorkflow calls ctx.WaitForExternalEvent("test-event", time.Hour) + // which produces origin=externalEvent(test-event). + _, err := cmdWorkflowRun(appID, "EventWorkflow", "--instance-id=event-origin-test") + require.NoError(t, err) + time.Sleep(2 * time.Second) + + output, err := cmdWorkflowHistory(appID, "event-origin-test") + require.NoError(t, err) + assert.Contains(t, output, "origin=externalEvent(test-event)") + }) + + t.Run("timer origin externalEvent in json attrs", func(t *testing.T) { + output, err := cmdWorkflowHistory(appID, "event-origin-test", "-o", "json") + require.NoError(t, err) + + var history []map[string]interface{} + require.NoError(t, json.Unmarshal([]byte(output), &history)) + + found := false + for _, ev := range history { + if ev["type"] == "TimerCreated" { + if attrs, ok := ev["attrs"].(string); ok { + assert.Contains(t, attrs, "origin=externalEvent") + assert.Contains(t, attrs, "eventName=test-event") + found = true + } + } + } + assert.True(t, found, "expected TimerCreated event with origin=externalEvent in attrs") + }) + + t.Run("timer origin activityRetry in details", func(t *testing.T) { + // ActivityRetryWorkflow calls a failing activity with retry policy, + // producing TimerCreated events with origin=activityRetry. + _, err := cmdWorkflowRun(appID, "ActivityRetryWorkflow", "--instance-id=activity-retry-origin-test") + require.NoError(t, err) + + // Wait for retries to produce timer events. + time.Sleep(5 * time.Second) + + output, err := cmdWorkflowHistory(appID, "activity-retry-origin-test") + require.NoError(t, err) + assert.Contains(t, output, "origin=activityRetry(") + }) + + t.Run("timer origin activityRetry in json attrs", func(t *testing.T) { + output, err := cmdWorkflowHistory(appID, "activity-retry-origin-test", "-o", "json") + require.NoError(t, err) + + var history []map[string]interface{} + require.NoError(t, json.Unmarshal([]byte(output), &history)) + + found := false + for _, ev := range history { + if ev["type"] == "TimerCreated" { + if attrs, ok := ev["attrs"].(string); ok && strings.Contains(attrs, "origin=activityRetry") { + assert.Contains(t, attrs, "taskExecId=") + found = true + } + } + } + assert.True(t, found, "expected TimerCreated event with origin=activityRetry in attrs") + }) + + t.Run("timer origin childWorkflowRetry in details", func(t *testing.T) { + // ChildWorkflowRetryWorkflow calls a failing child workflow with retry + // policy, producing TimerCreated events with origin=childWorkflowRetry. + _, err := cmdWorkflowRun(appID, "ChildWorkflowRetryWorkflow", "--instance-id=child-retry-origin-test") + require.NoError(t, err) + + // Wait for retries to produce timer events. + time.Sleep(5 * time.Second) + + output, err := cmdWorkflowHistory(appID, "child-retry-origin-test") + require.NoError(t, err) + assert.Contains(t, output, "origin=childWorkflowRetry(") + }) + + t.Run("timer origin childWorkflowRetry in json attrs", func(t *testing.T) { + output, err := cmdWorkflowHistory(appID, "child-retry-origin-test", "-o", "json") + require.NoError(t, err) + + var history []map[string]interface{} + require.NoError(t, json.Unmarshal([]byte(output), &history)) + + found := false + for _, ev := range history { + if ev["type"] == "TimerCreated" { + if attrs, ok := ev["attrs"].(string); ok && strings.Contains(attrs, "origin=childWorkflowRetry") { + assert.Contains(t, attrs, "instanceId=") + found = true + } + } + } + assert.True(t, found, "expected TimerCreated event with origin=childWorkflowRetry in attrs") + }) } func TestWorkflowSuspendResume(t *testing.T) { From ba2db2c56e264c98f6e5f03684c723531e80d6d3 Mon Sep 17 00:00:00 2001 From: Albert Callarisa Date: Thu, 9 Apr 2026 16:52:32 +0200 Subject: [PATCH 2/5] Address comments Signed-off-by: Albert Callarisa --- pkg/workflow/history.go | 44 ++++++++++++++--------- tests/e2e/standalone/workflow_test.go | 52 +++++++++++---------------- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/pkg/workflow/history.go b/pkg/workflow/history.go index 5c5020aea..68293da84 100644 --- a/pkg/workflow/history.go +++ b/pkg/workflow/history.go @@ -230,18 +230,11 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide row.addAttr("timerName", *t.TimerCreated.Name) } row.addAttr("fireAt", t.TimerCreated.FireAt.AsTime().Format(time.RFC3339)) - switch x := t.TimerCreated.GetOrigin().(type) { - case *protos.TimerCreatedEvent_CreateTimer: - row.addAttr("origin", "createTimer") - case *protos.TimerCreatedEvent_ExternalEvent: - row.addAttr("origin", "externalEvent") - row.addAttr("eventName", x.ExternalEvent.GetName()) - case *protos.TimerCreatedEvent_ActivityRetry: - row.addAttr("origin", "activityRetry") - row.addAttr("taskExecId", x.ActivityRetry.GetTaskExecutionId()) - case *protos.TimerCreatedEvent_ChildWorkflowRetry: - row.addAttr("origin", "childWorkflowRetry") - row.addAttr("instanceId", x.ChildWorkflowRetry.GetInstanceId()) + if o := timerOriginInfo(t.TimerCreated); o != nil { + row.addAttr("origin", o.kind) + if o.attrKey != "" { + row.addAttr(o.attrKey, o.attrVal) + } } case *protos.HistoryEvent_TimerFired: row.addAttr("timerId", fmt.Sprintf("%d", t.TimerFired.TimerId)) @@ -466,19 +459,36 @@ func flatTags(tags map[string]string, max int) string { return s } -func timerOriginString(tc *protos.TimerCreatedEvent) string { +type timerOrigin struct { + kind string // e.g. "createTimer", "externalEvent" + attrKey string // extra attr key, empty if none + attrVal string // extra attr value +} + +func timerOriginInfo(tc *protos.TimerCreatedEvent) *timerOrigin { switch x := tc.GetOrigin().(type) { case *protos.TimerCreatedEvent_CreateTimer: - return "createTimer" + return &timerOrigin{kind: "createTimer"} case *protos.TimerCreatedEvent_ExternalEvent: - return "externalEvent(" + x.ExternalEvent.GetName() + ")" + return &timerOrigin{kind: "externalEvent", attrKey: "eventName", attrVal: x.ExternalEvent.GetName()} case *protos.TimerCreatedEvent_ActivityRetry: - return "activityRetry(" + x.ActivityRetry.GetTaskExecutionId() + ")" + return &timerOrigin{kind: "activityRetry", attrKey: "taskExecId", attrVal: x.ActivityRetry.GetTaskExecutionId()} case *protos.TimerCreatedEvent_ChildWorkflowRetry: - return "childWorkflowRetry(" + x.ChildWorkflowRetry.GetInstanceId() + ")" + return &timerOrigin{kind: "childWorkflowRetry", attrKey: "instanceId", attrVal: x.ChildWorkflowRetry.GetInstanceId()} default: + return nil + } +} + +func timerOriginString(tc *protos.TimerCreatedEvent) string { + o := timerOriginInfo(tc) + if o == nil { return "" } + if o.attrVal != "" { + return o.kind + "(" + o.attrVal + ")" + } + return o.kind } func trim(ww *wrapperspb.StringValue, limit int) string { diff --git a/tests/e2e/standalone/workflow_test.go b/tests/e2e/standalone/workflow_test.go index 7fd93c6d6..a37151113 100644 --- a/tests/e2e/standalone/workflow_test.go +++ b/tests/e2e/standalone/workflow_test.go @@ -733,18 +733,16 @@ func TestWorkflowHistory(t *testing.T) { assert.GreaterOrEqual(t, len(history), 1) }) - t.Run("timer origin createTimer in details", func(t *testing.T) { + t.Run("timer origin createTimer", func(t *testing.T) { // WTimer calls ctx.CreateTimer which produces origin=createTimer. _, err := cmdWorkflowRun(appID, "WTimer", "--instance-id=timer-origin-test") require.NoError(t, err) - time.Sleep(2 * time.Second) - output, err := cmdWorkflowHistory(appID, "timer-origin-test") - require.NoError(t, err) - assert.Contains(t, output, "origin=createTimer") - }) + require.Eventually(t, func() bool { + out, err := cmdWorkflowHistory(appID, "timer-origin-test") + return err == nil && strings.Contains(out, "origin=createTimer") + }, 10*time.Second, 200*time.Millisecond) - t.Run("timer origin createTimer in json attrs", func(t *testing.T) { output, err := cmdWorkflowHistory(appID, "timer-origin-test", "-o", "json") require.NoError(t, err) @@ -763,19 +761,17 @@ func TestWorkflowHistory(t *testing.T) { assert.True(t, found, "expected TimerCreated event with origin=createTimer in attrs") }) - t.Run("timer origin externalEvent in details", func(t *testing.T) { + t.Run("timer origin externalEvent", func(t *testing.T) { // EventWorkflow calls ctx.WaitForExternalEvent("test-event", time.Hour) // which produces origin=externalEvent(test-event). _, err := cmdWorkflowRun(appID, "EventWorkflow", "--instance-id=event-origin-test") require.NoError(t, err) - time.Sleep(2 * time.Second) - output, err := cmdWorkflowHistory(appID, "event-origin-test") - require.NoError(t, err) - assert.Contains(t, output, "origin=externalEvent(test-event)") - }) + require.Eventually(t, func() bool { + out, err := cmdWorkflowHistory(appID, "event-origin-test") + return err == nil && strings.Contains(out, "origin=externalEvent(test-event)") + }, 10*time.Second, 200*time.Millisecond) - t.Run("timer origin externalEvent in json attrs", func(t *testing.T) { output, err := cmdWorkflowHistory(appID, "event-origin-test", "-o", "json") require.NoError(t, err) @@ -795,21 +791,17 @@ func TestWorkflowHistory(t *testing.T) { assert.True(t, found, "expected TimerCreated event with origin=externalEvent in attrs") }) - t.Run("timer origin activityRetry in details", func(t *testing.T) { + t.Run("timer origin activityRetry", func(t *testing.T) { // ActivityRetryWorkflow calls a failing activity with retry policy, // producing TimerCreated events with origin=activityRetry. _, err := cmdWorkflowRun(appID, "ActivityRetryWorkflow", "--instance-id=activity-retry-origin-test") require.NoError(t, err) - // Wait for retries to produce timer events. - time.Sleep(5 * time.Second) - - output, err := cmdWorkflowHistory(appID, "activity-retry-origin-test") - require.NoError(t, err) - assert.Contains(t, output, "origin=activityRetry(") - }) + require.Eventually(t, func() bool { + out, err := cmdWorkflowHistory(appID, "activity-retry-origin-test") + return err == nil && strings.Contains(out, "origin=activityRetry(") + }, 15*time.Second, 250*time.Millisecond) - t.Run("timer origin activityRetry in json attrs", func(t *testing.T) { output, err := cmdWorkflowHistory(appID, "activity-retry-origin-test", "-o", "json") require.NoError(t, err) @@ -828,21 +820,17 @@ func TestWorkflowHistory(t *testing.T) { assert.True(t, found, "expected TimerCreated event with origin=activityRetry in attrs") }) - t.Run("timer origin childWorkflowRetry in details", func(t *testing.T) { + t.Run("timer origin childWorkflowRetry", func(t *testing.T) { // ChildWorkflowRetryWorkflow calls a failing child workflow with retry // policy, producing TimerCreated events with origin=childWorkflowRetry. _, err := cmdWorkflowRun(appID, "ChildWorkflowRetryWorkflow", "--instance-id=child-retry-origin-test") require.NoError(t, err) - // Wait for retries to produce timer events. - time.Sleep(5 * time.Second) - - output, err := cmdWorkflowHistory(appID, "child-retry-origin-test") - require.NoError(t, err) - assert.Contains(t, output, "origin=childWorkflowRetry(") - }) + require.Eventually(t, func() bool { + out, err := cmdWorkflowHistory(appID, "child-retry-origin-test") + return err == nil && strings.Contains(out, "origin=childWorkflowRetry(") + }, 30*time.Second, 500*time.Millisecond) - t.Run("timer origin childWorkflowRetry in json attrs", func(t *testing.T) { output, err := cmdWorkflowHistory(appID, "child-retry-origin-test", "-o", "json") require.NoError(t, err) From f839bae9b3db58fa038d44524f5838d6e07ebec5 Mon Sep 17 00:00:00 2001 From: Albert Callarisa Date: Mon, 20 Apr 2026 14:42:31 +0200 Subject: [PATCH 3/5] fix: rename with proto changes Signed-off-by: Samantha Coyle Signed-off-by: Albert Callarisa --- go.mod | 34 ++++++++---------- go.sum | 64 ++++++++++++---------------------- pkg/workflow/history.go | 76 ++++++++++++++++------------------------- 3 files changed, 65 insertions(+), 109 deletions(-) diff --git a/go.mod b/go.mod index ff72dc80f..4da4825dc 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,23 @@ module github.com/dapr/cli -go 1.26.0 +go 1.26.2 require ( github.com/Masterminds/semver v1.5.0 github.com/Masterminds/semver/v3 v3.3.0 github.com/Pallinder/sillyname-go v0.0.0-20130730142914-97aeae9e6ba1 github.com/briandowns/spinner v1.19.0 - github.com/dapr/dapr v1.17.0-rc.8 + github.com/dapr/dapr v1.17.0-rc.1.0.20260409185128-2e4aff616422 github.com/dapr/durabletask-go v0.11.4-0.20260408193502-7e0554e3883e github.com/dapr/go-sdk v1.13.0 github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b - github.com/diagridio/go-etcd-cron v0.12.3 + github.com/diagridio/go-etcd-cron v0.12.4 github.com/docker/docker v28.5.2+incompatible github.com/evanphx/json-patch/v5 v5.9.0 github.com/fatih/color v1.17.0 github.com/go-sql-driver/mysql v1.8.1 github.com/gocarina/gocsv v0.0.0-20220927221512-ad3251f9fa25 - github.com/google/go-containerregistry v0.21.3 + github.com/google/go-containerregistry v0.21.4 github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/go-version v1.6.0 github.com/jackc/pgx/v5 v5.7.4 @@ -92,19 +92,17 @@ require ( github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cyphar/filepath-securejoin v0.6.1 // indirect - github.com/dapr/components-contrib v1.16.2-0.20260212154145-4a37800d3727 // indirect + github.com/dapr/components-contrib v1.17.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.0 // indirect - github.com/docker/cli v29.3.0+incompatible // indirect - github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/cli v29.3.1+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-events v0.0.0-20250808211157-605354379745 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect @@ -127,7 +125,7 @@ require ( github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect @@ -159,14 +157,14 @@ require ( github.com/jmoiron/sqlx v1.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.4 // indirect + github.com/klauspost/compress v1.18.5 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect - github.com/lestrrat-go/blackmagic v1.0.2 // indirect + github.com/lestrrat-go/blackmagic v1.0.3 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect - github.com/lestrrat-go/httprc v1.0.5 // indirect + github.com/lestrrat-go/httprc v1.0.6 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect - github.com/lestrrat-go/jwx/v2 v2.0.21 // indirect + github.com/lestrrat-go/jwx/v2 v2.1.6 // indirect github.com/lestrrat-go/option v1.0.1 // indirect github.com/lib/pq v1.10.9 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect @@ -190,7 +188,6 @@ require ( github.com/montanaflynn/stats v0.7.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect - github.com/ncruces/go-strftime v0.1.9 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect @@ -206,7 +203,6 @@ require ( github.com/prometheus/common v0.64.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rubenv/sql-migrate v1.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect @@ -272,10 +268,6 @@ require ( k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/kubectl v0.33.3 // indirect k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 // indirect - modernc.org/libc v1.61.9 // indirect - modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.8.2 // indirect - modernc.org/sqlite v1.34.5 // indirect oras.land/oras-go/v2 v2.6.0 // indirect sigs.k8s.io/controller-runtime v0.19.0 // indirect sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect @@ -284,3 +276,5 @@ require ( sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect ) + +// replace github.com/dapr/dapr => ../dapr diff --git a/go.sum b/go.sum index 1b64d2881..6ea73d1d0 100644 --- a/go.sum +++ b/go.sum @@ -160,40 +160,34 @@ github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE= github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1AX0a9kM5XL+NwKoYSc= -github.com/dapr/components-contrib v1.16.2-0.20260212154145-4a37800d3727 h1:qSvkGkWPd+4bIEpVoAwxNGh76UlS5/cd1lE6FjzUJtA= -github.com/dapr/components-contrib v1.16.2-0.20260212154145-4a37800d3727/go.mod h1:CrBOZVPMKdnblS9AjHGw02LGr9JVlNbgqiISwQeGVW8= -github.com/dapr/dapr v1.17.0-rc.8 h1:CZTPQRwX7sO9H4wKrVnnV6w1foKWLP89wtAJY/bL5KQ= -github.com/dapr/dapr v1.17.0-rc.8/go.mod h1:GZq8BjQaX3BbMmZET4HDe6Rrv58yC1pHNVQod3bIAVk= -github.com/dapr/durabletask-go v0.11.0 h1:e9Ns/3a2b6JDKGuvksvx6gCHn7rd+nwZZyAXbg5Ley4= -github.com/dapr/durabletask-go v0.11.0/go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q= +github.com/dapr/components-contrib v1.17.3 h1:lhSvLZ1nGGkmlRKCpzgNEsnNXqOWjFlhAtp1Rjxp8HU= +github.com/dapr/components-contrib v1.17.3/go.mod h1:lVPRj9ywzkUWoKXxRTAJbvS+Vg8A882av/nynGstNE4= +github.com/dapr/dapr v1.17.0-rc.1.0.20260409185128-2e4aff616422 h1:gSMftYDUZ0/q/kD/8y3vm4XUdneT/ptdj1Ow9qL0qr0= +github.com/dapr/dapr v1.17.0-rc.1.0.20260409185128-2e4aff616422/go.mod h1:FDERusHLXTmlIxUN1bRn4E8gnVGuYfz9ZgXRnOawufg= github.com/dapr/durabletask-go v0.11.4-0.20260408193502-7e0554e3883e h1:/ZE9swGMPaaaoo2wJNjC4xzDaQRaAk0m9yddSo7YRlo= github.com/dapr/durabletask-go v0.11.4-0.20260408193502-7e0554e3883e/go.mod h1:nElJPTX9FmveqErAmvTXZrAmt2nnyTQ7Glj0ahPphSY= github.com/dapr/go-sdk v1.13.0 h1:Qw2BmUonClQ9yK/rrEEaFL1PyDgq616RrvYj0CT67Lk= github.com/dapr/go-sdk v1.13.0/go.mod h1:RsffVNZitDApmQqoS68tNKGMXDZUjTviAbKZupJSzts= -github.com/dapr/kit v0.16.2-0.20251124175541-3ac186dff64d h1:csljij9d1IO6u9nqbg+TuSRmTZ+OXT8G49yh6zie1yI= -github.com/dapr/kit v0.16.2-0.20251124175541-3ac186dff64d/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM= github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b h1:hXbRlNKvmMGbiMSRy3MX04kH5OiMgH82PRuLN7adtwE= github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b/go.mod h1:2v02LZdXzPmOadxoT6EMEt0bsEYe6h1fn2ndYWmylCg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/diagridio/go-etcd-cron v0.12.3 h1:KfA//9LcktVeFFHSVv1MZ+Ui5U0fIAPFq1db7mzKPw4= -github.com/diagridio/go-etcd-cron v0.12.3/go.mod h1:XpjpGLT4WzS/eE+20h4aUl2yFtudShbrKK7cPQMtMJ0= +github.com/diagridio/go-etcd-cron v0.12.4 h1:pc0Jk0M5MjrQ7uGydYuX93dKzWfulInA8XAh+i7GQFI= +github.com/diagridio/go-etcd-cron v0.12.4/go.mod h1:XpjpGLT4WzS/eE+20h4aUl2yFtudShbrKK7cPQMtMJ0= github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM= github.com/distribution/distribution/v3 v3.0.0/go.mod h1:tRNuFoZsUdyRVegq8xGNeds4KLjwLCRin/tTo6i1DhU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk= -github.com/docker/cli v29.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= -github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/cli v29.3.1+incompatible h1:M04FDj2TRehDacrosh7Vlkgc7AuQoWloQkf1PA5hmoI= +github.com/docker/cli v29.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= @@ -206,8 +200,6 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -288,8 +280,8 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gocarina/gocsv v0.0.0-20220927221512-ad3251f9fa25 h1:wxgEEZvsnOTrDO2npSSKUMDx5IykfoGmro+/Vjc1BQ8= github.com/gocarina/gocsv v0.0.0-20220927221512-ad3251f9fa25/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -358,8 +350,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-containerregistry v0.21.3 h1:Xr+yt3VvwOOn/5nJzd7UoOhwPGiPkYW0zWDLLUXqAi4= -github.com/google/go-containerregistry v0.21.3/go.mod h1:D5ZrJF1e6dMzvInpBPuMCX0FxURz7GLq2rV3Us9aPkc= +github.com/google/go-containerregistry v0.21.4 h1:VrhlIQtdhE6riZW//MjPrcJ1snAjPoCCpPHqGOygrv8= +github.com/google/go-containerregistry v0.21.4/go.mod h1:kxgc23zQ2qMY/hAKt0wCbB/7tkeovAP2mE2ienynJUw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -449,8 +441,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= -github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= +github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/kolesnikovae/go-winjob v1.0.0 h1:OKEtCHB3sYNAiqNwGDhf08Y6luM7C8mP+42rp1N6SeE= github.com/kolesnikovae/go-winjob v1.0.0/go.mod h1:k0joOLP3/NBrRmDQjPV2+oN1TPmEWt6arTNtFjVeQuM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -469,16 +461,16 @@ github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k= -github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU= +github.com/lestrrat-go/blackmagic v1.0.3 h1:94HXkVLxkZO9vJI/w2u1T0DAoprShFd13xtnSINtDWs= +github.com/lestrrat-go/blackmagic v1.0.3/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= -github.com/lestrrat-go/httprc v1.0.5 h1:bsTfiH8xaKOJPrg1R+E3iE/AWZr/x0Phj9PBTG/OLUk= -github.com/lestrrat-go/httprc v1.0.5/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo= +github.com/lestrrat-go/httprc v1.0.6 h1:qgmgIRhpvBqexMJjA/PmwSvhNk679oqD1RbovdCGW8k= +github.com/lestrrat-go/httprc v1.0.6/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo= github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= -github.com/lestrrat-go/jwx/v2 v2.0.21 h1:jAPKupy4uHgrHFEdjVjNkUgoBKtVDgrQPB/h55FHrR0= -github.com/lestrrat-go/jwx/v2 v2.0.21/go.mod h1:09mLW8zto6bWL9GbwnqAli+ArLf+5M33QLQPDggkUWM= +github.com/lestrrat-go/jwx/v2 v2.1.6 h1:hxM1gfDILk/l5ylers6BX/Eq1m/pnxe9NBwW6lVfecA= +github.com/lestrrat-go/jwx/v2 v2.1.6/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= @@ -546,8 +538,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= -github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAmxBiA= github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -625,8 +615,6 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= @@ -1177,14 +1165,6 @@ k8s.io/kubectl v0.33.3 h1:r/phHvH1iU7gO/l7tTjQk2K01ER7/OAJi8uFHHyWSac= k8s.io/kubectl v0.33.3/go.mod h1:euj2bG56L6kUGOE/ckZbCoudPwuj4Kud7BR0GzyNiT0= k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979 h1:jgJW5IePPXLGB8e/1wvd0Ich9QE97RvvF3a8J3fP/Lg= k8s.io/utils v0.0.0-20250502105355-0f33e8f1c979/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -modernc.org/libc v1.61.9 h1:PLSBXVkifXGELtJ5BOnBUyAHr7lsatNwFU/RRo4kfJM= -modernc.org/libc v1.61.9/go.mod h1:61xrnzk/aR8gr5bR7Uj/lLFLuXu2/zMpIjcry63Eumk= -modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= -modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.8.2 h1:cL9L4bcoAObu4NkxOlKWBWtNHIsnnACGF/TbqQ6sbcI= -modernc.org/memory v1.8.2/go.mod h1:ZbjSvMO5NQ1A2i3bWeDiVMxIorXwdClKE/0SZ+BMotU= -modernc.org/sqlite v1.34.5 h1:Bb6SR13/fjp15jt70CL4f18JIN7p7dnMExd+UFnF15g= -modernc.org/sqlite v1.34.5/go.mod h1:YLuNmX9NKs8wRNK2ko1LW1NGYcc9FkBO69JOt1AR9JE= oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc= oras.land/oras-go/v2 v2.6.0/go.mod h1:magiQDfG6H1O9APp+rOsvCPcW1GD2MM7vgnKY0Y+u1o= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/pkg/workflow/history.go b/pkg/workflow/history.go index 68293da84..0508a9a0e 100644 --- a/pkg/workflow/history.go +++ b/pkg/workflow/history.go @@ -154,9 +154,9 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide switch t := ev.GetEventType().(type) { case *protos.HistoryEvent_ExecutionStarted: - if t.ExecutionStarted.OrchestrationInstance != nil && - t.ExecutionStarted.OrchestrationInstance.ExecutionId != nil { - execID := t.ExecutionStarted.OrchestrationInstance.ExecutionId.Value + if t.ExecutionStarted.WorkflowInstance != nil && + t.ExecutionStarted.WorkflowInstance.ExecutionId != nil { + execID := t.ExecutionStarted.WorkflowInstance.ExecutionId.Value row.ExecutionID = &execID } if t.ExecutionStarted.Input != nil { @@ -188,9 +188,9 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide if t.TaskCompleted.Result != nil { row.addAttr("output", trim(t.TaskCompleted.Result, 120)) } - case *protos.HistoryEvent_OrchestratorStarted: - if t.OrchestratorStarted.Version != nil { - version := t.OrchestratorStarted.GetVersion() + case *protos.HistoryEvent_WorkflowStarted: + if t.WorkflowStarted.Version != nil { + version := t.WorkflowStarted.GetVersion() if version.Name != nil { row.addAttr("versionName", *version.Name) } @@ -198,13 +198,13 @@ func HistoryWide(ctx context.Context, opts HistoryOptions) ([]*HistoryOutputWide row.addAttr("versionPatches", strings.Join(version.Patches, ",")) } } - case *protos.HistoryEvent_SubOrchestrationInstanceCreated: - if t.SubOrchestrationInstanceCreated.Input != nil { - row.addAttr("input", trim(t.SubOrchestrationInstanceCreated.Input, 120)) + case *protos.HistoryEvent_ChildWorkflowInstanceCreated: + if t.ChildWorkflowInstanceCreated.Input != nil { + row.addAttr("input", trim(t.ChildWorkflowInstanceCreated.Input, 120)) } - case *protos.HistoryEvent_SubOrchestrationInstanceCompleted: - if t.SubOrchestrationInstanceCompleted.Result != nil { - row.addAttr("output", trim(t.SubOrchestrationInstanceCompleted.Result, 120)) + case *protos.HistoryEvent_ChildWorkflowInstanceCompleted: + if t.ChildWorkflowInstanceCompleted.Result != nil { + row.addAttr("output", trim(t.ChildWorkflowInstanceCompleted.Result, 120)) } case *protos.HistoryEvent_TaskFailed: row.addAttr("scheduledId", fmt.Sprintf("%d", t.TaskFailed.TaskScheduledId)) @@ -284,28 +284,24 @@ func eventTypeName(h *protos.HistoryEvent) string { return "TaskCompleted" case *protos.HistoryEvent_TaskFailed: return "TaskFailed" - case *protos.HistoryEvent_SubOrchestrationInstanceCreated: - return "SubOrchCreated" - case *protos.HistoryEvent_SubOrchestrationInstanceCompleted: - return "SubOrchCompleted" - case *protos.HistoryEvent_SubOrchestrationInstanceFailed: - return "SubOrchFailed" + case *protos.HistoryEvent_ChildWorkflowInstanceCreated: + return "ChildWorkflowCreated" + case *protos.HistoryEvent_ChildWorkflowInstanceCompleted: + return "ChildWorkflowCompleted" + case *protos.HistoryEvent_ChildWorkflowInstanceFailed: + return "ChildWorkflowFailed" case *protos.HistoryEvent_TimerCreated: return "TimerCreated" case *protos.HistoryEvent_TimerFired: return "TimerFired" - case *protos.HistoryEvent_OrchestratorStarted: - return "OrchestratorStarted" - case *protos.HistoryEvent_OrchestratorCompleted: - return "OrchestratorCompleted" + case *protos.HistoryEvent_WorkflowStarted: + return "WorkflowStarted" + case *protos.HistoryEvent_WorkflowCompleted: + return "WorkflowCompleted" case *protos.HistoryEvent_EventSent: return "EventSent" case *protos.HistoryEvent_EventRaised: return "EventRaised" - case *protos.HistoryEvent_GenericEvent: - return "GenericEvent" - case *protos.HistoryEvent_HistoryState: - return "HistoryState" case *protos.HistoryEvent_ContinueAsNew: return "ContinueAsNew" case *protos.HistoryEvent_ExecutionSuspended: @@ -314,20 +310,6 @@ func eventTypeName(h *protos.HistoryEvent) string { return "ExecutionResumed" case *protos.HistoryEvent_ExecutionStalled: return "ExecutionStalled" - case *protos.HistoryEvent_EntityOperationSignaled: - return "EntitySignaled" - case *protos.HistoryEvent_EntityOperationCalled: - return "EntityCalled" - case *protos.HistoryEvent_EntityOperationCompleted: - return "EntityCompleted" - case *protos.HistoryEvent_EntityOperationFailed: - return "EntityFailed" - case *protos.HistoryEvent_EntityLockRequested: - return "EntityLockRequested" - case *protos.HistoryEvent_EntityLockGranted: - return "EntityLockGranted" - case *protos.HistoryEvent_EntityUnlockSent: - return "EntityUnlockSent" default: return "Unknown" } @@ -341,8 +323,8 @@ func deriveName(h *protos.HistoryEvent) *string { return nil case *protos.HistoryEvent_TaskFailed: return nil - case *protos.HistoryEvent_SubOrchestrationInstanceCreated: - return ptr.Of(t.SubOrchestrationInstanceCreated.Name) + case *protos.HistoryEvent_ChildWorkflowInstanceCreated: + return ptr.Of(t.ChildWorkflowInstanceCreated.Name) case *protos.HistoryEvent_TimerCreated: if t.TimerCreated.Name != nil { return ptr.Of(*t.TimerCreated.Name) @@ -362,7 +344,7 @@ func deriveStatus(h *protos.HistoryEvent) string { case *protos.HistoryEvent_TaskFailed: return "FAILED" case *protos.HistoryEvent_ExecutionCompleted: - return (workflow.WorkflowMetadata{RuntimeStatus: t.ExecutionCompleted.OrchestrationStatus}).String() + return (workflow.WorkflowMetadata{RuntimeStatus: t.ExecutionCompleted.WorkflowStatus}).String() case *protos.HistoryEvent_ExecutionTerminated: return "TERMINATED" case *protos.HistoryEvent_ExecutionSuspended: @@ -408,13 +390,13 @@ func deriveDetails(first *protos.HistoryEvent, h *protos.HistoryEvent) *string { return ptr.Of(fmt.Sprintf("eventId=%d", t.TaskCompleted.TaskScheduledId)) case *protos.HistoryEvent_ExecutionCompleted: return ptr.Of(fmt.Sprintf("execDuration=%s", utils.HumanizeDuration(h.GetTimestamp().AsTime().Sub(first.GetTimestamp().AsTime())))) - case *protos.HistoryEvent_SubOrchestrationInstanceCreated: - if in := t.SubOrchestrationInstanceCreated.RerunParentInstanceInfo; in != nil { + case *protos.HistoryEvent_ChildWorkflowInstanceCreated: + if in := t.ChildWorkflowInstanceCreated.RerunParentInstanceInfo; in != nil { return ptr.Of(fmt.Sprintf("rerunParent=%s", in.InstanceID)) } return nil - case *protos.HistoryEvent_SubOrchestrationInstanceCompleted: - return ptr.Of(fmt.Sprintf("eventId=%d", t.SubOrchestrationInstanceCompleted.GetTaskScheduledId())) + case *protos.HistoryEvent_ChildWorkflowInstanceCompleted: + return ptr.Of(fmt.Sprintf("eventId=%d", t.ChildWorkflowInstanceCompleted.GetTaskScheduledId())) default: return nil } From 93ef5a00c6afef3f60b6b403a0cc5bf33be2302b Mon Sep 17 00:00:00 2001 From: Albert Callarisa Date: Mon, 11 May 2026 17:18:11 +0200 Subject: [PATCH 4/5] Revert unnecessary go mod changes Signed-off-by: Albert Callarisa --- go.mod | 7 ++++--- go.sum | 14 ++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7178d0aed..e31a14166 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/fatih/color v1.17.0 github.com/go-sql-driver/mysql v1.8.1 github.com/gocarina/gocsv v0.0.0-20220927221512-ad3251f9fa25 - github.com/google/go-containerregistry v0.21.4 + github.com/google/go-containerregistry v0.21.3 github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/go-version v1.6.0 github.com/jackc/pgx/v5 v5.7.4 @@ -97,7 +97,8 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.0 // indirect - github.com/docker/cli v29.3.1+incompatible // indirect + github.com/docker/cli v29.3.0+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-events v0.0.0-20250808211157-605354379745 // indirect @@ -156,7 +157,7 @@ require ( github.com/jmoiron/sqlx v1.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.5 // indirect + github.com/klauspost/compress v1.18.4 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lestrrat-go/blackmagic v1.0.3 // indirect diff --git a/go.sum b/go.sum index fd4daf2e3..dbe99eaa0 100644 --- a/go.sum +++ b/go.sum @@ -184,8 +184,10 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v29.3.1+incompatible h1:M04FDj2TRehDacrosh7Vlkgc7AuQoWloQkf1PA5hmoI= -github.com/docker/cli v29.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk= +github.com/docker/cli v29.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= @@ -348,8 +350,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-containerregistry v0.21.4 h1:VrhlIQtdhE6riZW//MjPrcJ1snAjPoCCpPHqGOygrv8= -github.com/google/go-containerregistry v0.21.4/go.mod h1:kxgc23zQ2qMY/hAKt0wCbB/7tkeovAP2mE2ienynJUw= +github.com/google/go-containerregistry v0.21.3 h1:Xr+yt3VvwOOn/5nJzd7UoOhwPGiPkYW0zWDLLUXqAi4= +github.com/google/go-containerregistry v0.21.3/go.mod h1:D5ZrJF1e6dMzvInpBPuMCX0FxURz7GLq2rV3Us9aPkc= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -439,8 +441,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= -github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= +github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/kolesnikovae/go-winjob v1.0.0 h1:OKEtCHB3sYNAiqNwGDhf08Y6luM7C8mP+42rp1N6SeE= github.com/kolesnikovae/go-winjob v1.0.0/go.mod h1:k0joOLP3/NBrRmDQjPV2+oN1TPmEWt6arTNtFjVeQuM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From d9317ad91de6cb214c9a1763c5f73bd597215d06 Mon Sep 17 00:00:00 2001 From: Nelson Parente Date: Wed, 20 May 2026 16:32:58 +0100 Subject: [PATCH 5/5] test(e2e): emit timer origin and clean up timer-origin instances The 4 TestWorkflowHistory/timer_origin_* subtests have been failing in CI because the test worker app in tests/apps/workflow was still pinned to github.com/dapr/durabletask-go v0.10.0. That release predates the addition of the CreateTimerAction.Origin field, so even though the runtime and the CLI both decode Origin correctly, the worker never sets it -- the resulting TimerCreatedEvent has no Origin and the history command shows no `origin=` attr, so require.Eventually times out with "Condition never satisfied". Bump the worker app's durabletask-go to the same commit the CLI's main go.mod uses (c4b7279, pre-rename so API surface is still compatible with go-sdk v1.13.0). That version emits Origin for createTimer, externalEvent, activityRetry, and childWorkflowRetry. Also address Copilot's outstanding review comment by adding t.Cleanup to each timer-origin subtest. WTimer creates a 10h timer and EventWorkflow waits on an external event for 1h, so without cleanup those instances stay RUNNING in the state store and leak into later E2E runs. Each subtest now terminates and purges its own instance, and the instance ID is hoisted into a local const for readability. Signed-off-by: Nelson Parente --- tests/apps/workflow/go.mod | 38 +++++++++++------- tests/apps/workflow/go.sum | 51 ++++++++++++++++++++++++ tests/e2e/standalone/workflow_test.go | 57 ++++++++++++++++++++------- 3 files changed, 117 insertions(+), 29 deletions(-) diff --git a/tests/apps/workflow/go.mod b/tests/apps/workflow/go.mod index 9beb717cc..b71ab2f98 100644 --- a/tests/apps/workflow/go.mod +++ b/tests/apps/workflow/go.mod @@ -1,29 +1,39 @@ module workflow -go 1.24.7 +go 1.26.0 require ( - github.com/dapr/durabletask-go v0.10.0 + github.com/dapr/durabletask-go v0.11.4-0.20260413145313-c4b7279b6a8e github.com/dapr/go-sdk v1.13.0 - github.com/dapr/kit v0.16.1 + github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b ) require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/dapr/dapr v1.16.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/sirupsen/logrus v1.9.3 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel v1.36.0 // indirect - go.opentelemetry.io/otel/metric v1.36.0 // indirect - go.opentelemetry.io/otel/trace v1.36.0 // indirect - golang.org/x/net v0.41.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/text v0.26.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect - google.golang.org/grpc v1.73.0 // indirect - google.golang.org/protobuf v1.36.6 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect + golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect + golang.org/x/net v0.52.0 // indirect + golang.org/x/sys v0.42.0 // indirect + golang.org/x/text v0.35.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 // indirect + google.golang.org/grpc v1.79.3 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + modernc.org/libc v1.61.9 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.8.2 // indirect + modernc.org/sqlite v1.34.5 // indirect ) diff --git a/tests/apps/workflow/go.sum b/tests/apps/workflow/go.sum index deeb81574..47ac3ee95 100644 --- a/tests/apps/workflow/go.sum +++ b/tests/apps/workflow/go.sum @@ -1,20 +1,30 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/dapr/dapr v1.16.0 h1:la2WLZM8Myr2Pq3cyrFjHKWDSPYLzGZCs3p502TwBjI= github.com/dapr/dapr v1.16.0/go.mod h1:ln/mxvNOeqklaDmic4ppsxmnjl2D/oZGKaJy24IwaEY= github.com/dapr/durabletask-go v0.10.0 h1:vfIivPl4JYd55xZTslDwhA6p6F8ipcNxBtMaupxArr8= github.com/dapr/durabletask-go v0.10.0/go.mod h1:0Ts4rXp74JyG19gDWPcwNo5V6NBZzhARzHF5XynmA7Q= +github.com/dapr/durabletask-go v0.11.4-0.20260413145313-c4b7279b6a8e h1:SSBxGb1/dOmzyWZhKNHVliw/VemiYgLKlv8oOTIsGG0= +github.com/dapr/durabletask-go v0.11.4-0.20260413145313-c4b7279b6a8e/go.mod h1:nElJPTX9FmveqErAmvTXZrAmt2nnyTQ7Glj0ahPphSY= github.com/dapr/go-sdk v1.13.0 h1:Qw2BmUonClQ9yK/rrEEaFL1PyDgq616RrvYj0CT67Lk= github.com/dapr/go-sdk v1.13.0/go.mod h1:RsffVNZitDApmQqoS68tNKGMXDZUjTviAbKZupJSzts= github.com/dapr/kit v0.16.1 h1:MqLAhHVg8trPy2WJChMZFU7ToeondvxcNHYVvMDiVf4= github.com/dapr/kit v0.16.1/go.mod h1:40ZWs5P6xfYf7O59XgwqZkIyDldTIXlhTQhGop8QoSM= +github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b h1:hXbRlNKvmMGbiMSRy3MX04kH5OiMgH82PRuLN7adtwE= +github.com/dapr/kit v0.17.1-0.20260402173438-be272d92042b/go.mod h1:2v02LZdXzPmOadxoT6EMEt0bsEYe6h1fn2ndYWmylCg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -27,45 +37,86 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM= +golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8= golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5 h1:aJmi6DVGGIStN9Mobk/tZOOQUBbj0BPjZjjnOdoZKts= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260316180232-0b37fe3546d5/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= +google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= +google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +modernc.org/libc v1.61.9 h1:PLSBXVkifXGELtJ5BOnBUyAHr7lsatNwFU/RRo4kfJM= +modernc.org/libc v1.61.9/go.mod h1:61xrnzk/aR8gr5bR7Uj/lLFLuXu2/zMpIjcry63Eumk= +modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= +modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= +modernc.org/memory v1.8.2 h1:cL9L4bcoAObu4NkxOlKWBWtNHIsnnACGF/TbqQ6sbcI= +modernc.org/memory v1.8.2/go.mod h1:ZbjSvMO5NQ1A2i3bWeDiVMxIorXwdClKE/0SZ+BMotU= +modernc.org/sqlite v1.34.5 h1:Bb6SR13/fjp15jt70CL4f18JIN7p7dnMExd+UFnF15g= +modernc.org/sqlite v1.34.5/go.mod h1:YLuNmX9NKs8wRNK2ko1LW1NGYcc9FkBO69JOt1AR9JE= diff --git a/tests/e2e/standalone/workflow_test.go b/tests/e2e/standalone/workflow_test.go index a37151113..26a518dd5 100644 --- a/tests/e2e/standalone/workflow_test.go +++ b/tests/e2e/standalone/workflow_test.go @@ -735,15 +735,23 @@ func TestWorkflowHistory(t *testing.T) { t.Run("timer origin createTimer", func(t *testing.T) { // WTimer calls ctx.CreateTimer which produces origin=createTimer. - _, err := cmdWorkflowRun(appID, "WTimer", "--instance-id=timer-origin-test") + // The timer fires after 10h, so the instance will stay RUNNING; the + // cleanup below terminates and purges it so it doesn't leak into + // subsequent runs. + const instanceID = "timer-origin-test" + _, err := cmdWorkflowRun(appID, "WTimer", "--instance-id="+instanceID) require.NoError(t, err) + t.Cleanup(func() { + _, _ = cmdWorkflowTerminate(appID, instanceID) + _, _ = cmdWorkflowPurge(appID, redisConnString, instanceID) + }) require.Eventually(t, func() bool { - out, err := cmdWorkflowHistory(appID, "timer-origin-test") + out, err := cmdWorkflowHistory(appID, instanceID) return err == nil && strings.Contains(out, "origin=createTimer") }, 10*time.Second, 200*time.Millisecond) - output, err := cmdWorkflowHistory(appID, "timer-origin-test", "-o", "json") + output, err := cmdWorkflowHistory(appID, instanceID, "-o", "json") require.NoError(t, err) var history []map[string]interface{} @@ -762,17 +770,22 @@ func TestWorkflowHistory(t *testing.T) { }) t.Run("timer origin externalEvent", func(t *testing.T) { - // EventWorkflow calls ctx.WaitForExternalEvent("test-event", time.Hour) - // which produces origin=externalEvent(test-event). - _, err := cmdWorkflowRun(appID, "EventWorkflow", "--instance-id=event-origin-test") + // EventWorkflow waits on an external event with a 1h timeout, so the + // instance will stay RUNNING; cleanup terminates and purges it. + const instanceID = "event-origin-test" + _, err := cmdWorkflowRun(appID, "EventWorkflow", "--instance-id="+instanceID) require.NoError(t, err) + t.Cleanup(func() { + _, _ = cmdWorkflowTerminate(appID, instanceID) + _, _ = cmdWorkflowPurge(appID, redisConnString, instanceID) + }) require.Eventually(t, func() bool { - out, err := cmdWorkflowHistory(appID, "event-origin-test") + out, err := cmdWorkflowHistory(appID, instanceID) return err == nil && strings.Contains(out, "origin=externalEvent(test-event)") }, 10*time.Second, 200*time.Millisecond) - output, err := cmdWorkflowHistory(appID, "event-origin-test", "-o", "json") + output, err := cmdWorkflowHistory(appID, instanceID, "-o", "json") require.NoError(t, err) var history []map[string]interface{} @@ -793,16 +806,23 @@ func TestWorkflowHistory(t *testing.T) { t.Run("timer origin activityRetry", func(t *testing.T) { // ActivityRetryWorkflow calls a failing activity with retry policy, - // producing TimerCreated events with origin=activityRetry. - _, err := cmdWorkflowRun(appID, "ActivityRetryWorkflow", "--instance-id=activity-retry-origin-test") + // producing TimerCreated events with origin=activityRetry. The + // workflow itself fails after retries are exhausted; cleanup purges + // the terminal instance so it doesn't accumulate across runs. + const instanceID = "activity-retry-origin-test" + _, err := cmdWorkflowRun(appID, "ActivityRetryWorkflow", "--instance-id="+instanceID) require.NoError(t, err) + t.Cleanup(func() { + _, _ = cmdWorkflowTerminate(appID, instanceID) + _, _ = cmdWorkflowPurge(appID, redisConnString, instanceID) + }) require.Eventually(t, func() bool { - out, err := cmdWorkflowHistory(appID, "activity-retry-origin-test") + out, err := cmdWorkflowHistory(appID, instanceID) return err == nil && strings.Contains(out, "origin=activityRetry(") }, 15*time.Second, 250*time.Millisecond) - output, err := cmdWorkflowHistory(appID, "activity-retry-origin-test", "-o", "json") + output, err := cmdWorkflowHistory(appID, instanceID, "-o", "json") require.NoError(t, err) var history []map[string]interface{} @@ -823,15 +843,22 @@ func TestWorkflowHistory(t *testing.T) { t.Run("timer origin childWorkflowRetry", func(t *testing.T) { // ChildWorkflowRetryWorkflow calls a failing child workflow with retry // policy, producing TimerCreated events with origin=childWorkflowRetry. - _, err := cmdWorkflowRun(appID, "ChildWorkflowRetryWorkflow", "--instance-id=child-retry-origin-test") + // The parent workflow fails after retries are exhausted; cleanup + // purges the terminal instance. + const instanceID = "child-retry-origin-test" + _, err := cmdWorkflowRun(appID, "ChildWorkflowRetryWorkflow", "--instance-id="+instanceID) require.NoError(t, err) + t.Cleanup(func() { + _, _ = cmdWorkflowTerminate(appID, instanceID) + _, _ = cmdWorkflowPurge(appID, redisConnString, instanceID) + }) require.Eventually(t, func() bool { - out, err := cmdWorkflowHistory(appID, "child-retry-origin-test") + out, err := cmdWorkflowHistory(appID, instanceID) return err == nil && strings.Contains(out, "origin=childWorkflowRetry(") }, 30*time.Second, 500*time.Millisecond) - output, err := cmdWorkflowHistory(appID, "child-retry-origin-test", "-o", "json") + output, err := cmdWorkflowHistory(appID, instanceID, "-o", "json") require.NoError(t, err) var history []map[string]interface{}