nick-boss-tech opened a new pull request, #5170: URL: https://github.com/apache/solr/pull/5170
🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)* ## 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](https://github.com/apache/solr/blob/14c7aac0d151402b00259e2fb9bf5eed7049ec5d/solr/solr-ref-guide/modules/deployment-guide/pages/basic-authentication-plugin.adoc#L371), base). Main has no class by that name. The client is named `HttpJettySolrClient`, and [a source comment](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java#L96) records the old name. - [Line 375](https://github.com/apache/solr/blob/14c7aac0d151402b00259e2fb9bf5eed7049ec5d/solr/solr-ref-guide/modules/deployment-guide/pages/basic-authentication-plugin.adoc#L375), base, calls `HttpJettySolrClient.Builder()` without `new`. `Builder` is a [nested class with a public constructor](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java#L956), and no method of that name exists. - [Line 377](https://github.com/apache/solr/blob/14c7aac0d151402b00259e2fb9bf5eed7049ec5d/solr/solr-ref-guide/modules/deployment-guide/pages/basic-authentication-plugin.adoc#L377), base, calls `withInternalClientBuilder`. [#4782](https://github.com/apache/solr/pull/4782) removed that method from `CloudSolrClient.Builder` ([commit 3ef3d093c06](https://github.com/apache/solr/commit/3ef3d093c068b46431b6c7190d4706f5f599eaf7)), 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.** - The sentence now names an HTTP SolrClient builder, the type that `withHttpClientBuilder` accepts ([CloudSolrClient.java, line 1550](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java#L1550)). That type is [`HttpSolrClient.BuilderBase`](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java#L438). - The `httpClientBuilder` line adds `new`, as the [public constructor](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java#L956) requires. The chained [`withBasicAuthCredentials`](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java#L526) returns that builder, which `withHttpClientBuilder` accepts. - The last line calls `withHttpClientBuilder`. The example's constructor call, [`new CloudSolrClient.Builder(zkHostList, chroot)`](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java#L1398), already matches main. The client source under `solrj` and `solrj-jetty` is 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 commit [1acaced80b2](https://github.com/nick-boss-tech/solr/commit/1acaced80b2eb8ace290ce12fcefffed5e4b359f): - A snippet that mirrors the corrected example compiled clean against the built `solrj` and `solrj-jetty` client classes. - The Ref Guide site build (`buildLocalSite`) finished with BUILD SUCCESSFUL on 2026-10-04. The head, [a7ec9a1b65c0](https://github.com/nick-boss-tech/solr/commit/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d), differs from that commit only by removing one test file. The client source and the page are the same in both, so these two checks still describe the head. Neither check was run again at the head. ## 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 the example calls](https://github.com/nick-boss-tech/solr/blob/a7ec9a1b65c05b2e359e9a186fc2938fe7b7ca7d/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java#L1398) 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
