Skip to content

Conversation

@lucarlig
Copy link
Collaborator

@lucarlig lucarlig commented Feb 6, 2026

🔗 Related Issue

#2730 (partial close - first checklist item)


📝 Summary

Refactored pii_filter from a module within the plugins_rust crate into a standalone workspace subcrate. This improves modularity, enables independent versioning, and simplifies the build process for the PII filter plugin.

Changes:

  • Moved pii_filter module to plugins_rust/pii_filter/ as a workspace member
  • Created dedicated Cargo.toml and Makefile for the subcrate
  • Updated workspace-level Cargo.toml and Makefile to reference the new subcrate
  • Migrated benchmarks, tests, and documentation to the subcrate directory
  • Fixed deprecated method calls (trim_left_matchestrim_start_matches, trim_right_matchestrim_end_matches)
  • Updated module imports and visibility modifiers for the new structure
  • Updated to 2024 edition
  • changed deprecated methods downcast, blackbox

🏷️ Type of Change

  • Bug fix
  • Feature / Enhancement
  • Refactor
  • Chore (deps, CI, tooling)
  • Documentation
  • Other (describe below)

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 80% make coverage 36%

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • Tests added/updated for changes
  • Documentation updated (if applicable)
  • No secrets or credentials committed

📓 Notes

This PR completes the first item of issue #2730: "move pii_filter to a subcrate including fixing Makefiles etc". The subcrate now has its own build configuration and can be developed/tested independently while remaining part of the workspace.

The refactor maintains all existing functionality while improving the project structure for better maintainability and future extensibility.

Coverage for pii_filter need to be handled in a new pr for #1620 where also performance improvements can be investigated.
The integration tests was broken and needs to be rewritten using new version of pyo3 this can be done together with the second task of #2730 once the bridge is ready.

@lucarlig lucarlig self-assigned this Feb 6, 2026
@lucarlig lucarlig added rust Rust programming plugins labels Feb 6, 2026
@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch 2 times, most recently from 836db0d to fccb1ed Compare February 6, 2026 15:44
@lucarlig lucarlig changed the title 2730 rust refactor pyo3 common crate 2730 rust refactor pii_filter to own crate Feb 6, 2026
@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch from fccb1ed to 65b0313 Compare February 6, 2026 16:23
@crivetimihai crivetimihai self-assigned this Feb 6, 2026
@crivetimihai crivetimihai added this to the Release 1.0.0-RC1 milestone Feb 7, 2026
@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch from 65b0313 to 57fc5e8 Compare February 9, 2026 07:15
@crivetimihai
Copy link
Member

Excellent refactoring work, @lucarlig! The workspace structuring is clean — proper metadata inheritance, backward-compatible re-export, and the PyO3 0.28 migration is consistently applied. The let-chain refactoring using Rust 2024 edition features improves readability nicely.

One question: the subcrate's Cargo.toml has crate-type = ["rlib", "cdylib"] unconditionally. The cdylib target is only needed for the standalone Python module (with extension-module feature). Does a plain cargo build without --features extension-module succeed? If not, consider making cdylib conditional on the feature flag.

Minor: small typo in the Makefile help output — trailing period and space after make dev. LGTM!

@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch from 57fc5e8 to 1abac4d Compare February 10, 2026 11:14
@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch from 1abac4d to 0ddcda8 Compare February 10, 2026 11:33
@lucarlig
Copy link
Collaborator Author

@crivetimihai thanks for review, i removed outdated/broken integration tests, there is issue #2730 for rewriting in python and this will allow me start setting up the CI as well. cleaned up unnecessary files now should be better, completely removed the no-default-feature and cdylib are not required as you suggested.

@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch from fb5290c to 7fd28d5 Compare February 10, 2026 12:37
@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch 2 times, most recently from c90fb6f to 5cbac8d Compare February 10, 2026 13:11
Signed-off-by: lucarlig <[email protected]>
@lucarlig lucarlig force-pushed the 2730-rust-refactor-pyo3-common-crate branch from 5cbac8d to 86ffd39 Compare February 10, 2026 13:17
@lucarlig
Copy link
Collaborator Author

@crivetimihai should be all good now, final review and merge, I also fixed the CI.

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

Labels

plugins rust Rust programming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants