Add Last to the func name GetActivityByName and GetWorkflowByName & GetLastChildWorkflowByName#105
Merged
Conversation
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
JoshVanL
approved these changes
May 19, 2026
There was a problem hiding this comment.
Pull request overview
Renames two propagation API methods to make the "returns the last match" semantics explicit in their names: GetWorkflowByName → GetLastWorkflowByName and GetActivityByName → GetLastActivityByName. Doc comments and all callers in the tests are updated to match.
Changes:
- Rename
PropagatedHistory.GetWorkflowByNametoGetLastWorkflowByNameandWorkflowResult.GetActivityByNametoGetLastActivityByName, updating doc comments. - Update all test functions and call sites in
api/propagation_test.goto use the new names.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| api/propagation.go | Renames the two singular getters and updates the related doc comments. |
| api/propagation_test.go | Updates test names and call sites to the new method names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
JoshVanL
approved these changes
May 19, 2026
3 tasks
siri-varma
added a commit
to siri-varma/java-sdk
that referenced
this pull request
May 20, 2026
Address review feedback on dapr#1739: replace user-facing PropagatedHistoryChunk with WorkflowResult, mirroring dapr/durabletask-go#105. Adds typed ActivityResult and ChildWorkflowResult value types, and getLast*ByName / get*ByName lookups so callers don't walk raw history events. Renames getWorkflowByName to getLastWorkflowByName for symmetry with the new methods. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
This was referenced May 20, 2026
dapr-bot
pushed a commit
to dapr/java-sdk
that referenced
this pull request
May 22, 2026
* Apply suggestions from code review Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Refactor BookTripWorkflow to use CompensationHelper Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Add CompensationHelper class for managing compensations Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Await cancellation activities in BookTripWorkflow Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Add the new changes Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * fix violations Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Fix helper Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Modify readme Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Modify readme Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Modify readme Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update copyright year and improve comment clarity Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update copyright year to 2026 Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update HistoryPropagationScope.java Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Update ActivityHistoryPropagationTest.java Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Change to 2026 Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Fix things Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Potential fix for pull request finding Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Hide chunk concept; expose WorkflowResult with typed lookups Address review feedback on #1739: replace user-facing PropagatedHistoryChunk with WorkflowResult, mirroring dapr/durabletask-go#105. Adds typed ActivityResult and ChildWorkflowResult value types, and getLast*ByName / get*ByName lookups so callers don't walk raw history events. Renames getWorkflowByName to getLastWorkflowByName for symmetry with the new methods. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Bump copyright year to 2026 on PR files Address review feedback (#1739): the new files in this PR were stamped 2025 - update them to 2026 to match the year the work is landing. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Surface PropagatedHistoryException at parse boundaries Address review feedback (#1739): - TaskOrchestrationExecutor.execute: catch PropagatedHistoryException ahead of the generic Exception branch so a malformed payload is logged as a parse failure (not just "unhandled exception") before failing the context. - TaskActivityExecutor.execute: wrap PropagatedHistory.fromProto in a try/catch and rethrow PropagatedHistoryException with the activity name in the message, so the caller sees a typed parse failure rather than something that looks like a generic protobuf error. Adds tests for both paths driving a malformed PropagatedHistory chunk through each executor. Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> * Address comments Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> --------- Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
siri-varma
added a commit
to dapr/java-sdk
that referenced
this pull request
May 22, 2026
* Apply suggestions from code review * Refactor BookTripWorkflow to use CompensationHelper * Add CompensationHelper class for managing compensations * Await cancellation activities in BookTripWorkflow * Add the new changes * fix violations * Fix helper * Modify readme * Modify readme * Modify readme * Update copyright year and improve comment clarity * Update copyright year to 2026 * Update HistoryPropagationScope.java * Update ActivityHistoryPropagationTest.java * Change to 2026 * Fix things * Potential fix for pull request finding * Hide chunk concept; expose WorkflowResult with typed lookups Address review feedback on #1739: replace user-facing PropagatedHistoryChunk with WorkflowResult, mirroring dapr/durabletask-go#105. Adds typed ActivityResult and ChildWorkflowResult value types, and getLast*ByName / get*ByName lookups so callers don't walk raw history events. Renames getWorkflowByName to getLastWorkflowByName for symmetry with the new methods. * Bump copyright year to 2026 on PR files Address review feedback (#1739): the new files in this PR were stamped 2025 - update them to 2026 to match the year the work is landing. * Surface PropagatedHistoryException at parse boundaries Address review feedback (#1739): - TaskOrchestrationExecutor.execute: catch PropagatedHistoryException ahead of the generic Exception branch so a malformed payload is logged as a parse failure (not just "unhandled exception") before failing the context. - TaskActivityExecutor.execute: wrap PropagatedHistory.fromProto in a try/catch and rethrow PropagatedHistoryException with the activity name in the message, so the caller sees a typed parse failure rather than something that looks like a generic protobuf error. Adds tests for both paths driving a malformed PropagatedHistory chunk through each executor. * Address comments --------- (cherry picked from commit d87a84c) Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com> Co-authored-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Copilot AI
pushed a commit
to dapr/dotnet-sdk
that referenced
this pull request
May 22, 2026
Cassie (durabletask-go author) flagged the .NET surface for cross-SDK divergence post-merge of dotnet-sdk#1802 / #1818. This rewrites the public history-propagation API to match the go-sdk shape — same one the python-sdk just adopted (python-sdk#1047). Issue dotnet-sdk#1801 was closed before her review; this PR delivers what the issue originally described. Three concrete gaps closed: 1. Activity-level opt-in (was missing entirely) - PropagationScope moved from ChildWorkflowTaskOptions to base WorkflowTaskOptions; ChildWorkflowTaskOptions inherits it. - WithHistoryPropagation() extension method added on the base record. - scheduleTaskAction.HistoryPropagationScope is now wired in WorkflowOrchestrationContext.CallActivityInternalAsync so activities can opt into propagation, matching CallChildWorkflowInternalAsync. - Without this, the Go SDK's reference example (SettlePayment activity using PropagateOwnHistory) literally cannot be ported to .NET. 2. Read API rewritten as high-level resolvers (was lossy FilterBy* + a PropagatedHistoryEvent record that dropped input/output/failure payloads) - PropagatedHistory.FilterByAppId/InstanceId/WorkflowName removed. - PropagatedHistory now exposes GetWorkflows(), GetWorkflowsByName(), GetLastWorkflowByName(), GetAppIds(), GetWorkflowsByAppId(), GetWorkflowsByInstanceId(). - New WorkflowResult class with InstanceId/AppId/Name plus GetActivitiesByName(), GetLastActivityByName(), GetChildWorkflowsByName(), GetLastChildWorkflowByName() — mirrors durabletask-go's GetLastWorkflowByName / GetLastActivityByName / GetLastChildWorkflowByName renames from durabletask-go#105. - New ActivityResult record carries Name, Started, Completed, Failed, Input, Output, FailureDetails — matching the Go/Python equivalents so chain-of-custody patterns line up. - New ChildWorkflowResult record with the equivalent shape. 3. Event payload preserved internally (was discarded by ConvertChunk) - ConvertChunk in WorkflowOrchestrationContext now parses raw events, walks them to resolve TaskScheduled <-> TaskCompleted/Failed and ChildWorkflowInstanceCreated <-> ChildWorkflowInstanceCompleted/ Failed by scheduleId, and produces fully-populated ActivityResult / ChildWorkflowResult instances. SDK retries reuse TaskExecutionId so matching is on scheduleId (matching Go/Python semantics). - Public API does not leak the proto HistoryEvent type — resolution happens at construction time inside Dapr.Workflow. Additional surface additions: - PropagationNotFoundException for missing-name lookups (mirrors Python's PropagationNotFoundError / Go's error returns). - Static WorkflowHistory.PropagateLineage() / PropagateOwnHistory() factory helpers for go-sdk call-site parity. Removed (clean break — 1.18 unreleased): PropagatedHistoryEntry, PropagatedHistoryEvent, HistoryEventKind, FilterByAppId, FilterByInstanceId, FilterByWorkflowName. Tests: - WorkflowHistoryPropagationTests.cs rewritten end-to-end to cover the new resolvers, query helpers, factory helpers, activity-level scope wiring, and child-workflow-level scope wiring. - HistoryPropagationWorkflowTests.cs (integration) updated to use GetWorkflows().Count in place of Entries.Count. Refs: #1801, dapr/durabletask-go#105, dapr/go-sdk#823, dapr/python-sdk#1047 Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-authored-by: nelson-parente <20144601+nelson-parente@users.noreply.github.com>
sicoyle
pushed a commit
to GHX5T-SOL/python-sdk
that referenced
this pull request
May 26, 2026
* feat(workflow): align history propagation API with go-sdk 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> * refactor(workflow): drop propagate_lineage/propagate_own_history factories Per review feedback, Go-style factory helpers are not idiomatic Python: they obscure the actual enum value at the call site and confuse static type checkers (return annotation only shows PropagationScope, not the specific member). Use PropagationScope.LINEAGE / PropagationScope.OWN_HISTORY directly instead. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> --------- Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
WhitWaldo
added a commit
to dapr/dotnet-sdk
that referenced
this pull request
May 27, 2026
* feat(workflow): align history propagation API with go-sdk Cassie (durabletask-go author) flagged the .NET surface for cross-SDK divergence post-merge of dotnet-sdk#1802 / #1818. This rewrites the public history-propagation API to match the go-sdk shape — same one the python-sdk just adopted (python-sdk#1047). Issue dotnet-sdk#1801 was closed before her review; this PR delivers what the issue originally described. Three concrete gaps closed: 1. Activity-level opt-in (was missing entirely) - PropagationScope moved from ChildWorkflowTaskOptions to base WorkflowTaskOptions; ChildWorkflowTaskOptions inherits it. - WithHistoryPropagation() extension method added on the base record. - scheduleTaskAction.HistoryPropagationScope is now wired in WorkflowOrchestrationContext.CallActivityInternalAsync so activities can opt into propagation, matching CallChildWorkflowInternalAsync. - Without this, the Go SDK's reference example (SettlePayment activity using PropagateOwnHistory) literally cannot be ported to .NET. 2. Read API rewritten as high-level resolvers (was lossy FilterBy* + a PropagatedHistoryEvent record that dropped input/output/failure payloads) - PropagatedHistory.FilterByAppId/InstanceId/WorkflowName removed. - PropagatedHistory now exposes GetWorkflows(), GetWorkflowsByName(), GetLastWorkflowByName(), GetAppIds(), GetWorkflowsByAppId(), GetWorkflowsByInstanceId(). - New WorkflowResult class with InstanceId/AppId/Name plus GetActivitiesByName(), GetLastActivityByName(), GetChildWorkflowsByName(), GetLastChildWorkflowByName() — mirrors durabletask-go's GetLastWorkflowByName / GetLastActivityByName / GetLastChildWorkflowByName renames from durabletask-go#105. - New ActivityResult record carries Name, Started, Completed, Failed, Input, Output, FailureDetails — matching the Go/Python equivalents so chain-of-custody patterns line up. - New ChildWorkflowResult record with the equivalent shape. 3. Event payload preserved internally (was discarded by ConvertChunk) - ConvertChunk in WorkflowOrchestrationContext now parses raw events, walks them to resolve TaskScheduled <-> TaskCompleted/Failed and ChildWorkflowInstanceCreated <-> ChildWorkflowInstanceCompleted/ Failed by scheduleId, and produces fully-populated ActivityResult / ChildWorkflowResult instances. SDK retries reuse TaskExecutionId so matching is on scheduleId (matching Go/Python semantics). - Public API does not leak the proto HistoryEvent type — resolution happens at construction time inside Dapr.Workflow. Additional surface additions: - PropagationNotFoundException for missing-name lookups (mirrors Python's PropagationNotFoundError / Go's error returns). - Static WorkflowHistory.PropagateLineage() / PropagateOwnHistory() factory helpers for go-sdk call-site parity. Removed (clean break — 1.18 unreleased): PropagatedHistoryEntry, PropagatedHistoryEvent, HistoryEventKind, FilterByAppId, FilterByInstanceId, FilterByWorkflowName. Tests: - WorkflowHistoryPropagationTests.cs rewritten end-to-end to cover the new resolvers, query helpers, factory helpers, activity-level scope wiring, and child-workflow-level scope wiring. - HistoryPropagationWorkflowTests.cs (integration) updated to use GetWorkflows().Count in place of Entries.Count. Refs: #1801, dapr/durabletask-go#105, dapr/go-sdk#823, dapr/python-sdk#1047 Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * fix(workflow): address code-review feedback on history-propagation alignment - Document the `new`-hiding contract on ChildWorkflowTaskOptions .WithHistoryPropagation and add a regression test that asserts the returned type is ChildWorkflowTaskOptions (not the base record), so InstanceId survives the with-expression. - Add the standard `()`, `(string)`, and `(string, Exception)` constructors on PropagationNotFoundException so callers can wrap inner exceptions. - Alias StringValue alongside the existing Timestamp alias in WorkflowOrchestrationContext so the propagation helper signature stays consistent with the rest of the file. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * test(workflow): clarify chunk-order test variable names Renames the test fixtures in GetPropagatedHistory_PreservesChunkOrder so the variable order matches the documented oldest-first chunk ordering (index 0 is the oldest ancestor, the last chunk is the immediate parent). No behavior change. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * fix(workflow): pass StringValue-wrapped fields directly as strings protoc unwraps google.protobuf.StringValue to a plain string in the generated C# (only the wire codec uses the wrapper). The StringValueOrNull(StringValue?) helper added in this branch expected the wrapper type, breaking the build with CS1503 at the three call sites in ResolveActivity / ResolveChildWorkflow. Drop the helper and pass the generated string fields straight through — they are already nullable at runtime and ActivityResult/ChildWorkflowResult accept string? for Input/Output. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * test(workflow): assign string directly to wrapper-typed fields Same StringValue mismatch as the production fix — protoc-generated properties for google.protobuf.StringValue fields are plain string, not the wrapper. Drop the new StringValue { Value = ... } wrappers in the test helpers. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * refactor(workflow): rename propagation types and adopt TryGet pattern Addresses Whit's review on #1825: - Rename ActivityResult -> PropagatedHistoryActivityResult - Rename ChildWorkflowResult -> PropagatedHistoryChildWorkflowResult - Rename WorkflowResult -> PropagatedHistoryEntry (primary constructor) - Drop WorkflowHistory static class; callers pass HistoryPropagationScope directly - Switch GetLast*ByName to TryGet*ByName + drop PropagationNotFoundException - Drop chunk/chain terminology from public XML docs - Surface malformed propagated event bytes via InvalidProtocolBufferException instead of silently skipping - Update unit tests to new names and TryGet asserts Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * test(workflow): rename propagation test cases to match renamed types Test names previously embedded the old type names (ActivityResult, ChildWorkflowResult); rename to the more general Activity_/ChildWorkflow_ prefix to avoid confusion with the renamed public types. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * fix(workflow): match propagated-history names and app IDs case-insensitively Workflow / activity names register through WorkflowsFactory with StringComparer.OrdinalIgnoreCase, and app IDs are matched case-insensitively on the invocation path. Align the propagated history lookups (GetAppIds, GetWorkflowsByName, TryGetLastWorkflowByName, GetWorkflowsByAppId, GetActivitiesByName, TryGetLastActivityByName, GetChildWorkflowsByName, TryGetLastChildWorkflowByName) with that contract so callers don't get surprising misses or duplicate logical IDs that only differ by casing. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * perf(workflow): pre-index completion events in ConvertChunk ConvertChunk previously rescanned the full event list inside ResolveActivity and ResolveChildWorkflow, making conversion O(n²) in the number of history events. Pre-index TaskCompleted / TaskFailed by TaskScheduledId (and the ChildWorkflowInstance counterparts) up front so each scheduled item resolves in O(1). Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * refactor(workflow): rename PropagatedHistory backing field to _entries The private field and ctor parameter on PropagatedHistory are now named after the value type they hold (PropagatedHistoryEntry) rather than the 'workflows' role those entries play today. Public API surface is unchanged. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * refactor(workflow): use generic propagated-history method names; add Status enum Addresses Whit's 2026-05-24 review. Rename the PropagatedHistory query family to scope-neutral names so the public surface need not change if propagated history ever carries non-workflow entries: GetWorkflows() -> GetEntries() GetWorkflowsByName() -> FilterByWorkflowName() GetWorkflowsByAppId() -> FilterByAppId() GetWorkflowsByInstanceId() -> FilterByInstanceId() Add PropagatedHistoryTaskStatus (Pending/Completed/Failed) and a computed Status property on PropagatedHistoryActivityResult and PropagatedHistoryChildWorkflowResult so callers can switch on a single value. The Started/Completed/Failed flags are retained for go-sdk/python-sdk parity; Status is a projection of them, with Failed taking precedence over Completed. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * test(workflow): fix case-insensitive AppId filter expectation FilterByAppId matches case-insensitively, so two entries whose app IDs differ only in casing ("AppA" / "appa") both match a query for "APPA". The de-duped GetAppIds list collapses to one, but the filter returns both; assert two matches instead of one. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> --------- Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Co-authored-by: Whit Waldo <whit.waldo@innovian.net>
sicoyle
added a commit
to dapr/python-sdk
that referenced
this pull request
May 28, 2026
) * feat(workflow): align history propagation API with go-sdk Cassie (durabletask-go author) flagged divergence between python-sdk #1025 and the freshly-renamed go-sdk helpers in durabletask-go #105 (merged 2026-05-19, after #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: #1001, dapr/durabletask-go#105, dapr/go-sdk#823 * refactor(workflow): drop propagate_lineage/propagate_own_history factories Per review feedback, Go-style factory helpers are not idiomatic Python: they obscure the actual enum value at the call site and confuse static type checkers (return annotation only shows PropagationScope, not the specific member). Use PropagationScope.LINEAGE / PropagationScope.OWN_HISTORY directly instead. --------- (cherry picked from commit 2fd3237) Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com> Co-authored-by: Nelson Parente <nelson_parente@live.com.pt> Co-authored-by: Sam <sam@diagrid.io>
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.
No description provided.