feat: add contrib.bom.utils.BomDependencyGraphFlatMerger#997
Conversation
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Documentation build overview
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.04% coverage variation
Metric Results Coverage variation ✅ +0.04% coverage variation Diff coverage ✅ 100.00% diff coverage (80.00%) Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (9beaf5c) 6050 5699 94.20% Head commit (d791222) 6078 (+28) 5728 (+29) 94.24% (+0.04%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#997) 29 29 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
Adds a contrib utility to flatten/merge a BOM dependency graph into a non-recursive representation, intended to help with cases where nested Dependency structures are not serialized as expected (related to #941).
Changes:
- Introduces
contrib.bom.utils.BomDependencyGraphFlatMergeras a context-manager for temporary flatten/merge ofBom.dependencies. - Adds unit tests exercising both manual
reset()and context-manager usage for the new merger.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cyclonedx/contrib/bom/utils.py |
Adds BomDependencyGraphFlatMerger and exports it via __all__. |
tests/test_contrib/test_bom_utils.py |
Adds tests validating flatten/merge behavior and restoration of original dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
add a utility to flatten/merge bom dependnecy graphs.
related to #941
AI Tool Disclosure
[e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.][e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.][Summarize the key prompts or instructions given to the AI tools]Affirmation