Skip to content

Migrate NodeHealthAPI from homegrown @EndPoint to JAX-RS; add ref guide link#4171

Open
epugh wants to merge 9 commits intoapache:mainfrom
epugh:copilot/migrate-node-health-api
Open

Migrate NodeHealthAPI from homegrown @EndPoint to JAX-RS; add ref guide link#4171
epugh wants to merge 9 commits intoapache:mainfrom
epugh:copilot/migrate-node-health-api

Conversation

@epugh
Copy link
Contributor

@epugh epugh commented Feb 28, 2026

Migrates NodeHealthAPI — the last node-level V2 API still using Solr's homegrown @EndPoint annotation — to standard JAX-RS, following the same pattern as NodeLogging, GetPublicKey, etc.

Design

The logic stays in HealthCheckHandler (minimising diff surface). NodeHealthAPI is a thin JAX-RS wrapper (~60 lines) that delegates entirely to it.

Key changes

  • solr/api — New NodeHealthApi interface (@Path, @GET, @Operation) and NodeHealthResponse model (status, message, num_cores_unhealthy)
  • NodeHealthAPI — Replaces @EndPoint with JAX-RS; injects CoreContainer, delegates to HealthCheckHandler
  • HealthCheckHandler — Logic unchanged; adds public NodeHealthResponse checkNodeHealth(Boolean, Integer) as the shared entry point for both v1 (handleRequestBody) and v2 (NodeHealthAPI); switches to getJerseyResources() / empty getApis()
  • V2NodeAPIMappingTest — Removes the now-obsolete @EndPoint/ApiBag routing test for health
  • NodeHealthAPITest — New Mockito unit tests for the API class
  • NodeHealthAPITest2 — New mock-free integration tests: cloud-mode via real MiniSolrCloudCluster, legacy mode via embedded CoreContainer built from NodeConfig
  • implicit-requesthandlers.adoc — Health section now links to both HealthCheckHandler (v1) and NodeHealthAPI (v2) javadocs

Copilot AI and others added 4 commits February 22, 2026 12:52
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
…ef guide

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
@epugh
Copy link
Contributor Author

epugh commented Feb 28, 2026

Some outstanding questions: 1) there is a more mock and less mock versions of the same test. Which do we prefer? 2) Does this seem like a reasonable pattern for the conversion?

@epugh
Copy link
Contributor Author

epugh commented Feb 28, 2026

I wish I didnt' have TWO ways of writing tests, one for cloud and one for standalone... sigh.

@epugh
Copy link
Contributor Author

epugh commented Mar 1, 2026

tests all pass!

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 no-changelog tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants