feat: add support for Bom.annotations - #1035
Open
saquibsaifee wants to merge 4 commits into
Open
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
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.
Documentation build overview
8 files changed ·
|
Adds Annotation and Annotator models and integrates them into Bom.annotations. The property is gated with @serializable.view for schema versions 1.5, 1.6, and 1.7. - cyclonedx/model/annotation.py: new Annotator and Annotation classes - cyclonedx/model/bom.py: replaces the TODO placeholder with a live annotations property - tests/test_model_annotation.py: 8 unit tests, 100% coverage - tests/_data/models.py: get_bom_with_annotations() fixture Closes CycloneDX#578 (Missing annotations on Bom) Signed-off-by: saquibsaifee <saquibsaifee2@gmail.com>
saquibsaifee
force-pushed
the
feat-bom-annotations-10219399216754954684
branch
from
September 1, 2026 16:48
cbcd7d3 to
b9285d4
Compare
- Wire get_bom_with_annotations() into the integration test fixtures by moving it before the all_get_bom_funct_* tuples so it is auto-discovered - Add it to all_get_bom_funct_with_incomplete_deps (no dep graph set) - Fix serialization: bom-ref uses json_name/xml_name decorators and bom_ref_from_str to avoid double-wrapping on deserialization - Fix subjects: use _AnnotationSubject XML wrapper with a custom _SubjectsSerializationHelper that handles both JSON (plain strings) and XML (<subject ref='...'/> elements) correctly - Generate all 14 snapshot binaries (JSON + XML for schema 1.0–1.7) Signed-off-by: saquibsaifee <saquibsaifee2@gmail.com>
Both classes are stored in SortedSet so they require __lt__. Adopt the _ComparableTuple pattern used by Vulnerability and Service for __eq__, __lt__, and __hash__ consistency. Also align _SubjectsSerializationHelper.deserialize return type with xml_denormalize — both now return set[_AnnotationSubject]. Signed-off-by: saquibsaifee <saquibsaifee2@gmail.com>
Contributor
Author
|
@jkowalleck does this look promising? |
saquibsaifee
force-pushed
the
feat-bom-annotations-10219399216754954684
branch
2 times, most recently
from
September 1, 2026 18:55
aa83269 to
2f24862
Compare
Replace getter/setter and eq/hash unit tests with sort and invalid-construction tests, matching the pattern used by all other test_model_*.py files. Signed-off-by: saquibsaifee <saquibsaifee2@gmail.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.
Description
Addresses one of the missing features outlined in #578 for full CycloneDX v1.5 schema support. This PR adds the
AnnotationandAnnotatormodels and integrates them intoBom.annotations. It also includes a corresponding test fixture and updated snapshots.AI Tool Disclosure
Gemini JulesGemini 3.1 ProAffirmation