Plumb liveness health-check-interval module parameter#1849
Plumb liveness health-check-interval module parameter#1849IvanBorislavovDimitrov wants to merge 2 commits into
Conversation
Adds a new MTA module-level parameter `health-check-interval` (Integer, seconds) that is parsed from the descriptor, propagated through the Staging immutable, sent on the outbound CF Data builder in buildHealthCheck, read back via RawCloudProcess into CloudProcess, included in HealthCheckInfo equality so the staging attribute updater detects re-stage conditions, and logged by AdditionalModuleParametersReporter. Mirrors the existing readiness-health-check-interval pipeline in every layer. JIRA:LMCROSSITXSADEPLOY-3316
Covers HealthCheckInfo equality semantics for the new healthCheckInterval field, StagingParametersParser parsing of the health-check-interval key, and AdditionalModuleParametersReporter behaviour for the new branch. JIRA:LMCROSSITXSADEPLOY-3316
MTA Quality Report — PR #1849Jira: LMCROSSITXSADEPLOY-3316 — Introduce Health check interval
Code ReviewNo code-review findings (confidence ≥ 80). The diff is a faithful additive mirror of the existing Minor stylistic note (not flagged): SecurityNo issues found. The change adds an SonarCloudSonarCloud check run ("Build and analyze") was still in_progress at the time of this scan — no quality-gate verdict or annotations are available yet. Re-run the quality agent once analysis finishes.
Dependency CVEsNo new CVEs — this PR does not modify any dependency files ( Verdict: READY TO MERGE pending SonarCloud quality gate. Posted by adi-dev-workflow / mta-quality-agent. |
|



Description:
Introduces a new MTA module-level parameter
health-check-interval(Integer, seconds) and plumbs it end-to-end through the deploy service so it reaches the liveness health check on Cloud Foundry. This brings parity with Cloud Foundry's nativehealth-check-intervalsetting and with the already-supported readiness counterpart (readiness-health-check-interval). Until now the value was silently ignored when present in an MTA descriptor.The implementation mirrors the existing
readiness-health-check-intervalpipeline at every layer:SupportedParameters— adds theHEALTH_CHECK_INTERVAL = "health-check-interval"constant and includes it inMODULE_PARAMETERSso the descriptor parser recognises it as a valid module parameter (no "unsupported parameter" warning).StagingParametersParser— reads the value viaPropertiesUtil.getPropertyValue(...), casts toInteger, and sets it on theImmutableStagingbuilder. Default (parameter omitted) isnull⇒ no value is sent to CF and CF's default applies.Staging— gains a@Nullable Integer getHealthCheckInterval()accessor in the liveness block, alongsidegetHealthCheckTimeout()etc.CloudControllerRestClientImpl.buildHealthCheck— the outbound livenessData.builder()chain now also calls.interval(staging.getHealthCheckInterval()), mirroring the readiness chain.CloudProcess— gains the matchinggetHealthCheckInterval()accessor.RawCloudProcess.derive— readsintervalfrom the inbound CF livenessDataand propagates it viaImmutableCloudProcess.builder().HealthCheckInfo— gains anintervalfield withgetInterval()accessor, included inequals(...).StagingApplicationAttributeUpdater's liveness comparison already delegates toHealthCheckInfo.equals, so re-stage detection on a changed interval works automatically — no source change is required in the updater.AdditionalModuleParametersReporter— adds a symmetric liveness log helperreportUsageOfHealthCheckParameterswith the same field order and Dynatrace-observed comment as the readiness helper, so log analysis tools can match both branches identically.The CF Java client
5.16.0.RELEASEsharedorg.cloudfoundry.client.v3.processes.Dataalready exposesgetInterval()andBuilder.interval(Integer)— no client upgrade was required.Backward compatibility
The change is purely additive. Descriptors that do not declare
health-check-intervalcontinue to deploy unchanged: the parser sets the field tonull, the outbound builder receivesnull, and CF's default health-check interval applies. Wire and descriptor formats are unchanged.Tests
17 new/updated JUnit 5 cases across three modules, all passing locally:
multiapps-controller-client— newHealthCheckInfoTest(10 cases) coversfromStaging/fromProcesspopulating the newintervalfield, type defaulting, null propagation, and the updatedequalscontract.multiapps-controller-core—StagingParametersParserTestextended (2 cases) to assert parsing + null default forhealth-check-interval.multiapps-controller-process— newAdditionalModuleParametersReporterTest(5 cases) verifies the new liveness branch is entered, tolerates a null interval, is skipped whenhealth-check-typeis missing, coexists with the readiness branch, and tolerates an empty parameter map.Verification:
→ BUILD SUCCESS, 17 tests run, 0 failures.
Issue:
JIRA: LMCROSSITXSADEPLOY-3316