solr
solr copied to clipboard
Resolve CLI tool issues for hostContext "/"
Description
This is the continuation of #2778, as it seems there are some special cases that cause URL parsing issues.
Solution
The changes leverage jakarta's UriBuilder to avoid custom logic for URL path concatenation, which seems to cause some issues for cases where path segments like the hostContext may be /. Additionally, the currently used SolrCLI#normalizeSolrUrlis updated to behave differently for the special case where hostContext is /.
Any usage of PostTool#appendPath is replaced to avoid custom concatenation.
Tests
Since the appendPath method is removed, the tests for that method are also removed.
Checklist
Please review the following and check all that apply:
- [X] 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.
- [X] 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
mainbranch. - [X] I have run
./gradlew check. - [ ] I have added tests for my changes.
- [ ] I have added documentation for the Reference Guide
@janhoy I had to override the system property for hostContext to run into test failures, but I am not sure if this just executed a different execution path. If you have the time to check this solution let me know.
Should this PR be marked "Ready for Review" versus Draft?