(feat): PubSub Harness - #18
Merged
Merged
Conversation
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate findings affect broker authentication, credential handling, and endpoint configuration.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds RabbitMQ-backed Dapr Pub/Sub support with a reusable container, harness, integration, tests, exports, and documentation.
Changes:
- Adds RabbitMQ container and Pub/Sub component helpers.
- Adds
PubSubHarnesslifecycle and client support. - Integrates RabbitMQ with
DaprContainer. - Adds tests, exports, and README usage.
File summaries
| File | Summary | Findings |
|---|---|---|
src/RabbitMQContainer.ts |
RabbitMQ container and component utilities | Critical (3 votes): Default guest credentials fail for remote Dapr connections (lines 20, 49). Moderate (2 votes): Credentials must be percent-encoded in the AMQP URI. |
src/RabbitMQContainer.test.ts |
RabbitMQ behavior and startup tests | No final comments. |
src/PubSubHarness.ts |
Pub/Sub harness lifecycle and clients | Moderate (1 vote): Derive port and protocol from the effective client options. |
src/PubSubHarness.test.ts |
Harness and end-to-end tests | No final comments. |
src/index.ts |
Public exports | No final comments. |
src/DaprContainer.ts |
RabbitMQ and Pub/Sub integration | Moderate (3 votes): Propagate custom container credentials when Pub/Sub credentials are omitted. |
README.md |
Pub/Sub usage documentation | No final comments. |
Review details
Suppressed comments (2)
src/PubSubHarness.ts:196
- The default port is selected from the server's protocol, but
serverOptions.clientOptionsis spread over it below and can override the client protocol. For example, a gRPC client override still receives the HTTP port, so the server's internal Dapr client connects to the wrong endpoint. Derive the port andcommunicationProtocolfrom the effective nested client options together.
clientOptions: {
daprHost: started.getHost(),
daprPort: defaultPort,
communicationProtocol: protocol,
...serverOptions?.clientOptions,
src/RabbitMQContainer.ts:51
withPortchanges the port exposed by Testcontainers and the port later used in the component, but it never configures RabbitMQ's listener. A container created with.withPort(5673)still listens on 5672, sogetMappedPort(5673)andrabbitmq:5673do not point at the broker. Configure RabbitMQ's node port here, or remove this override and keep the fixed internal port.
public withPort(port: number): this {
this.rabbitMQPort = port;
this.withExposedPorts(port);
- Files reviewed: 7/7 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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
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
Added RabbitMQ container and PubSub 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: