Skip to content
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

SOLR-17489: CLI: Deprecate variations on solr urls options #2756

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

epugh
Copy link
Contributor

@epugh epugh commented Oct 11, 2024

https://issues.apache.org/jira/browse/SOLR-17489

Description

See JIRA

Solution

Deprecate old options in favour of --solr-url and --name. I am really liking how this looks after going through the code...

Debating if we should be using --collection instead of --name.... That can be a seperate ticket.

Tests

bats and java

@epugh
Copy link
Contributor Author

epugh commented Oct 11, 2024

@malliaridis okay, this one is ready for another set of eyes!

@epugh
Copy link
Contributor Author

epugh commented Oct 11, 2024

After merging this, we can then sort out the -s in the SolrExporter.java class.

Copy link
Contributor

@malliaridis malliaridis left a comment

Choose a reason for hiding this comment

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

I like the fact that we can use the same params in all tools now. I hope this change is preferred by the others as well. A few more references:

  • The error message in PostTool#runImpl (line 309) could be updated to reflect the none-deprecated options
  • post-tool.adoc#27: -url should be split into --solr-url and --name
  • post-tool.adoc#115: -url should be split into --solr-url and --name
  • post-tool.adoc#124: -url should be split into --solr-url and --name
  • post-tool.adoc#131: -url should be split into --solr-url and --name
  • post-tool.adoc#138: -url should be split into --solr-url and --name
  • post-tool.adoc#154: -url should be split into --solr-url and --name
  • post-tool.adoc#166: -url should be split into --solr-url and --name
  • post-tool.adoc#173: -url should be split into --solr-url and --name
  • post-tool.adoc#180: -url should be split into --solr-url and --name
  • post-tool.adoc#189: -url should be split into --solr-url and --name
  • post-tool.adoc#210: -url should be split into --solr-url and --name
  • post-tool.adoc#219: -url should be split into --solr-url and --name
  • spatal-search.adoc#74: -url should be split into --solr-url and --name

url = SolrCLI.normalizeSolrUrl(cli) + "/solr/" + cli.getOptionValue("name");

} else {
url = cli.getOptionValue("solr-collection-url");
Copy link
Contributor

Choose a reason for hiding this comment

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

Since solr-collection-url was required before, we should check for null here and throw an error if it is also not provided.

url = SolrCLI.normalizeSolrUrl(cli) + "/solr/" + cli.getOptionValue("name");

} else {
url = cli.getOptionValue("solr-collection-url");
Copy link
Contributor

Choose a reason for hiding this comment

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

Same null-check applies here as well.

"--solr-update-url",
cluster.getJettySolrRunner(0).getBaseUrl() + "/" + collection + "/update",
"--solr-url",
cluster.getJettySolrRunner(0).getBaseUrl().toString(),
Copy link
Contributor

Choose a reason for hiding this comment

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

getBaseUrl() extends v1 API path /solr, and the new logic does also add /solr/ if --solr-url is used. This results to a path like /solr/solr/collection/update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think I fixed it with the use of SolrCLI.normalizeSolrUrl() in the tool

"-url",
cluster.getJettySolrRunner(0).getBaseUrl() + "/" + COLLECTION_NAME,
"--solr-url",
cluster.getJettySolrRunner(0).getBaseUrl().toString(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Same issue with path here.

"--solr-update-url",
solrUrl + "/" + testCollectionName + "/update",
"--solr-url",
solrUrl,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same problem with path applies here as well, but this uses different logic.

@epugh
Copy link
Contributor Author

epugh commented Oct 17, 2024

Will add CHANGES.txt all at once.

@epugh epugh merged commit 0f4a465 into apache:main Oct 17, 2024
5 checks passed
epugh added a commit that referenced this pull request Oct 17, 2024
Use --solr-url and --name consistently.

(cherry picked from commit 0f4a465)
iamsanjay pushed a commit to iamsanjay/solr that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants