fix: upgrade gradle to 8.11.1 and set java version used to 21.#9623
fix: upgrade gradle to 8.11.1 and set java version used to 21.#9623plumpy merged 48 commits intoGoogleContainerTools:mainfrom
Conversation
ghost
left a comment
There was a problem hiding this comment.
Hi team,
I'm currently reviewing this pull request and will have a full review ready in a few minutes. In the meantime, here's a quick summary to help you and other reviewers get up to speed:
This pull request aims to upgrade the Gradle Spring Boot version and enhance support for OpenJDK versions within the Skaffold integration examples. The changes are focused on updating dependencies and build configurations to ensure compatibility and leverage the latest features.
Here's a breakdown of the changes:
integration/examples/jib-sync/build.gradle: This file has been modified to upgrade the Spring Boot dependency from version2.0.5.RELEASEto2.6.15.- Line 3:
id 'org.springframework.boot' version '2.0.5.RELEASE'changed toid 'org.springframework.boot' version '2.6.15' - Line 25:
jib.from.image = 'openjdk:17'changed tojib.from.image = 'openjdk:23'
- Line 3:
integration/examples/jib-sync/gradle/wrapper/gradle-wrapper.properties: The Gradle wrapper has been updated from version5.6.4to8.10.- Line 3:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zipchanged todistributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
- Line 3:
These updates ensure that the example projects remain current and compatible with newer Java versions and Gradle releases. This should improve the overall build process and maintainability of the examples.
And now, a little haiku to lighten the mood:
Code flows like a stream,
Upgrades bring a fresh new spring,
Bugs flee in the breeze.
Best,
Gemini
ghost
left a comment
There was a problem hiding this comment.
This pull request upgrades Gradle, Spring Boot, and the base OpenJDK version for the jib-sync example. Upgrading dependencies is good practice for maintaining security and leveraging new features. The changes look correct, but there are a few minor suggestions and some points to consider for future updates.
I've referenced the implicit style guide used in the project when making suggestions.
Summary of Changes & Recommendations:
- Gradle Upgrade: Upgrading from 5.6.4 to 8.10 is a significant jump. Ensure thorough testing to catch any compatibility issues. Consider incrementally upgrading Gradle to intermediate versions first before jumping directly to 8.10. This can help isolate any potential issues.
- Spring Boot Upgrade: Upgrading from 2.0.5 to 2.6.15 is also substantial. Verify all Spring Boot features used in the project still function as expected. Similar to the Gradle upgrade, consider a staged upgrade approach if feasible.
- OpenJDK Upgrade: Moving from OpenJDK 17 to 23 is a good move. OpenJDK 23 is not an LTS release. Consider using OpenJDK 21 (LTS) for long-term support and stability.
- Dependency Management Plugin: Align the Spring Boot and dependency management plugin versions for better compatibility. See the Spring Boot 2.6.15 documentation for the recommended version.
- JIB Plugin: While updating dependencies, consider upgrading the JIB plugin to the latest version for potential performance improvements and bug fixes.
- Documentation: Update the project's README or documentation to reflect the new dependency versions.
- Testing: Add or update integration tests to ensure compatibility with the upgraded dependencies.
integration/examples/jib-sync/gradle/wrapper/gradle-wrapper.properties
Outdated
Show resolved
Hide resolved
plumpy
left a comment
There was a problem hiding this comment.
Thanks!! I was trying to fix this myself too in #9622 because I thought my PR caused it. But my attempt at fixing it didn't work, so thanks for figuring this out!
Can you copy these changes over to skaffold/examples/jib-sync (which is basically just a copy of this directory)
integration/examples/jib-sync/gradle/wrapper/gradle-wrapper.properties
Outdated
Show resolved
Hide resolved
… used in skaffold.yaml so that the ccompiled java application runs in java V21 environment instead of V11.
…ge is defined in the skaffold.yaml
…eContainerTools#9623) * fix: upgrade gradle spring boot and support openjdk versions * fix: upgrade gradle spring boot and support openjdk versions * #fix address PR comments, update all plugins to latest version * copy changes over to examples/jib-sync * fix: set source and target compability to 21 * set target jdk to 17 * fix: set java version used in the gradle test to 21. Change the image used in skaffold.yaml so that the ccompiled java application runs in java V21 environment instead of V11. * run only problematic test and add debug logging * add debug line * add vebosity flag * add debugging code * add debugging code * more debug lines * more debug lines * more debug lines * more debug lines * call gradle directly to get debug error * Run skaffold dev to see output * Run TestDevAutoSync. * remove XDG_CONFIG_HOM environment variable * remove XDG_CONFIG_HOM environment variable * run skaffold test * re-enable all tests and sync the two copies of build.gradle * update jib-gradle example * add databind dependency which is needed by netty * Sync changes in integration/examples/jib-gradle to examples/jib-gradle * remove jib.fromImage specification in build.gradle since the base image is defined in the skaffold.yaml * fix jib-gradle/skaffold.yaml, set apiVersion to v4beta11 * use setup-java action to set the java version
Fixes: #nnn
Related: Relevant tracking issues, for context
Merge before/after: Dependent or prerequisite PRs
Description
The skaffold integration test TestRun is failing, here is an example error:
This PR upgrades Gradle to 8.11 and spring-boot to 3.4.1. Due to Gradle's Java requirements, the integration test environment now uses Java 21. The Micronaut tool in the jib-gradle example was also upgraded for compatibility with java 21 and gradle 8.11.
User facing changes (remove if N/A)
The tools used in the
jib-gradleandjib-syncexamples were upgraded to work with java 21 and gradle 8.11.Follow-up Work (remove if N/A)