api.adoptium.net icon indicating copy to clipboard operation
api.adoptium.net copied to clipboard

Improve the latest version updating to be dynamic

Open johnoliver opened this issue 2 years ago • 1 comments

Currently the latest version is set at compile or runtime at:

https://github.com/adoptium/api.adoptium.net/blob/main/adoptium-models-parent/adoptium-api-v3-models/src/main/kotlin/net/adoptium/api/v3/models/Versions.kt#L14

But does not update when a new release is performed, requiring a re-deploy when we release a new major version.

We could make this more dynamic by sing the "tip information" that we pull down at:

https://github.com/adoptium/api.adoptium.net/blob/main/adoptium-updater-parent/adoptium-api-v3-updater/src/main/kotlin/net/adoptium/api/v3/dataSources/ReleaseVersionResolver.kt#L20

That tells us what is the latest version is in source code, so gives us a number that we could set the latest version number to, just need to figure out how to expose that version number and set it inside Versions.kt.

One issue: the incremental update only updates major versions that already exist within the repository, (see https://github.com/adoptium/api.adoptium.net/blob/main/adoptium-updater-parent/adoptium-api-v3-updater/src/main/kotlin/net/adoptium/api/v3/AdoptReposBuilder.kt#L46) as such, updating the Versions will not be enough on its own, the incremental update code would also need to be altered to look for a new major version too.

johnoliver avatar Nov 07 '23 20:11 johnoliver

Also noting that we should automate the LTS detection using the same logic we wrote in https://github.com/adoptium/marketplace-api.adoptium.net/blob/main/adoptium-marketplace-schema/src/main/java/net/adoptium/marketplace/schema/OpenjdkVersionData.java#L152-L155

gdams avatar Nov 07 '23 22:11 gdams