Skip to content

Implementation plan / Session plan / Handover RC-3-S12

Handover RC-3-S12 Build: Platform: delivery pipeline (FR-ISE-REL-003)

Card: RC-3-S12. Issue: cema-care/his#68. Branch: session/RC-3-S12. Slice: RC-3. Decision record: ADR-HIS-103.

What was built and where

Everything is in platform/delivery-pipeline/, except the decision record, its row in the decision record index, and this handover. The unit's README.md has every state, rule, setting, metric and policy action, in its new sections "Change records" and "The upgrade test".

Scope as read. The card covers FR-ISE-REL-003 (upgrade, compatibility, rollback and change communication) and TEST-ISE-025. It extends what RC-1-S19 built and does not rebuild it. It meets the contract point of RC-3-S12 in contracts/ise/README.md ("Contract points of slice RC-3"), except one part ("Differences" below).

What was built:

  • The change records of releases.v1 1.1, in the releases service (module mod-ise-005, new package change), with migration V2__change_records.sql. The service now serves every operation of releases.v1:
  • createChangeRecord, listChangeRecords, readChangeRecord;
  • decideChangeRecord: approve, approve-emergency, close;
  • transitionChangeRecord: schedule, record-implemented, record-failed-recovered;
  • recordRetrospectiveReview, readChangeFailureRate;
  • authorizeRecovery (in release/ReleaseService).
  • The lifecycle of part 11: Draft, Approved, Scheduled, Implemented, Failed (recovered), Closed. Each step has its preconditions (README table), its history entry with actor and time, its audit event and its metric.
  • The gate reads the change record (release/Gate.of(doc, change), change/ChangeRecords.gate):
  • recovery-plan-missing (PR-REL-003-1, PR-REL-003-2);
  • mixed-version-incompatibility (parts 2 and 3, section 10). It is raised for compatibility evidence the release's manifest asks for and that is missing, for a failed compatibility test, and for a rolling migration or event schema change that was not mixed-version tested.
  • Both block production, not pre-production.
  • Production follows the change record. Approving production needs it Approved or Scheduled. Deploying to production needs it Scheduled (its release notice sent) and, for an outage, the maintenance window (part 4).
  • Recovery of the recorded plan (part 6). authorizeRecovery is a person's authorization, and only of the change record's plan kind. The pipeline's recordRecovery now needs that authorization, and uses it once. A failed production health check is recorded on the release and its change record, and then the change cannot be recorded as Implemented.
  • Release notices (part 5) through D10 notification.v1 (ise.release-notice), one per stakeholder.
  • The notice before the change is sent when the change is scheduled. If it cannot be sent, the change is not scheduled (503).
  • Completion notices are kept in outbound_request and sent after the transaction, then again every minute until D10 takes them (change/Outbound).
  • The emergency path (part 7, BR-ISE-021, PR-REL-003-3).
  • approve-emergency sends the ise.retrospective-review task (queue ise.release-management) through workflow.v1, the same way as the completion notices.
  • The review is due 7 days after creation (configurable).
  • Closing an emergency change needs its review.
  • The verified pre-change backup of an irreversible migration (PR-REL-003-2). It is read from recovery.v1 readBackupSet on approval, and must be succeeded and Verified (or copied to the immutable store). If recovery.v1 cannot be reached, the approval fails closed (503).
  • The change failure rate (part 8): the changes that ended in the period, and how many failed.
  • The maintenance window of CFG-ISE-022 (ChangeSettings.Window): Sunday 01:00 to 05:00 local time, at most 4 hours, announced 7 days ahead (24 hours for an emergency), unless an approved exception is given.
  • Outbound clients (ports/Downstreams, ports/HttpDownstreams). They use this unit's client-credentials token, and pass the correlation identifier and purpose of use. A URL or secret that is not configured, an outage, or an answer outside the contract is "unavailable", never a grant.
  • The upgrade test bin/upgrade-test (lib/upgrade.py, Python standard library). It produces the change record's compatibility evidence for parts 2 and 3, AC-01 and TEST-ISE-025:
  • It reads every migration the change adds. A merged migration that is edited or removed fails. A drop, rename, type change or new NOT NULL column is incompatible with a rolling release. A drop, truncate, delete, update or type conversion is irreversible.
  • It runs the previous version's own tests on a database the new version migrated. For this, the unit's HisTestDatabase (kit test fixtures) gained HIS_TEST_DATABASE_KEEP and HIS_TEST_DATABASE_TEMPLATE.
  • It runs his-contract check of the contract folders given, against the previous version.
  • The upgrade test found a real problem in this card's own first migration. A foreign key from change_record to the V1 release table broke 19 of the previous version's 56 tests, because they truncate release. V2 now has no foreign key on a V1 table (ADR-HIS-103 point 2), and the previous version passes all 56.
  • The unit-own pipeline API (api/release-pipeline.v1.openapi.yaml) states the new preconditions of recordDeployment, recordRecovery and attachChangeRecord. attachChangeRecord now needs a recorded change record.
  • Checks:
  • bin/self-test also runs test_upgrade;
  • scripts/ends-when-rc-3.sh is this card's "Ends when";
  • scripts/ends-when.sh stays RC-1-S19's.

