Skip to content

Sorting of version fields is not numeric #757

Open
@Kanti

Description

@Kanti

Current Behavior

currently the order of versions is not always sorted by the numeric version number.

If you have eg. composer packages, there version number is prefixed by a v and with that the sorting is not done numerically.

e.g.

  • v1.0.0
  • v10.0.0
  • v2.0.0

if it is mixed with eg. npm components, there the version number is not prefixed.
Than the Sorting of npm packages are correct but the composer packages are also sorted at the buttom (v is after every number).

Steps to Reproduce

Have 3 Components with version numbers like v1.0.0 v2.0.0 and v10.0.0

Expected Behavior

it should sort numerically like this:

  • v1.0.0
  • v2.0.0
  • v10.0.0

if mixed with npm packges it should look something like this:

  • 1.0.0
  • v1.0.0
  • 1.5.0
  • v2.0.0
  • 9.0.0
  • v10.0.0

Dependency-Track Frontend Version

4.7.x

Browser

Mozilla Firefox

Browser Version

No response

Operating System

Windows

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSomething isn't workinggnomesIssues for milestone planning and effort estimation by the DT teamhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions