Skip to content

Conversation

@YunchuWang
Copy link
Member

@YunchuWang YunchuWang commented Feb 9, 2026

Summary

What changed?

  • Added 7 new runnable sample projects under examples/azure-managed/ demonstrating all major SDK features:
    • hello-orchestrations — Activity chaining, fan-out/fan-in (whenAll), sub-orchestrations, whenAny, deterministic GUID (newGuid)
    • retry-and-error-handlingRetryPolicy, handleFailure predicate, AsyncRetryHandler, sub-orchestration retry, raiseIfFailed()
    • human-interaction — External events, timers, whenAny race pattern, sendEvent, setCustomStatus
    • lifecycle-management — Terminate (recursive), suspend/resume, continue-as-new, restart, purge, tags
    • query-and-historygetAllInstances with pagination, listInstanceIds, getOrchestrationHistory, typed history events
    • versioningVersionMatchStrategy, VersionFailureStrategy, ctx.version, ctx.compareVersionTo()
    • unit-testingInMemoryOrchestrationBackend, TestOrchestrationClient/TestOrchestrationWorker, ReplaySafeLogger, NoOpLogger (no emulator required)
  • Each sample includes sample.json (metadata/discovery marker), index.ts, and README.md
  • Added examples/azure-managed/sample.json marker for the existing root-level distributed-tracing example
  • Added CI pipeline .github/workflows/validate-samples.yaml with auto-discovery, Docker service containers (DTS emulator), and matrix strategy
  • Replaced examples/azure-managed/README.md with a comprehensive Samples Index including feature coverage map (40+ features → samples), quick-start instructions, and troubleshooting — existing distributed-tracing documentation preserved below the index

Why is this change needed?

  • The SDK exports 40+ public features (orchestration patterns, retry policies, lifecycle management, versioning, querying, in-memory testing, etc.) but had only 2 existing examples (hello-world and distributed-tracing), leaving most functionality undocumented by runnable code
  • New contributors and users had no way to discover or learn advanced features without reading source code and e2e tests
  • No CI validation existed for examples, so samples could silently break as the SDK evolves

Issues / work items

  • Resolves #
  • Related #

Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to CHANGELOG.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)
    • Note: Samples are validated by the new validate-samples.yaml CI workflow; no unit/E2E test changes needed since these are documentation/example files
  • Breaking change?
    • No breaking changes. All additions are new files; no existing code was modified except:
      • examples/azure-managed/README.md (documentation only — prepended Samples Index, preserved existing content)
      • test/e2e-azuremanaged/retry-handler.spec.ts (removed 5 stale eslint-disable directives via --fix)

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 (Claude Opus 4.6, agent mode in VS Code)
  • AI-assisted areas/files:
    • All 7 sample directories (index.ts, README.md, sample.json)
    • .github/workflows/validate-samples.yaml
    • examples/azure-managed/README.md (Samples Index)
  • What you changed after AI output:
    • Reviewed and verified all API references against actual SDK exports in packages/durabletask-js/src/index.ts and packages/durabletask-js-azuremanaged/src/index.ts
    • Fixed 4 lint errors (missing yield in generators, unused imports/variables)
    • Auto-fixed 5 stale eslint-disable directives in retry-handler.spec.ts

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 — npm run lint passes with 0 errors, 0 warnings

Manual validation (only if runtime/behavior changed)

  • Environment (OS, Node.js version, components): Windows, Node.js ≥22, DTS emulator (Docker)
  • Steps + observed results:
    1. npm install && npm run build — SDK builds successfully
    2. npm run lint — 0 errors, 0 warnings
    3. unit-testing sample runs without emulator via InMemoryOrchestrationBackend
  • Evidence (optional): N/A

Notes for reviewers

  • Samples are grouped by concern area (core patterns, fault tolerance, event-driven, lifecycle, observability, versioning, testing) so related features are demonstrated together. Each sample is self-contained and can be read in under 5 minutes.
  • The unit-testing sample is the only one with "requiresEmulator": false in its sample.json — CI runs it without Docker.
  • The CI pipeline auto-discovers samples via sample.json marker files, so adding new samples requires no workflow changes.
  • The feature coverage map in the README ensures every exported public API symbol maps to at least one sample.
  • Files changed: 22 new files, 1 modified (examples/azure-managed/README.md), plus lint auto-fix in retry-handler.spec.ts.

Copilot AI review requested due to automatic review settings February 9, 2026 20:15
@YunchuWang YunchuWang marked this pull request as draft February 9, 2026 20:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a set of runnable Azure Managed Durable Task Scheduler (DTS) samples under examples/azure-managed/ and introduces CI to automatically discover and execute them (with/without the emulator).

Changes:

  • Added multiple new Azure Managed DTS sample scenarios (hello orchestrations, retries, lifecycle ops, query/history, versioning, human interaction, unit testing).
  • Added a GitHub Actions workflow to auto-discover samples via sample.json and run them in CI (including emulator-backed runs).
  • Expanded the Azure Managed samples README with an index and guidance for adding/validating samples.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/e2e-azuremanaged/retry-handler.spec.ts Removes eslint-disable comment lines (but introduces trailing whitespace).
examples/azure-managed/README.md Adds a sample index + CI validation notes for Azure Managed samples.
.github/workflows/validate-samples.yaml New workflow to discover and run samples (emulator + non-emulator).
examples/azure-managed/sample.json Adds metadata for the root “azure-managed basics” sample.
examples/azure-managed/hello-orchestrations/sample.json Sample metadata for core orchestration patterns.
examples/azure-managed/hello-orchestrations/index.ts New “hello orchestrations” runnable sample.
examples/azure-managed/hello-orchestrations/README.md Documentation for running/validating the “hello orchestrations” sample.
examples/azure-managed/retry-and-error-handling/sample.json Sample metadata for retry/error-handling scenarios.
examples/azure-managed/retry-and-error-handling/index.ts New runnable sample covering retry policies and handlers.
examples/azure-managed/retry-and-error-handling/README.md Documentation for running/validating the retry sample.
examples/azure-managed/human-interaction/sample.json Sample metadata for event-driven/human interaction patterns.
examples/azure-managed/human-interaction/index.ts New runnable sample demonstrating external events, timers, sendEvent, etc.
examples/azure-managed/human-interaction/README.md Documentation for running/validating the human-interaction sample.
examples/azure-managed/lifecycle-management/sample.json Sample metadata for lifecycle operations.
examples/azure-managed/lifecycle-management/index.ts New runnable sample for terminate/suspend/restart/purge/tags/etc.
examples/azure-managed/lifecycle-management/README.md Documentation for running/validating the lifecycle sample.
examples/azure-managed/query-and-history/sample.json Sample metadata for query and history inspection.
examples/azure-managed/query-and-history/index.ts New runnable sample demonstrating query APIs and typed history events.
examples/azure-managed/query-and-history/README.md Documentation for running/validating the query/history sample.
examples/azure-managed/versioning/sample.json Sample metadata for versioning strategies.
examples/azure-managed/versioning/index.ts New runnable sample demonstrating orchestration version matching/failure strategies.
examples/azure-managed/versioning/README.md Documentation for running/validating the versioning sample.
examples/azure-managed/unit-testing/sample.json Sample metadata for in-memory unit testing (no emulator).
examples/azure-managed/unit-testing/index.ts New runnable sample demonstrating in-memory test client/worker/backend.
examples/azure-managed/unit-testing/README.md Documentation for running/validating the unit-testing sample.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

YunchuWang and others added 14 commits February 9, 2026 12:22
…nted-out client version in versioning sample
…timeout durations in human interaction samples
@YunchuWang YunchuWang marked this pull request as ready for review February 10, 2026 01:13
@YunchuWang YunchuWang merged commit e4da4a0 into main Feb 10, 2026
22 checks passed
@YunchuWang YunchuWang deleted the wangbill/samples branch February 10, 2026 17:17
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