(feat): Actor Harness - #24
Merged
Merged
Conversation
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
There was a problem hiding this comment.
🟡 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
ActorHarnessproxies, 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
DaprContaineralways launchesdaprdwith--app-protocol http, and the current@dapr/daprGRPCServerActordoes not implement actor registration or initialization. PassingcommunicationProtocol: GRPChere 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 afterharness.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 addingActorStateTTLeven thoughactorStateTTLdefaults totrueand 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: