Skip to content

feat: Add version_range property to Component for CycloneDX v1.7 - #1032

Open
nulano wants to merge 1 commit into
CycloneDX:mainfrom
nulano:feature/version-range
Open

feat: Add version_range property to Component for CycloneDX v1.7#1032
nulano wants to merge 1 commit into
CycloneDX:mainfrom
nulano:feature/version-range

Conversation

@nulano

@nulano nulano commented Aug 28, 2026

Copy link
Copy Markdown

Description

Implement the versionRange property for Compoments as specified in the CycloneDX v1.7 schema. The versionRange can be specified instead of the version for external components to specify the accepted version range.

  • Add version_range property to Component with serialization decorators.
  • Adjust Component.repr to show whether a component is external and the version_range if provided.
  • Extend Bom.validate with validation for CycloneDX v1.7 requirements regarding versionRange and isExternal.
  • Add unit tests for Component.version_range proprety and Bom.validate changes.
  • Add serialization snapshot tests for various kinds of external components.

Resolves or fixes issue: part of #903 (versionRange)

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: [e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]
    • LLMs and versions: [e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.]
    • Prompts: [Summarize the key prompts or instructions given to the AI tools]

Affirmation

Implement the versionRange property for Compoments as specified in the CycloneDX v1.7 schema.
The versionRange can be specified instead of the version for external components to specify the accepted version range.

* Add version_range property to Component with serialization decorators.
* Adjust Component.__repr__ to show whether a component is external and the version_range if provided.
* Extend Bom.validate with validation for CycloneDX v1.7 requirements regarding versionRange and isExternal.
* Add unit tests for Component.version_range proprety and Bom.validate changes.
* Add serialization snapshot tests for various kinds of external components.

Implements part of CycloneDX#903

Signed-off-by: Ondrej Baranovič <nulano@nulano.eu>
@nulano
nulano requested a review from a team as a code owner August 28, 2026 15:55
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

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.

@read-the-docs-community

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant