Skip to content

KAFKA-20531: ducker-ak: Add --clean-build option to replace REBUILD env var#22186

Open
ryan-cho-i wants to merge 1 commit intoapache:trunkfrom
ryan-cho-i:KAFKA-20531-clean-build-flag
Open

KAFKA-20531: ducker-ak: Add --clean-build option to replace REBUILD env var#22186
ryan-cho-i wants to merge 1 commit intoapache:trunkfrom
ryan-cho-i:KAFKA-20531-clean-build-flag

Conversation

@ryan-cho-i
Copy link
Copy Markdown

Adds a --clean-build / -c flag to both ducker-ak up and
ducker-ak test, providing a discoverable CLI replacement for the
REBUILD=t environment variable in tests/docker/run_tests.sh.

What changed

tests/docker/ducker-ak

  • prepare_native_dir() now accepts an optional force_rebuild
    argument. When set, the Kafka release tarball is rebuilt even
    if a cached one already exists, addressing the stale-tarball
    problem when source code has changed since the last build.
  • ducker_up parses -c|--clean-build and forwards it to
    prepare_native_dir. Has no effect in JVM mode.
  • ducker_test parses -c|--clean-build and runs
    ./gradlew clean systemTestLibs instead of the incremental build.
  • Help text updated for both up and test.

tests/docker/run_tests.sh

  • Existing REBUILD=t behavior is preserved for backward
    compatibility, but the path now emits a deprecation warning
    pointing to the new flag.
  • Added a TODO marker indicating the env var should be removed
    in 5.0.

Why split across up and test?

The two commands handle different caches:

  • ducker-ak up's prepare_native_dir produces the Kafka native
    tarball that gets baked into the Docker image. Stale here means
    testing against an outdated binary.
  • ducker-ak test builds systemTestLibs, which is consumed at
    ducktape execution time inside the already-running cluster.

Adding the flag to both keeps the responsibility split intact and
matches the description in the JIRA issue ("forces native tarball
rebuild in prepare_native_dir").

Testing

  • bash -n passes on both modified files.
  • ./tests/docker/ducker-ak --help correctly shows the new flag
    under both up and test sections.
  • Verified deprecation warning fires when REBUILD=t is set on
    run_tests.sh.

Follow-up

A separate ticket can track the removal of the REBUILD=t code
path in 5.0.

@github-actions github-actions Bot added tests Test fixes (including flaky tests) triage PRs from the community small Small PRs labels Apr 29, 2026
…nv var

Add a --clean-build / -c flag to both `ducker-ak up` and `ducker-ak test`
that triggers clean Gradle builds, replacing the REBUILD=t environment
variable used by run_tests.sh.

* `ducker-ak up --clean-build`: forces `prepare_native_dir` to rebuild
  the Kafka release tarball even if a cached one exists. No effect in
  JVM mode.
* `ducker-ak test --clean-build`: runs `./gradlew clean systemTestLibs`
  instead of the incremental build before running tests.

Deprecate REBUILD=t in tests/docker/run_tests.sh. The existing path is
preserved for backward compatibility, but it now emits a warning
pointing users to the new flag, with a TODO to remove the env var path
in 5.0.
@ryan-cho-i ryan-cho-i force-pushed the KAFKA-20531-clean-build-flag branch from 577cdc1 to 337154b Compare April 29, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs tests Test fixes (including flaky tests) triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant