APPENG-5614 : Escape regex metacharacters in Function Caller Finder#281
Merged
Conversation
APPENG-5614: Fix regex escaping in function_name_extractor Escape regex metacharacters (., [], +, etc.) in function name prefix so identifiers like "protojson.Unmarshal" or "[]byte" are treated as literals instead of regex patterns. Note: The other changes from APPENG-5614 (pre-indexing, dedup, DFS ordering in chain_of_calls_retriever.py) are already in main. Split from: RHEcosystemAppEng#261 Signed-off-by: RedTanny <stanny@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
zvigrinberg
reviewed
Jul 8, 2026
Comment on lines
74
to
75
Collaborator
There was a problem hiding this comment.
@RedTanny A Small suggestion related to the theme of the PR but not something introduced by the PR itself : to escape also metacharacters from extracted arguments/parameters if they're composite type like array and contains also maybe other metacharacters.
Suggested change
| if (param.startswith("'") and param.endswith("'")) or (param.startswith('"') and param.endswith('"')): | |
| return re.escape(param) |
Collaborator
Author
There was a problem hiding this comment.
zvigrinberg
approved these changes
Jul 8, 2026
zvigrinberg
left a comment
Collaborator
There was a problem hiding this comment.
@RedTanny LGTM Approved.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
APPENG-5614: Fix regex escaping in function_name_extractor
Escape regex metacharacters (., [], +, etc.) in function name prefix so identifiers like "protojson.Unmarshal" or "[]byte" are treated as literals instead of regex patterns.
Note: The other changes from APPENG-5614 (pre-indexing, dedup, DFS ordering in chain_of_calls_retriever.py) are already in main.
Split from: #261