SOLR-17697 Use picocli instead of commons-cli - #3254
Conversation
|
Actually, I'd like to try to implement PoC for few initial tools. upd: oh, I didnt notice there is a PR created for this |
Yea, there's an in-progress exploration taking place, feel free to join the discussion about it or POC for yourself on how to solve various issues that arise. We're still trying to land on the most elegant way to introduce things, and I plan to dial down the ambitions for the other PR to do bare minimal for one or two tools, and perhaps the "start" tool. Eventually, when we start getting the grip on how things should flow, it will be easier to jump in and implement PRs for new tools, targeting this branch. |
4ddb026 to
97a673e
Compare
97a673e to
cb41a69
Compare
|
Let's get this into main as soon as possible!!! |
|
@xtenzQ Everything is now brought up to speed with main. I have merged the first few tools into the feature branch. And I have two in-flight PRs ready for review and merging into this branch. See a comment in the JIRA issue for how to contribute for other tools not yet converted. |
Update lockfiles and sha-files Better --host docs and example on StartCommand Tweak example in CreateTool
… for cli (#4443) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@jaykay12 this is the ticket I mentioned in JIRA with a whole bunch of items to be worked on in hte description of the PR. Please tag me on your PR's to this branch, as I'd love to see this get over the finish line soon! |
…ocli # Conflicts: # solr/api/gradle.lockfile # solr/benchmark/gradle.lockfile # solr/core/gradle.lockfile # solr/core/src/java/org/apache/solr/cli/ConfigSetUploadTool.java # solr/core/src/java/org/apache/solr/cli/CreateTool.java # solr/core/src/java/org/apache/solr/cli/DeleteTool.java # solr/core/src/java/org/apache/solr/cli/StatusTool.java # solr/core/src/java/org/apache/solr/cli/VersionTool.java # solr/cross-dc-manager/gradle.lockfile # solr/modules/analysis-extras/gradle.lockfile # solr/modules/clustering/gradle.lockfile # solr/modules/cross-dc/gradle.lockfile # solr/modules/cuvs/gradle.lockfile # solr/modules/extraction/gradle.lockfile # solr/modules/gcs-repository/gradle.lockfile # solr/modules/jwt-auth/gradle.lockfile # solr/modules/langid/gradle.lockfile # solr/modules/language-models/gradle.lockfile # solr/modules/ltr/gradle.lockfile # solr/modules/opentelemetry/gradle.lockfile # solr/modules/s3-repository/gradle.lockfile # solr/modules/scripting/gradle.lockfile # solr/modules/sql/gradle.lockfile # solr/packaging/build.gradle # solr/packaging/test/test_create.bats # solr/server/gradle.lockfile # solr/solr-ref-guide/gradle.lockfile # solr/solrj-jetty/gradle.lockfile # solr/solrj-streaming/gradle.lockfile # solr/solrj-zookeeper/gradle.lockfile # solr/solrj/gradle.lockfile # solr/test-framework/build.gradle # solr/test-framework/gradle.lockfile # solr/webapp/gradle.lockfile
…igSets API changes - DeleteTool: use CLIUtils.getSolrConnection and 'Connecting to Solr at' message as on main, since delete no longer talks to ZooKeeper directly - CreateTool: only take solrUrl from explicit connection options so the live-node URL fallback works again (as on main) - StatusTool: default picocli --max-wait-secs to 0 to avoid NPE
…n changes - SolrCLI --version now prints 'Client version:' matching commons-cli output - ZkConnectionOptions, ConnectionOptions (create/delete) and StatusTool gain -s/--solr-connection accepting a ZooKeeper or HTTP(s) connection string, with --solr-url now long-only, mirroring CommonCLIOptions on main - StatusTool picocli target options grouped mutually exclusive like the commons-cli OptionGroup; zk/connection targets resolved to a Solr URL via new shared CLIUtils.solrUrlFromConnection (extracted from normalizeSolrUrl) - CliDefaultValueProvider supports SOLR_CONNECTION env default - test_status.bats accepts both engines' mutual-exclusion error messages Connection parsing is string-only; network calls happen only at tool execution time, never during picocli parsing.
|
This branch is now up to date with latest What it took, beyond routine conflict resolution:
The zk→live-node URL resolution needed by StatusTool was extracted into |
Import IOException in ConnectionOptions and picocli.CommandLine in SolrCLITest instead of using fully qualified names.
The picocli field refactor made the credential-taking overload read the (unset) field instead of its parameter, so AssertTool's status checks sent no Authorization header and test_basic_auth.bats failed with 401.
…ages Project.javaexec was removed in Gradle 9 (which arrived with the main merge); use injected ExecOperations as done in gradle/globals.gradle. Regenerated pages/cli to reflect the new -s/--solr-connection option group on status, create, delete and zk subcommands.
# Conflicts: # solr/core/src/java/org/apache/solr/cli/AuthTool.java
https://issues.apache.org/jira/browse/SOLR-17697
This PR is just a way to visualize the status of the feature branch
jira/SOLR-17697-picocli.Create PRs targeting that branch to tackle individual tasks, and then squash merge into this feature branch once done. Then at the end this branch can be merged (not-squash) into main to preserve each tool porting.
Pick a tool not yet converted from the list below. You'll find a useful LLM prompt template in the JIRA issue linked above. Feel free to link your PR number next to the tool line below to signal that you are working on it. Once merged into the feature-branch, check the checkbox.
Tasks/milestones: