Skip to content

fix: labels namespace filtering in rules not working #4670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
May 6, 2025

Conversation

skynetigor
Copy link
Contributor

@skynetigor skynetigor commented May 1, 2025

Closes #4662

📑 Description

  • Improved CEL AST Serialization: Made the CEL AST JSON-friendly by integrating Pydantic models.
  • Simplified AST Structure: Removed the MethodAccess node to streamline the CEL AST structure.
  • Normalized String Matching Nodes: Replaced contains, startswith, and endswith method nodes with ComparisonNode using appropriate operators.
  • Read-Only Rule Display: Updated CelInput component to support read-only mode for displaying rules in the Correlation Rules table.
  • Reliable AST Parsing: Replaced the buggy react-querybuilder/parseCEL with a new approach that uses CEL AST JSON to construct the QueryBuilder structure.
  • Alert Query Refactor: Replaced the /alerts/search endpoint with /alerts/query for Correlation Rules.
image

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Copy link

vercel bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
keep ⬜️ Ignored (Inspect) Visit Preview May 5, 2025 7:12am

Copy link

codecov bot commented May 1, 2025

Codecov Report

Attention: Patch coverage is 78.14208% with 40 lines in your changes missing coverage. Please review.

Project coverage is 46.63%. Comparing base (2bd391e) to head (140cc0a).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
keep/api/core/cel_to_sql/ast_nodes.py 86.41% 11 Missing ⚠️
keep/api/core/cel_to_sql/sql_providers/base.py 75.00% 9 Missing ⚠️
...ep/api/core/cel_to_sql/sql_providers/postgresql.py 27.27% 8 Missing ⚠️
keep/api/core/cel_to_sql/cel_ast_converter.py 73.33% 4 Missing ⚠️
keep/api/core/cel_to_sql/sql_providers/mysql.py 33.33% 4 Missing ⚠️
keep/api/core/cel_to_sql/properties_mapper.py 88.88% 2 Missing ⚠️
keep/api/core/facets.py 50.00% 1 Missing ⚠️
keep/api/routes/rules.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4670      +/-   ##
==========================================
- Coverage   46.69%   46.63%   -0.07%     
==========================================
  Files         165      165              
  Lines       17005    17070      +65     
==========================================
+ Hits         7940     7960      +20     
- Misses       9065     9110      +45     

☔ 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.

@skynetigor skynetigor marked this pull request as ready for review May 4, 2025 08:42
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Bug Something isn't working Correlation UI User interface related issues labels May 4, 2025
Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 6, 2025
@skynetigor skynetigor merged commit 984ae52 into main May 6, 2025
20 checks passed
@skynetigor skynetigor deleted the 4662-labels-namespace-filtering-in-rules branch May 6, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Correlation lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files. UI User interface related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: labels.namespace filtering in rules
2 participants