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

deps extractor: Add support for subfilesystems/subpaths #5128

Open
puerco opened this issue Dec 4, 2024 · 0 comments
Open

deps extractor: Add support for subfilesystems/subpaths #5128

puerco opened this issue Dec 4, 2024 · 0 comments
Labels

Comments

@puerco
Copy link
Contributor

puerco commented Dec 4, 2024

Minder's dependency extractor interface takes an fs.FS filesystem and walks through it, returning dependency data from any source it finds. The whole filesystem approach makes it hard for rules that need to evaluate only from dependencies sourced from a subpath of the code base. The best example of this is a monorepo when many projects are hosted in the same repository.

To solve this we should add a setting to the dependency extractor options (these don't exist yet) with a path we could use to restrict the scanning process. There are several ways of approaching this:

  1. Support fs.SubFS: The problem here is that we reduce the kinds of filesystems we can feed to the extractor (not all fs.FS implementations support SubFS)
  2. Filter results: This means inefficiently scanning the directories that are out of scope.
  3. A mix of both
  4. Another method

The path could also be a file.
This is useful when we know the exact source of dependencies (eg requirements.txt in python projects). In this case we could scope the extractor scanning process to only act on that file.

Related to #5127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant