From 18ea857841861938ba2bde9bc0e3b0c0024f7103 Mon Sep 17 00:00:00 2001 From: James Maes Date: Mon, 19 Oct 2026 15:22:33 -0500 Subject: [PATCH] fix: forward Java deployment migration and smoke settings Co-Authored-By: Codex Signed-off-by: James Maes --- docs/SESSION-STATE.md | 13 +++++ docs/TODO.md | 2 + src/scripts/packed_generate_config.sh | 2 + .../partials/java-webapp-deploy.yml.tpl | 2 + tests/test_java_deploy_health.sh | 54 +++++++++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 tests/test_java_deploy_health.sh diff --git a/docs/SESSION-STATE.md b/docs/SESSION-STATE.md index ff3b7f9..addeafa 100644 --- a/docs/SESSION-STATE.md +++ b/docs/SESSION-STATE.md @@ -1,3 +1,16 @@ +## Java deployment health parameter correction (2026-10-19) + +Backend develop job 6405 exposed missing migration/smoke configuration in the +shared Java deployment partial: startup failed because slack_template was absent. +The partial now forwards health_migrations and health_smoke_paths just like the +production and release workflows. No application or scan policy changes. + +tests/test_java_deploy_health.sh checks configured values and empty defaults in +develop, staging, production and release-candidate using both source and packed +generators. Full make all, 20 BATS tests, focused regression rerun and shell lint +passed through WSL. Packed scripts are synchronized. Publication and consumer +verification are pending. + ## Verified agile CI rollout (2026-10-19) Munitor 0.3.10 is published from main 19192d07 (PR48 implementation, PR49 release, diff --git a/docs/TODO.md b/docs/TODO.md index 86caf6d..7cf7d88 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -2,6 +2,8 @@ ## Pending +- [ ] Validate and release Java develop/staging health_migrations and health_smoke_paths propagation; verify both generators and a corrected consumer build before claiming rollout success. + - [x] Publish 0.3.10, adopt in backend PR333, verify aggregate check names and migrate required lists; docs PR335 passed in 5m23 and native cancellation was observed (docs/PLAN-agile-ci.md). - [x] Publish fast Java CI as 0.3.9; backend PR330 adopted it and measured the warm workflow at 20m45 (from 37m04). diff --git a/src/scripts/packed_generate_config.sh b/src/scripts/packed_generate_config.sh index 7b77e7f..b05daca 100755 --- a/src/scripts/packed_generate_config.sh +++ b/src/scripts/packed_generate_config.sh @@ -2694,6 +2694,8 @@ cat > /tmp/munitor/templates/partials/java-webapp-deploy.yml.tpl << 'MUNITOR_PAR health_path: ${MUNITOR_HEALTH_PATH} health_port: "${MUNITOR_HEALTH_PORT}" health_db: "${MUNITOR_HEALTH_DB}" + health_migrations: "${MUNITOR_HEALTH_MIGRATIONS}" + health_smoke_paths: "${MUNITOR_HEALTH_SMOKE_PATHS}" ##IF_SUPPLEMENTAL## supplemental_images: '${MUNITOR_SUPPLEMENTAL_IMAGES_JSON}' ##ENDIF_SUPPLEMENTAL## diff --git a/src/scripts/templates/partials/java-webapp-deploy.yml.tpl b/src/scripts/templates/partials/java-webapp-deploy.yml.tpl index 606d425..afe2eed 100644 --- a/src/scripts/templates/partials/java-webapp-deploy.yml.tpl +++ b/src/scripts/templates/partials/java-webapp-deploy.yml.tpl @@ -66,6 +66,8 @@ health_path: ${MUNITOR_HEALTH_PATH} health_port: "${MUNITOR_HEALTH_PORT}" health_db: "${MUNITOR_HEALTH_DB}" + health_migrations: "${MUNITOR_HEALTH_MIGRATIONS}" + health_smoke_paths: "${MUNITOR_HEALTH_SMOKE_PATHS}" ##IF_SUPPLEMENTAL## supplemental_images: '${MUNITOR_SUPPLEMENTAL_IMAGES_JSON}' ##ENDIF_SUPPLEMENTAL## diff --git a/tests/test_java_deploy_health.sh b/tests/test_java_deploy_health.sh new file mode 100644 index 0000000..14af37b --- /dev/null +++ b/tests/test_java_deploy_health.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Verify deployment health configuration reaches source and shipped generators. +set -euo pipefail +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +WORK=$(mktemp -d) +trap 'rm -rf -- "$WORK"' EXIT +export CIRCLE_BRANCH=develop CIRCLE_TAG="" +cp "${SCRIPT_DIR}/fixtures/java-webapp.munitor.yml" "${WORK}/defaults.yml" +cp "${WORK}/defaults.yml" "${WORK}/configured.yml" +cat >>"${WORK}/configured.yml" <<'YAML' +health: + path: /health/ready + port: 8181 + db: "true" + migrations: migrations + smoke_paths: + - /api/templates + - /api/version +YAML + +# Packed helpers share /tmp/munitor; run these generators sequentially. +for generator in generate_config.sh packed_generate_config.sh; do + for mode in configured defaults; do + MUNITOR_CONFIG="${WORK}/${mode}.yml" MUNITOR_OUTPUT_FILE="${WORK}/generated.yml" \ + bash "${SCRIPT_DIR}/../src/scripts/${generator}" >"${WORK}/generator.log" 2>&1 || { + cat "${WORK}/generator.log" + exit 1 + } + yq -o=json '.' "${WORK}/generated.yml" >"${WORK}/generated.json" + python3 - "${WORK}/generated.json" "$mode" <<'PY' +import json +import sys + +with open(sys.argv[1], encoding='utf-8') as source: + workflows = json.load(source)['workflows'] +expected = {'health_migrations': '', 'health_smoke_paths': ''} +if sys.argv[2] == 'configured': + expected = { + 'health_path': '/health/ready', + 'health_port': '8181', + 'health_db': 'true', + 'health_migrations': 'migrations', + 'health_smoke_paths': '/api/templates,/api/version', + } +for workflow in ('develop', 'staging', 'production', 'release-candidate'): + jobs = [job['munitor/docker_build_push'] for job in workflows[workflow]['jobs'] + if isinstance(job, dict) and 'munitor/docker_build_push' in job] + assert len(jobs) == 1, (workflow, 'expected one Docker build job', jobs) + for parameter, value in expected.items(): + assert jobs[0].get(parameter) == value, (workflow, parameter, jobs[0].get(parameter), value) +PY + printf 'PASS: %s %s deployment health parameters\n' "$generator" "$mode" + done +done -- 2.54.0