Repository navigation
SOLR-18518: Port the snapshot commands to picocli - #5044
Conversation
Adds the picocli code path next to the commons-cli one for snapshot-create, -delete, -describe, -export and -list, with test twins and the generated reference pages. The page generator now takes a command's hyphenated name from the pages that exist rather than from splitting the file name, so these are not titled "snapshot create".
janhoy
left a comment
There was a problem hiding this comment.
This implementation does not do what the JIRA prescribes, i.e. splitting into sub-commands and keeping the flat commands as shims only. Please re-read the JIRA
…den shims The JIRA asks for bin/solr snapshot <sub-command>, with the five flat spellings only as deprecated, hidden shims and an upgrade note. The flat commands became sub-commands of a snapshot group, the old spellings extend them, and the page generator change is no longer needed.
|
Re-read the JIRA and reworked it: |
janhoy
left a comment
There was a problem hiding this comment.
Nice work. Some comments...
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.
…ey run The change lands in 10.2, so the shims are deprecated since 10.2 and removed in 11.0, and the upgrade note moves to the 10.2 section of major-changes-in-solr-10.adoc. A shim logs one deprecation notice naming the new command, because it is otherwise silent. --backup-repo-name takes a repository name, which the synopsis now shows.
|
Done in f7b468e: the shims are |
EnvUtils maps the SOLR_CONNECTION environment variable to solr.connection, so the solr-connection key the shared connection lookup of the snapshot commands 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.
…snapshot # Conflicts: # changelog/unreleased/SOLR-17697-picocli-experimental-cli.yml # solr/core/src/java/org/apache/solr/cli/SolrCLI.java
https://issues.apache.org/jira/browse/SOLR-18518
Description
Adds the picocli code path for the snapshot commands, as
bin/solr snapshot <sub-command>, next to the commons-cli one.Solution
snapshotis a sub-command group withcreate,delete,describe,exportandlist;-cand--snapshot-namecome from two small mixins. The fivesnapshot-*spellings stay as hidden shims, deprecated since 10.2 and removed in 11.0, and an upgrade note says so. The commons-cli path is unchanged. Written with Claude Code.Tests
SnapshotToolsPicocliTestruns create, list, describe and delete through the new sub-commands and checks that the old spellings still work, are hidden and are deprecated.SnapshotExportToolPicocliTestruns the export tests throughsnapshot export.check -x testis clean (rat skipped).Checklist
mainbranch../gradlew check.