-
Notifications
You must be signed in to change notification settings - Fork 707
Enable picocli for a few tools #3247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jira/SOLR-17697-picocli
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks super interesting! I briefly looked at Picocli based on @janhoy input back when we started revamping the cli in 2024, but it felt a step too far, so we focused on just getting all our args reworked.
Now, I think that picocli brings a lot of great features. One that I am quite intrigued by is generating docs for our CLI in AsciiDoc: https://picocli.info/#_generate_man_page_documentation, I took a stab at generating docs from commons-cli, but it was too hard. Plus the support for sub commands looks interesting... I think this is a really good direction...
|
||
@Override | ||
public int callTool() throws Exception { | ||
if (zkHost == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we should have a more generic abstraction that isn't tied to "zkHost" for detecting if we are in solr cloud mode? Maybe an explicit method, because I feel like we are slowly hiding zkHost more and more, and the client may just be a solrClient configured with a solrUrl. <-- this isn't specific to your picocli change I know!
Eric, you have really lifted the CLI in the last versions, none of which is wasted if/when moving to picocli! Also, we have pretty good test coverage in bats tests, which is a great way to validate parity. It's not a goal to retain the exact same help/usage output. Let the tool generate based on best practices. However, given a CLI invocation I'd be interested in chipping away on this in a central collaborative feature branch over the course of a several weeks.. |
I'd love to work with you on this... I lean towards this being a 10x feature, just so we don't have to backport, and we have some time to make it "perfect". I think CLI bugfixes on 9x will just being and end on 9x branch in this case. So what is next? A branch in the main asf repo? Or do we just push to this one? |
PR that will merge into the Picocli feature branch visualized by #3254. This PR adds:
bin/solr
with picocli by default but also retain commons-cli for comparison. Switch usingSOLR_PICOCLI=false
VersionTool
,HealthcheckTool
andStatusTool
as sub commandsZkTool
sub command, which in turn hasZkLsTool
as a sub commanddefaultValueProvider
to let--zk-host
option look for a value in environmentThis is the first of many PRs to go against the feature branch to try to build full picocli coverage for the CLI tools.
Sample output for
bin/solr -h
: