Skip to content

Conversation

dejan2609
Copy link
Contributor

@dejan2609 dejan2609 commented Apr 18, 2025

@reviewers:

if you want to save some time please skip straight to this comment:
⬇️
#19513 (comment)

Related JIRA ticket:

https://issues.apache.org/jira/browse/KAFKA-19174

List of changes:

  • prerequisite Jira ticket:
    KAFKA-19591
    • at the moment Kafka trunk branch is using Gradle version 8.14.1
    • gradlew is still referencing an older template file version
      (unixStartScript.txt from a Gradle 8.7.0)
    • it means that gradlew is missing all recent changes for a template
      file unixStartScript.txt
  • Gradle version will be upgraded: 8.14.1 -->> 9.0.0
  • Gradle Shadow plugin version will be upgraded: 8.3.6 -->> 9.0.2
  • build logic will be refactored in order to accommodate Gradle 9
    breaking changes
  • (optional): dozen of Gradle plugin versions will be upgraded also
  • another JIRA ticket solved:
    KAFKA-16801

Related links:

Note: new Gradle version brings up some breaking changes (as
always 😃); Kafka build with Gradle 9 has same issues as other
projects:

@github-actions github-actions bot added triage PRs from the community build Gradle build or GitHub Actions small Small PRs labels Apr 18, 2025
@dejan2609 dejan2609 changed the title [KAFKA-19174] Gradle version upgrade 8 -->> 9 [Work in progress] [KAFKA-19174] Gradle version upgrade 8 -->> 9 Apr 18, 2025
Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link

This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

@github-actions github-actions bot added stale Stale PRs and removed needs-attention stale Stale PRs labels Jul 25, 2025
Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@dejan2609
Copy link
Contributor Author

Update: project compilation works as expected (when powered by Gradle 9) but binary release creation fails.
More work has to be done in order to accommodate to Gradle breaking changes.

Copy link

github-actions bot commented Aug 3, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@chia7712
Copy link
Member

chia7712 commented Aug 6, 2025

@dejan2609 any update?

Copy link

github-actions bot commented Aug 8, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@dejan2609
Copy link
Contributor Author

@chia7712
Will provide an update during the weekend (there are two problems with Gradle 9 build, will explain in more details and provide some insights).

@chia7712
Copy link
Member

chia7712 commented Aug 8, 2025

@dejan2609 thanks!

@dejan2609
Copy link
Contributor Author

@chia7712 feel free to check this related PR: #20327

@dejan2609
Copy link
Contributor Author

Pending: I will also explain second problem (specific to Gradle 9, that is).

Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@dejan2609 dejan2609 closed this Sep 1, 2025
@dejan2609 dejan2609 deleted the KAFKA-19174 branch September 1, 2025 06:13
@dejan2609
Copy link
Contributor Author

dejan2609 commented Sep 1, 2025

I just accidentally deleted remote branch (from my command line via git push origin :<KAFKA-ticketNumber>).
Will recover it instantly.

@dejan2609 dejan2609 restored the KAFKA-19174 branch September 1, 2025 06:16
@dejan2609
Copy link
Contributor Author

Done, branch recovered 😌

@dejan2609 dejan2609 reopened this Sep 1, 2025
@dejan2609 dejan2609 changed the title KAFKA-19174 KAFKA-19591 Gradle version upgrade 8 -->> 9 KAFKA-19174 Gradle version upgrade 8 -->> 9 Sep 1, 2025
@dejan2609
Copy link
Contributor Author

dejan2609 commented Sep 1, 2025

FYI @chia7712

Just to sum it up here:

In a broader context:

Copy link

github-actions bot commented Sep 2, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link

github-actions bot commented Sep 4, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

…rsion (i.e. file `unixStartScript.txt`) was being referenced
details:
 - gradle:       8.14.1 -->> 9.0.0
    - https://github.com/gradle/gradle/releases/tag/v9.0.0
    - https://gradle.org/whats-new/gradle-9
    - https://docs.gradle.org/9.0.0/userguide/upgrading_major_version_9.html#changes_major_9
 - shadow plugin: 8.3.6 -->> 9.0.2
    - https://github.com/GradleUp/shadow/releases/tag/9.0.0
    - https://github.com/GradleUp/shadow/releases/tag/9.0.1
    - https://github.com/GradleUp/shadow/releases/tag/9.0.2

