Skip to content

[LMCROSSITXSADEPLOY-3316] Introduce health-check-interval module parameter#1852

Closed
IvanBorislavovDimitrov wants to merge 4 commits into
masterfrom
feature/LMCROSSITXSADEPLOY-3316
Closed

[LMCROSSITXSADEPLOY-3316] Introduce health-check-interval module parameter#1852
IvanBorislavovDimitrov wants to merge 4 commits into
masterfrom
feature/LMCROSSITXSADEPLOY-3316

Conversation

@IvanBorislavovDimitrov

Copy link
Copy Markdown
Contributor

Summary

Adds support for the health-check-interval MTA module parameter, achieving feature parity with Cloud Foundry's liveness health-check interval setting. End users can now author MTAs like:

modules:
  - name: my-app
    type: application
    parameters:
      health-check-interval: 15

The interval is parsed from the descriptor, propagated through the Staging immutable, sent to the controller via the CF Java client, harvested back into CloudProcess for diagnostics, and surfaced in the additional-module-parameters reporter alongside the existing health-check fields.

Jira

  • LMCROSSITXSADEPLOY-3316 — Introduce Health check interval (Backlog Item)

Changes by module

  • multiapps-controller-client
    • Staging gains getHealthCheckInterval().
    • RawCloudProcess harvests the interval; CloudProcess exposes it.
    • CloudControllerRestClientImpl forwards it on app create/update.
    • HealthCheckInfo extended with the new field plus updated hashCode / equality.
  • multiapps-controller-core
    • SupportedParameters.HEALTH_CHECK_INTERVAL constant added.
    • StagingParametersParser reads the parameter into Staging.
    • Cloud-model fixtures (apps-with-health-check-type-*.json, mtad-health-check-type-*.yaml) updated.
  • multiapps-controller-process
    • AdditionalModuleParametersReporter reports the liveness interval.
    • Process-step tests (CreateOrUpdateStepWithExistingAppTest, PollStartAppStatusExecutionTest, PrepareToStopDependentModuleStepTest, RestartAppStepTest) and ReadinessHealthCheckUtilTest extended to cover the new field.

Tests

  • Added multiapps-controller-client/.../HealthCheckInfoTest (11 cases) — round-trips the interval through the immutable, exercises null handling and equality.
  • Modified multiapps-controller-core/.../StagingParametersParserTest (+2 cases) — interval parsing happy-path and absent-value path.
  • Existing coverage re-run green: AdditionalModuleParametersReporterTest (3 cases on the new liveness-reporter path), CloudModelBuilderTest fixtures, ApplicationsCloudControllerClientIntegrationTest.
  • Maven invocation:
    mvn -pl multiapps-controller-client -am test -Dtest=HealthCheckInfoTest && mvn -pl multiapps-controller-core -am test -Dtest=StagingParametersParserTest -Dsurefire.failIfNoSpecifiedTests=false

Notes

  • No delegations back to the impl agent were required during the test stage.
  • Test commit Add unit tests for health-check-interval was assembled by the PR agent from staged test files left on the branch; production code was untouched.
  • Schema / external-release-note / SAP-samples follow-ups listed in the Jira DoD remain out of scope for this PR.

Wires a new optional Integer module parameter `health-check-interval`
through the client/core layer in parallel with the existing
readiness-health-check-interval. Touched layers:

- SupportedParameters: declare HEALTH_CHECK_INTERVAL constant and
  register it in MODULE_PARAMETERS.
- StagingParametersParser: read the descriptor entry and populate
  Staging.healthCheckInterval.
- Staging / CloudProcess: expose @nullable Integer accessors so both
  the desired and existing-app sides of staging-change comparison
  carry the field.
- RawCloudProcess: harvest the value from
  HealthCheck.getData().getInterval().
- CloudControllerRestClientImpl#buildHealthCheck: forward the value
  via Data.builder().interval(...). The cf-java-client setter ignores
  null, so omitting the parameter produces a byte-identical request.
- HealthCheckInfo: add the field to the value object compared by
  StagingApplicationAttributeUpdater so an interval-only change
  triggers a staging update; also adds the missing hashCode override.

JIRA:LMCROSSITXSADEPLOY-3316
Extends AdditionalModuleParametersReporter to surface the liveness
health-check family (type, http endpoint, timeout, invocation timeout,
interval) when any of those parameters is present on a module — in
parallel with the existing readiness reporting. The new
reportUsageOfHealthCheckParameters method mirrors the readiness method
verbatim and is intentionally kept as a sibling rather than refactored
into a generic helper (rule of three has not been met).

Wording is the same MessageFormat shape as the readiness log line,
substituting "readiness health check parameters" with "health check
parameters" so existing Dynatrace observability on the readiness line
is unaffected.

JIRA:LMCROSSITXSADEPLOY-3316
- CloudModelBuilderTest fixtures: add health-check-interval to two
  mtad-health-check-*.yaml inputs and the matching expected JSON
  outputs (port=30, http-with-endpoint=45). The third
  http-without-endpoint case is left without the parameter to keep
  the "omitted -> null" assertion case intact.
- ApplicationsCloudControllerClientIntegrationTest: set
  healthCheckInterval on the staging used in the createApplication
  test, then assert the value round-trips through the controller via
  CloudProcess.getHealthCheckInterval(). New constant
  HEALTH_CHECK_INTERVAL=60 added to IntegrationTestConstants.
- CreateOrUpdateStepWithExistingAppTest: add a parameterized row whose
  only delta between old and new staging is healthCheckInterval, and
  propagate the field through the mocked CloudProcess so equality
  comparison sees both sides; verifies an interval-only change drives
  StagingApplicationAttributeUpdater to update.
- ReadinessHealthCheckUtilTest: new test asserting that setting
  healthCheckInterval alone (without any readiness parameter) does
  NOT flip the readiness gate (FR-7-style guarantee).
- RestartAppStepTest, PollStartAppStatusExecutionTest,
  PrepareToStopDependentModuleStepTest: propagate the new field
  through their existing Staging literals.
- AdditionalModuleParametersReporterTest (new): three focused tests
  asserting that the reporter (a) handles a module declaring only
  health-check-interval, (b) handles the full liveness family, and
  (c) handles a module with no health-check parameters at all,
  without throwing.

JIRA:LMCROSSITXSADEPLOY-3316
JIRA:LMCROSSITXSADEPLOY-3316
@IvanBorislavovDimitrov IvanBorislavovDimitrov deleted the feature/LMCROSSITXSADEPLOY-3316 branch June 1, 2026 15:22
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant