Skip to content

Bulk load component relationships for BOM export#5147

Merged
nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro:issue-5107
Jul 27, 2025
Merged

Bulk load component relationships for BOM export#5147
nscuro merged 1 commit intoDependencyTrack:masterfrom
nscuro:issue-5107

Conversation

@nscuro
Copy link
Copy Markdown
Member

@nscuro nscuro commented Jul 27, 2025

Description

Bulk loads component relationships for BOM export.

Addressed Issue

Fixes #5107

Additional Details

N/A

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 added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@nscuro nscuro added this to the 4.14.0 milestone Jul 27, 2025
Copilot AI review requested due to automatic review settings July 27, 2025 15:53
@nscuro nscuro added defect Something isn't working backport/4.13.3 PRs to be backported to v4.13.3 labels Jul 27, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the BOM export functionality by bulk loading component relationships to improve performance during CycloneDX export operations.

  • Introduces scoped customization with FetchGroup.ALL to bulk load component relationships
  • Restructures component and service fetching to use try-with-resources for proper resource management
Comments suppressed due to low confidence (1)

src/main/java/org/dependencytrack/parser/cyclonedx/CycloneDXExporter.java:64

  • The variable name 'ignored' is misleading since the ScopedCustomization resource is being actively used for its scoping behavior. Consider renaming to 'scopedCustomization' or 'fetchScope' to better reflect its purpose.
        try (final var ignored = new ScopedCustomization(qm.getPersistenceManager())

@owasp-dt-bot
Copy link
Copy Markdown

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

security/snyk check is complete. No issues have been found. (View Details)

@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9e7332a) 24095 19491 80.89%
Head commit (4594f82) 24097 (+2) 19493 (+2) 80.89% (+0.00%)

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 (#5147) 4 4 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%

See your quality gate settings    Change summary preferences

@nscuro nscuro merged commit b06209d into DependencyTrack:master Jul 27, 2025
11 of 12 checks passed
@nscuro nscuro deleted the issue-5107 branch July 27, 2025 17:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/4.13.3 PRs to be backported to v4.13.3 defect Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lazy Evalution of Component properties to distant RDS causes long BOM download times

3 participants