Skip to content

Backport: Remove unnecessary enrichment when querying for individual projects - #7258

Merged
nscuro merged 1 commit into
DependencyTrack:4.14.xfrom
nscuro:backport-pr-6514-4.14.x
Sep 8, 2026
Merged

nscuro merged 1 commit into
DependencyTrack:4.14.xfrom
nscuro:backport-pr-6514-4.14.x

Conversation

@nscuro

@nscuro nscuro commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Description

Removes unnecessary enrichment when querying for individual projects.

Addressed Issue

Backports #6514

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 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/

Removes metrics and versions enrichment from
`ProjectQueryManager#getLatestProjectVersion(name)` and
`#getProject(name, version)`. That data is only needed by the two
`ProjectResource` endpoints that return the project to the client, but all
other call sites paid the cost for it despite not needing it. In v4 those are
the BOM and VEX upload endpoints, the badge endpoints, and the seven call
sites that only resolve the previous latest version in order to unset its
`isLatest` flag.

Enrichment is now done directly at the call sites where it's needed. The
badge endpoints already re-queried the metrics themselves, so they lose a
redundant round trip as well.

Both queries now also close their JDO `Query` via `executeAndCloseUnique`.

(cherry picked from commit 980d239)
Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro added this to the 4.14.4 milestone Sep 8, 2026
@nscuro nscuro added the defect Something isn't working label Sep 8, 2026
@owasp-dt-bot

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.

@nscuro nscuro added enhancement New feature or request and removed defect Something isn't working labels Sep 8, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 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.

@nscuro
nscuro merged commit 4324951 into DependencyTrack:4.14.x Sep 8, 2026
9 checks passed
@nscuro
nscuro deleted the backport-pr-6514-4.14.x branch September 8, 2026 11:10
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.

2 participants