Automating Kafka `version` property update process in code repository

Not sure if appropriate to ask here…but I imagine somewhere in the Kafka code there is a version property that lets the clients and the servers keep track of their version. Is that updated manually on each release, or is it automated somehow? I think the fact that we have to do PR’s like this on our project is a big Code Smell…so I’d be open to tips on how to automate: https://github.com/littlehorse-enterprises/littlehorse/pull/708/files

There’s a version in our gradle.properties but:

  1. Not sure how to access that in our Java code
  2. Definitely not sure how to access that in our Go CLI code

Yes, this is happening automatically with Kafka.

Cf https://github.com/apache/kafka/pull/14993

It’s still few places where we need to update the version…

But in the end, it’s picked up, and we add a properties files that we put into the jar, and this properties file is read on startup to read the version.

Ah, putting a properties file in the jar is a good idea. Thanks!

Cf AppInfoParser.java

We also encode the commit hash in this file.

cf https://github.com/apache/kafka/blob/trunk/build.gradle#L870-L886

I am not a gradle person, but the magic happens somewhere there