Skip to content

SOLR-18509: Port ApiTool to picocli - #5037

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

janhoy merged 5 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18509-picocli-api

Conversation

@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor

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

Description

Adds the picocli code path for bin/solr api, next to the commons-cli one. test_modules.bats and test_security_manager.bats call api, so they could not join the picocli suite until now.

Solution

ApiTool gets its annotated options and callTool() and is registered in SolrCLI; the commons-cli path is unchanged. Written with Claude Code.

Tests

ApiToolPicocliTest runs the existing ApiToolTest through picocli. Both BATS suites pass under picocli and are added to integrationTestsPicocli; 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 a test twin, the generated reference page and test_modules.bats and test_security_manager.bats in the picocli suite.
@github-actions github-actions Bot added documentation Improvements or additions to documentation tool:build tests cat:cli labels Oct 6, 2026

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

Just one thing to fix...

Comment thread solr/core/src/java/org/apache/solr/cli/ApiTool.java Outdated
The option text repeated what the command does; the generated page now says what the value is, with an example. The footer example also pointed at GET /api/cluster, which SOLR-18450 removed, so it uses /api/collections.
Comment thread changelog/unreleased/SOLR-18509-picocli-api.yml Outdated
serhiy-bzhezytskyy and others added 3 commits October 7, 2026 15:42
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.
# Conflicts:
#	changelog/unreleased/SOLR-17697-picocli-experimental-cli.yml
#	solr/core/src/java/org/apache/solr/cli/SolrCLI.java
#	solr/packaging/build.gradle
#	solr/solr-ref-guide/modules/deployment-guide/deployment-nav.adoc
#	solr/solr-ref-guide/modules/deployment-guide/pages/cli/index.adoc
@janhoy
janhoy merged commit 14924e6 into apache:main Oct 8, 2026
6 of 7 checks passed
@janhoy janhoy added this to the 10.x milestone Oct 8, 2026
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 14924e6)
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 tool:build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants