Skip to content

feat: add entity registration methods to Azure managed worker builder#266

Merged
YunchuWang merged 1 commit into
mainfrom
copilot-finds/improve/worker-builder-add-entity-methods
Jun 12, 2026
Merged

feat: add entity registration methods to Azure managed worker builder#266
YunchuWang merged 1 commit into
mainfrom
copilot-finds/improve/worker-builder-add-entity-methods

Conversation

@YunchuWang

Copy link
Copy Markdown
Member

Summary

Fixes #239

Copilot AI review requested due to automatic review settings June 11, 2026 20:54
…bleTaskAzureManagedWorkerBuilder

The Azure managed worker builder supports registering orchestrators and
activities through addOrchestrator/addNamedOrchestrator and
addActivity/addNamedActivity, but has no corresponding methods for
entity registration. Users must call worker.addEntity() or
worker.addNamedEntity() directly on the worker after build(), breaking
the fluent builder pattern.

This adds addEntity() and addNamedEntity() methods to
DurableTaskAzureManagedWorkerBuilder, following the same pattern used
for orchestrators and activities. Entities are stored during builder
configuration and registered on the worker during build().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@YunchuWang
YunchuWang force-pushed the copilot-finds/improve/worker-builder-add-entity-methods branch from aad566b to 3f8ea8a Compare June 11, 2026 20:57

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.

Pull request overview

Adds fluent entity registration support to the Azure-managed worker builder so users can register entities via the same builder pattern used for orchestrators and activities (fixing the gap described in #239).

Changes:

  • Added addEntity(factory) and addNamedEntity(name, factory) to DurableTaskAzureManagedWorkerBuilder.
  • Registered configured entities onto the underlying TaskHubGrpcWorker during build().
  • Added unit tests covering chaining behavior and verifying entities are registered on build.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/durabletask-js-azuremanaged/src/worker-builder.ts Adds entity registration methods, stores entity factories, and registers them on the worker during build().
packages/durabletask-js-azuremanaged/test/unit/worker-builder.spec.ts Adds unit tests validating fluent chaining and that entity factories are applied to the built worker.

@YunchuWang
YunchuWang merged commit 74f7055 into main Jun 12, 2026
28 checks passed
@YunchuWang
YunchuWang deleted the copilot-finds/improve/worker-builder-add-entity-methods branch June 12, 2026 20:22
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.

[copilot-finds] Improve: DurableTaskAzureManagedWorkerBuilder missing addEntity/addNamedEntity methods

4 participants