Repository navigation
Conversation
epugh
left a comment
There was a problem hiding this comment.
One suggested change, but otherwise LGTM!
|
|
||
| Solr is migrating the `bin/solr` command line tool from Apache Commons CLI to https://picocli.info/[picocli]. | ||
| While that work is in progress, both implementations ship together and the picocli one can be enabled on request. | ||
| Solr has migrated the `bin/solr` command line tool from Apache Commons CLI to https://picocli.info/[picocli]. |
There was a problem hiding this comment.
This should be removed on Solr 11 Ref Guide, of course, we need it on solr 10. I hope we see commons-cli removed from Solr 11 very soon!
There was a problem hiding this comment.
yes, we will plan for the cleanup as well real quick.
|
🤖 AI text below 🤖 (reviewed by Nick Shanin) Thanks for this. SOLR_PICOCLI=false is the escape hatch as described. Two things to tidy before merge:
@test "create help with SOLR_PICOCLI=false uses the commons-cli fallback" {
SOLR_PICOCLI=false run solr create --help
assert_success
assert_output --partial 'bin/solr create'
refute_output --partial 'Usage: solr create'
}I haven't run this example, so the expected strings are unconfirmed. CI failure: The "Run Solr Script Tests" job fails on one assertion in |
actually, we are maintaining 1 single CL file for the picoCLI migration & not every PR wise. thus, the cl file is updated & the jira it carries is the main parent one, under which all these subtasks land upon.
thanks @nick-boss-tech for the review. that makes me doubt, if this is intermittent only & we should check it again. @epugh requesting you to retrigger the workflows again, & we will keep an eye on the bats this time. |
| 'test/test_snapshots.bats', | ||
| 'test/test_ssl.bats', | ||
| 'test/test_start_solr.bats', | ||
| 'test/test_zz_cleanup.bats', |
There was a problem hiding this comment.
So this means we now run the entire BATS suite for picocli, right?
There was a problem hiding this comment.
we are running 26/30 bats suite for now, the 4 that are not in the list: tests_basic_auth, test_help, test_post & test_stream. I will work on debugging & fixing in a quick follow-up PR & then those will also get added. we will then remove this Todo & then we can say all 30 BATs suite runs for PicoCLI.
| [NOTE] | ||
| ==== | ||
| This page documents the `bin/solr` script as it behaves by default. | ||
|
|
||
| An experimental re-implementation of the command line interface, built on picocli, is also included in this release. | ||
| It is disabled by default, and the options it accepts differ in places from those documented here. | ||
| A re-implementation of the command line interface, built on picocli, is also included in this release. | ||
| It is enabled by default, and the options it accepts differ in places from those documented here. | ||
| See xref:cli/index.adoc[] if you would like to try it. | ||
| ==== |
There was a problem hiding this comment.
I think this NOTE shuold be replaced with a short note about commons-cli being available as an escape hatch. The link to xref:cli/index.adoc[] should instead be a new paragraph == Man pages or similar, telling that each command has its own documentation page and the link.
I wonder if perhpas most of the remainder of this adoc page can be deleted since it is manually maintained and largely redundant with the new man pages? There are some general sections near the bottom that could perhaps stay.
There was a problem hiding this comment.
I think this NOTE shuold be replaced with a short note about commons-cli being available as an escape hatch. The link to xref:cli/index.adoc[] should instead be a new paragraph == Man pages or similar, telling that each command has its own documentation page and the link.
have done few changes in the wordings here.
There was a problem hiding this comment.
I wonder if perhpas most of the remainder of this adoc page can be deleted since it is manually maintained and largely redundant with the new man pages? There are some general sections near the bottom that could perhaps stay.
imo, we should not do this cleanup now. This solr-control-script-reference.adoc ties back to commons-cli & till the time we are supporting commons-cli there is no harm in keeping it. when we remove commons-cli support, this ref guide also dies alongside it.
we are explicitly asking users to report any behaviour diff if they observe with respect to this page over in the bottom of index.sdoc.
There was a problem hiding this comment.
The wording "See xref:cli/index.adoc[] if you would like to try it" feels strange when this is now the actual default. So we should instead actively point people to the new CLI page as the reference docs for what is now the default CLI commands.
IMO these two pages shuold be written as if picocli was our only choice, and mention commons-cli as a side-note and escape hatch if they run in to a bug.
It's probably ok to keep some of the tool descriptions on the control-script-reference page, unless they contradict options or output from picocli. Perhaps we should add a heading saying that the below section describes the fallback commons-cli and may differ from what is now default?
There was a problem hiding this comment.
have done few changes, pls have a look now, does it look better?
There was a problem hiding this comment.
I'm still sceptical to keeping such a large CLI usage block this prominent when it does not apply (fully) to the default CLI that 99% will be using. Could we move the section to a new sub page "Commons-CLI command reference"? That page could describe the escape hatch and document the old behavior.
janhoy
left a comment
There was a problem hiding this comment.
DId a review, sorry for not grouping all comments under this review. I did not yet take it for a spin or render the ref guide to inspect how it reads. After next round of edits I'll take it for a spin.
PS: I merged Nick's small ssl bats change but did not merge it into this branch so won't see the effect yet.
Co-authored-by: Jan Høydahl <[email protected]>
Co-authored-by: Jan Høydahl <[email protected]>
| == Commands | ||
|
|
||
| These following commands now have a reference page generated from their source annotations. | ||
| Each command has a reference page generated from its source annotations. |
There was a problem hiding this comment.
An end user won't know what a "source annotation" is. The ref guide is for end users, we should describe what they see, the commands they write and the response they get back, not code-level things.
| * On a sub-command, `-v` means `--verbose`; only the top-level `bin/solr` accepts `-v` as a request for the version. | ||
| * `bin/solr config` has no `-v` short form for `--value`, because `-v` means `--verbose`; use `--value`. | ||
| The default implementation accepts `-v` for it. | ||
| The legacy CLI accepts `-v` for it. |
There was a problem hiding this comment.
It's dangerous to use a term like legacy, in this context we could perhaps say that before Solr 10.2 -v was a short-hand for value for the config command, but not any more.
The legacy comment is general for any other place it may have been used.
Also, I'm not sure that "migration changes" even belong in this doc page. It will duplicate the upgrade notes in major-changes-in-solr-10, section 10.2. so I'd prefer if we just do a WARNING callout on this page with a link to that upgrade notes section, and document all deliberate breaking changes for PicoCLI there only.
| [NOTE] | ||
| ==== | ||
| This page documents the `bin/solr` script as it behaves by default. | ||
|
|
||
| An experimental re-implementation of the command line interface, built on picocli, is also included in this release. | ||
| It is disabled by default, and the options it accepts differ in places from those documented here. | ||
| A re-implementation of the command line interface, built on picocli, is also included in this release. | ||
| It is enabled by default, and the options it accepts differ in places from those documented here. | ||
| See xref:cli/index.adoc[] if you would like to try it. | ||
| ==== |
There was a problem hiding this comment.
I'm still sceptical to keeping such a large CLI usage block this prominent when it does not apply (fully) to the default CLI that 99% will be using. Could we move the section to a new sub page "Commons-CLI command reference"? That page could describe the escape hatch and document the old behavior.
|
Review TL/DR:
Review Details: @jaykay12 Thanks for clarifying the shared migration changelog in the earlier discussion. Keeping the entry under SOLR-17697 makes sense, and I confirmed that the SSL BATS fix from #5193 is already included in this branch. Reviewing
For verification, I would check that each named task selects its intended parser even when the invoking environment specifies the opposite value, followed by the relevant help/post coverage from #5204. These findings are from static inspection; I have not run Gradle or BATS. |

https://issues.apache.org/jira/browse/SOLR-18561
Description
Flipping CLI default flag to PicoCLI
Based upon the Dev-List item: https://lists.apache.org/thread.html/zxckzh6v98xqjfxf8kn3l73g3593nfly
Solution
SOLR_PICOCLI=false is the hatch, which helps us be backward-compatible & use commons-cli in case any unforeseen error comes.
Tests
NA
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.