You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org> on 2026/09/22 11:13:11 UTC

[PR] SOLR-17697: Implement picocli for assert, cluster, config, api, export, postlogs, run_example, post, stream and the snapshot-* commands [solr]

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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17697: Implement picocli for assert, cluster, config, api, export, postlogs, run_example, post, stream and the snapshot-* commands [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4931:
URL: https://github.com/apache/solr/pull/4931#issuecomment-6018517334

   @janhoy hey, thanks, i will do as you suggested - split PR per tool/jira and etc


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17697: Implement picocli for assert, cluster, config, api, export, postlogs, run_example, post, stream and the snapshot-* commands [solr]

Posted by "sergeybzhezitskiy (via GitHub)" <gi...@apache.org>.
sergeybzhezitskiy commented on PR #4931:
URL: https://github.com/apache/solr/pull/4931#issuecomment-6018499233

   @janhoy hey, np. i will do as you suggested


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17697: Implement picocli for assert, cluster, config, api, export, postlogs, run_example, post, stream and the snapshot-* commands [solr]

Posted by "janhoy (via GitHub)" <gi...@apache.org>.
janhoy commented on PR #4931:
URL: https://github.com/apache/solr/pull/4931#issuecomment-6018083871

   @serhiy-bzhezytskyy this got closed unintentionally after merging the feature-branch PR. I expected GH to auto move this PR tonto main as it usually does, but no. Please try to edit target branch yourself on this PR, if you can't do it I'm afraid you'll have to open a new PR.
   
   Also FYI, each remaining tool or group of tools that are not yet ported now have separate JIRA issues, see https://issues.apache.org/jira/issues/?jql=project%20%3D%20SOLR%20AND%20text%20~%20%22port%20picocli%22
   
   Ideally there will be one PR per JIRA/Tool for easier review. This huge PR adds 1317 lines of code and what will happen is that it wil be hard to get reviewers for it.
   
   Also, I made a LLM prompt to capture some best practices from other ports, see link in each JIRA. Feel free to ask your LLM to consider that info - perhaps there are useful improvements to be found.


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-17697: Implement picocli for assert, cluster, config, api, export, postlogs, run_example, post, stream and the snapshot-* commands [solr]

Posted by "janhoy (via GitHub)" <gi...@apache.org>.
janhoy closed pull request #4931: SOLR-17697: Implement picocli for assert, cluster, config, api, export, postlogs, run_example, post, stream and the snapshot-* commands
URL: https://github.com/apache/solr/pull/4931


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org