apalan60 commented on PR #20699:
URL: https://github.com/apache/kafka/pull/20699#issuecomment-3418423695

   This PR introduces multiple fixes. Below are some steps for easier error 
reproduction and fix validation.
   
   ### Pre‑setup: apply a patch to simplify local runs
   This patch removes checks unrelated to the error and JDK change:
   
   * Skip Maven CLI presence check
   * Skip SVN CLI presence check
   * Skip unfixed JIRA tickets check while generating release notes.
   
   
   ```bash
   # Switch to dryrun branch
   git switch dryrun 2>/dev/null || git switch -c dryrun
   
   # Apply pre-setup patch as a commit
   cat <<'PATCH' | git am -3
   From 392a6f60db1f79cfa5ef064fae382f34be7a33ce Mon Sep 17 00:00:00 2001
   From: Hong-Yi Chen <[email protected]>
   Date: Sat, 18 Oct 2025 20:40:35 +0800
   Subject: [PATCH] pre-setup
   
   ---
    release/notes.py   | 14 --------------
    release/release.py |  7 +++++--
    2 files changed, 5 insertions(+), 16 deletions(-)
   
   diff --git a/release/notes.py b/release/notes.py
   index e561fa03a2..aaf25dd4ec 100644
   --- a/release/notes.py
   +++ b/release/notes.py
   @@ -144,20 +144,6 @@ def generate(version):
        at all for the specified version.
        """
        issues = query(f"project=KAFKA and fixVersion={version}")
   -    if not issues:
   -        raise Exception(f"Didn't find any issues for version {version}")
   -    unresolved_issues = filter_unresolved(issues)
   -    if unresolved_issues:
   -        issue_list = "\n".join([issue_str(issue) for issue in 
unresolved_issues])
   -        raise Exception(f"""
   -Release {version} is not complete since there are unresolved or improperly
   -resolved issues tagged {version} as the fix version:
   -
   -{issue_list}
   -
   -Note that for some resolutions, you should simply remove the fix version
   -as they have not been truly fixed in this release.
   -        """)
        return render(version, issues)
    
    
   diff --git a/release/release.py b/release/release.py
   index 92b76dee1e..5cb7d4e8fb 100644
   --- a/release/release.py
   +++ b/release/release.py
   @@ -226,7 +226,6 @@ global_gradle_props = 
os.path.expanduser("~/.gradle/gradle.properties")
    gpg_key_id = textfiles.prop(global_gradle_props, "signing.keyId")
    gpg_passphrase = textfiles.prop(global_gradle_props, "signing.password")
    gpg_key_pass_id = gpg.key_pass_id(gpg_key_id, gpg_passphrase)
   -preferences.once(f"verify_gpg_key_{gpg_key_pass_id}", verify_gpg_key)
    
    apache_id = preferences.get('apache_id', lambda: prompt("Please enter your 
apache-id: "))
    jdk21_env = get_jdk(21)
   @@ -242,7 +241,11 @@ def verify_prerequisites():
                else:
                    print(f"Pre-requisite met: {name}")
            except Exception as e:
   -            fail(f"Pre-requisite not met: {name}. Error: {e}")
   +            #skip mvn CLI and snn check
   +            if name in ['Apache Maven CLI (mvn) in PATH', "svn CLI in 
PATH"]:
   +                print(f"Pre-requisite skipped: {name}. Error: {e}")
   +            else:
   +                fail(f"Pre-requisite not met: {name}. Error: {e}")
        prereq('Apache Maven CLI (mvn) in PATH', lambda: "Apache Maven" in 
execute("mvn -v"))
        prereq("svn CLI in PATH", lambda: "svn" in execute("svn --version"))
        prereq("Verifying that you have no unstaged git changes", lambda: 
git.has_unstaged_changes())
   -- 
   2.51.1
   
   PATCH
   ```
   
   
   ---
   
   ### Commands
   
   ```bash
   # directory setup 
   # cd <project-root>/release
   
   # Create a temporary remote for dry runs
   export DRYRUN_REMOTE_DIR="$(mktemp -d /tmp/kafka-release-remote.XXXXXX)"
   git init --bare "$DRYRUN_REMOTE_DIR"
   git remote remove dryrun 2>/dev/null || true
   git remote add dryrun "$DRYRUN_REMOTE_DIR"
   
   # seed 4.2 branch
   git fetch origin 4.2:4.2 || git push dryrun HEAD:refs/heads/4.2
   
   python3 -m venv .venv
   source .venv/bin/activate
   pip install -r requirements.txt
   
   source .venv/bin/activate
   export PUSH_REMOTE_NAME=dryrun
   python release.py
   ```
   
   ---
   
   ### Expected Error 1: Git check false negative
   
   **Before**
   ```
   Begin to check if you have met all the pre-requisites for the release process
   Pre-requisite met: Apache Maven CLI (mvn) in PATH
   Pre-requisite met: svn CLI in PATH
   FAILURE: Pre-requisite not met: Verifying that you have no unstaged git 
changes
   ```
   
   **Apply the patch**
   
   ```bash
   curl -L 
https://github.com/apache/kafka/commit/b715387d1838dbff636ac0bbf8d7074114d30e79.patch
 \
        -L 
https://github.com/apache/kafka/commit/e04d1e12cbb8abc0e9e50f1daa3b2ca74ba3a1c7.patch
 \
     | git am -3
   ```
   
   then run `python release.py` again
   
   **After**
   ```txt
   Begin to check if you have met all the pre-requisites for the release process
   Pre-requisite met: Apache Maven CLI (mvn) in PATH
   Pre-requisite met: svn CLI in PATH
   Pre-requisite met: Verifying that you have no unstaged git changes
   Pre-requisite met: Verifying that you have no staged git changes
   ```
   
   
   ### Expected Error 2: Gradle aggregatedJavadoc failure
   With Gradle 9, `aggregatedJavadoc` fails when executed in parallel:
   
   **Before**
   ```
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':aggregatedJavadoc'.
   > Resolution of the configuration ':connect:compileClasspath' was attempted 
without an exclusive lock. This is unsafe and not allowed.
   ```
   
   
   **Apply the patch**
   
   (Also upgrade JDK25 together in these patches since these commits have 
dependencies. If needed, I can rebase and force push to make it easier to 
review.)
   ```bash
   curl -L 
https://github.com/apache/kafka/commit/3941f3f7bf7fed66ccda37a9d5c088c9cf0285d4.patch
 \
        -L 
https://github.com/apache/kafka/commit/ddacb45cd9f22a7414387f463a73054d9cb949a5.patch
 \
        -L 
https://github.com/apache/kafka/commit/33dcc69e69c863ad33a3306ada1751af56165812.patch
 \
     | git am -3
   ```
   
   switch to use JDK25 and then run `python release.py` again
   
   **After**
   
   ```txt
   > > Task :streams:compileJava
   > > Task :connect:api:compileJava
   > > Task :tools:tools-api:compileJava
   > > Task :aggregatedJavadoc
   > 
   > [Incubating] Problems report is available at: 
file:///Users/hongyi/IdeaProjects/kafka/.release_work_dir/kafka/build/reports/problems/problems-report.html
   > 
   > Deprecated Gradle features were used in this build, making it incompatible 
with Gradle 10.
   > 
   > You can use '--warning-mode all' to show the individual deprecation 
warnings and determine if they come from your own scripts or plugins.
   > 
   > For more on this, please refer to 
https://docs.gradle.org/9.1.0/userguide/command_line_interface.html#sec:command_line_warnings
 in the Gradle documentation.
   > 
   > BUILD SUCCESSFUL in 18s
   ```
   
   ---
   
   ### Cleanup
   
   ```bash
   # --- Remove the 'dryrun' remote and the temporary bare repo ---
   
   # Force-delete the local 'dryrun' branch if it exists
   git switch trunk
   git branch -D dryrun 2>/dev/null || true
   
   # Remove the local git remote named 'dryrun' (ignore if it doesn't exist)
   git remote remove dryrun 2>/dev/null || true
   
   # If DRYRUN_REMOTE_DIR is set and exists, delete it
   if [ -n "${DRYRUN_REMOTE_DIR:-}" ] && [ -d "$DRYRUN_REMOTE_DIR" ]; then
     rm -rf "$DRYRUN_REMOTE_DIR"
   fi
   
   # Fallback: remove any /tmp/kafka-release-remote.* directories created by 
mktemp
   rm -rf /tmp/kafka-release-remote.* 2>/dev/null || true
   
   
   # Deactivate the current Python virtual environment if active
   deactivate 2>/dev/null || true
   
   ```


-- 
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