feat(workflow): align history propagation API with go-sdk#1047
Open
nelson-parente wants to merge 1 commit into
Open
feat(workflow): align history propagation API with go-sdk#1047nelson-parente wants to merge 1 commit into
nelson-parente wants to merge 1 commit into
Conversation
Cassie (durabletask-go author) flagged divergence between python-sdk dapr#1025 and the freshly-renamed go-sdk helpers in durabletask-go dapr#105 (merged 2026-05-19, after dapr#1025 landed). This brings python-sdk's surface back in line for cross-SDK parity before 1.18 ships. Read API renames (mirror durabletask-go GetLast*ByName): - PropagatedHistory.get_workflow_by_name -> get_last_workflow_by_name - WorkflowResult.get_activity_by_name -> get_last_activity_by_name - WorkflowResult.get_child_workflow_by_name -> get_last_child_workflow_by_name Plural variants (get_workflows_by_name, get_activities_by_name, get_child_workflows_by_name) and the chain-level helpers are unchanged. Scheduling helpers (mirror go-sdk workflow.PropagateLineage / workflow.PropagateOwnHistory): - propagate_lineage() -> PropagationScope.LINEAGE - propagate_own_history() -> PropagationScope.OWN_HISTORY PropagationScope enum is kept as the underlying value, so both `propagation=propagate_lineage()` and `propagation=PropagationScope.LINEAGE` work. Example, README snippet, and tests updated to use the renamed/new surface. No runtime/proto changes. Refs: dapr#1001, dapr/durabletask-go#105, dapr/go-sdk#823 Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1047 +/- ##
==========================================
- Coverage 86.63% 82.47% -4.16%
==========================================
Files 84 146 +62
Lines 4473 14509 +10036
==========================================
+ Hits 3875 11966 +8091
- Misses 598 2543 +1945 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the workflow history propagation surface added in #1025 with the freshly-renamed go-sdk helpers (durabletask-go#105, merged 2026-05-19). That rename landed four days after #1025 merged, so this is drift, not a defect — Cassie flagged it post-merge while building the cross-SDK quickstarts.
This brings python-sdk back in line for cross-SDK parity before 1.18 ships.
Read API renames
Mirror durabletask-go's
GetLast*ByNameform to make it obvious these return the most-recent occurrence (with pluralget_*s_by_namesiblings for the full list):PropagatedHistory.get_workflow_by_nameget_last_workflow_by_nameWorkflowResult.get_activity_by_nameget_last_activity_by_nameWorkflowResult.get_child_workflow_by_nameget_last_child_workflow_by_namePlural variants (
get_workflows_by_name,get_activities_by_name,get_child_workflows_by_name) and chain-level helpers (get_app_ids,get_events_by_*) are unchanged.Scheduling helpers
Add factory helpers mirroring
workflow.PropagateLineage()/workflow.PropagateOwnHistory()from go-sdk:The
PropagationScopeenum is kept as the underlying value, sopropagation=PropagationScope.LINEAGEandpropagation=propagate_lineage()are both supported.Non-goals
propagation=). Renaming towith_history_propagation=would mirror go-sdk'sWithHistoryPropagation()more literally but isn't idiomatic Python; happy to follow up if reviewers prefer it.Test plan
uv run ruff check --fix && uv run ruff format— cleanuv run pytest ext/dapr-ext-workflow/tests/durabletask/test_propagation.py ext/dapr-ext-workflow/tests/durabletask/test_propagation_wiring.py— 31 passeduv run python -m unittest discover -v ./ext/dapr-ext-workflow/tests— 133 passeduv run pytest tests/examples/test_workflow.py::test_history_propagationagainst a 1.18-RC sidecar (output-based test; print statements unchanged, should still pass)References
cc @cicoyle @acroca