redhat-developer / alizer

⛔️ DEPRECATED - Application analyzer toolkit, use https://github.com/devfile/alizer instead
Apache License 2.0
12 stars 17 forks source link

Alizer component scanning should exclude vendor folders #208

Closed yangcao77 closed 1 year ago

yangcao77 commented 1 year ago

as discussed in https://redhat-internal.slack.com/archives/C04PZ7H0VA8/p1683797822489049

the vendor folder were also scanned and components are being returned

which is causing performance problems as time was spent on unnecessary files & folders for component/port detection

mike-hoang commented 1 year ago

Added vendor to the Go exclude_folders in the languages-customization.yml and confirmed that the directory is skipped when scanning.

External repo test is failing (maybe due to how the repo is structured), will look into it

mike-hoang commented 1 year ago

After more digging, it turns out that exclude_folders does not filter out file paths when searching and is used when checking if the file is valid for component detection (i.e. package.json inside the node_modules is invalid)

To exclude directories, GetFilePathsFromRoot needs to be updated. Currently it excludes anything found in .gitignore which was why my initial confirmation was wrong (my test repo had a gitignore that included the vendor dir)