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

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Derive package folder from purl #98

merged 3 commits into from
Jan 23, 2025

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.

@san-zrl san-zrl added the enhancement New feature or request label Jan 19, 2025
Signed-off-by: san-zrl <[email protected]>
@n1ckl0sk0rtge n1ckl0sk0rtge merged commit b4df18e into main Jan 23, 2025
4 checks passed
@n1ckl0sk0rtge n1ckl0sk0rtge deleted the purl-folder branch January 23, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants