feat(health): add runtime‑agnostic Health SPI and Run /health endpoint#2730
Conversation
|
The previous CI failure was just bizarre. I reran the build manually and it passed successfully here |
There was a problem hiding this comment.
Pull request overview
Adds a runtime-agnostic health-check SPI in the engine and wires it into Spring Boot (Actuator + webapps), Operaton Run (/health), and the Quarkus extension so health reporting is consistent across deployment models.
Changes:
- Introduce
HealthService/HealthResult(+ optionalFrontendHealthContributor) and a default engine implementation (DefaultHealthService) with tests. - Spring Boot starter: auto-configure a
HealthService, contribute frontend/webapps health details, and adapt the existingProcessEngineHealthIndicatorto delegate to the SPI. - Quarkus + Run: add readiness health check integration (Quarkus) and a new
/healthREST controller + test (Run), plus dependency updates.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| spring-boot-starter/starter/src/test/java/org/operaton/bpm/spring/boot/starter/actuator/ProcessEngineHealthIndicatorTest.java | Updates tests for the new HealthService-backed indicator behavior. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/actuator/ProcessEngineHealthIndicator.java | Makes the Spring Boot health indicator delegate status/details to HealthService. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/OperatonBpmHealthServiceConfiguration.java | Adds Spring Boot auto-config to provide a default HealthService bean. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/OperatonBpmAutoConfiguration.java | Imports the new health service configuration into starter auto-config. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/OperatonBpmActuatorConfiguration.java | Wires HealthService into Actuator health indicator registration. |
| spring-boot-starter/starter-webapp-core/src/main/java/org/operaton/bpm/spring/boot/starter/webapp/SpringWebappFrontendHealthContributor.java | Adds webapp resource presence reporting for health details. |
| spring-boot-starter/starter-webapp-core/src/main/java/org/operaton/bpm/spring/boot/starter/webapp/OperatonBpmWebappAutoConfiguration.java | Registers the frontend health contributor when webapps are enabled. |
| quarkus-extension/engine/runtime/src/main/java/org/operaton/bpm/quarkus/engine/extension/OperatonHealthCheck.java | Adds a MicroProfile readiness health check that delegates to HealthService. |
| quarkus-extension/engine/runtime/src/main/java/org/operaton/bpm/quarkus/engine/extension/HealthServiceProducer.java | Produces a CDI HealthService backed by DefaultHealthService. |
| quarkus-extension/engine/runtime/pom.xml | Adds SmallRye Health dependency for Quarkus runtime integration. |
| quarkus-extension/engine/deployment/src/test/java/org/operaton/bpm/quarkus/engine/test/health/OperatonHealthCheckTest.java | Adds Quarkus unit tests for health service exposure and details. |
| quarkus-extension/engine/deployment/pom.xml | Adds SmallRye Health dependency for Quarkus deployment/testing. |
| engine/src/test/java/org/operaton/bpm/engine/impl/health/DefaultHealthServiceTest.java | Adds unit tests for default health evaluation (DB/job executor/frontend). |
| engine/src/main/java/org/operaton/bpm/engine/impl/health/DefaultHealthService.java | Implements the default runtime-agnostic health check. |
| engine/src/main/java/org/operaton/bpm/engine/health/HealthService.java | Introduces the public health SPI interface. |
| engine/src/main/java/org/operaton/bpm/engine/health/HealthResult.java | Introduces the health value object returned by the SPI. |
| engine/src/main/java/org/operaton/bpm/engine/health/FrontendHealthContributor.java | Adds SPI for optional frontend/webapps health contributions. |
| distro/run/core/src/test/java/org/operaton/bpm/run/test/health/HealthEndpointTest.java | Adds a Run integration test for /health JSON response. |
| distro/run/core/src/main/java/org/operaton/bpm/run/health/HealthController.java | Adds Operaton Run /health REST endpoint backed by HealthService. |
| distro/run/core/pom.xml | Adjusts Run core web dependency to ensure the /health endpoint can be served. |
|
@Fejbien I did some polishing and had a rough look. I will continue soon with the review. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Introduces a runtime-agnostic health SPI (HealthService/HealthResult) and wires it into Spring Boot Actuator, Quarkus MicroProfile Health, and Operaton Run’s /health REST endpoint to provide consistent health reporting across runtimes.
Changes:
- Added
HealthServiceSPI,HealthResultvalue type, and a default implementation (DefaultHealthService) in the engine. - Updated Spring Boot actuator integration to use
HealthServiceand added a webapps frontend health contributor. - Added Quarkus readiness health check + producer and introduced Operaton Run
/healthcontroller with tests.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| spring-boot-starter/starter/src/test/java/org/operaton/bpm/spring/boot/starter/actuator/ProcessEngineHealthIndicatorTest.java | Updates tests to cover HealthService-driven actuator status mapping. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/actuator/ProcessEngineHealthIndicator.java | Uses HealthService result to set actuator status/details. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/OperatonBpmHealthServiceConfiguration.java | Registers DefaultHealthService as a Spring bean when missing. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/OperatonBpmAutoConfiguration.java | Imports health service configuration into starter auto-config. |
| spring-boot-starter/starter/src/main/java/org/operaton/bpm/spring/boot/starter/OperatonBpmActuatorConfiguration.java | Wires HealthService into ProcessEngineHealthIndicator bean setup. |
| spring-boot-starter/starter-webapp-core/src/test/java/org/operaton/bpm/spring/boot/starter/webapp/SpringWebappFrontendHealthContributorTest.java | Adds tests for frontend/webapps health contributor behavior. |
| spring-boot-starter/starter-webapp-core/src/main/java/org/operaton/bpm/spring/boot/starter/webapp/SpringWebappFrontendHealthContributor.java | Implements frontend health contributor by checking webjar resources. |
| spring-boot-starter/starter-webapp-core/src/main/java/org/operaton/bpm/spring/boot/starter/webapp/OperatonBpmWebappAutoConfiguration.java | Exposes frontend health contributor bean when webapp is enabled. |
| quarkus-extension/engine/runtime/src/main/java/org/operaton/bpm/quarkus/engine/extension/OperatonHealthCheck.java | Adds MicroProfile readiness health check backed by HealthService. |
| quarkus-extension/engine/runtime/src/main/java/org/operaton/bpm/quarkus/engine/extension/HealthServiceProducer.java | Produces a CDI HealthService (default engine health service). |
| quarkus-extension/engine/runtime/pom.xml | Adds SmallRye Health dependency for runtime health check. |
| quarkus-extension/engine/deployment/src/test/java/org/operaton/bpm/quarkus/engine/test/health/OperatonHealthCheckTest.java | Adds Quarkus tests verifying health service availability and details. |
| quarkus-extension/engine/deployment/pom.xml | Adds SmallRye Health dependency for deployment/test module. |
| engine/src/test/java/org/operaton/bpm/engine/impl/health/DefaultHealthServiceTest.java | Adds unit tests for the new default health service. |
| engine/src/main/java/org/operaton/bpm/engine/impl/health/DefaultHealthService.java | Implements runtime-agnostic health logic (DB, JobExecutor, frontend). |
| engine/src/main/java/org/operaton/bpm/engine/health/HealthService.java | Introduces the health SPI interface. |
| engine/src/main/java/org/operaton/bpm/engine/health/HealthResult.java | Adds the health result record used across runtimes. |
| engine/src/main/java/org/operaton/bpm/engine/health/FrontendHealthContributor.java | Adds SPI for contributing frontend/webapps health details. |
| distro/run/core/src/test/java/org/operaton/bpm/run/test/health/HealthEndpointTest.java | Adds integration test for Operaton Run /health endpoint. |
| distro/run/core/src/test/java/org/operaton/bpm/run/test/health/HealthControllerTest.java | Adds MVC tests for HTTP status mapping and JSON body of /health. |
| distro/run/core/src/main/java/org/operaton/bpm/run/health/HealthController.java | Implements Operaton Run /health REST endpoint backed by HealthService. |
| distro/run/core/pom.xml | Switches to spring-boot-starter-web and adds MVC test starter for /health. |
|
@Fejbien I have polished the changes. Looks fine for me know. |
- C1: HealthController returns HTTP 503 when status is not UP - C2: document that job executor state is informational only; status is determined solely by database connectivity (Operaton is UP even if the job executor is not running) - C3: expand HealthService Javadoc to explain DI-over-ServiceLoader design decision for SPI extensibility - I1: ProcessEngineHealthIndicator handles UNKNOWN and custom statuses without mapping them to DOWN - I3: Quarkus HealthServiceProducer now injects ProcessEngine and extracts JobExecutor from its configuration instead of passing null - I4: add HealthControllerTest with @WebMvcTest covering 200/503 cases; add spring-boot-starter-webmvc-test to distro/run/core test scope - I5: document why @ConditionalOnBean replaces @dependsOn in OperatonBpmActuatorConfiguration - M1: validate status is non-null in HealthResult compact constructor - M2: fix DefaultHealthServiceTest to stub jobExecutor.isActive() and add test verifying UP status when job executor is inactive - M3: add SpringWebappFrontendHealthContributorTest - M4: improve pom.xml comment on spring-boot-starter-web dependency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
related #1245 replaces #1582