infra-statistics icon indicating copy to clipboard operation
infra-statistics copied to clipboard

Plugin versions are not sorted by semver

Open strangelookingnerd opened this issue 1 year ago • 1 comments

Reproduction steps

  1. Pick any plugin such as custom-folder-icon from the generated stats -> https://github.com/jenkins-infra/infra-statistics/blob/gh-pages/plugin-installation-trend/custom-folder-icon.stats.json
  2. Notice that the order of installationsPerVersion and installationsPercentagePerVersion is made alphanumeric which does not work with semver

Expected Results

Versions sorted by semver:

"2.0": 0.00070848624,
"2.1": 0.00035424312,
"2.3": 0.030819152,
"2.4": 0.0014169725,
"2.5": 0.0042509176,
"2.6": 0.0031881882,
"2.7": 0.0046051606,
"2.8": 0.020900344,
"2.9": 0.030819152,
"2.10": 0.06270103,
"2.11": 0.0010627294,
"2.12": 0.25186685

Actual Results

Versions sorted alphanumerically:

"2.0": 0.00070848624,
"2.1": 0.00035424312,
"2.10": 0.06270103,
"2.11": 0.0010627294,
"2.12": 0.25186685,
"2.3": 0.030819152,
"2.4": 0.0014169725,
"2.5": 0.0042509176,
"2.6": 0.0031881882,
"2.7": 0.0046051606,
"2.8": 0.020900344,
"2.9": 0.030819152

Anything else?

Since these stats are being used by stats.jenkins.io this causes some charts to become confusing:

Installations by Version (Jun 2024)

strangelookingnerd avatar Nov 01 '24 13:11 strangelookingnerd