Appearance
ADR-2535: Forward Verified CI GxP Evidence to Releases and Synchronize Service Migration Snapshots
- Status: Accepted
- Date: 2026-11-20
- Authors: @fderuiter, Stitch Agent
- Deciders: @fderuiter
- Requirements: PRD-SYS-053 (development guardrails and deterministic GxP verification evidence), PRD-EVT-001
1. Context & Problem Statement
On pushes to main, release/*, and v* tags, .github/workflows/ci.yml executes the full .NET 10 xUnit verification suite against a pinned PostgreSQL 18 container (dotnet-tests), validates GxP traceability (compliance), and then invokes .github/workflows/production-pipeline.yml. Previously, production-pipeline.yml had no access to the TestResults/gxp TRX and *.database.txt artifacts produced by dotnet-tests and defaulted RTM_DRAFT=true, while deploy-docs.yml triggered as an unguarded push workflow in parallel with validation. In addition, recent domain state-machine and transactional outbox updates in ctms, tickets, and payments modified EF Core entity configurations without recording matching EF Core migrations, causing PendingModelChangesWarning and MigrationUnitTests failures during PostgreSQL qualification.
2. Decision Drivers & Constraints
- Release archives published by
production-pipeline.ymlmust contain non-draft, integrity-stamped GxP RTM and IQ/OQ/PQ execution reports backed by verified PostgreSQL 18 test evidence (ADR-2531,ADR-2532,ADR-2533). dotnet-testsmust fail closed if eithertests/Cadence.IntegrationTestsortests/Cadence.E2ETestsomits TRX output, omits*.database.txtfixture evidence, or skips non-opt-in database tests (DatabaseTestEvidence.OptInTests).- Every service
DbContextmodel must match its EF Core migration snapshot (MigrationUnitTests) soMigrateAsync()executes cleanly against PostgreSQL 18. - Artifact uploads across
ci.ymlandproduction-pipeline.ymlmust be scoped by<run_id>-<run_attempt>so re-runs never collide on immutable artifact names.
3. Options Considered
Option 1: Gate reusable release/docs workflows in ci.yml, forward gxp-test-evidence to gxp snapshot --results-dir, and add missing service migrations (Selected)
- Overview: Upload verified
TestResults/gxp(*.trxand*.database.txt) fromdotnet-testsonly afterscripts/check-database-test-results.shpasses; consume that artifact in bothcompliance(gxp sync --results-dir) andproduction-pipeline.yml(gxp snapshot --results-dir, falling back to runninggxp snapshotagainst pinned PostgreSQL 18 onworkflow_dispatch); gatedeploy-docs.ymlviaworkflow_callfromci.ymlonmainpushes; and synchronize the EF Core migrations forctms(#5900),tickets(#5899), andpayments(#5900). - Pros:
- ✅ Eliminates duplicate
.NETtest execution during push release archiving while guaranteeing non-draft, PostgreSQL-backed GxP qualification bundles. - ✅ Prevents unvalidated documentation deployments and artifact name collisions on workflow re-attempts.
- ✅ Restores 1:1 parity between EF Core runtime models and migration snapshots across all 15 platform services.
- ✅ Eliminates duplicate
- Cons:
- ❌
production-pipeline.ymlmust support bothworkflow_call(forwarded artifact) and standaloneworkflow_dispatch(self-hosted PostgreSQL 18 service container).
- ❌
Option 2: Re-run the full .NET PostgreSQL suite unconditionally inside production-pipeline.yml
- Cons:
- ❌ Doubles CI runtime on every
mainand release push and can qualify a different transient execution than the onecomplianceverified.
- ❌ Doubles CI runtime on every
4. Decision Outcome
Chosen option: Option 1.
gxp snapshotaccepts--results-dir <dir>and requires recorded*.database.txtPostgreSQL fixture metadata (DatabaseTestEvidence.HasRecordedEnvironment) alongside zero non-opt-in skipped database tests.dotnet-testsenforces assembly,*.database.txt, andNotExecutedchecks viascripts/check-database-test-results.shbefore uploadinggxp-test-evidence-${{ github.run_id }}-${{ github.run_attempt }}.ci.ymlcallsproduction-pipeline.ymlanddeploy-docs.ymlonly after all push validation jobs succeed, and disablescancel-in-progressonpushevents so release evidence pipelines are not aborted mid-run. Insideproduction-pipeline.yml,Download Verified .NET Test Evidencegates ongithub.event_name != 'workflow_dispatch'(because GitHub Actions reusable workflows inherit the caller'spushevent name rather thanworkflow_call), while standaloneworkflow_dispatchrunsdotnet test Cadence.slnandscripts/check-database-test-results.shintoTestResults/gxpbefore removing the committeddocs/SDLCcopies and invokinggxp snapshot --results-dir TestResults/gxp.ctms(AddTransactionalOutbox,#5900),tickets(EnforceTicketStatusCheckConstraint,#5899), andpayments(AddPaymentStatusCheckConstraints,#5900) include EF Core migrations matching their domain state-machine and transactional outbox configurations without duplicate migrations.apps/web(client.ts,demoMode.js,router/index.js) andapps/subject-portal(src/index.js) guard circular ESMimport.meta.envaccess, dynamically resolveVITE_API_BASE_URLacross circular OpenAPI client imports, normalize path-based demo deep links into hash routes prior tocreateWebHashHistoryinitialization, and runinitializeApp()immediately whendocument.readyState !== "loading"so allaccessibility-e2ebrowser suites (subject-portal,web, andBrowserCorrectionReachesTheDatabaseWithItsReason) execute deterministically in CI.- MassTransit consumer unit tests (
ClinicalVisitCompletedConsumerTests,EconsentReconsentConsumerTests,EtmfConsumersTests) register per-consumer scopedDbContextinstances (AddScoped), setConcurrentMessageLimit = 1, await each delivery deterministically viaIConsumeObserver(MassTransitHarnessExtensions.PublishAndWaitForConsumeAsync), and stopITestHarnessbefore tearing down SQLite/EF Core fixtures so duplicate-delivery idempotency assertions never race EF Core'sConcurrencyDetectoror MassTransit'sInactivityToken.
5. Consequences & Trade-offs
- Release archives (
gxp-release-evidence-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}) carry stamped, non-draft RTM and IQ/OQ/PQ reports without committing generated snapshots on feature branches (ADR-2532). - Manual
workflow_dispatchexecutions ofproduction-pipeline.ymlstill qualify against a live pinned PostgreSQL 18 service container when no upstreamevidence_artifactis supplied. - Standalone CI runs of
apps/webPlaywright E2E execute against--mode demowith stateful MSW handlers while preservingE2E_KEYCLOAK=truefor live Docker Keycloak runs and keeping non-demo runtime authentication strictly Keycloak-only (ADR-2493).
6. Implementation & Verification
packages/cli/src/Commands/GxPCommands.cs,packages/cli/src/Services/GxPComplianceService.cs,packages/tooling_core/src/Services/SyncGxPService.cs, andpackages/compliance/src/DatabaseTestEvidence.cs.scripts/check-database-test-results.shandscripts/test-check-database-test-results.sh..github/workflows/ci.yml,.github/workflows/production-pipeline.yml, and.github/workflows/deploy-docs.yml.- EF Core migrations under
apps/ctms/src/Infrastructure/Persistence/Migrations/,apps/tickets/src/Infrastructure/Persistence/Migrations/, andapps/payments/src/Infrastructure/Persistence/Migrations/. - Browser & E2E verification across
apps/web/src/api/client.ts,apps/web/src/router/index.js,apps/web/src/mocks/demoHandlers.js,apps/subject-portal/src/index.js,apps/subject-portal/tests/e2e/, andtests/Cadence.IntegrationTests/Kernel/KernelObservationHostPostgresTests.cs.