Add timer origin to the history information#1627
Conversation
Signed-off-by: Albert Callarisa <albert@diagrid.io>
There was a problem hiding this comment.
Pull request overview
Adds display of timer origin information in workflow history output (details + attrs) and validates it via unit and e2e tests.
Changes:
- Extend
pkg/workflowhistory formatting to surface timer origin (createTimer / externalEvent / activityRetry / childWorkflowRetry). - Add unit tests for origin formatting and details derivation.
- Add e2e coverage and supporting test workflows/activities for retry-origin timers; bump related Go module deps.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/standalone/workflow_test.go | Adds e2e assertions that history output includes timer origin in both text details and JSON attrs. |
| tests/apps/workflow/app.go | Registers new workflows/activities used to generate retry-origin timer events in e2e. |
| pkg/workflow/history.go | Adds origin decoding into history “Attrs” and “Details” output. |
| pkg/workflow/history_test.go | New unit tests for timer origin formatting and inclusion in derived details. |
| go.mod | Bumps durabletask-go + kit and adds new indirect deps. |
| go.sum | Updates sums for the module changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Albert Callarisa <albert@diagrid.io>
|
Waiting for #1629 to be merged |
Signed-off-by: Samantha Coyle <sam@diagrid.io> Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
| // WTimer calls ctx.CreateTimer which produces origin=createTimer. | ||
| _, err := cmdWorkflowRun(appID, "WTimer", "--instance-id=timer-origin-test") | ||
| require.NoError(t, err) | ||
|
|
cicoyle
left a comment
There was a problem hiding this comment.
changes mostly lgtm but there are test failures still from this PR - please take a look and address it and copilots feedback:
time="2026-05-12T16:21:38.006246853Z" level=info msg="Workflow Actor 'child-retry-origin-test:0002': workflow completed with status 'ORCHESTRATION_STATUS_FAILED' workflowName 'FailingChildWorkflow'" app_id=test-workflow instance=runnervmeorf1 scope=dapr.runtime.actors.targets.orchestrator type=log ver=1.18.0-rc.3
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 <nelson_parente@live.com.pt>
|
Hi @acroca — I pushed d9317ad directly to this branch ( Root cause of the 4 failing subtestsThe
So the CLI code in this PR is correct; the worker just wasn't producing the field. Fix
Verification done locally
E2E will run on CI for the real verification. |
Timers have
originnow. This PR displays the timer origin.