Firewall rules support#40
Conversation
Deploying pipebench with
|
| Latest commit: |
998c7de
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://63650ce6.pipebench.pages.dev |
| Branch Preview URL: | https://dev-firewall-rules.pipebench.pages.dev |
WalkthroughThis change adds support for a new "drop" scenario in HTTP source correctness testing. The config validator now accepts "drop" alongside "deliver" and "reject", and the runner's test driver adds logic to verify sender-side acceptance combined with zero receiver-side delivery. ChangesDrop Scenario Support
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Runner
participant Sender
participant Receiver
Runner->>Sender: poll /stats for accepted request count
Sender-->>Runner: accepted count reaches expected total
Runner->>Receiver: poll delivered record count
Receiver-->>Runner: count remains zero
Runner->>Runner: fail if records delivered or sender under-accepted
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
internal/runner/runner.go (1)
5233-5314: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffReduce duplication between "reject" and "drop" branches.
The new
"drop"branch (Lines 5261-5292) is nearly identical to the existing"reject"branch (Lines 5233-5260): same polling loop, sameccfWaitStablecall, samegot > 0check, differing only in which sender-stat field is validated (rejectedvsaccepted) and the message text. Consider extracting the shared polling/verification logic into a helper parameterized by scenario name and the expected-count field, reducing risk of divergence when one branch is updated but not the other.🤖 Prompt for 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. In `@internal/runner/runner.go` around lines 5233 - 5314, The reject and drop paths in runner.go duplicate the same polling and delivery-check flow, so extract the shared logic from the Scenario-specific block in ccfWaitStable/httpSenderStats handling into a helper. Keep the scenario-specific validation as parameters (reject vs accept field, and the corresponding success/error text), and have the helper drive the common wait-for-sender, stable-read, and got>0 checks to avoid drift between the two branches.internal/config/case.go (1)
1516-1520: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate
Scenariofield doc comment to mention "drop".The
HTTPSourceConfig.Scenariocomment only documents"deliver"and"reject", but the validator now also accepts"drop"(Line 1566 in this file). Leaving the doc stale will confuse config authors.📝 Proposed doc update
// Scenario: "deliver" (a valid credential → all Count events reach the // receiver) or "reject" (a bad credential → the source rejects every request, - // nothing is delivered, and the sender records Count rejections). + // nothing is delivered, and the sender records Count rejections), or "drop" + // (a valid credential accepted by the source, but a downstream pipeline + // drops every record before it reaches the receiver). Scenario string `yaml:"scenario"`🤖 Prompt for 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. In `@internal/config/case.go` around lines 1516 - 1520, Update the HTTPSourceConfig.Scenario doc comment to include the newly accepted "drop" scenario alongside "deliver" and "reject". Edit the comment on HTTPSourceConfig so it accurately reflects the validator behavior in the same type, keeping the wording concise and consistent with the existing scenario descriptions.
🤖 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.
Nitpick comments:
In `@internal/config/case.go`:
- Around line 1516-1520: Update the HTTPSourceConfig.Scenario doc comment to
include the newly accepted "drop" scenario alongside "deliver" and "reject".
Edit the comment on HTTPSourceConfig so it accurately reflects the validator
behavior in the same type, keeping the wording concise and consistent with the
existing scenario descriptions.
In `@internal/runner/runner.go`:
- Around line 5233-5314: The reject and drop paths in runner.go duplicate the
same polling and delivery-check flow, so extract the shared logic from the
Scenario-specific block in ccfWaitStable/httpSenderStats handling into a helper.
Keep the scenario-specific validation as parameters (reject vs accept field, and
the corresponding success/error text), and have the helper drive the common
wait-for-sender, stable-read, and got>0 checks to avoid drift between the two
branches.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f9771e87-1bce-4bc7-8b38-2020666f7705
📒 Files selected for processing (2)
internal/config/case.gointernal/runner/runner.go
Summary by CodeRabbit