Skip to content

SOLR-18234: Reorganize org.apache.solr.cli into domain-based sub-packages - #4663

Open
jaykay12 wants to merge 15 commits into
apache:mainfrom
jaykay12:SOLR-18234-solr-cli-refactor
Open

jaykay12 wants to merge 15 commits into
apache:mainfrom
jaykay12:SOLR-18234-solr-cli-refactor

Conversation

@jaykay12

@jaykay12 jaykay12 commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Description/Scope

Reorganize org.apache.solr.cli into domain-based sub-packages

Solution

For the main Jira: SOLR-18234, final objective is to move cli package out from core module, into a separate module of itself.
This PR scope is to just make the original/current package structure organised.

There is some tangling between packagemanager package inside core, which depends on the SolrCLI that exists in cli. This change & any other improvement that i find good to do in the cli package, with come in series of PR before we finally migrate cli module out.

Tests

Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

@dsmiley

dsmiley commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Can you please describe this change? The PR description is not indicative; I suggest removing the template as it's a waste/distraction.

@jaykay12 jaykay12 changed the title SOLR-18234: Refactoring CLI module SOLR-18234: Reorganize org.apache.solr.cli into domain-based sub-packages Jul 25, 2026

@jaykay12 jaykay12 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grok Review of the PR:

Main Feature
Screenshot 2026-07-26 at 4 03 43 AM Screenshot 2026-07-26 at 4 04 01 AM

Comment on lines -223 to -239
/**
* Returns the value of the option with the given name, or the value of the deprecated option. If
* both values are null, then it returns the default value.
*
* <p>If this method is marked as unused by your IDE, it means we have no deprecated CLI options
* currently, congratulations! This method is preserved for the next time we need to deprecate a
* CLI option.
*/
public static String getOptionWithDeprecatedAndDefault(
CommandLine cli, Option opt, Option deprecated, String def) {
String val = cli.getOptionValue(opt);
if (val == null) {
val = cli.getOptionValue(deprecated);
}
return val == null ? def : val;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused method. thus removed it.

@jaykay12
jaykay12 marked this pull request as ready for review July 25, 2026 22:36
@jaykay12

Copy link
Copy Markdown
Contributor Author

Can you please describe this change? The PR description is not indicative; I suggest removing the template as it's a waste/distraction.

yes, @dsmiley
PR was not ready by then, thus I kept it under draft.

Have added the description & PR scope now. Thanks in advance. ✨

@jaykay12

jaykay12 commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@epugh can please check this PR? if this looks worthy enough, I will raise the one against picoCLI feature branch & get that one merged.

We can close this one, & let these re-packaging changes flow via the picoCLI migration.

@jaykay12

Copy link
Copy Markdown
Contributor Author

@epugh can you check the objective of this PR & see if this improves our code structure & management?

@epugh

epugh commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

I think I like it... The bigger challenge is that we have a LOT of seperate efforts all going in the CLI right now, and I'm not sure how to land this without breaking all the other work going on.. We need to get our CLI finished migrating over to Picocli and that is probably the bigger more important effort, then this could go on top...

@dsmiley

dsmiley commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@jaykay12 I think progress can be made now by an independent PR solely focused on untangling the outgoing solr-core to CLI dependencies. No grand reorganization. Would you agree @epugh ?

@dsmiley

dsmiley commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I'm referring to the subset of work quoted in the PR description:

There is some tangling between packagemanager package inside core, which depends on the SolrCLI that exists in cli. This change & any other improvement that i find good to do in the cli package, with come in series of PR before we finally migrate cli module out.

@jaykay12

jaykay12 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@jaykay12 I think progress can be made now by an independent PR solely focused on untangling the outgoing solr-core to CLI dependencies. No grand reorganization. Would you agree @epugh ?

@dsmiley I have raised the PR: #5018 for this one. Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants