feat(poetry): extract SHA-256 hashes from poetry.lock for SBOM generation#534
Open
a-oren wants to merge 1 commit into
Open
feat(poetry): extract SHA-256 hashes from poetry.lock for SBOM generation#534a-oren wants to merge 1 commit into
a-oren wants to merge 1 commit into
Conversation
…tion Extend _extractMarkerData() to extract files[].hash entries per package from poetry.lock and populate graph entries with SHA-256 hashes. Prefers sdist (.tar.gz) hash over wheel hashes. The hashes flow through the existing base_pyproject pipeline into CycloneDX SBOM components. Implements TC-4333 Assisted-by: Claude Code
Reviewer's GuideExtend the Python Poetry provider to extract SHA-256 hashes from poetry.lock file entries, attach them to the dependency graph, and propagate them into generated CycloneDX SBOM fixtures for poetry-based projects. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- _extractMarkerData() is now responsible for both marker extraction and hash extraction, which makes the name and responsibility misleading; consider either renaming it or splitting the hash handling into a separate helper to keep concerns clear.
- _extractSha256FromFiles() assumes each files[] entry has a truthy file and hash field; it may be safer to guard against malformed entries (e.g., missing file/hash) before accessing endsWith/hash to avoid runtime errors on unexpected lockfile formats.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- _extractMarkerData() is now responsible for both marker extraction and hash extraction, which makes the name and responsibility misleading; consider either renaming it or splitting the hash handling into a separate helper to keep concerns clear.
- _extractSha256FromFiles() assumes each files[] entry has a truthy file and hash field; it may be safer to guard against malformed entries (e.g., missing file/hash) before accessing endsWith/hash to avoid runtime errors on unexpected lockfile formats.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
Verification Report for TC-4333 (commit 42d49e6)
Overall: PASSAll checks pass. Implementation correctly extracts SHA-256 hashes from This comment was AI-generated by sdlc-workflow/verify-pr v0.5.11. |
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
poetry.lockfiles[].hashentries in the poetry provider_extractMarkerData()to build a hash map per package, preferring sdist (.tar.gz) hashesbase_pyprojectpipeline into CycloneDX SBOM componentsImplements TC-4333
Test plan
hashesarray with SHA-256 entries🤖 Generated with Claude Code
Summary by Sourcery
Add support for extracting SHA-256 hashes from poetry.lock and propagating them into generated SBOM components.
New Features:
Enhancements:
Tests: