Skip to content

Support tags on entity-started orchestrations - #1412

Open
wangbill (YunchuWang) wants to merge 1 commit into
mainfrom
yunchuwang-entity-tags-core-pr
Open

wangbill (YunchuWang) wants to merge 1 commit into
mainfrom
yunchuwang-entity-tags-core-pr

Conversation

@YunchuWang

@YunchuWang wangbill (YunchuWang) commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Support tags on entity-started orchestrations

Carry caller-supplied tags from an entity's start-orchestration action into the child orchestration, while preserving inherited entity tags and the mandatory fire-and-forget behavior.

Changes

  • Add optional, public/settable IDictionary<string, string>? Tags to StartNewOrchestrationOperationAction, including API documentation.
  • Use OrchestrationTags.MergeTags to let caller tags override ordinary inherited keys, then apply the runtime FireAndForget marker in the final merge. Neither source dictionary is mutated.
  • Cover both JSON serializers, missing/null/empty tags, inheritance, overrides, marker collisions, dictionary isolation, unchanged scheduling/tracing, and actual child completion/failure dispatch without notifying the entity. Retain the existing fire-and-forget regression.

Validation

  • Focused Core tests on net8.0 and net48: 49 passed per framework, 0 failed, 0 skipped.
    dotnet test Test\DurableTask.Core.Tests\DurableTask.Core.Tests.csproj --configuration Debug --no-restore -p:GeneratePackageOnBuild=false --filter 'FullyQualifiedName~TestTaskEntityDispatcher|FullyQualifiedName~ScheduleTaskOptionsTests|FullyQualifiedName~TaskOrchestrationContextTests|FullyQualifiedName~ContinueAsNewTerminationTests'
  • Test-first evidence: both serializer cases failed before adding Tags; five dispatcher cases failed because caller tags were missing before changing the merge. All focused checks pass with this change.
  • The October 6 signed Core Release build and local prerelease pack had 0 warnings, 0 errors. The unpublished validation package Microsoft.Azure.DurableTask.Core 3.10.1-entitytags807.local was produced from this PR's source using build-only version overrides. It satisfies the downstream AzureStorage floor of Core >= 3.10.0 stable. Package/DLL identities and the source commit were verified. This package was not published, and the Core repository release version remains unchanged.
  • git diff origin/main...HEAD --check: passed.
  • Full solution/service-dependent suites and release pipelines were not run locally. October 6 combined validation used exact local PR artifacts; this is historical evidence, not proof that prerequisite packages have been published or that all consumer/server paths are release-ready.

Related Issues

Related dependency for microsoft/durabletask-dotnet#807, not a standalone fix for the entire issue. SDK and Functions/protobuf conversion changes are also required to carry caller tags end to end.

Compatibility

Missing, null, and empty caller tags preserve existing scheduling behavior. The runtime marker always wins collisions, so successful or failed child completion does not send an unsupported completion event back to the entity. No orchestration naming, versioning, IDs, inputs, scheduled time, parent linkage, tracing, or transactional message handling is changed. No dependency or repository release-version updates, package publication, or PR merge are included.

Companion PRs and release order

Companion Role
microsoft/durabletask-protobuf#80 Optional native entity-start tags field 8.
Azure/durabletask#1412 (this PR) Core action property and wrapped-Core tag merging.
microsoft/durabletask-dotnet#812 SDK snapshots and serializes the tags.
Azure/azure-functions-durable-extension#3566 Functions host converts the tags into Core actions.
DTS native backend companion (private/internal PR; link omitted from public GitHub) Consumes native action tags and validates them before native batch side effects.
  1. Merge the canonical protocol contract in Doesn't work with Service Bus Premium Tier #80; there is no new NuGet version to guess for that schema-only change.
  2. Merge and publish the Core prerequisite. Coordinate the approved native DTS backend rollout after the protocol contract; the native backend does not require a new Core package. Deploy compatible receivers before enabling tag-emitting SDK senders.
  3. Only after the Core prerequisite package is actually released, update Orchestration instance stuck in a partial RunAsync execution cycle after a request to Abort #812's Core dependency to the real published version, pass normal CI, and release the SDK.
  4. Only after Core and the tag-aware SDK are actually released, update #3566's applicable dependency versions to the real published versions, pass normal CI, and release the Functions extension.

Package dependency versions must be updated after prerequisite release only. Do not commit unpublished .local validation pins, guessed future versions, or validation-only feeds/overrides. Local previews are build-only test inputs. SDK/Functions PRs remain dependency-blocked until the published prerequisite API is available and the later version updates are made; local tests are not a normal-CI or release claim.

Merge optional caller tags with inherited entity tags while keeping the mandatory FireAndForget runtime marker authoritative. Cover serialization, tag precedence and defaults, input dictionary isolation, scheduling/tracing preservation, and child completion/failure dispatch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3d59e0dc-efdb-4b0a-b588-6dbd83416193
Copilot AI balanced review requested due to automatic review settings October 6, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused implementation correctly preserves existing behavior and is comprehensively covered by active Core tests.

Review effort: Balanced
Findings: None

What changed in this PR

Adds tag propagation for entity-started child orchestrations while preserving inheritance and fire-and-forget semantics.

Changes:

  • Adds a public optional Tags property.
  • Merges caller and inherited tags without mutation.
  • Adds serialization, merge, tracing, and completion tests.
File Description
StartNewOrchestrationOperationAction.cs Exposes caller-supplied tags.
TaskEntityDispatcher.cs Merges tags and enforces fire-and-forget.
TestTaskEntityDispatcher.cs Covers serialization and dispatch behavior.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

var (startEvent, _) = SendStartMessage(runtimeState, action);

Assert.AreEqual("", startEvent.Tags[OrchestrationTags.FireAndForget]);
Assert.IsTrue(startEvent.Tags.ContainsKey("custom"));
Assert.AreEqual(1, runtimeState.Tags.Count);
if (useTags)
{
Assert.IsTrue(service.State.Tags.ContainsKey("custom"));
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