Skip to content

Conversation

@leonprietobailo
Copy link
Contributor

@leonprietobailo leonprietobailo commented Jan 4, 2026

…h Java code)

Which Issue(s) This PR Fixes(Closes)

Fixes #5424

Brief Description

N/A

How Did You Test This Change?

N/A

Summary by CodeRabbit

  • New Features
    • Added support for unary filtering operations including Negate, In, Not, BooleanCast, and Like operations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

Walkthrough

The changes introduce a new UnaryType enumeration to the rocketmq-filter crate through a new constant module, defining five unary operation variants (Negate, In, Not, BooleanCast, Like) with standard trait implementations for debugging, comparison, and hashing.

Changes

Cohort / File(s) Summary
UnaryType Enum Definition
rocketmq-filter/src/constant/unary_type.rs
Adds public enum UnaryType with variants: Negate, In, Not, BooleanCast, Like. Implements derived traits: Debug, Clone, Copy, PartialEq, Eq, Hash.
Module Hierarchy
rocketmq-filter/src/constant.rs, rocketmq-filter/src/lib.rs
Creates new constant module by declaring pub mod unary_type; in constant.rs, then exposes the constant module via pub mod constant; in lib.rs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Five variants now dance in the filter's domain,
Negate, In, Not—simplifying the chain!
BooleanCast and Like, a unary parade,
With derives so standard, a foundation well-made! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a UnaryType enumeration to the rocketmq-filter crate, matching the actual code additions in the changeset.
Linked Issues check ✅ Passed The PR successfully implements the UnaryType enumeration with all required variants (Negate, In, Not, BooleanCast, Like) and proper trait implementations as shown in the linked issue images.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the UnaryType enumeration: new module files, enum definition, and module exports in lib.rs with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@rocketmq-rust-bot
Copy link
Collaborator

🔊@leonprietobailo 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@rocketmq-rust-robot rocketmq-rust-robot added Difficulty level/Easy Easy ISSUE feature🚀 Suggest an idea for this project. labels Jan 4, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
rocketmq-filter/src/constant/unary_type.rs (1)

16-22: Consider adding documentation comments for the public API.

The public enum and its variants lack rustdoc comments, which would help users understand the purpose and usage of each unary operation type.

📝 Suggested documentation
+/// Represents the type of unary operation in filter expressions.
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
 pub enum UnaryType {
+    /// Negates a numeric value.
     Negate,
+    /// Tests membership in a collection.
     In,
+    /// Logical NOT operation.
     Not,
+    /// Casts a value to boolean.
     BooleanCast,
+    /// Pattern matching operation.
     Like,
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7efc0cf and a34b87d.

📒 Files selected for processing (3)
  • rocketmq-filter/src/constant.rs
  • rocketmq-filter/src/constant/unary_type.rs
  • rocketmq-filter/src/lib.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: auto-approve
🔇 Additional comments (4)
rocketmq-filter/src/constant/unary_type.rs (2)

15-22: Well-formed enum definition with appropriate derives.

The UnaryType enum is correctly defined with suitable variants for unary operations. The derived traits (Debug, Clone, Copy, PartialEq, Eq, Hash) are appropriate for this use case.


16-22: Verify alignment with Java implementation.

The PR explicitly states the UnaryType enum was added "with Java code," but the original Java implementation could not be located in the official Apache RocketMQ repository. While the Rust codebase demonstrates consistent alignment with Java RocketMQ semantics elsewhere (BloomFilter, FilterSpi, BooleanExpression), the specific Java reference for the UnaryType enum (ISSUE #5424) cannot be independently verified. Please confirm the source of the Java implementation and ensure the five variants (Negate, In, Not, BooleanCast, Like) match the corresponding Java enum.

rocketmq-filter/src/constant.rs (1)

14-14: LGTM!

The module declaration is correct and follows Rust conventions for organizing related constants.

rocketmq-filter/src/lib.rs (1)

15-15: LGTM!

The new constant module is properly exposed in the library's public API and placed in alphabetical order with other module declarations.

@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.83%. Comparing base (7efc0cf) to head (a34b87d).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5453      +/-   ##
==========================================
- Coverage   37.83%   37.83%   -0.01%     
==========================================
  Files         811      811              
  Lines      109903   109903              
==========================================
- Hits        41585    41584       -1     
- Misses      68318    68319       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot left a comment

Choose a reason for hiding this comment

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

LGTM - All CI checks passed ✅

@mxsm mxsm merged commit 1a6af1b into mxsm:main Jan 5, 2026
12 of 22 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge Difficulty level/Easy Easy ISSUE feature🚀 Suggest an idea for this project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature🚀] Add UnaryType enumeration to rocketmq-filter crate (with Java code)

4 participants