Skip to content

flow-filter clean-up: Remove is_initiator from FlowSummary - #1784

Merged
qmonnet merged 1 commit into
mainfrom
pr/qmonnet/is_initiator
Sep 1, 2026
Merged

flow-filter clean-up: Remove is_initiator from FlowSummary#1784
qmonnet merged 1 commit into
mainfrom
pr/qmonnet/is_initiator

Conversation

@qmonnet

@qmonnet qmonnet commented Sep 1, 2026

Copy link
Copy Markdown
Member

No need to keep a separate field in FlowSummary for the value of the initiator flag, we can trivially retrieve it from the flow info (attached to the FlowSummary) without locking.

Reported by Fredi during the review for #1713, but the PR got merged before I got a chance to address it.

No need to keep a separate field in FlowSummary for the value of the
initiator flag, we can trivially retrieve it from the flow info
(attached to the FlowSummary) without locking.

Fixes: 5d68fd1 ("feat(flow-filter): Use new flow flag to avoid duplicate context lookup")
Suggested-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Quentin Monnet <qmo@qmon.net>
@qmonnet
qmonnet requested a review from a team as a code owner September 1, 2026 10:00
Copilot AI lite review requested due to automatic review settings September 1, 2026 10:00
@qmonnet
qmonnet enabled auto-merge September 1, 2026 10:00
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 25bf1129-db46-4f0a-a19b-82cf18622fed

📥 Commits

Reviewing files that changed from the base of the PR and between c5af905 and 10559c4.

📒 Files selected for processing (2)
  • flow-filter/src/lib.rs
  • flow-filter/src/tests.rs
💤 Files with no reviewable changes (1)
  • flow-filter/src/tests.rs

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

Flow revalidation now derives initiator status from FlowInfo flags through FlowSummary::is_initiator(). The stored FlowSummary.is_initiator field and its test fixture initialization were removed.

Changes

Flow revalidation

Layer / File(s) Summary
Derive initiator status during revalidation
flow-filter/src/lib.rs, flow-filter/src/tests.rs
FlowSummary no longer stores initiator status. The private method derives it from FlowInfo flags, and revalidation uses the method. The test fixture no longer initializes the removed field.

Suggested reviewers: fredi-raspall

Merge Risk: ⚪ Minimal · up to 10559

This PR removes a redundant FlowSummary field and updates its related test usage; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing the redundant is_initiator field from FlowSummary.
Description check ✅ Passed The description directly explains why FlowSummary no longer needs a separate is_initiator field and relates to the changeset.
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.
  • Fix all pre-merge checks with AI

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

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

This PR removes the redundant is_initiator field from the internal FlowSummary helper type in flow-filter, instead deriving the initiator direction directly from the attached FlowInfo flags (avoiding any additional locking for that value).

Changes:

  • Removed is_initiator: bool from FlowSummary and stopped populating it when building summaries.
  • Replaced direct field access with a small FlowSummary::is_initiator() accessor that reads from FlowInfo flags.
  • Updated property-based tests that construct FlowSummary literals to match the new struct layout.

Reviewed changes

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

File Description
flow-filter/src/lib.rs Drops the cached initiator field from FlowSummary and derives initiator-ness from FlowInfo flags via a helper method.
flow-filter/src/tests.rs Updates test construction of FlowSummary to remove the deleted is_initiator field.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@qmonnet
qmonnet added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 9ab6f3b Sep 1, 2026
24 checks passed
@qmonnet
qmonnet deleted the pr/qmonnet/is_initiator branch September 1, 2026 20:40
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.

3 participants