Repository navigation
Conversation
Signed-off-by: juliosuas <juliosuas@users.noreply.github.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 33 |
| 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
5 files changed ·
|
|
review done by Claude Fable 5.1, prompt: "do a review, comment your findings" Verdict: LGTM with minor, non-blocking remarks. What I verified
Minor remarks (non-blocking)
Nothing blocking from my side. 👍 |
| self.expressions = expressions | ||
| self.timestamp = timestamp | ||
| self.attributed_to = attributed_to | ||
| self.process = process |
There was a problem hiding this comment.
In cyclonedx/model/citation.py (Citation.__init__, lines 78-87), if attributed_to is None and process is None: runs before self.attributed_to and self.process are normalized via _bom_ref_from_str(..., optional=True). Passing attributed_to='' (or process='') bypasses NoPropertiesProvidedException and sets both fields to None, so JsonV1Dot7 emits a citation entry without attributedTo or process that fails JsonStrictValidator(SchemaVersion.V1_7). Passing an empty BomRef() similarly serializes attributedTo as None and causes Citation(..., attributed_to=BomRef(), process='p1') == Citation(..., attributed_to=None, process='p1') to evaluate to False. Assigning self.attributed_to and self.process before checking if not self.attributed_to and not self.process: keeps constructor validation and equality aligned with the 1.7 schema.
Disclosure: Review and test verification conducted with assistance from Gemini 4 Argon.
Signed-off-by: juliosuas <juliosuas@users.noreply.github.com>
Align the schema-support wording to "Since next", drop "extension" from the Citation module docstring, and add a fixture citation that sets both attributed_to and process. Signed-off-by: juliosuas <juliosuas@users.noreply.github.com>
Description
Adds support for the CycloneDX v1.7
citationselement on the BOM.Citationmodel (cyclonedx/model/citation.py), covering bom-ref, pointers/expressions, timestamp, attributed-to, process and note.Bom(citations=...): the citations are serialized only for schema version 1.7. Older schema versions leave them out.docs/schema-support.rstupdated.Refs #903
Out of scope (intentionally)
signatureon citationsBomRefDiscriminatorintegration for citation bom-refsTesting
AI disclosure
AI tools helped write this change. I reviewed and tested it before opening the PR.
Affirmation