No dependency was added: the Java unit uses the template's dependencies, and the Python tools use the standard library only. No contract file changed.

Checks and their result

The integration environment ran as HIS_SESSION=RC-3-S12 (his-rc-3-s12), light profile.

Check Command Result
Unit build and every test ./gradlew build in platform/delivery-pipeline Passed (step 1 of ends-when-rc-3.sh). Module tests: ChangeRecordTest 17 (new), PromotionTest 9, DeploymentTest 5, GateTest 6, module 1; the kit and app tests also pass
Provider contract test contract/ReleasesContractTest, part of the build his-contract verify contracts/ise of all 12 operations of releases.v1 1.1 (the 4 of RC-1-S19 and the 8 of FR-ISE-REL-003): no case failed. validate-event of ReleaseDeployed on a deployment and an authorized rollback: passed (2)
Consumer contract test contract/DownstreamConsumerContractTest, part of the build notification.v1 requestNotification (before and completion notices, team, role and user recipients), workflow.v1 createTask, recovery.v1 readBackupSet, against his-contract serve of contracts/ess and contracts/ise: no violation recorded; an unreachable or unconfigured service is unavailable (4 tests)
Pipeline self-test bin/self-test 73 tests; 70 passed, 1 skipped as before, and 2 failed: test_pipeline.ContractCheckTest's two cases. They fail because this host's Node.js 22.22.1 cannot run the contract tool's cli.ts (ERR_UNKNOWN_FILE_EXTENSION), as RC-3-S03 noted. Neither bin/contract-check nor its test is changed here, and the workflow job has its own Node.js. test_upgrade (12, new) passed
Upgrade test, TEST-ISE-025 ends-when-rc-3.sh step 3 (bin/upgrade-test platform/delivery-pipeline --base origin/main --contracts contracts/ise) Passed. See "Final check results"
Static analysis bin/static-analysis platform/delivery-pipeline No blocking finding. The first run flagged xml.etree in lib/upgrade.py, which was replaced; no clinical artifact in the change
Dependency scan, register gate bin/dependency-scan platform/delivery-pipeline 0 blocking (4 medium, as before); gate --coverage passed over 527 components
Secret scan bin/secret-scan code origin/main HEAD, bin/secret-scan docs origin/main HEAD No secret found
Links, documentation site check_links.py; mkdocs build 0 broken, 0 duplicate anchors; builds with no new warning (the four warnings are earlier records' links to code folders)

Requirements and test scenarios

Every test names its requirement, and its test scenario where one exists: JUnit @Tag and display name, or the Python test name and docstring. Java tests are in platform/delivery-pipeline/mod-ise-005/src/test/java/care/cema/his/ise/mod005/, Python tests in platform/delivery-pipeline/test/.

Requirement, criterion or scenario Covered by
FR-ISE-REL-003 AC-01: an upgrade with a database migration and an event schema change works in mixed-version operation ChangeRecordTest.mixed_version_compatibility (missing, failed or untested evidence blocks approval and production); test_upgrade.StatementTest, MigrationsTest; ends-when-rc-3.sh step 3a: this card's migration with the previous version's 56 tests, and contracts/ise compatible. Step 3b: a column drop and a new required event field each fail
FR-ISE-REL-003 AC-02: a production change record holds approvals, impact, test and recovery plan ChangeRecordTest.change_record_is_complete, approval_needs_the_whole_record; the complete record at the end of failed_deployment_is_recovered
FR-ISE-REL-003 AC-03: after a failed deployment, the recovery plan returns the service to the prior or corrected behaviour ChangeRecordTest.failed_deployment_is_recovered (rollback, prior behaviour); DeploymentTest.release_deployed_events (rollback and forward-fix, authorized, with ReleaseDeployed)
FR-ISE-REL-003 AC-04: an emergency clinical fix has an expedited approval record and a retrospective review ChangeRecordTest.emergency_fix; DownstreamConsumerContractTest.review_task
Behaviour 1, preconditions change_record_is_complete, approval_needs_the_whole_record
Behaviours 2 and 3 bin/upgrade-test (test_upgrade; ends-when-rc-3.sh step 3); mixed_version_compatibility
Behaviour 4, CFG-ISE-022 ChangeRecordTest.maintenance_window, outage_deployed_only_in_window
Behaviour 5, INT-ISE-017 ChangeRecordTest.notice_before_the_change, completion_notice; DownstreamConsumerContractTest.release_notices
Behaviour 6 failed_deployment_is_recovered
Behaviour 7 emergency_fix
Behaviour 8, outputs ChangeRecordTest.change_failure_rate, listing
PR-REL-003-1 ChangeRecordTest.recovery_plan_missing_blocks_promotion; GateTest.production_only_items
PR-REL-003-2 ChangeRecordTest.irreversible_migration; test_upgrade.StatementTest...lose_data_are_irreversible; DownstreamConsumerContractTest.backup_set
PR-REL-003-3 emergency_fix (the task, sent again while the task service was down)
Section 10: a health check fails after deployment; a mixed-version incompatibility in pre-production failed_deployment_is_recovered; mixed_version_compatibility
Sections 11 to 13: states, audit, security ChangeRecordTest.who_decides_and_lifecycle (a person approves; Deny is 403; the outage of the decision point is 503; transitions out of order are 400; 401 without a token); audit assertions in each test above
TEST-ISE-025: upgrade with a database migration and an event schema change in mixed-version operation; fail a deployment health check. Expected: mixed-version works, the recovery plan restores service, the change record is complete Mixed-version: ends-when-rc-3.sh step 3 with bin/upgrade-test, and mixed_version_compatibility. Failed health check, recovery and complete record: failed_deployment_is_recovered
releases.v1 1.1, every operation (provider) contract/ReleasesContractTest: his-contract verify of all 12 operations, and validate-event of ReleaseDeployed
notification.v1, workflow.v1, recovery.v1 (consumer) contract/DownstreamConsumerContractTest, against his-contract serve of contracts/ess and contracts/ise, with no violation

Non-functional targets: - NFR-ISE-005, security: - every decision goes through the D10 decision point, which fails closed; - approvals, closure, recovery authorization and the review are by a person only; - an outage of recovery.v1 or the notification service refuses, never grants; - service credentials come from the secret store, never from the repository. - NFR-ISE-009, interoperability: provider and consumer contract tests. - NFR-ISE-012, observability: the metrics in the README; his_change_outbound_pending shows what D10 has not yet taken; his_release_health_checks_failed_total. - NFR-ISE-016, time integrity: UTC instants with Z everywhere. The maintenance window is checked in its configured zone. - NFR-ISE-018, localization: the unit has no screen. The notice content is parameters for D10's template, which localizes them.

The card has no "Safety" row. The change makes the control of RC-1-S19's safety-critical function (release and configuration deployment) stricter and replaces none of it, so it needs no hazard log entry.

Differences from the card or specification

  • Contracts are not submitted to the contract catalogue (contract point: "Submit each changed contract to contract-catalogue.v1 submitContractVersion when it reaches main").
  • VersionSubmission needs owner, purpose, dataClassification and supportContact. No contract folder carries these, and contract.yaml's schema (FN-S04) admits no such block.
  • Inventing them would put data into the catalogue that traces to nothing (rule 3). RC-3-S13's own contract point serves the catalogue from the contract folders.
  • Follow-up below. ADR-HIS-103 point 11.
  • "Incident raised" (section 10, WF-ISE-002) has no API in any contract.
  • A failed production health check is recorded and blocks Implemented. It is published in ReleaseDeployed with healthCheck: failed, and counted in his_release_health_checks_failed_total.
  • Raising the incident from these is an alert rule of the observability unit (follow-up).
  • Retrospective review due date. BR-ISE-021 names no period. The unit uses 7 days, the contract's own example, configurable (question 2).
  • The zone of the maintenance window. CFG-ISE-022 is per facility and in local time, but releases are enterprise-scoped. The zone is a deployment setting, by default Asia/Jakarta. "Once a month" is not enforced on a single change (ADR-HIS-103 point 10).
  • Event schema evidence. A release manifest has no event schema type. Event schema compatibility comes from the release's contract-tests evidence, and from bin/upgrade-test --contracts. A change record's event-schema entry is checked when given, but not required.
  • Stakeholders as notification recipients. role:<role> and user:<account> name those recipient kinds of notification.v1. Any other stakeholder is a team.
  • recordRecovery now needs an authorization (unit-own API). Before, it recorded any rollback or forward-fix of a Deployed release. This follows section 3 (the Release Manager authorizes).
  • Production deployment needs the change record Scheduled. This is how the system guarantees that the notice went out "before the change" (part 5).
  • Test fixture of the kit. The unit's HisTestDatabase gained the keep and template modes the upgrade test needs. The service template's copy does not have them (follow-up).

Review round 1

The review asked for the audit events of the change records and the recovery authorization to carry what D10-ESS 9.5 makes mandatory for Administration and configuration: the item's reference and version, its values before and after, and the approver. Fixed:

  • The unit's kit (service-kit/.../audit/AuditRecord.java, AuditEmitter.java) gained resourceVersion, sent as resourceRef.version, as RC-1-S28-F15 (#254) did in the event backbone's kit.
  • Every event of ChangeService (create, decide, transition, retrospective review) and of ReleaseService.authorizeRecovery now carries, through the new support/AuditChanges:
  • the record's revision as its version;
  • changedFields, before and after in the before_after form of F15 (the status, and the schedule, implementation, failure, approvals, notices, review or recovery authorization that changed);
  • approver on every decision.
  • A new record has no before.
  • Tests. ChangeRecordTest.audit_events_carry_version_and_values asserts them for create, approve, schedule and record-implemented. failed_deployment_is_recovered and emergency_fix assert them for the recovery authorization, the recovered failure, the emergency approval and the retrospective review. ChangeRecordTest now has 15 tests.

The audit events of RC-1-S19's release operations (promotion, sign-off, deployment) are not changed: they are outside this card. Their item version is a follow-up.

Review round 2

The pipeline's job platform/delivery-pipeline failed on the self-hosted runner in the kit's HttpPolicyDecisionClientTest. That is the test that failed once locally under load ("Final check results"). - Cause. Its client has a 300 ms timeout. The first calls of a cold JVM on a loaded runner take longer, so a Permit or a Deny was read as an outage. The test, not the kit, was wrong. - Fix. In this unit's kit, the test's client now waits 2 seconds. Its timeout case replies after 5 seconds, so failing closed on a timeout is still tested. - Other units. Every unit's copy of the kit has the same test. The service template and the other units are a follow-up.

Merge with main, round 2

  • Merge. Main added ADR-HIS-104. ADR-HIS-103 is still free, so it kept its number, and the index has 103 records.
  • A flaky kit test in the previous version. After the merge, step 3a failed once. One test of the previous version failed: HttpPolicyDecisionClientTest, the same kit test with main's 300 ms timeout (review round 2). It checks the kit library and depends on timing alone.
  • Fix. bin/upgrade-test now runs the previous version's unit tests (modules and app) on the new schema and leaves out the kit's own tests: --previous-tests, by default test -x :service-kit:test. The module and app tests still use the kit's outbox, audit and inbox on that schema.

Review round 3

The review found that a change record attached through the pipeline's attachChangeRecord was never bound to its release. Fixed:

  • Bound to its release (PipelineService.attachChangeRecord, ChangeStore.bindRelease).
  • Attaching a change record now sets its releaseRef in the same transaction, and records attached-to-release in its history.
  • Without the binding, the Implemented and Failed (recovered) checks never read the release. A change whose production health check had failed could then be recorded Implemented, against behaviour 6, AC-03 and the change failure rate.
  • Attaching the same record again changes nothing.
  • One open change record per release, and one release per change record. Attaching is refused for:
  • a change record that is not open (Implemented, Failed (recovered) or Closed);
  • a change record bound to another release;
  • a release that already has another open change record, which is never replaced.
  • So one Scheduled notice never covers two production deployments. This is the same rule as createChangeRecord.
  • Tests:
  • ChangeRecordTest.attached_change_record_is_bound_to_its_release: attach, approve, schedule, a failed production health check. record-implemented is then refused, and the recovered failure waits for the rollback.
  • ChangeRecordTest.attach_refusals: each refusal above, and a successful attach.
  • The upgrade test's scratch database (lib/upgrade.py).
  • It is dropped only in the PostgreSQL of this session's compose project, his-<session> for HIS_SESSION. An empty or foreign project is refused before anything is created.
  • It drops only a name of the scratch form u_<unit>_<hex>.
  • test_upgrade.SessionTest covers both.

Review round 4

The pipeline's build of the unit failed one test: ReleasesContractTest, "EVT-ISE-007 ReleaseDeployed as published passes his-contract validate-event", with 401 unauthenticated.

  • Cause. The release pipeline's service token was a static field, signed once when the class loaded. A kit test token lasts 300 seconds. On the CI runner the module's tests ran for about 20 minutes, and the contract test's twelve verify runs come before this test. So the token had expired by the time it was sent. Locally the run was fast enough to stay inside the 300 seconds.
  • Fix. The token is now signed on each request: ReleaseTestBase.pipeline() and ReleasesContractTest.pipelineToken(). No other test in the unit keeps a token in a field.

Questions for a person

None blocks this session. They are under "Needs a person" in the pull request:

  1. ADR-HIS-103, for the Enterprise Architecture Board.
  2. Owner of D02-ISE: within what period after an emergency change must its retrospective review be done (BR-ISE-021, DE-ISE-014 retrospective_review_due)? The unit uses 7 days, his.ise.release.retrospective-review-days.
  3. Owner of D02-ISE (CFG-ISE-022): releases are enterprise-scoped, but the maintenance window is "local time" per facility. Is one zone per deployment right (default Asia/Jakarta), or must a change affecting several facilities meet each facility's window?

Follow-ups outside the card

  • Contract catalogue submission (RC-3-S13, and an ISE or FN-S04 contract session). Agree where a contract's owner, purpose, data classification and support contact live, for example a block in contract.yaml that the contract tool accepts. Then a pipeline step on main can call submitContractVersion with the result of his-contract check.
  • D10 policy (ess-runtime-decision): the actions ise.change.* and ise.release.authorize-recovery, in the README's table.
  • D10 coordination (ess-coordination):
  • register the notification type ise.release-notice;
  • register the task type ise.retrospective-review and the queue ise.release-management;
  • register this unit's client (delivery-pipeline) as a requester of both.
  • Deployment:
  • HIS_ISE_RELEASE_NOTIFICATION_URL, HIS_ISE_RELEASE_TASK_URL, HIS_ISE_RELEASE_RECOVERY_URL;
  • the client secret HIS_ISE_RELEASE_CLIENT_SECRET, from OpenBao;
  • the realm client delivery-pipeline with client credentials.
  • RC-3-S17 (recovery.v1): readBackupSet answers the approval of an irreversible migration. Until it is deployed, such an approval fails closed.
  • Observability: an alert rule on ReleaseDeployed with healthCheck: failed, or on his_release_health_checks_failed_total, to raise the incident of section 10. Also one on his_change_outbound_pending staying above 0.
  • A release workflow (follow-up of RC-1-S19). Run bin/upgrade-test <unit> --base <previous tag> --contracts <domain>, and put its compatibilityEvidence into createChangeRecord.
  • Service template: take the keep and template modes of HisTestDatabase, so that every unit can run bin/upgrade-test's mixed-version step. A unit runs that step once its own fixture has the modes. The tool puts the new version's fixture into the previous version's tree, so the previous version needs no change. Until then, --static-only gives the migration and event schema evidence, with mixedVersionTested false.
  • Service template and every unit's kit: HttpPolicyDecisionClientTest uses a 300 ms timeout that a loaded runner exceeds. Give it the 2 seconds of this unit's copy (review round 2).
  • RC-1-S19's release audit events (promotion decisions, sign-off, deployments, rollback): give them the item version and before and after values as well (D10-ESS 9.5), as this card did for the change records.
  • UI-ISE-007 (screens): the change record operations are served and verified, for the release and change console.

Final check results

HIS_SESSION=RC-3-S12 platform/delivery-pipeline/scripts/ends-when-rc-3.sh, on 2026-11-29. Steps 1 and 2 ran in the full run: step 1 passed, and step 2 has only the two host Node.js failures above. Steps 3 and 4 were run again with HIS_ENDS_WHEN_FROM=3 on the last commit, and passed:

  1. The unit, module, kit and contract tests (./gradlew build).
  2. bin/self-test, with the two host-only failures above.
  3. TEST-ISE-025 on this unit:
  4. a. This change beside the previous version (origin/main):
    • V2__change_records.sql is additive;
    • all 56 tests of the previous version pass on the schema V2 migrated. After the second merge with main, the kit's own tests are left out and its 29 unit tests (modules and app) pass;
    • contracts/ise is compatible;
    • evidence: database-migration=passed event-schema=passed.
  5. b. In a scratch clone, a migration dropping release.environment and a new required field in ReleaseDeployed:
    • the migration is read as incompatible and irreversible;
    • 31 of the previous version's 82 tests fail on that schema (31 of its 56 unit tests in the last run);
    • the event schema change is incompatible;
    • the upgrade test exits 1.
  6. Only platform/delivery-pipeline/, this handover, ADR-HIS-103 and the decision record index changed.

What the upgrade test's own runs found, and what changed because of it: - A foreign key in the first V2. It broke the previous version; it was removed (ADR-HIS-103 point 2). - A cached previous run. One run reused the previous version's cached test results. The tool now always executes them (--rerun --no-build-cache). - A kit test that failed once under load. One run of 3a failed 1 of 56 tests: HttpPolicyDecisionClientTest, the kit's HTTP client test against a local server, which has nothing to do with the schema. It passed three times out of three on its own, and in the next full run of 3a.