Skip to content

Fix stale names in the Basic Authentication Plugin example - #5170

Merged
epugh merged 5 commits into
apache:mainfrom
nick-boss-tech:solr-18368-submit
Oct 21, 2026
Merged

epugh merged 5 commits into
apache:mainfrom
nick-boss-tech:solr-18368-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 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:

  • The sentence above the example names Http2SolrClient.Builder (line 371, base). Main has no class by that name. The client is named HttpJettySolrClient, and a source comment records the old name.
  • Line 375, base, calls HttpJettySolrClient.Builder() without new. Builder is a nested class with a public constructor, and no method of that name exists.
  • Line 377, base, calls withInternalClientBuilder. #4782 removed that method from CloudSolrClient.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.

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 built solrj and solrj-jetty client 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.

  • No test covers the example text, so a later rename could leave the page wrong again.
  • The example does not declare zkHostList or chroot; the constructor it calls takes the chroot as an Optional<String>. This change does not touch those lines.
  • No one-line upgrade note is added about the removal, for users who hit the old compile error. I can add one here, or in a follow-up, on request.

Changelog: none. This branch has no changelog fragment. The removal's own entry is already in changelog/unreleased on main.

AI assistance

AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.

…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.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 16, 2026
@nick-boss-tech nick-boss-tech changed the title Fix the Basic Authentication Plugin example so it compiles against the current clients Fix stale names in the Basic Authentication Plugin example Oct 16, 2026
@nick-boss-tech
nick-boss-tech marked this pull request as ready for review October 16, 2026 16:00
@epugh epugh added this to the 10.x milestone Oct 21, 2026
@epugh epugh self-assigned this Oct 21, 2026
epugh added 2 commits October 20, 2026 20:32
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.
@epugh
epugh merged commit c8769bb into apache:main Oct 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants