Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge JDK release binaries if it shares a release name #145

Merged

Conversation

froque
Copy link
Contributor

@froque froque commented Apr 1, 2024

api.adoptium.net may respond with a duplicate release name if a new build was required [1]. In this case, adopt_build_number should be present and incremented.

Note that they have different adopt_build_number, in effect openjdk_version to Adoptium releases are not 1:1 within the API, and therefore will be grouped into different release lists. As in this case we might re-spin a release, this would modify the adopt_build_number but would map to the same openjdk_version since they are built from the same tag of the OpenJDK repo, and would map to the same version in the upstream project.

[1] adoptium/api.adoptium.net#829

Should fix JENKINS-72319 Unable to install JDK 21.0.

the current diff is

❯ rm -r target/
wget -q https://mirrors.jenkins-ci.org/updates/updates/io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.json -O io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.json
groovy -Dgrape.config=./grapeConfig.xml ./lib/runner.groovy adoptopenjdk.groovy > /dev/null
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/groovy/lib/groovy-2.4.21.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
❯ diff target/io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.json io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller.json 
3471a3472,3481
>           "binaries": [          {
>             "architecture": "x64",
>             "binary_link": "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_windows_hotspot_21.0.1_12.zip",
>             "openjdk_impl": "hotspot",
>             "os": "windows"
>           }],
>           "openjdk_impl": "hotspot",
>           "release_name": "jdk-21.0.1+12"
>         },
>                 {
3514,3519d3523
<             },
<                         {
<               "architecture": "x64",
<               "binary_link": "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_windows_hotspot_21.0.1_12.zip",
<               "openjdk_impl": "hotspot",
<               "os": "windows"

api.adoptium.net may respond with a duplicate release name if a new build
was required [1]. In this case, adopt_build_number should be present and
incremented.

> Note that they have different adopt_build_number, in effect openjdk_version to Adoptium releases are not 1:1 within the API, and therefore will be grouped into different release lists. As in this case we might re-spin a release, this would modify the adopt_build_number but would map to the same openjdk_version since they are built from the same tag of the OpenJDK repo, and would map to the same version in the upstream project.

[1] adoptium/api.adoptium.net#829

Should fix JENKINS-72319 Unable to install JDK 21.0.
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much! The result looks promising though I assume it needs to be run again with comparison between v1 and v2 rather than between v1 and v1

adoptopenjdk.groovy Outdated Show resolved Hide resolved
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
@froque
Copy link
Contributor Author

froque commented Apr 1, 2024

Thanks very much! The result looks promising though I assume it needs to be run again with comparison between v1 and v2 rather than between v1 and v1

Yeah, bad copy paste. thanks for the catch.

@MarkEWaite MarkEWaite self-requested a review April 1, 2024 17:23
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MarkEWaite MarkEWaite merged commit e7608ba into jenkins-infra:main Apr 1, 2024
2 checks passed
@froque froque deleted the fix_JENKINS-72319_duplicate_jdk_entry branch April 1, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants