Skip to content

SOLR-16396: Migrate remaining GET /config/{component} sections to JAX-RS - #5174

Merged
epugh merged 20 commits into
apache:mainfrom
jaykay12:SOLR-16396-config-remaining-get-sections
Oct 20, 2026
Merged

epugh merged 20 commits into
apache:mainfrom
jaykay12:SOLR-16396-config-remaining-get-sections

Conversation

@jaykay12

@jaykay12 jaykay12 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Description

Migrate remaining GET /config/{component} sections to JAX-RS

Solution

With this PR merged, all GET config sections will get be fully JAX-RS compatible.

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

jaykay12 and others added 2 commits October 17, 2026 19:14
circuitBreaker, initParams, listener, and updateRequestProcessorChain
are declared without REQUIRE_NAME in SolrConfig's plugin registry, so
SolrConfig#writeMap serializes them as a List rather than a name-keyed
Map. GetConfig#filterByComponentName's unconditional (Map) cast then
threw ClassCastException for any by-name lookup against these sections
(reachable both via v1's componentName query param, pre-existing, and
the new v2 GET /config/{component}/{componentName} path added here),
surfacing as an uncaught 500 instead of the documented 404 convention.

- filterByComponentName now checks the section's shape and throws a
  clean NOT_FOUND when by-name filtering doesn't apply, fixing the v1
  path that predates this PR.
- Also drop the 4 non-named sections from the v2 by-name @path regex,
  since offering a route that can never find a match by name isn't a
  useful API surface.
- cache has the same REQUIRE_NAME+MULTI_OK shape as the other sections
  already pluralized here (listener->listeners, queryParser->
  queryParsers, etc.) but was left singular; renamed to caches for
  consistency.

Verified via a throwaway reproduction test: GET .../config/circuitBreaker/x
500'd with ClassCastException before this change, now returns a clean 404.

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

epugh commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Found a bug while reviewing this against `dev-docs/apis-v2-conventions.adoc`: `circuitBreaker`, `initParams`, `listener`, and `updateRequestProcessorChain` are declared without `REQUIRE_NAME` in `SolrConfig`'s plugin registry, so `SolrConfig#writeMap` serializes them as a `List` rather than a name-keyed `Map`. `GetConfig#filterByComponentName`'s unconditional `(Map)` cast then throws a `ClassCastException` for any by-name lookup against these sections — reachable both via v1's `componentName` query param (pre-existing bug, predates this PR) and the new v2 `GET /config/{component}/{componentName}` path this PR adds. That surfaces as an uncaught 500 instead of the documented NOT_FOUND/404 convention.

Reproduced with a throwaway test: `GET .../config/circuitBreaker/x` 500'd with the ClassCastException before this fix, returns a clean 404 after.

Pushed a fix:

  • `filterByComponentName` now checks the section's shape and throws a clean `NOT_FOUND` when by-name filtering doesn't apply (fixes the v1 path too).
  • Dropped those 4 non-named sections from the v2 by-name `@Path` regex, since a route that can never match by name isn't useful API surface.
  • Also noticed `cache` has the same `REQUIRE_NAME + MULTI_OK` shape as the other sections this PR already pluralizes (`listener`→`listeners`, `queryParser`→`queryParsers`, etc.) but was left singular — renamed to `caches` for consistency.

All existing tests pass (`GetConfigTest`, `GetConfigSolrCloudTest`, `V2ConfigAPIMappingTest`, `TestSolrConfigHandler`, `TestSolrConfigHandlerCloud`).

@epugh
epugh marked this pull request as ready for review October 20, 2026 12:43
@jaykay12

jaykay12 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Testing

Few V2 APIs

link test screenshot
link Screenshot 2026-10-20 at 9 09 17 PM
link Screenshot 2026-10-20 at 9 10 42 PM
link Screenshot 2026-10-20 at 9 11 14 PM
link Screenshot 2026-10-20 at 9 11 46 PM

Remaining others, i couldn't find for the "techproducts" example that i was using in local testing.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 20, 2026

@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.

self review ✅
precommit ✅
local testing ✅

@epugh epugh added this to the 10.x milestone Oct 20, 2026
@epugh
epugh merged commit 8576dc8 into apache:main Oct 20, 2026
2 of 7 checks passed
@jaykay12
jaykay12 deleted the SOLR-16396-config-remaining-get-sections branch October 20, 2026 21:17
@jaykay12 jaykay12 mentioned this pull request Oct 20, 2026
4 of 8 tasks
dsmiley pushed a commit that referenced this pull request Oct 22, 2026
nick-boss-tech added a commit to nick-boss-tech/solr that referenced this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:api documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants