Repository navigation
Fix stale names in the Basic Authentication Plugin example - #5170
Merged
Merged
Conversation
…ernalClientBuilder alias, and pin the removal with a test (the removal itself landed upstream in apache#4782)
…ilder removal, keep the docs fix only The test asserted by reflection that CloudSolrClient.Builder no longer declares withInternalClientBuilder. The method is already gone on main (the removal landed upstream in apache#4782), so the test passed before the change and could never fail: any caller of the removed method fails to compile anyway. The branch is now the ref-guide example fix alone.
nick-boss-tech
marked this pull request as ready for review
October 16, 2026 16:00
Both code blocks in the 'Per-Client Credentials' section were hand-typed and had silently gone stale (the bug this branch's prior commits fix). Add BasicAuthenticationRefGuideExamplesTest, which exercises both snippets against a real cluster secured with BasicAuthPlugin, and switch the page to include::[] the tagged snippets instead of duplicating the code, so a future rename breaks the build instead of the docs.
Readable JSON instead of a string-concatenation chain; no quote escaping needed. No other test defines a shared constant for this - BasicAuthOnSingleNodeTest, AuthWithShardHandlerFactoryOverrideTest, and TestQueryingOnDownCollection each independently define their own STD_CONF with a different (but equivalent) credential hash.
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.
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
https://issues.apache.org/jira/browse/SOLR-18368
This PR carries no ticket of its own. It covers the part of SOLR-18368 that still exists on main, and the commits carry that key.
What happens today
The example on the Basic Authentication Plugin page cannot compile against main.
Three lines of the page use a name or syntax that main does not have. These links point to the base commit, where the page is the same as on main:
Http2SolrClient.Builder(line 371, base). Main has no class by that name. The client is namedHttpJettySolrClient, and a source comment records the old name.HttpJettySolrClient.Builder()withoutnew.Builderis a nested class with a public constructor, and no method of that name exists.withInternalClientBuilder. #4782 removed that method fromCloudSolrClient.Builder(commit 3ef3d093c06), and that commit is already in the base. Apart from changelog entries, the page is the only place that still uses the name.What this change does
The branch corrects those three lines and changes nothing else in the page or the code.
HttpSolrClient.BuilderBaseinstance, the type thatwithHttpClientBuilderaccepts (CloudSolrClient.java, line 1550).httpClientBuilderline addsnew, as the public constructor requires. The chainedwithBasicAuthCredentialsreturns that builder.withHttpClientBuilder. The example's constructor call,new CloudSolrClient.Builder(zkHostList, chroot), already matches main. The client source undersolrjandsolrj-jettyis the same on the base commit, on this head, and on current main.Proof
This change has no test. It is a documentation fix, checked by compiling a copy of the example and building the page.
At the head, 15dd2aa74b, the Ref Guide site build (
buildLocalSite) finished with BUILD SUCCESSFUL on 2026-10-16, and the generated page carries the corrected example. A snippet that mirrors the corrected example also compiled clean against the builtsolrjandsolrj-jettyclient classes; that check ran at commit 1acaced, and the example's code lines are unchanged since.Limits
Three gaps are named below. This change does not close any of them.
zkHostListorchroot; the constructor it calls takes the chroot as anOptional<String>. This change does not touch those lines.Changelog: none. This branch has no changelog fragment. The removal's own entry is already in
changelog/unreleasedon main.AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.