-
Notifications
You must be signed in to change notification settings - Fork 14.7k
KAFKA-19756: Add documentation for Gradle version upgrade process #20741
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
base: trunk
Are you sure you want to change the base?
Conversation
| may depend on the kafka jar for integration tests where they may include a scala library with a different version), we don't enable it by | ||
| default. See https://www.lightbend.com/blog/scala-inliner-optimizer for more details. | ||
|
|
||
| ### Upgrading Gradle version ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving the docs to gradle/wrapper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved to gradle/wrapper and left a simple reference link to it.
WDYT
| - Verify the wrapper JAR URL is accessible at: | ||
| `https://raw.githubusercontent.com/gradle/gradle/v<VERSION>/gradle/wrapper/gradle-wrapper.jar` | ||
|
|
||
| 4. **Regenerate the wrapper script**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just out of curiosity, should we also update the checksum in the gradlew file?
Line 204 in 05999c7
| REQUIRED_WRAPPER_JAR_CHECKSUM="76805e32c009c0cf0dd5d206bddc9fb22ea42e84db904b764f3047de095493f3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to manually update the checksum in the gradlew file. When we run ./gradlew wrapper, it regenerates the gradlew based on the configuration in wrapper.gradle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your explanation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch. Left some comments.
| distributionSha256Sum=<sha256-checksum-from-release-page> | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip | ||
| ``` | ||
| - Verify the distribution URL is accessible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure why this verification is needed.
The link distribution URL in https://services.gradle.org/distributions/ will be accessible.
|
|
||
| 3. **Update wrapper JAR checksum** in `wrapper.gradle`: | ||
| - Find the Wrapper JAR Checksum at https://gradle.org/release-checksums/ | ||
| - Update the `wrapperChecksum` variable (line 42): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't hardcode the line number here as it might change in the future.
How about:
| - Update the `wrapperChecksum` variable (line 42): | |
| - Update the `wrapperChecksum` variable: | |
| ```groovy | |
| task bootstrapWrapper() { | |
| ... | |
| doLast { | |
| ... | |
| String wrapperChecksum = "<wrapper-jar-sha256-checksum>" |
| 2. **Update distribution checksums** in `gradle/wrapper/gradle-wrapper.properties`: | ||
| - Find the SHA256 checksum for the binary distribution at https://gradle.org/release-checksums/ | ||
| - Update `distributionSha256Sum` with the Binary-only (-bin) ZIP Checksum | ||
| - Update `distributionUrl` to point to the new version: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Update `distributionUrl` to point to the new version: | |
| - Update `distributionUrl` to use the latest version from `https://services.gradle.org/distributions/`: |
Currently, there is no documentation describing how to upgrade Gradle in the Kafka project. The upgrade process involves
updating three separate configuration files with specific checksums and URLs, which can be error-prone without clear guidance.
a. Update Gradle version in gradle/dependencies.gradle
b. Update distribution checksums in gradle/wrapper/gradle-wrapper.properties
c. Update wrapper JAR checksum in wrapper.gradle
d. Regenerate the wrapper script using ./gradlew wrapper