Skip to content

(feat): Actor Harness - #24

Merged
WhitWaldo merged 5 commits into
mainfrom
actors-harness
Sep 15, 2026
Merged

WhitWaldo merged 5 commits into
mainfrom
actors-harness

Conversation

@WhitWaldo

Copy link
Copy Markdown
Contributor

Description

Implementing Actor harness

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo
WhitWaldo requested a lite review from Copilot September 14, 2026 02:13
@WhitWaldo WhitWaldo self-assigned this Sep 14, 2026
@WhitWaldo WhitWaldo added the enhancement New feature or request label Sep 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical harness wiring and state-store configuration issues, plus a moderate TTL configuration issue, remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Dapr Actor testing support with Redis-backed state, actor configuration, lifecycle management, exports, tests, and documentation.

Changes:

  • Adds actor options, Redis state-store, and TTL configuration.
  • Introduces ActorHarness proxies, servers, and lifecycle APIs.
  • Updates configuration serialization, tests, exports, and README examples.
File summaries
File Reviewed changes Final findings
src/index.ts Exports ActorHarness. No final comments.
src/DaprContainer.ts Adds actor options, Redis setup, and TTL configuration. Critical (1 vote): actor-specific state-store options can be silently ignored. Moderate (1 vote): custom configuration can skip ActorStateTTL.
src/DaprContainer.test.ts Tests actor Redis startup. No final comments.
src/Configuration.ts Supports feature configuration serialization. No final comments.
src/Configuration.test.ts Tests feature YAML output. No final comments.
src/ActorHarness.ts Implements actor harness lifecycle and proxy APIs. Critical (1 vote): effective server port can differ from the sidecar app port. Critical (2 votes): the injected sidecar client is not started before runtime wiring.
src/ActorHarness.test.ts Adds actor integration and lifecycle tests. No final comments.
README.md Documents actor harness usage. No final comments.
Review details

Suppressed comments (3)

src/ActorHarness.ts:224

  • DaprContainer always launches daprd with --app-protocol http, and the current @dapr/dapr GRPCServerActor does not implement actor registration or initialization. Passing communicationProtocol: GRPC here therefore creates an unsupported actor server; reject non-HTTP protocols or add matching app-protocol support before exposing this option.
    const protocol = serverOptions?.communicationProtocol ?? CommunicationProtocolEnum.HTTP;

src/ActorHarness.ts:256

  • This convenience method creates a fresh client through createDaprClient, which only constructs a client and does not start it, then returns a builder that will use it immediately. Callers have no client handle through the builder/proxy APIs to perform the required async initialization, so the README and end-to-end tests invoke an uninitialized client after harness.start(). Reuse the initialized sidecar client or make the proxy factory APIs initialize a client before returning.
    const client = this.createDaprClient(clientOptions);
    return new ActorProxyBuilder<T>(actorTypeClass, client);

src/DaprContainer.ts:238

  • When callers provide any custom Configuration (for example to add tracing), this guard skips adding ActorStateTTL even though actorStateTTL defaults to true and is exposed as an actor option. The harness then silently loses the actor TTL feature unless every custom configuration repeats it; merge the feature into an existing configuration while preserving an explicitly supplied feature setting.
      if (!this.configuration && (this.actorOptions?.actorStateTTL ?? true)) {
        this.configuration = new Configuration("actorConfig", undefined, undefined, [
          { name: "ActorStateTTL", enabled: true },
        ]);
      }
  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Lite

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

Comment thread src/ActorHarness.ts
Comment thread src/ActorHarness.ts Outdated
Comment thread src/DaprContainer.ts Outdated
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo
WhitWaldo merged commit 16a252c into main Sep 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants