Visitar URL original
SOLR-18511: Port ClusterTool to picocli by serhiy-bzhezytskyy · Pull Request #5038 · apache/solr · GitHub
Skip to content

SOLR-18511: Port ClusterTool to picocli - #5038

Merged
janhoy merged 5 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18511-picocli-cluster
Oct 8, 2026
Merged

janhoy merged 5 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18511-picocli-cluster

Conversation

@serhiy-bzhezytskyy

@serhiy-bzhezytskyy serhiy-bzhezytskyy commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-18511

Description

Adds the picocli code path for bin/solr cluster, next to the commons-cli one.

Solution

ClusterTool gets its annotated options and callTool() and is registered in SolrCLI; the commons-cli path is unchanged. The connection comes from the shared ZkConnectionOptions, as for the other ZooKeeper commands, so --solr-connection, --solr-url and --credentials work too, and zkHost / ZK_HOST is the fallback. Written with Claude Code.

Tests

testSetClusterProperty in ZkSubcommandsTest now goes through the parser hook, so ZkSubcommandsPicocliTest runs it under picocli; new tests cover the zkHost fallback and --solr-connection. check -x test is clean (rat skipped).

Checklist

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

Adds the picocli code path next to the commons-cli one, with the generated reference page. testSetClusterProperty now runs under both parsers, and a new test checks that the zkHost property is honoured without -z.
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests cat:cli labels Oct 6, 2026
The cluster command declared its own --zk-host. The shared ZkConnectionOptions that the other ZooKeeper commands use gives it --solr-connection, --solr-url and --credentials as well, and resolves the ZooKeeper address the same way for all of them.

@janhoy janhoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Using ZkConnectionOptions here is the right choice for a ZooKeeper-only command, and the new tests for the zkHost property fallback and --solr-connection cover the paths that matter. Precommit and the full test suite are green.

serhiy-bzhezytskyy and others added 3 commits October 7, 2026 15:43
No picocli feature has been released yet, so a new command is a detail of the SOLR-17697 entry. Its author and JIRA are added there instead of a separate entry.
…cluster

# Conflicts:
#	changelog/unreleased/SOLR-17697-picocli-experimental-cli.yml
#	solr/core/src/java/org/apache/solr/cli/SolrCLI.java
@janhoy janhoy added this to the 10.x milestone Oct 8, 2026
@janhoy
janhoy merged commit 4ae645e into apache:main Oct 8, 2026
4 of 5 checks passed
dsmiley pushed a commit that referenced this pull request Oct 9, 2026
Co-authored-by: Jan Høydahl <janhoy@apache.org>
(cherry picked from commit 4ae645e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:cli documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants