Skip to content

Conversation

@cicoyle
Copy link

@cicoyle cicoyle commented Jun 18, 2025

expose cross app functionality in durabletask and update contributing docs with how to update protos

Implementation for this proposal

cicoyle added 8 commits June 16, 2025 14:46
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
@cicoyle cicoyle marked this pull request as draft June 19, 2025 22:24
@cicoyle cicoyle marked this pull request as ready for review June 20, 2025 19:26
@cicoyle cicoyle requested a review from JoshVanL June 23, 2025 15:43
task/activity.go Outdated
type callActivityOptions struct {
rawInput *wrapperspb.StringValue
retryPolicy *RetryPolicy
AppID string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this AppID and not Target or similar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the OrchestrationCtx AppID as-is, and did not change it to sourceAppID. I did however change this to be targetAppID. I prefixed it with target to be clear its the target, not a source per say, but also left AppID to be clear what the 'target' is.

As of now its used like:

err := ctx.CallActivity("ProcessData",
			task.WithActivityInput(input),
			task.WithAppID(appID2)).
			Await(&output)

lmk if you think it would be clearer to use task.WithTargetAppID(appID2)) or task.OnAppID(appID2) instead

Comment on lines 204 to 207
// Extract source AppID from HistoryEvent Router if this is ExecutionStartedEvent
if ctx.AppID == "" && e.GetRouter() != nil && e.GetRouter().GetSource() != "" {
ctx.AppID = e.GetRouter().GetSource()
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we doing here?

Why are we checking whether AppID is an empty string?

Copy link
Author

@cicoyle cicoyle Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tweaked the if statement, but I assigned ctx.AppID during the ExecutionStarted event because that’s when we can be sure we’re handling the current orchestration — not a parent or child in the call stack.

While router metadata is technically available on every history event, setting AppID earlier (for ex: in NewOrchestrationContext()) could be misleading in the presence of sub-orchestrations. To do that cleanly, I’d either need to pass AppID into NewOrchestrationContext (which would require changes across multiple ExecuteOrchestrator implementations in backend/orchestration.go, client/worker_grpc.go, and azurefunc/middleware.go) or scan through oldEvents and newEvents, which felt fragile and error-prone.

Open to suggestions if there's a cleaner place you think it belongs — happy to tweak!

cicoyle added 2 commits June 30, 2025 22:29
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
@cicoyle cicoyle requested a review from JoshVanL July 1, 2025 03:45
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
cicoyle added 4 commits July 1, 2025 15:41
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants