Skip to content
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

✨ Add go grep package to replace OS-specific grep commands for builtin provider #737

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kthatipally
Copy link
Contributor

@kthatipally kthatipally commented Nov 22, 2024

PR Summary

This pull request introduces a cross-platform supported grep package to replace OS-specific grep commands.
This the regex2 package to scan files and search for patterns, making the codebase more portable and easier to maintain: https://github.com/dlclark/regexp2 (supports lookahead)

provider/internal/builtin/service_client.go: Replaced OS-specific grep command with a cross-platform solution using regexp2 and file scanning.
go.mod and go.sum: Added regexp2 dependency.

WIP: Testing, resolve merge-conflicts

@kthatipally kthatipally changed the title :feature: Add go grep package to replace OS-specific grep commands for builtin provider ✨ Add go grep package to replace OS-specific grep commands for builtin provider Nov 22, 2024
Signed-off-by: kthatipally <[email protected]>
@kthatipally kthatipally force-pushed the kthatipally/add-grep-regex2-go-package branch from 5b73431 to e002d57 Compare November 22, 2024 22:48
@kthatipally kthatipally changed the title ✨ Add go grep package to replace OS-specific grep commands for builtin provider ✨ Add go grep package to replace OS-specific grep commands for builtin provider Nov 22, 2024
@jmle jmle added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 10, 2024
}

if f.Mode().IsRegular() {
eg.Go(func() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to put a limit on this across the engine this could spawn a bunch of go routines I think just setting the limit on the errorgroup.Group should be enough

@shawn-hurley
Copy link
Contributor

We need to test this with this rule id to make sure that it covers the lookahead and lookbehind

https://github.com/konveyor/rulesets/blob/f7ce5496f11d73d40c126a8d9be5f3880481a2a3/default/generated/eap7/108-eap6.windup.yaml#L112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants