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

Derive package folder from purl #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Derive package folder from purl #98

wants to merge 1 commit into from

Conversation

san-zrl
Copy link
Member

@san-zrl san-zrl commented Jan 17, 2025

This PR adds code that derives the package folder from a given purl. Scanning will then take place in the package folder only.

The package folder is detected by traversing the repo's directory tree and inspecting all build files. The name of the build file and the method of parsing its content depends on the build environment used for the package. Build file inspection is currently implemented for pom.xml files (for pkg:maven purls) and pyproject.toml files (for pkg:pypi purls). The package folder is the directory hat contains the build file which builds the package with the same name as the purl's name part. If found the package folder overrides the subfolder that can be specified in the UI.

As a result of this PR the key for uniquely identifying a CBOM has changed. It is either the combination of [giturl, commit, subfolder] or [purl, commit].

Still to be implemented: inspection of gradle build files for maven purls. and setup.cfg (.py) files for pypi purls.

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

Successfully merging this pull request may close these issues.

2 participants