Skip to content

Use modern CycloneDX tools metadata - #6785

Merged
nscuro merged 2 commits into
DependencyTrack:mainfrom
AKSHATSPAR:issue-3937-modern-cyclonedx-tools
Aug 21, 2026
Merged

nscuro merged 2 commits into
DependencyTrack:mainfrom
AKSHATSPAR:issue-3937-modern-cyclonedx-tools

Conversation

@AKSHATSPAR

@AKSHATSPAR AKSHATSPAR commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

CycloneDX 1.5 added a component and service based shape for metadata.tools, but Dependency-Track exports still use the deprecated tools array.

This updates 1.5 and newer exports to identify Dependency-Track as an application component. CycloneDX 1.2 through 1.4 exports keep the legacy array. Versions 1.0 and 1.1 continue to omit tool metadata because those schemas do not define it. The requested spec version is now passed into metadata generation for project, component, VDR, and VEX exports.

I also added JSON and XML coverage for versions 1.2 through 1.6, including schema validation and round-trip parsing.

Addressed Issue

Fixes #3937

Additional Details

This PR changes export behavior only. Dependency-Track already models both legacy and component/service-based tool metadata.

Checks run locally:

  • BomResourceTest and VexResourceTest
  • Legacy and modern metadata tools import tests
  • make lint-java AGENT=1
  • make build AGENT=1

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have updated the migration changelog accordingly
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly
  • This PR is a substantial change (per the ADR criteria), and I have added an ADR under docs/adr/

@owasp-dt-bot

owasp-dt-bot commented Jul 22, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

codacy-production Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 8 complexity

Metric Results
Complexity 8

View in Codacy

🟢 Coverage 88.57% diff coverage · -0.08% coverage variation

Metric Results
Coverage variation ✅ -0.08% coverage variation (-1.00%)
Diff coverage ✅ 88.57% diff coverage (70.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (018760a) Report Missing Report Missing Report Missing
Head commit (13592bb) 42967 (+18) 37324 (-20) 86.87% (-0.08%)

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 (#6785) 35 31 88.57%

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%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

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.

Represent Dependency-Track as a component in CycloneDX 1.5 and newer
exports while retaining legacy tool metadata for older schemas. Add
serialization and schema validation coverage.

Signed-off-by: Akshat Sparsh <akshatsparsh@gmail.com>
@AKSHATSPAR
AKSHATSPAR force-pushed the issue-3937-modern-cyclonedx-tools branch from c5dbc65 to 18980b1 Compare July 22, 2026 11:48

@nscuro nscuro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Minor test rearrangement please, otherwise looks good.

@nscuro nscuro added this to the 5.1 milestone Jul 24, 2026
@nscuro nscuro added the enhancement New feature or request label Jul 24, 2026
Keep the version-specific JSON and XML coverage alongside the existing project export tests.

Signed-off-by: Akshat Sparsh <akshatsparsh@gmail.com>
@AKSHATSPAR
AKSHATSPAR requested a review from nscuro July 24, 2026 14:27
@AKSHATSPAR

Copy link
Copy Markdown
Contributor Author

Hi @nscuro, the requested test rearrangement is in place. I also ran the full test suite locally against the current main, and it passes. When you have a chance, could you please take another look? Thanks!

@nscuro
nscuro merged commit c157ee4 into DependencyTrack:main Aug 21, 2026
18 of 19 checks passed
@nscuro nscuro mentioned this pull request Sep 8, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move from unsupported tools property to replacement

3 participants