refactoring (performed in order to accomodate Gradle 9 breaking changes):
 - tasks `siteDocsTar` and `releaseTarGz` are moved out of `core` (and into a new module: `distribution`); GA workflows and Python scripts are changed accordingly
 - `preserveFileTimestamps` Tar taks property value explicitly set to `true` (default values: Gradle 8: `true`, Gradle 9: 'false')
 - files and folders permissions are introduced
 - git placeholder file (.gitkeep) is added in order to preserve `distribution` folder (Apache Rat check for that file is skipped)
 - `wrapper.gradle` changes: no need to check number of dots for Gradle versions >=9 anymore
 - redundant 'gradleVersion' ext property is removed (in favor of 'versions.gradle' usage)
 - folder pattern 'bin/' is added into .gitignore
… dependencies/plugins and GitHub Actions

details:
 - `setup-gradle` GitHub Action: 4.3.0 -->> 4.4.2 (note: this version was tested against Gradle 9: https://github.com/gradle/actions/releases/tag/v4.4.2)
 - grgit: 4.1.1 -->> 5.3.0
 - gradle versions plugin: 0.48.0 -->> 0.52.0
 - owasp dependency check : 8.2.1 -->> 12.1.3
 - spotbugs: 6.2.3  -->> 6.2.5
 - spotless: 6.25.0 -->> 7.2.1
 - Zinc Scala compiler: 1.9.2 -->> 1.10.8
 - Scala fmt: 3.7.14 -->> 3.9.9
 - Scala Coverage:
   - scoverage: 2.0.11 -->> 2.3.0
   - Scala version for scoverage: 2.13.9 -->> 2.13.16 (i.e. `org.scoverage:scalac-scoverage-plugin_2.13.16:2.3.0` will be used)
   - scoverage gradle plugin: 8.0.3 -->> 8.1
Copy link

github-actions bot commented Sep 6, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@dejan2609 thanks for this patch. It is coool that we could use gradle 9.

@@ -42,7 +42,7 @@ runs:
distribution: temurin
java-version: ${{ inputs.java-version }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
Copy link
Member

Choose a reason for hiding this comment

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

Could you please use the git commit hash instead, to follow the Apache policy (see below)?

You MUST pin all external actions to the specific git hash (SHA1) of the action that has been reviewed for use by the project. For instance, you MUST pin foobar/baz-action@8843d7f92416211de9ebb963ff4ce28125932878.

reference: https://infra.apache.org/github-actions-policy.html

@@ -164,7 +164,7 @@ jobs:
# Check if there are any empty files under ./site-docs/generated, If any empty files are found, print an error
# message and list the empty files
run: |
tar zxvf core/build/distributions/kafka_2.13-$(./gradlew properties | grep version: | awk '{print $NF}' | head -n 1)-site-docs.tgz
tar zxvf distribution/build/distributions/kafka_2.13-$(./gradlew properties | grep version: | awk '{print $NF}' | head -n 1)-site-docs.tgz
Copy link
Member

Choose a reason for hiding this comment

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

Changing the path may break downstream CI or workflows. Could you please provide more details about this change?

@@ -119,13 +119,13 @@ versions += [
// When updating the scalafmt version please also update the version field in checkstyle/.scalafmt.conf. scalafmt now
// has the version field as mandatory in its configuration, see
// https://github.com/scalameta/scalafmt/releases/tag/v3.1.0.
scalafmt: "3.7.14",
scoverage: "2.0.11",
scalafmt: "3.9.9",
Copy link
Member

Choose a reason for hiding this comment

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

Are those changes necessary?

@dejan2609
Copy link
Contributor Author

dejan2609 commented Sep 7, 2025

Thank you for a review @chia7712.
Good points, will address them and update commits ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Gradle build or GitHub Actions ci-approved tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants