Add PURL generation from VCS URL for SPDX NTIA compliance#155
Merged
vpetersson merged 3 commits intomasterfrom Jan 29, 2026
Merged
Add PURL generation from VCS URL for SPDX NTIA compliance#155vpetersson merged 3 commits intomasterfrom
vpetersson merged 3 commits intomasterfrom
Conversation
NTIA Minimum Elements require a unique identifier (PURL) for the main component. This adds automatic PURL construction for SPDX SBOMs when: - No PURL exists on the main package - VCS info is available from CI environment Supported VCS hosts are mapped to their PURL types: - github.com -> pkg:github/owner/repo@sha - gitlab.com -> pkg:gitlab/owner/repo@sha - bitbucket.org -> pkg:bitbucket/owner/repo@sha This brings SPDX to parity with CycloneDX for NTIA element 4 (unique identifier) when the SBOM is generated in a CI environment with VCS info. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused `package_name` parameter from `_construct_purl_from_vcs()` - Remove dead code for PACKAGE_MANAGER category (VCS PURLs are always OTHER) - Handle GitLab nested groups by using last path component as repo name - Add test for GitLab nested groups (group/subgroup/project) - Update docstring to document behavior for self-hosted GitLab detection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The docstring incorrectly mentioned PACKAGE-MANAGER category but the code always uses OTHER for VCS-based PURLs (github/gitlab/bitbucket). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NTIA Minimum Elements require a unique identifier (PURL) for the main
component. This adds automatic PURL construction for SPDX SBOMs when:
Supported VCS hosts are mapped to their PURL types:
This brings SPDX to parity with CycloneDX for NTIA element 4 (unique
identifier) when the SBOM is generated in a CI environment with VCS info.