feat(materials): extract main component info from SPDX files#2984
Open
waveywaves wants to merge 2 commits intochainloop-dev:mainfrom
Open
feat(materials): extract main component info from SPDX files#2984waveywaves wants to merge 2 commits intochainloop-dev:mainfrom
waveywaves wants to merge 2 commits intochainloop-dev:mainfrom
Conversation
143b790 to
76e2477
Compare
Follow the CycloneDX pattern to extract and populate MainComponent in SBOMArtifact for SPDX JSON materials. Uses spdxlib.GetDescribedPackageIDs to find the described package, then extracts name, version, and kind (PrimaryPackagePurpose). Container names are standardized via go-containerregistry. Gracefully skips when no described package is found. Fixes chainloop-dev#2580 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
The Id field is deprecated in crafting_state.proto (kept only for server-side compatibility). Remove the test assertion to fix the SA1019 staticcheck lint failure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
76e2477 to
9e0f4dc
Compare
Contributor
Author
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.
Summary
spdxlib.GetDescribedPackageIDsto identify the described package, then populateSBOMArtifact.MainComponentwith the package's name, version, and lowercasedPrimaryPackagePurposego-containerregistry(same as CycloneDX) and gracefully skip when no described package is foundFixes #2580
Test plan
go vetpasses cleanly🤖 Generated with Claude Code