dejan2609 opened a new pull request, #23905:
URL: https://github.com/apache/kafka/pull/23905

   Notes:
   - JIRA ticket: KAFKA-21327
   - Rationale: this is a prerequisite for KAFKA-21326 _(Enable Gradle 
configuration cache)_ which blocks upgrade to Gradle 10: KAFKA-20102 
_Preparations for Gradle 10_
   - **drafted and smoke tested in a session with Claude Opus 5.5**
   - **requires more manual (human) testing; testing steps will be added ASAP**
   
   
   ___
   
   
   _Drafted with Claude, then reviewed and edited._
   
   :x: **Pitfall**: 
   - `build.gradle` opens the repository with JGit at configuration time to 
compute the `commit id` and the `RAT excludes`
   - With the configuration cache enabled, Git.open starts external processes 
(`git --version`, `git config --system ...`) that Gradle cannot track, so it 
reports configuration cache problems and fails the build by default.
   
   :bulb: **Solution**: 
   - Use providers.exec to run `git rev-parse HEAD` and `git ls-files --others 
--directory` instead. Gradle tracks their output as configuration inputs, so a 
new commit or a new untracked file correctly invalidates the cache. 
   - The RAT exclude set is unchanged: on a working tree, JGit's 
clean().setDryRun(true) output matches `git ls-files --others --directory` 
exactly.
   - `.git` is now checked with `exists()` instead of `isDirectory()`, so 
builds in a git worktree (where .git is a file) also get the real commit id and 
run RAT.
   
   This also removes an implicit dependency: since KAFKA-21086 the 
`org.eclipse.jgit` import in `build.gradle` relied on JGit being on the build 
script classpath transitively via the Spotless plugin; related PR :arrow_down: 
   - #23450
   
   **Note: `:generator` submodule keeps its own JGit dependency (fetched from 
`gradle/dependencies.gradle`).**
   
   Co-Authored-By: Claude Opus 5.5 <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to