Skip to content

KAFKA-12744: Upgrade argparse4j to 0.9.0 - #23033

Open
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-12744-argparse4j-upgrade
Open

KAFKA-12744: Upgrade argparse4j to 0.9.0#23033
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-12744-argparse4j-upgrade

Conversation

@lh0156

@lh0156 lh0156 commented Aug 2, 2026

Copy link
Copy Markdown

Corresponding JIRA ticket: https://issues.apache.org/jira/browse/KAFKA-12744

What is the purpose of this change?

Upgrade argparse4j from 0.7.0 to 0.9.0 and migrate Kafka's production parser construction to the supported builder API. The migration preserves the existing parser behavior, including help handling, prefix characters, and from-file prefixes, while updating the moved HelpScreenException package and LICENSE-binary.

Brief change log

  • Replace every production ArgumentParsers.newArgumentParser call with newFor(...).build().
  • Preserve the existing parser options for shell, storage, Docker, and command-line tools.
  • Update HelpScreenException imports to the argparse4j 0.9.0 package.
  • Keep the unavoidable legacy ArgumentAction callback suppression local to its required override.
  • Update the binary dependency license record.

Testing

  • TDD red phase: compiling after only the dependency upgrade exposed the moved exception package and deprecated parser construction API.
  • TDD green phase: migrated all production call sites and verified the relevant modules compile.
  • ./gradlew :shell:compileJava :generator:compileJava :tools:compileJava :connect:mirror:compileJava :trogdor:compileJava :core:compileScala --no-build-cache --console=plain
  • ./gradlew :core:test --tests kafka.tools.StorageToolTest --tests kafka.docker.KafkaDockerWrapperTest :tools:test --tests org.apache.kafka.tools.MetadataQuorumCommandUnitTest --tests org.apache.kafka.tools.FeatureCommandTest --tests org.apache.kafka.tools.TransactionsCommandTest --no-build-cache --console=plain
  • ./gradlew :shell:test --tests org.apache.kafka.shell.command.CommandTest --no-build-cache --console=plain
  • ./gradlew :trogdor:test --tests org.apache.kafka.trogdor.agent.AgentTest --tests org.apache.kafka.trogdor.coordinator.CoordinatorTest --tests org.apache.kafka.trogdor.coordinator.CoordinatorClientTest --no-build-cache --console=plain
  • ./gradlew :generator:test --no-build-cache --console=plain passed all 104 tests in a normal clone.
  • ./gradlew spotlessCheck --no-build-cache --console=plain
  • git diff --check

The broad root check was started with the known worktree-only generator Git test excluded; the visible suites passed, and the run was stopped because it expanded into the full long-running integration suite. The targeted module tests and the complete generator suite passed independently.

Generated-by: OpenAI Codex (GPT-5)
@github-actions github-actions Bot added triage PRs from the community core Kafka Broker tools connect mirror-maker-2 dependencies Pull requests that update a dependency file build Gradle build or GitHub Actions generator RPC and Record code generator small Small PRs labels Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions connect core Kafka Broker dependencies Pull requests that update a dependency file generator RPC and Record code generator mirror-maker-2 small Small PRs tools triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant