KAFKA-8934: Create version file during build for Streams#7397
KAFKA-8934: Create version file during build for Streams#7397guozhangwang merged 2 commits intoapache:trunkfrom
Conversation
The Kafka Clients library includes a version file that contains its version and Git commit ID. Since Kafka Streams wants to expose version and commit ID in the metrics it needs to read the version file. To enable the users to check during runtime for version mismatches between the Streams library and the Clients library, the version file is copied from Clients during build time and during runtime only the Streams version file is read. If Streams would read Clients' version file during runtime, it would read a wrong version and commit ID if the libraries where not build from repositories in different states.
|
Call for review @guozhangwang @vvcephei |
|
JDK 8/Scala 2.11 failed with the following error: JDK 11/Scala2.13 failed with the following failing tests: Retest this, please |
|
Retest this, please |
|
Hey, thanks for this, @cadonna ! I've been bitten by this a few times as well. Instead of copying the version file from the clients module, can we just generate our own the same way they do? It just seems a little cleaner that way, so there's not the extra dependency on an "implementation detail" of the clients build. Thanks again! |
|
Yes, this is just preliminary. This information will be exposed in client-level metrics. |
|
Retest this, please |
1 similar comment
|
Retest this, please |
|
@cadonna could you run the whole unit test suite locally? Jenkins seems not happy atm. |
| duplicatesStrategy 'exclude' | ||
| } | ||
|
|
||
| task determineCommitId { |
There was a problem hiding this comment.
The determineCommitId logic is the same for both client and streams, I'm wondering if we can make it a global task that both can rely on (I'm not an expert of gradle, just wondering).
There was a problem hiding this comment.
I also had the same thought and I am also not a gradle expert. I would leave the duplicate code as it is for now to have a chance to get client-level metrics into the release and fix this afterwards.
|
@guozhangwang: all tests pass locally |
Conflicts: * .gitignore: addition of clients/src/generated-test was near local additions for support-metrics. * checkstyle/suppressions.xml: upstream refactoring of exclusions for generator were near the local changes for support-metrics. * gradle.properties: scala version bump caused a minor conflict due to the kafka version change locally. gradle/dependencies.gradle: bcpkix version bump was near avro additions in the local version. * apache-github/trunk: (49 commits) KAFKA-8471: Replace control requests/responses with automated protocol (apache#7353) MINOR: Don't generate unnecessary strings for debug logging in FetchSessionHandler (apache#7394) MINOR:fixed typo and removed outdated varilable name (apache#7402) KAFKA-8934: Create version file during build for Streams (apache#7397) KAFKA-8319: Make KafkaStreamsTest a non-integration test class (apache#7382) KAFKA-6883: Add toUpperCase support to sasl.kerberos.principal.to.local rule (KIP-309) KAFKA-8907; Return topic configs in CreateTopics response (KIP-525) (apache#7380) MINOR: Address review comments for KIP-504 authorizer changes (apache#7379) MINOR: add versioning to request and response headers (apache#7372) KAFKA-7273: Extend Connect Converter to support headers (apache#6362) MINOR: improve the Kafka RPC code generator (apache#7340) MINOR: Improve the org.apache.kafka.common.protocol code (apache#7344) KAFKA-8880: Docs on upgrade-guide (apache#7385) KAFKA-8179: do not suspend standby tasks during rebalance (apache#7321) KAFKA-8580: Compute RocksDB metrics (apache#7263) KAFKA-8880: Add overloaded function of Consumer.committed (apache#7304) HOTFIX: fix Kafka Streams upgrade note for broker backward compatibility (apache#7363) KAFKA-8848; Update system tests to use new AclAuthorizer (apache#7374) MINOR: remove unnecessary null check (apache#7299) KAFKA-6958: Overload methods for group and windowed stream to allow to name operation name using the new Named class (apache#6413) ...
The Kafka Clients library includes a version file that
contains its version and Git commit ID.
Since Kafka Streams wants to expose version and commit ID
in the metrics it needs to read the version file.
To enable the users to check during runtime for
version mismatches between the Streams library and the Clients
library, a version file is also created for Streams during build
time and during runtime only the Streams version file is read.
If Streams would read the Clients' version file during runtime, it
would read a wrong version and commit ID if the libraries were
built from repositories in different states.
Committer Checklist (excluded from commit message)