Jan Høydahl created SOLR-18516:
----------------------------------

             Summary: Port PostTool and PostLogsTool to PicoCli
                 Key: SOLR-18516
                 URL: https://issues.apache.org/jira/browse/SOLR-18516
             Project: Solr
          Issue Type: Improvement
          Components: cli
            Reporter: Jan Høydahl


Port {{PostTool}} and {{PostLogsTool}} to picocli, adding the picocli code path 
alongside the existing commons-cli one.

*Covers:* {{bin/solr post}} and {{bin/solr postlogs}}

Grouped into one issue because {{postlogs}} is effectively a specialised 
variant of {{post}} and the two will share option plumbing; split into two 
issues if that turns out not to hold.

{{post}} (the Post Command) indexes files, directories, URLs or stdin into the 
collection named by {{\-c}} / {{\-\-name}}, with {{\-\-mode}}, {{\-\-type}}, 
{{\-\-filetypes}}, {{\-\-format}}, {{\-\-params}}, {{\-\-recursive}}, 
{{\-\-delay}}, {{\-\-skip-commit}}, {{\-\-optimize}} and {{\-\-dry-run}}. 
{{postlogs}} indexes Solr's own logs from {{\-\-rootdir}} into the collection 
named by {{\-c}} / {{\-\-name}}. Neither has sub-commands.

Both were renamed to "Post Command" and "Stream Command" in the ref guide by 
SOLR-18463, so the generated CLI pages should use that wording.

*Acceptance criteria*
* {{bin/solr post}} and {{bin/solr postlogs}} and all their options work with 
{{SOLR_PICOCLI=true}}, and the commons-cli path is left behaviourally unchanged.
* Both tools are registered in {{SolrCLI}}'s picocli {{subcommands}} list and 
{{ToolBase.callTool()}} is implemented for each, replacing the 
{{UnsupportedOperationException}} stubs.
* Shared options reuse the existing mixins ({{ConnectionOptions}}, 
{{CredentialsOptions}}, {{HelpMixin}}) rather than redeclaring them.
* A {{PostToolPicocliTest}} and a {{PostLogsToolPicocliTest}} subclass the 
existing tests and override only the {{runTool}} hook, so the inherited 
assertions run through both parsers.
* {{./gradlew :solr:solr-ref-guide:generateCliDocs}} is re-run and the 
generated {{cli/solr-post.adoc}} and {{cli/solr-postlogs.adoc}} pages are 
committed, so {{checkCliDocsUpToDate}} passes.

*AI assistance:* a coding-agent prompt template encoding the patterns already 
established by the ported tools is available at 
[https://gist.github.com/janhoy/a3fe0dbcaadf24b3493558946cc549d9] — name 
{{PostTool}} and {{PostLogsTool}} in its Assignment line up front and the rest 
of the prompt adapts. Please review agent output as carefully as hand-written 
code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to