-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
CELExpressionExtractor
with a more robust parser implementa…
…tion (#34) This patch improves our CEL expression parsing system, replacing the regex based CELExpressionsExtractor with a more robust parser. The previous implementation relied heavily on regulars expressions, which proved to be ineffective for handling complex nested structures and led to limitations in accurat parsing and extracting CEL expressions from kubernetes resource definitions (`resources[*].definition`) The new parser uses a token aware string traversal approach. It scans input character by character recognizing `"${"` and `"}"` tokens. It tracks brace nesting to handle complex structures, including nestde dictionaries and conditionals. In a nutshell, this patch makes the following changes: - Remove the celextractor package and its regex based functionality - Introduce a new parser package with the token aware parsing algorithm - Support both schemaless and structured parsing. - Update the `resourcegroup`/`controller` packages to integrate the new parser - Add unit tests and reach 87.5% coverage. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
Showing
12 changed files
with
1,273 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.