Skip to content

fix(log-surgeon): Disable capture groups in schema due to subquery decomposition limitations in schema-based search.#1959

Merged
SharafMohamed merged 3 commits into
y-scope:mainfrom
SharafMohamed:disable-captures
Feb 9, 2026
Merged

fix(log-surgeon): Disable capture groups in schema due to subquery decomposition limitations in schema-based search.#1959
SharafMohamed merged 3 commits into
y-scope:mainfrom
SharafMohamed:disable-captures

Conversation

@SharafMohamed

@SharafMohamed SharafMohamed commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Description

  • Temporarily disable capture group support in CLP, since Log Surgeon does not currently support search with capture groups.
  • Previously, multi-captures were meant to be disabled in CLP/CLG/CLO, but were only disabled in CLG/CLO. This PR ensures they are disabled everywhere.
    • Note: When single-captures are re-enabled, changes will be required in both the CLP location and the CLG/CLO location.

Validation Performed

  • Updated the unit-tests to confirm that any schema containing capture groups triggers errors in both the CLP path and the CLG/CLO path.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved schema validation to reject regex patterns containing capture groups with enhanced error messages. The system now identifies the problematic rule and schema file location, catching invalid configurations earlier in the process to prevent downstream issues.

@SharafMohamed SharafMohamed requested a review from a team as a code owner February 5, 2026 13:05
@coderabbitai

coderabbitai Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The changes implement stricter validation for capture groups in schema rules by rejecting any capture groups (previously only multiple groups were invalid). Runtime validation was added to fail early when loading schemas containing capture groups in regex patterns.

Changes

Cohort / File(s) Summary
Capture Group Validation Logic
components/core/src/clp/Utils.cpp, components/core/src/clp/clp/run.cpp
Modified validation to reject all capture groups (not just multiple). Utils.cpp changes threshold from 1 to 0 captures; run.cpp adds new runtime inspection of parser lexer rules to throw errors when capture groups are detected, including schema file path and rule name in error messages.
Test Updates
components/core/tests/test-ParserWithUserSchema.cpp
Converted test cases from validating successful schema parsing and internal capture mechanics to asserting exception-based failures. Tests now verify that schemas with any capture groups correctly raise errors during loading and compression operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: disabling capture groups in schemas to address Log Surgeon limitations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@SharafMohamed SharafMohamed changed the title fix: disable capture groups in schema to prevent search errors. fix(log-surgeon): Disable capture groups in schema due to subquery decomposition limitations in schema-based search. Feb 9, 2026
@SharafMohamed SharafMohamed merged commit fede734 into y-scope:main Feb 9, 2026
27 checks passed
@junhaoliao junhaoliao added this to the February 2026 milestone Feb 26, 2026
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…composition limitations in schema-based search. (y-scope#1959)

Co-authored-by: SharafMohamed <SharafMohamed@users.noreply.github.com>
Co-authored-by: davidlion <david.lion@yscope.com>
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