Repository navigation
CLI: Fix SOLR_CONNECTION fallback and other small improvements - #5054
Merged
Merged
Conversation
…ate example typo The solr-connection property key read by CliDefaultValueProvider and CLIUtils never matched the solr.connection sysprop that SOLR_CONNECTION maps to, so the documented fallback was dead on both parser paths. StartCommand still advertised --prompt-inputs after the rename to --script-inputs, and the create --help example used -s (solr-connection) where -sh (shards) was meant.
dsmiley
reviewed
Oct 7, 2026
Comment on lines
+39
to
+43
| } finally { | ||
| System.clearProperty("solr.connection"); | ||
| System.clearProperty("zkHost"); | ||
| System.clearProperty("solr.url"); | ||
| } |
Contributor
There was a problem hiding this comment.
Our tests clean up system properties. Do you not know this? LLMs didn't get the memo...
Contributor
Author
There was a problem hiding this comment.
Yea. Note that SolrTestCase only cleans up sysprops at the end of the test class, so individual test methods need to handle props individually. But I suppose methods within a test class always runs sequentially so they won't interfere, and since testNoDefaultWhenPropertiesUnset clears props itself, there is no need for an explicit cleanup here. Fixed.
Contributor
Author
There was a problem hiding this comment.
I added a line to AGENTS...
dsmiley
approved these changes
Oct 7, 2026
janhoy
added a commit
to jaykay12/solr
that referenced
this pull request
Oct 7, 2026
Main renamed the key from 'solr-connection' to 'solr.connection' in apache#5054; EnvUtils maps SOLR_FOO -> solr.foo, so the hyphenated key was never set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SOLR_CONNECTIONfallback was dead on both parser paths.CliDefaultValueProviderandCLIUtils.resolveSolrConnectionFromCliread thesolr-connectionproperty, butEnvUtilsmapsSOLR_CONNECTIONtosolr.connectionand its camelCase fallback can't bridge a hyphen, so the documented "unnecessary if SOLR_CONNECTION is defined in solr.in.sh" never worked. Now readssolr.connection. Covered by the newCliDefaultValueProviderTest(picocli) and two tests inCLIUtilsTest(commons-cli).bin/solr start --help(picocli) still advertised--prompt-inputs, which was renamed to--script-inputsin SOLR-18468;bin/solrandRunExampleToolalready use the new name.bin/solr create --helpexample used-s 2for shards;-sis--solr-connection, shards is-sh.Ref-guide CLI pages regenerated (
solr-start.adoc,solr-create.adoc). No behaviour change on the commons-cli path other than theSOLR_CONNECTIONfallback now taking effect.