Repository navigation
SOLR-16396: Align v2 full-config section keys with pluralised forms - #5175
Conversation
|
/no-changelog |
|
Agreed no changelog needed |
epugh
left a comment
There was a problem hiding this comment.
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
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
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. |
# Conflicts: # solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java
|
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
|
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. |
/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
…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





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:
mainbranch../gradlew check.