serhiy-bzhezytskyy opened a new pull request, #4931: URL: https://github.com/apache/solr/pull/4931
https://issues.apache.org/jira/browse/SOLR-17697 @janhoy @dsmiley @epugh Converts 11 of the remaining unconverted tools to picocli: `assert`, `cluster`, `config`, `api`, `export`, `postlogs`, `run_example` (`bin/solr start -e`), `post`, `stream`, and the five `snapshot-*` commands (`snapshot-create`, `snapshot-delete`, `snapshot-describe`, `snapshot-export`, `snapshot-list`). `PackageTool` is intentionally left out - #4739 is already open for it. Each tool reuses the existing `ConnectionOptions`/`CredentialsOptions`/`ZkConnectionOptions` mixins where applicable. Two new shared helpers were added to `CLIUtils` (`resolveSolrUrl`/`resolveSolrConnection`) so tools needing the commons-cli path's `normalizeSolrUrl(CommandLine)`/`getSolrConnection(CommandLine)` cluster-probe behavior don't each reimplement it. Two small, unavoidable divergences from the commons-cli path, both because picocli enforces at construction time what commons-cli only silently shadows: - `ConfigTool --value` drops its `-v` short form. `-v` is already `ToolBase`'s `--verbose`, and the commons-cli path already has them colliding (`VALUE_OPTION` is registered after `VERBOSE_OPTION`, so `-v` currently resolves to `--value`, not `--verbose`); picocli refuses the duplicate outright. - `ExportTool`/`PostLogsTool`'s connection group is declared `multiplicity = "1"` (mandatory) instead of manually throwing `IllegalArgumentException` when absent, since both already require a connection unconditionally. Verified: - `./gradlew :solr:core:test --tests "org.apache.solr.cli.*"` - 152 tests, 2 skipped, all green. - Every new subcommand's `--help` starts cleanly under `SolrCLIPicocliTest.testEveryCommandSupportsHelp`. - Live-tested each one against a real Solr instance under `SOLR_PICOCLI=true`, across all three connection forms plus the no-connection default: `config` (set/unset + validation), `api` (GET), `cluster` (ZK write, confirmed via `zk cp`), the full `snapshot-*` lifecycle (create, list, describe, delete, plus export's `--snapshot-name` rejection), `assert` (both outcomes, exit code 100, mutual exclusion), `postlogs` (including a pre-existing `LogRecordReader` parsing quirk that reproduces identically on both parsers). AI-assisted (Claude Sonnet 5). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
