Visitar URL original
SOLR-18519: Port StreamTool to picocli by serhiy-bzhezytskyy · Pull Request #5043 · apache/solr · GitHub
Skip to content

SOLR-18519: Port StreamTool to picocli - #5043

Merged
janhoy merged 6 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18519-picocli-stream
Oct 8, 2026
Merged

janhoy merged 6 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18519-picocli-stream

Conversation

@serhiy-bzhezytskyy

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

Copy link
Copy Markdown
Contributor

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

Description

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

Solution

StreamTool gets its annotated options and callTool() and is registered in SolrCLI; the commons-cli path is unchanged. The connection is resolved in the same order as under commons-cli, including the zkHost and solr-connection properties. Written with Claude Code.

Tests

StreamToolPicocliTest runs the existing StreamToolTest through picocli; new tests cover the zkHost property and the --execution values (any case, unknown ones rejected). 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 and the generated reference page. The connection falls back to the zkHost and solr-connection properties, as it does under commons-cli.
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests cat:cli labels Oct 6, 2026
picocli now lists and validates local and remote itself, accepting them in any case as the commons-cli path does, so an unknown value is a usage error instead of silently meaning remote. The command description follows the Stream command wording of the reference guide.

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

Good, just the general changelog comment

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.
EnvUtils maps the SOLR_CONNECTION environment variable to solr.connection, so the solr-connection key the stream connection lookup read could never be set. The picocli path now reads the right key, which a test covers, and the zkHost test drops its own property cleanup because the base class restores properties.
@janhoy janhoy added this to the 10.x milestone Oct 8, 2026
@janhoy
janhoy merged commit 7d17c65 into apache:main Oct 8, 2026
1 check passed
dsmiley pushed a commit that referenced this pull request Oct 9, 2026
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