Skip to content

SOLR-16396: Align v2 full-config section keys with pluralised forms - #5175

Merged
epugh merged 13 commits into
apache:mainfrom
jaykay12:SOLR-16396-plural-config-all-fix
Oct 20, 2026
Merged

epugh merged 13 commits into
apache:mainfrom
jaykay12:SOLR-16396-plural-config-all-fix

Conversation

@jaykay12

@jaykay12 jaykay12 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Description

Align v2 full-config section keys with pluralised forms

Solution

Since, this is an ongoing initiative, imo no CL is required here.

Tests

Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.

Checklist

Please review the following and check all that apply:

  • 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.
  • 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 main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

@github-actions github-actions Bot added the tests label Oct 16, 2026
@jaykay12

Copy link
Copy Markdown
Contributor Author

/no-changelog

@jaykay12

Copy link
Copy Markdown
Contributor Author

Testing Evidences

Scenario Main Feature Veridict
V2 full config Screenshot 2026-10-17 at 4 29 39 AM Screenshot 2026-10-17 at 4 27 15 AM Fixed now ✅
- - - -
V2 filtered config Screenshot 2026-10-17 at 4 28 46 AM Screenshot 2026-10-17 at 4 26 08 AM Was already correct 👍🏽

@jaykay12 jaykay12 left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@epugh please help in triggering workflows for this fix.

@epugh

epugh commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Agreed no changelog needed

@epugh epugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This makes sense.... however do we need to document in the ref guide the two different out puts? Between v1 and v2?

The V1/V2 full-config output comparison only called out the children-key
difference; add the searchComponent/queryResponseWriter pluralization
this PR introduces, shown the same way as the existing children-key
example (separate V1/V2 JSON output per tab).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 17, 2026
epugh and others added 2 commits October 17, 2026 11:10
The new V1/V2 full-config diff duplicated the elevator/xslt example and
explanation already given a few dozen lines down, where the per-section
GET endpoints are documented. Drop the redundant JSON snippets and keep
a single forward-pointing sentence instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
reqhandlertests() is shared between v1 and v2 harness runs (toggled
randomly in @before), and asserted the singular "searchComponent" key
against the bare /config endpoint regardless of API version. Since
GetConfig#getConfig now pluralizes that key under v2, the test failed
whenever the random toggle picked v2 (reproduced with CI's exact seed
177EED04838EDD3C). Pick the expected key based on the harness's URL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
@jaykay12

Copy link
Copy Markdown
Contributor Author

This makes sense.... however do we need to document in the ref guide the two different out puts? Between v1 and v2?

thanks @epugh for doing ref guide updates this time. I will try keeping them in sync from next PRs.

can we retrigger the workflows & verify once.

@jaykay12
jaykay12 requested a review from epugh October 17, 2026 20:06
jaykay12 and others added 2 commits October 18, 2026 12:43
# Conflicts:
#	solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java
@epugh

epugh commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Merged `upstream/main` in and resolved the one conflict (in `GetConfig.java` — `getConfig`'s pluralization logic needed to call the now-1-arg `buildConfigMap(expandParams)` signature from #5168, instead of the old 2-arg one). CI re-triggered and approved — running now.

Ran the full relevant local test suite post-merge (48 tests across `GetConfigTest`, `GetConfigSolrCloudTest`, `V2ConfigAPIMappingTest`, `TestSolrConfigHandler`, `TestSolrConfigHandlerCloud`, `PackageToolTest`, `PackageToolPicocliTest`, package-manager tests) — all green, spotless clean.

The full /config dump already pluralized searchComponent/queryResponseWriter
for v2 clients, but left requestHandler singular even though the dedicated
GET /config/requestHandlers endpoint (and its response key) has used the
plural form since SOLR-16396's requestHandler migration. Add requestHandler
-> requestHandlers to the same external/internal name map so the full-config
remapping picks it up consistently.

v1's GET /config is unaffected (explicitly opts out of the renaming via
useExternalComponentNames=false).

Also fixes two test assertions (TestSolrConfigHandler.testProperty and
reqhandlertests) that checked the full "/config" response for a hardcoded
singular "requestHandler" key with no v1/v2 branching - these would have
started failing intermittently against the V2 harness once this change
landed, the same race the existing searchComponentKey branching was already
guarding against.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
@epugh

epugh commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Also pluralized `requestHandler` -> `requestHandlers` in the full v2 `/config` response, for consistency with the dedicated `GET /config/requestHandlers` endpoint (which has used the plural form since the requestHandler migration) and with `searchComponent`/`queryResponseWriter` already being pluralized here. v1's `/config` is unaffected.

Also caught and fixed two test assertions (`TestSolrConfigHandler.testProperty` and `reqhandlertests`) that checked the full `/config` response for a hardcoded singular `"requestHandler"` key without v1/v2 branching — these would have started failing intermittently against the randomized V2 harness runs once this landed, the same class of issue the existing `searchComponentKey` branching already guarded against. Reproduced the failure first (3-4/4 runs failing), then fixed and reran clean (4/4, 6/6 across separate runs).

Updated the ref guide to describe this as a third V1/V2 difference in the full-config output, alongside the existing `children`-key and `searchComponent`/`queryResponseWriter` notes.

CI re-approved and running.

@jaykay12 jaykay12 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

final local testing done with most latest changes, lgtm ✅

Image

/simplify findings applied:

- GetConfig.getConfig's boolean useExternalComponentNames parameter
  encoded "which API version is calling" as an unlabeled boolean, with
  the only caller (SolrConfigHandler's v1 path) reading as a bare
  "getConfig(expandParams, false)". Replaced the boolean overload with
  two distinctly-named methods: getConfig (v2, always pluralizes) and
  getConfigWithInternalNames (v1, unchanged names) - self-documenting
  at the one call site that needed it.

- EXTERNAL_TO_INTERNAL_COMPONENT_NAME was doing double duty: it drives
  the GET /config/{component} path-routing translation (only
  searchComponent/queryResponseWriter ever route through there) and,
  separately, the full /config dump's top-level key renaming (which
  also needs requestHandler). Adding requestHandler to the shared map
  made it look reachable via the path-routing lookup even though
  requestHandler has its own dedicated endpoint and never goes through
  getConfigComponent(ByName) - a future path-regex change "completing"
  the pattern based on this map would have silently lost
  implicit-handler merging and useParams expansion. Split into two
  maps scoped to their actual callers.

- Factored the duplicated "pick internal vs external key name based on
  whether this test harness is V1 or V2" ternary (independently
  written out in both testProperty and reqhandlertests) into one
  shared fullConfigKey helper in TestSolrConfigHandler.

No behavior change - verified via repeated runs of TestSolrConfigHandler
(whose @before randomly toggles V1/V2 per run) and the rest of the
GetConfig/SolrConfigHandler test suite.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
Comment thread solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java Outdated
epugh and others added 2 commits October 20, 2026 15:12
…ntries

The previous comment claimed this map was "a superset of
EXTERNAL_TO_INTERNAL_COMPONENT_NAME", but it was actually just a second,
independently-written Map.of() literal with the same two entries copy-pasted
in. Nothing enforced that relationship - a future edit to one map without
the other would silently make the comment false, with no compiler or test
catching the drift.

Build the full-config map from the component-routing map instead, adding
only the one extra entry (requestHandler) that's unique to it. The
"superset" claim is now true by construction.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
jaykay12 flagged the comments on EXTERNAL_TO_INTERNAL_COMPONENT_NAME and
EXTERNAL_TO_INTERNAL_FULL_CONFIG_NAME as too much code commenting. Cut
both down to the one non-obvious fact each carries (requestHandler is
intentionally excluded from the routing map; the full-config map is
derived, not duplicated), dropping restatement of what the
code/identifiers already make clear.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
@epugh epugh added this to the 10.x milestone Oct 20, 2026
@epugh
epugh merged commit d5a1701 into apache:main Oct 20, 2026
6 checks passed
@jaykay12
jaykay12 deleted the SOLR-16396-plural-config-all-fix branch October 20, 2026 20:44
dsmiley pushed a commit that referenced this pull request Oct 22, 2026
…5175)

Co-authored-by: Eric Pugh <epugh@opensourceconnections.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit d5a1701)
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 no-changelog tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants