Skip to content

Version numbers conf parsing script - #4304

Merged
adamfarley merged 48 commits into
adoptium:masterfrom
adamfarley:generate_tag_from_version_numbers_conf
Dec 2, 2025
Merged

adamfarley merged 48 commits into
adoptium:masterfrom
adamfarley:generate_tag_from_version_numbers_conf

Conversation

@adamfarley

Copy link
Copy Markdown
Contributor

This ensures that we're using the OpenJDK version string as defined in the version_numbers.conf file rather than the git tag (if the two are different).

We do this because conflicts have caused problems in the past, where we tell (e.g.) an installer creation job that various dependencies are in the folder for version 1, even though the folders are named after version 2 in version_numbers.conf.

Resolves #4302

Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley adamfarley self-assigned this Nov 13, 2025
@github-actions github-actions Bot added the installer Issues that relate to our installer jobs or installer repo label Nov 13, 2025
@karianna
karianna marked this pull request as draft November 13, 2025 19:35
This version is far more conservative so as to minimise risk of
disruption to the builds.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley

adamfarley commented Nov 14, 2025 •

Copy link
Copy Markdown
Contributor Author

Test run on jdk25u, where we see the issue we're trying to solve.

https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk25u/job/jdk25u-windows-x64-temurin/13/

Update: Specifying a default build number of 0 causes problems (detailed below), so I'm changing it to "1" and rerunning.

https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk25u/job/jdk25u-windows-x64-temurin/14/

When we specify a build number of 0, the openjdk build scripts interpret that as there being no build number at all.

This means that the vendor string and folder names use build number "0", while everything else uses an empty string.

So we end up having the same problem. The installer jobs are passed a build number of "null", while the folder names are using "+0". Installer job creation fails.

So I changed it to "1" to avoid that logic path.

Update 2: Test passed completely. Ready for review.

Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley adamfarley changed the title WIP: Version numbers conf parsing script Version numbers conf parsing script Nov 18, 2025
@adamfarley
adamfarley marked this pull request as ready for review November 18, 2025 16:59
@karianna

Copy link
Copy Markdown
Contributor

General comment, how does the git tag get out of sync with that conf file? Should one or the other not be corrected?

@adamfarley

adamfarley commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor Author

@adamfarley there's an erroneous '}'

Ah yes. I removed an elif by accident. All sorted.

Linter still has concerns though. Fixing them now.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Comment thread sbin/build.sh Outdated
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley

adamfarley commented Nov 26, 2025 •

Copy link
Copy Markdown
Contributor Author

And here's a jenkins helper tweak to accommodate build number 0 (so VersionInfo doesn't return a null).

adoptium/jenkins-helper#63

Testing here:

https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk25u/job/jdk25u-windows-x64-temurin/18/

It passed the relevant stages, but failed SBOM validation.

I've written a fix and tested it here: https://ci.adoptium.net/job/sbom_validator_job/272 - passed.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Comment thread tooling/validateSBOMcontent.sh Outdated
Signed-off-by: Adam Farley <adfarley@ibm.com>
Comment thread tooling/validateSBOMcontent.sh Outdated
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley

Copy link
Copy Markdown
Contributor Author

Here is the PR for passing an empty string into the sbom validator when scm is not set.

adoptium/ci-jenkins-pipelines#1330

Signed-off-by: Adam Farley <adfarley@ibm.com>
Comment thread sbin/build.sh Outdated
Comment thread sbin/build.sh Outdated
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley
adamfarley merged commit 5584d0f into adoptium:master Dec 2, 2025
29 checks passed
@adamfarley

Copy link
Copy Markdown
Contributor Author

Merged. Thanks for the reviews and your help refining this code.
@sxa @andrew-m-leonard @karianna 😎

@adamfarley

adamfarley commented Dec 2, 2025 •

Copy link
Copy Markdown
Contributor Author

On request, here's an additional test run against a repo without any tags:

https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk25u/job/jdk25u-windows-x64-temurin/35

Update: It passed correctly. We received two warnings:

  • The first said there were no tags, so we'd use the default tag of 25.0.0
  • The second said that 25.0.0 didn't match the source, so we override the default with 25.0.3

SehrishHussain pushed a commit to SehrishHussain/temurin-build that referenced this pull request Dec 9, 2025
* First draft of version numbers conf parsing script

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Second draft of the jdk version file parser

This version is far more conservative so as to minimise risk of
disruption to the builds.

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Linter fixes and improvements

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Checking for unbound SCM_REF

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Redelimiting unbound variable

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Making a zero-length check shorter

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Amending null check to include indexing errors

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Changing bash delimiters to disable index expansion

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Trialling removal of a flaky if condition

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Adding quotes for string

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Fix for version string parser in build.sh

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Refactoring unbound variable handling

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Removing superfluous dollar sign

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Switching to -v for cross-compatibility

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Switching to -z again

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Switching to -v

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Another try

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Trying a for loop

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Adding formatting whitespace

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Changing default build number to 1 in version string

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Handling an incorrect number of arguments

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Updating arg validation logic and comments

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Switching build_src to camel case

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Updated comments

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Removing duplicate error reporting logic

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Extra comments and restructuring for readability

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Extra comments for clarity

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Useful comment

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Extracting file parsing logic from compareToOpenJDKFileVersion

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Removing unused variable

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Switching to -n to avoid scm_ref unbound variable issue

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Switching version file parser gate to TAG for better locality

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Updating jdk version comparison logic for brevity and clarity

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Changing if to elif to prevent multiple matches

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Quoting grep output to prevent splitting

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Adding warning message for jdk version override

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Removing excess whitespace

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Updating SBOM validator to better handle false negatives

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Restructuring SHA check in SBOM validation

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Improving posix compliance of SBOM validation

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Changing script to use empty strings instead of nulls

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Amending curl command for efficiency

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Allow for empty scm parameter

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Removing unnecessary code

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Make code shorter and easier to read

Signed-off-by: Adam Farley <adfarley@ibm.com>

* Making code more concise and easier to maintain

Signed-off-by: Adam Farley <adfarley@ibm.com>

---------

Signed-off-by: Adam Farley <adfarley@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

installer Issues that relate to our installer jobs or installer repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JDK version should be parsed out of version-numbers.conf when SCM_REF is not specified

4 participants