KAFKA-20085 Replace verbose version instructions with updateVersion task#22065
Merged
chia7712 merged 1 commit intoapache:4.2from Apr 15, 2026
Merged
KAFKA-20085 Replace verbose version instructions with updateVersion task#22065chia7712 merged 1 commit intoapache:4.2from
chia7712 merged 1 commit intoapache:4.2from
Conversation
Member
Author
|
CI will be fixed in #22066 |
…ask (apache#21340) Replaces verbose manual version instructions with a new Gradle task `updateVersion` and introduces a verification task `verifyVersionConsistency` to enforce version consistency. **Features** 1. **Automated Verification (`check` lifecycle):** The `verifyVersionConsistency` task is hooked into `./gradlew check`. If `gradle.properties` is updated but dependent files are not, the build will **fail** with a descriptive error prompting the user to run `updateVersion`. 2. **Automated Update (`updateVersion` task):** * **Sync Mode:** `./gradlew updateVersion` (Syncs the current version from `gradle.properties` to all dependent files) * **Update Mode:** `./gradlew updateVersion -PnewVersion=4.3.0-SNAPSHOT` (Updates `gradle.properties` first, then syncs to all dependent files) **Affected Files** * `gradle.properties` (only if `-PnewVersion` is used) * `committer-tools/kafka-merge-pr.py` * `tests/kafkatest/version.py` * `tests/kafkatest/__init__.py` * `streams/quickstart/pom.xml` * `streams/quickstart/java/pom.xml` * `streams/quickstart/java/src/main/resources/archetype-resources/pom.xml` *Simulating a Release Manager manually updating `gradle.properties` but forgetting others.* 1. Manually modify `gradle.properties` to a new version. 2. Run `./gradlew check` (or just the verification task). **Result: Build Fails (Expected)** ```text > Task :verifyVersionConsistency FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':verifyVersionConsistency'. > Found inconsistent versions in the following files: committer-tools/kafka-merge-pr.py tests/kafkatest/version.py ... Please run './gradlew updateVersion -PnewVersion=...' to fix them. ``` 1. Run `./gradlew updateVersion -PnewVersion="4.2.0-SNAPSHOT"` ```text > Task :updateVersion Updated gradle.properties to version 4.2.0-SNAPSHOT Updated committer-tools/kafka-merge-pr.py Updated tests/kafkatest/version.py Updated tests/kafkatest/__init__.py Updated streams/quickstart/pom.xml Updated streams/quickstart/java/pom.xml Updated streams/quickstart/java/src/main/resources/archetype-resources/pom.xml BUILD SUCCESSFUL in 1s 1 actionable task: 1 executed ``` 2. Run `./gradlew check` again. **Result: Build Passes** ```text > Task :verifyVersionConsistency All versions are consistent with gradle.properties. BUILD SUCCESSFUL ``` 1. `./gradlew updateVersion -PnewVersion="invalid-version"` ```text > Task :updateVersion FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':updateVersion'. > Invalid version format: 'invalid-version'. Expected format: X.Y.Z or X.Y.Z-SNAPSHOT ``` Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com> (cherry picked from commit 62206cf)
fdbb71b to
65e71f0
Compare
chia7712
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cherry picked from commit 62206cf
Reviewers: Chia-Ping Tsai chia7712@gmail.com