Skip to content

test(flow-filter): Add non-regression test - #1680

Open
qmonnet wants to merge 1 commit into
mainfrom
pr/qmonnet/non-reg-flow-filter
Open

test(flow-filter): Add non-regression test#1680
qmonnet wants to merge 1 commit into
mainfrom
pr/qmonnet/non-reg-flow-filter

Conversation

@qmonnet

@qmonnet qmonnet commented Jul 31, 2026

Copy link
Copy Markdown
Member

As described in the test's comment, we recently discovered a bug in the previous flow-filter implementation. The new version is not affected, but let's introduce a non-regression test to be sure of it.

As described in the test's comment, we recently discovered a bug in the
previous flow-filter implementation. The new version is not affected,
but let's introduce a non-regression test to be sure of it.

Signed-off-by: Quentin Monnet <qmo@qmon.net>
@qmonnet qmonnet self-assigned this Jul 31, 2026
@qmonnet
qmonnet requested a review from a team as a code owner July 31, 2026 22:11
Copilot AI review requested due to automatic review settings July 31, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This change adds a multi-prefix test helper and a regression test for overlapping and contiguous peerings. The test verifies forward and reverse lookups, unset NAT requirements, and local and remote rules without /32 prefixes.

Changes

Prefix overlap validation

Layer / File(s) Summary
Overlapping prefix regression test
flow-filter/src/test_utils.rs, flow-filter/src/context/tests.rs
Added expose_multi to build VpcExpose values from multiple prefixes. Added coverage for routing lookups, NAT results, and normalized local and remote rules.

Possibly related PRs

Suggested reviewers: mvachhar, fredi-raspall

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies a non-regression test for the flow-filter component.
Description check ✅ Passed The description accurately explains that the pull request adds a regression test for a previously discovered flow-filter bug.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 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 `@flow-filter/src/context/tests.rs`:
- Around line 547-578: The routing test around route must cover both contiguous
addresses, 10.0.2.2 and 10.0.2.3, in both forward and reverse directions and
verify each result. Replace the weak assert_ne! checks over reference_rules with
assertions that the relevant local and remote rules contain the expected
normalized 10.0.2.2/31 prefix, while still validating the intended rule
collections are present.
🪄 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: 6dd81d13-00a4-4560-a13a-25aef101d6e8

📥 Commits

Reviewing files that changed from the base of the PR and between e7c4e76 and 2d22da3.

📒 Files selected for processing (2)
  • flow-filter/src/context/tests.rs
  • flow-filter/src/test_utils.rs

Comment thread flow-filter/src/context/tests.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

flow-filter/src/context/tests.rs:511

confidence: 10
tags: [docs]

Typo in the regression-test comment: “discrepency” should be “discrepancy”.

// then we would merge entries in the temporary list of overlapping prefixes used to compute table
// entries, resulting in a discrepency between (merged) prefixes for vpc2's context and (split)
// prefixes for vpc3's context. In our example here, the context table would contain, for source

**flow-filter/src/context/tests.rs:508**
* ```yaml
confidence: 8
tags: [docs]

The explanatory comment describes “vpc2 and vpc3 exposing overlapping prefixes to vpc1” and gives an example where, for source vpc1, the destination-prefix table has 10.0.2.x entries resolving to vpc2/vpc3. In this test setup, 10.0.2.x prefixes are on vpc1’s local/source exposes (towards vpc2/vpc3), while vpc2/vpc3 expose 20.0.0.0/24 and 30.0.0.0/24 to vpc1 (no overlap). Please either adjust the setup to match the described scenario, or update/rewrite the comment so it matches what the test actually exercises and asserts.

This issue also appears on line 509 of the same file.

// - vpc2 and vpc3 exposing overlapping prefixes to vpc1, and
// - vpc3's exposed prefixes being contained within vpc2's exposed prefixes to vpc1, and
// - vpc2's exposed prefixes containing contiguous prefixes that could be merged into a single
//   parent prefix,
//

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants