jenkins-infra / helpdesk

Open your Infrastructure related issues here for the Jenkins project
https://github.com/jenkins-infra/helpdesk/issues/new/choose
16 stars 10 forks source link

Exclude non-numeric plugin versions from Update Center #3317

Closed zbynek closed 1 year ago

zbynek commented 1 year ago

Service(s)

Update center

Summary

The update center publishes some very non-semantic plugin versions:

alibabacloud-ecs@alibabacloud-ecs-1.11
alibabacloud-ecs@y
buildrotator@y
categorized-view@y
cctray-xml@-rc26.47a8c6264c6d
confluence-publisher@-rc125.6ba78c5ed4a2
discord-notifier@v1.4.8
durable-task@-rc492.27169c99ee95
jabber@unspecified
jobcacher@-rc197.ca_db_107d3a_13
jobcacher@-rc198.8b_b_34da_c7403
jucies@unspecified
junit-realtime-test-reporter@y
logstash@-rc203.c5e91b42cf67
openshift-sync@y
prometheus@Bn
relution-publisher@true
requests@requests-2.0.1
requests@requests-2.1.0
requests@requests-2.2
simpleclearcase@pppppppppppppppppppp
upload-build-to-sofy@-rc31.651ac4e06d9e
upload-build-to-sofy@-rc32.ca9d99f51810
usemango-runner@y

These are not sorted properly on the plugin site because the version comparison is done by JS and does not 100% follow the Maven algorithm. Maybe instead of fixing that on the plugin site these should be simply not published by the UC.

Reproduction steps

Go to https://plugins.jenkins.io/requests/#releases -- the non-semantic versions should be at the bottom, like in https://updates.jenkins.io/download/plugins/requests/

To list all problematic versions you can go to https://updates.jenkins.io/current/plugin-versions.json and run this in console:

console.log([].concat(...Object.values(JSON.parse(document.body.innerText).plugins).map(x=>Object.values(x).filter(v=>!v.version.match(/^[0-9]+([-.].*)?$/)).map(v=>`${v.name}@${v.version}`)).filter(x=>x.length)).join("\n"));
MarkEWaite commented 1 year ago

@daniel-beck and @halkeye, do you have a preference for how this should be handled?

Rejecting incorrect version strings in update center seems consistent with its ability to suspend distribution of plugins, though deciding what is an incorrect version string may be more complicated than we want to include in the update center generator.

daniel-beck commented 1 year ago

do you have a preference for how this should be handled?

No preference, but note that "non-numeric" isn't the problem exactly. Lots of versions aren't (fully) numeric, including all of https://www.jenkins.io/doc/developer/publishing/releasing-experimental-updates/ as well as all JEP-229 CD versions with non-numeric suffix.

$ curl --silent https://updates.jenkins.io/current/update-center.actual.json | jq --raw-output '.plugins[].version' | grep -E '[^0-9.-]+' | wc -l
     297

(Granted, excluding the usual JEP-229 convention leaves only ~15, of which ~8 are JEP-229(ish) or JEP-305, i.e., likely badly set up JEP-229.)

Maven algorithm

FWIW it's likely actually https://github.com/jenkinsci/lib-version-number/

zbynek commented 1 year ago

Lots of versions aren't (fully) numeric

that's fine, my suggestion was just to remove plugin versions where the major version is not numeric. I believe that would not affect the latest version of any released plugin (full list of affected versions in issue description).

daniel-beck commented 1 year ago

A rule like "version needs to start with a digit" should be straightforward to implement (and document).

To confirm, all of these version numbers are fine then?

``` 0.1-preview-1 0.1-preview-2 0.1-preview-3 0.1-preview-4 0.1.6-RELEASE 0.10.1rc10 0.10.1rc6 1.0.1-prerelease192.v03d2a_b_2f36e6 1.0.1-prerelease193.v6c423de4b_8a_3 1.0.1-prerelease219.v72201397d73a 1.0.1-prerelease236.vd84fc1d933b_a 1.0.1-prerelease243.v39971973e590 1.0.1-prerelease245.v8334f684fa_97 1.0.1-prerelease250.v151e7b_11eb_97 1.0.1-prerelease252.v1c7ff5236013 1.0.1-prerelease254.v4819b_1c92a_d9 1.0.1-prerelease257.vb_7341f1216a_f 1.0.1-prerelease262.v555821e1def0 1.0.1-prerelease278.v4e17b_5b_4c7e2 1.0.1-prerelease286.v3f0b_94b_58d94 1.0.3-jenkins-1 1.0+build.10 1.0+build.14 1.0+build.20 1.0+build.30 1.0+build.33 1.0+build.4 1.0+build.5 1.0+build.50 1.0+build.51 1.0+build.53 1.0+build.7 1.0+build.8 1.0+build.9 1.02r 1.1+build.59 1.10+build.201608030223 1.10+build.201610041454 1.10+build.201611041949 1.11+build.201701152243 1.12+build.201704111018 1.12+build.201708172343 1.12+build.201805070054 1.12+build.201809041621 1.12+build.201809061734 1.13+build.202109302210 1.13+build.202110011108 1.13+build.202110011223 1.13+build.202111180915 1.13+build.202111181729 1.13+build.202111192133 1.13+build.202111200136 1.13+build.202111200525 1.13+build.202111200811 1.13+build.202111200854 1.13+build.202111201725 1.13+build.202111220004 1.13+build.202111221941 1.13+build.202111240043 1.13+build.202111250336 1.13+build.202111291630 1.13+build.202112011911 1.13+build.202112012056 1.13+build.202112022140 1.13+build.202112032101 1.13+build.202112032236 1.13+build.202112061615 1.13+build.202112201543 1.13+build.202112201608 1.13+build.202112271657 1.13+build.202112271752 1.13+build.202201031340 1.13+build.202201031417 1.13+build.202201031653 1.13+build.202201101545 1.13+build.202201101632 1.13+build.202201171452 1.13+build.202201171523 1.13+build.202201171559 1.13+build.202201171633 1.13+build.202201201754 1.13+build.202201201829 1.13+build.202201201901 1.13+build.202201221819 1.13+build.202201311606 1.13+build.202201311641 1.13+build.202201311744 1.13+build.202201311821 1.13+build.202202100032 1.13+build.202202112257 1.13+build.202202112334 1.13+build.202202120059 1.13+build.202202120254 1.13+build.202202141528 1.13+build.202202141611 1.13+build.202202151850 1.13+build.202202212113 1.13+build.202202281553 1.13+build.202203012346 1.13+build.202203020040 1.13+build.202203071536 1.13+build.202203141426 1.13+build.202203211645 1.13+build.202203211713 1.13+build.202203212026 1.13+build.202203221632 1.13+build.202204041554 1.13+build.202204041616 1.13+build.202204041635 1.13+build.202204111503 1.13+build.202204181545 1.13+build.202204241251 1.13+build.202205071934 1.13+build.202205140447 1.2+build.64 1.3+build.68 1.3+build.70 1.3+build.71 1.3+build.72 1.4-SHAPSHOT 1.4+build.102 1.5+build.117 1.5+build.118 1.5+build.119 1.5+build.120 1.5+build.123 1.6+build.130 1.6+build.132 1.6+build.135 1.6+build.138 1.6+build.140 1.6+build.142 1.6+build.149 1.6+build.150 1.6+build.156 1.6+build.159 1.6+build.162 1.6+build.163 1.6+build.164 1.7.24-jenkins-2 1.7+build.172 1.8-RELEASE 1.8+build.201601050116 1.8+build.201601052013 1.8+build.201601112328 1.9+build.201605021413 1.9+build.201606052339 1.9+build.201606131328 2.1.1-STAGING 2.3.O // db note: Actual letter o, not zero. 4.0.1.q ```