Add pipeline broker support for the subject's internal pipeline bus#21
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds an optional ChangesPipeline Broker per Test Case
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/config/case.go`:
- Around line 55-65: The new PipelineBroker field in the case configuration
creates fixed compose service names (pipeline-broker and pipeline-broker-init)
that can collide with user-defined endpoint names. You need to find the endpoint
name validation logic in the config package and add pipeline-broker and
pipeline-broker-init to the list of reserved service names that are blocked from
being used as endpoint names. This will prevent users from creating endpoints
with names that would conflict with the automatically generated pipeline broker
services.
- Around line 319-327: Add validation logic to enforce the documented contract
that when AutoCreate is set to false, the Topics field must contain at least one
topic. This validation should check that if AutoCreate is not nil and is false,
then Topics must be non-empty, otherwise return a validation error. This
validation should be added to the config validation function or method that
handles the struct containing the AutoCreate and Topics fields to prevent
invalid topology configurations from being created at runtime.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d494a25b-d5f2-4944-9caf-e5507f0dfadd
📒 Files selected for processing (2)
internal/config/case.gointernal/orchestrator/docker.go
Deploying pipebench with
|
| Latest commit: |
5452782
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://003f90fa.pipebench.pages.dev |
| Branch Preview URL: | https://dev-pipe-broker.pipebench.pages.dev |
What
Adds an optional
pipeline_broker:block to a test case, which stands up asecond, dedicated Redpanda broker (hostname
pipeline-broker, default port19092) for the subject's own internal transport — e.g. VirtualMetric'spipeline_bus: {type: kafka}.This is independent of the existing
kafka:block (hostnameredpanda, port9092), which feeds the generator/subject device. Different hostname andport means a case can use both at once with no collision. Point the subject
config at
pipeline-broker:<port>.Why
The
kafka:broker models the device's input/output transport. A subjectthat uses Kafka as its internal pipeline bus needs a separate broker it owns —
mixing the two on one broker conflates the harness's traffic with the subject's
internal traffic. This gives the subject a clean, dedicated bus.
Details
depends_onthe broker being healthy(
rpk cluster health) before starting, so the subject's broker dial can'trace container startup.
Set
auto_create: falseto mirror brokers that disallow it (e.g. Azure EventHubs); in that case
topics:MUST list the bus topics, which a one-shotpipeline-broker-initpre-creates before the subject starts (the subject thendepends_onthat init completing rather than just broker health).image(
redpandadata/redpanda:latest),memory(1G),smp(1),port(
19092),auto_create(true).Changes
internal/config/case.go— newPipelineBrokerConfigtype,PipelineBrokerfield on
TestCase, and*OrDefault()accessors.internal/orchestrator/docker.go— render thepipeline-broker(and optionalpipeline-broker-init) compose services, wire the subject'sdepends_on, andthe corresponding
composeVarsfields.Summary by CodeRabbit
Release Notes