Skip to content

Implement per-orchestration and per-activity versioning#694

Closed
torosent wants to merge 34 commits intomainfrom
design/per-orchestration-versioning
Closed

Implement per-orchestration and per-activity versioning#694
torosent wants to merge 34 commits intomainfrom
design/per-orchestration-versioning

Conversation

@torosent
Copy link
Copy Markdown
Member

@torosent torosent commented Apr 2, 2026

Summary

What changed?

  • Implemented per-orchestration and per-activity versioning across the abstractions, worker runtime, gRPC worker, in-proc sidecar, and source generator surfaces.
  • Added version-aware routing and migration support for orchestrators and activities, including explicit ActivityOptions.Version overrides, inherited version fallback behavior, ContinueAsNew version migration, and strict worker-version filter handling.
  • Added and updated focused samples and tests, including the activity versioning sample and unit/integration coverage for explicit version selection, fallback behavior, tag propagation, and review follow-ups.
  • Removed the local-only docs/superpowers planning/spec artifacts from the branch diff.

Why is this change needed?

  • The SDK needs task-level version selection so orchestrations and activities can evolve independently without forcing users onto worker-level versioning semantics.
  • Explicit activity version selection must be strict for correctness, while inherited orchestration-version activity routing still needs compatibility fallback to existing unversioned registrations.
  • This PR moves the implementation from the design/proposal stage in #692 to a working end-to-end implementation with generator, runtime, sample, and test coverage.

Issues / work items


Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to release_notes.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • Breaking change?
    • If yes:
      • Impact:
      • Migration guidance:

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s): GitHub Copilot CLI (GPT-5.4)
  • AI-assisted areas/files:
    • src/Abstractions/*
    • src/Worker/Core/*
    • src/Worker/Grpc/*
    • src/InProcessTestHost/*
    • src/Grpc/orchestrator_service.proto
    • test/Worker/Core.Tests/*
    • test/Grpc.IntegrationTests/*
    • samples/*versioning*
  • What you changed after AI output:
    • Drove the implementation through multiple review/debug cycles, tightened explicit activity-version semantics, fixed tag propagation gaps in the in-proc sidecar/protobuf path, added stricter regression coverage, and removed local-only planning docs from the PR.

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed
  • dotnet build Microsoft.DurableTask.sln --nologo --verbosity minimal
  • dotnet test test/Worker/Core.Tests/Worker.Tests.csproj --nologo --verbosity minimal
  • dotnet test test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj --nologo --verbosity minimal
  • dotnet test test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj --filter "FullyQualifiedName~VersionedClassSyntaxIntegrationTests" --nologo --verbosity minimal

Manual validation (only if runtime/behavior changed)

  • Environment (OS, .NET version, components): macOS, .NET SDK 10.0.5, gRPC worker, in-proc sidecar/integration host
  • Steps + observed results:
    1. Scheduled versioned orchestrations with explicit versions and observed routing to the matching class-based implementation.
    2. Executed explicit activity-version override scenarios and observed exact-match routing with no fallback to unversioned registrations.
    3. Executed inherited activity-version scenarios and observed compatibility fallback to unversioned activity registrations when no explicit activity version was requested.
  • Evidence (optional):
    • Integration coverage in VersionedClassSyntaxIntegrationTests

Notes for reviewers

  • Explicit activity-version strictness relies on ActivityRequest.tags; sidecars outside this repo need matching support to preserve the same semantics end-to-end.
  • The PR includes the review follow-ups that protect the internal explicit-version tag from user spoofing and keep TaskScheduledEvent.Tags in the in-proc protobuf path.

torosent and others added 30 commits March 31, 2026 15:28
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Split into two focused samples:
- WorkerVersioningSample: deployment-based versioning with UseDefaultVersion()
- PerOrchestratorVersioningSample: multi-version routing with [DurableTaskVersion]

Both tested against the DTS emulator.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The v1 orchestrator uses an AlreadyMigrated flag in the input to prevent
infinite ContinueAsNew loops if the backend does not propagate NewVersion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
torosent and others added 4 commits April 2, 2026 09:17
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@torosent
Copy link
Copy Markdown
Member Author

torosent commented Apr 2, 2026

Closing this draft and recreating it from the requested branch: torosent/orchestration-versioning.

@torosent torosent closed this Apr 2, 2026
@torosent torosent deleted the design/per-orchestration-versioning branch April 2, 2026 16:18
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.

Per-Task Versioning: Architecture Proposal

1 participant