Skip to content

Fix project sorting by version#6652

Merged
nscuro merged 1 commit into
DependencyTrack:mainfrom
bergerst:fix-project-version-query
Jul 10, 2026
Merged

Fix project sorting by version#6652
nscuro merged 1 commit into
DependencyTrack:mainfrom
bergerst:fix-project-version-query

Conversation

@bergerst

Copy link
Copy Markdown
Contributor

Description

Fixes an error when querying for projects sorted by version.

All other sort columns have lowercase synonyms in the query, but version was forgotten.

This results in a query error where PostgreSQL cannot find a "version" column.

Addressed Issue

Fixes #6651

Additional Details

An alternative to giving each sortable column an alias would be to specify the original column as part of queryName in the annotation:
https://github.com/bergerst/dependency-track/blob/main/apiserver/src/main/java/org/dependencytrack/persistence/jdbi/FindingDao.java#L865

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/

Signed-off-by: Berger Stefan <stefan.berger@x-tention.at>
@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.

@codacy-production

codacy-production Bot commented Jul 10, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation +0.00% coverage variation (-1.00%)
Diff coverage diff coverage (70.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c8a6038) 42816 37144 86.75%
Head commit (7977880) 42816 (+0) 37144 (+0) 86.75% (+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 (#6652) 0 0 ∅ (not applicable)

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%

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.

@bergerst bergerst changed the title Fixes project sorting by version Fix project sorting by version Jul 10, 2026

@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!

@nscuro nscuro added this to the 5.1 milestone Jul 10, 2026
@nscuro nscuro added defect Something isn't working backport/5.0.3 PRs to be backported to v5.0.3 labels Jul 10, 2026
@nscuro nscuro merged commit 341c917 into DependencyTrack:main Jul 10, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/5.0.3 PRs to be backported to v5.0.3 defect Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP 500 when sorting projects by version in API

3 participants