Skip to content

feat: run the next version's migrations against verify replicas - #107

Merged
dannash100 merged 18 commits into
mainfrom
feat/migration-testing
Aug 2, 2026
Merged

feat: run the next version's migrations against verify replicas#107
dannash100 merged 18 commits into
mainfrom
feat/migration-testing

Conversation

@dannash100

@dannash100 dannash100 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Changes

Audit logging had no spec: nothing under specs/ mentioned the changelog. This adds specs/audit/changelog.md, covering what is logged, what an entry holds, when entries are written, attribution and pausing, and synchronisation.

The synchronisation section deserves the most careful read: entries are DO_NOT_SYNC and travel attached to the record they describe, receivers pause auditing so entries are copied rather than regenerated, and mobile is the exception (central authors entries for mobile-originated changes). All verified against the code.

Two criteria are stated declaratively but only become true with #10635: "exactly one changelog trigger" (prescriptions currently double-logs) and the signers_historical exclusion. Hard-delete capture is deliberately absent; its criteria land with #10632.

Each criterion is meant to be a checkable fact about behaviour, so review those rather than the prose.

Attributing a failure. Tamanu only writes a logs.migrations batch once every migration in it has applied, so a failed run writes no row. Two consequences are handled here: the result reader records the newest batch already in the snapshot before starting the Job and ignores anything at or before it, so a failure is never pinned on one of the deployment's own past upgrades; and failedMigration is read from stats.failedMigration, falling back to unknown for target versions that don't record it. beyondessential/tamanu#10647 makes tamanu record the failed batch, which is what fills that field in.

Auto-Deploy

  • Deploy
Options
  • Artillery load test
  • Seed from closest snapshot
  • Generate fake data
  • More data (20Gi)
  • No facility servers (central-only)
  • No sync (facility tasks scaled to zero)
  • Skip mobile build
  • Always build mobile
  • Stay up for 8 hours
  • Stay up for 24 hours
  • Stay up (no TTL)
  • Build images only (don't deploy)
  • Build all images (amd64 + Windows; default is arm64 only)
  • Pause this deploy

Tests

  • Run E2E tests
  • Run DAST scan

Review Hero

  • Run Review Hero
  • Auto-fix review suggestions Wait for Review Hero to finish, resolve any comments you disagree with or want to fix manually, then check this to auto-fix the rest.
  • Auto-fix CI failures Check this to auto-fix lint errors, test failures, and other CI issues.
  • Auto-merge upstream Check this to merge the base branch into this PR, with AI conflict resolution if needed.
  • Save suppressions Check this to capture 👎 reactions on Review Hero comments as suppression rules in .github/review-hero/suppressions.yml. Also runs automatically at the end of any auto-fix run.

Remember to...

  • ...write or update tests
  • ...add UI screenshots and testing notes to the Linear issue
  • ...add any manual upgrade steps to the Linear issue
  • ...update the config reference, settings reference, or any relevant runbook(s)
  • ...call out additions or changes to config files for the deployment team to take note of

@dannash100
dannash100 marked this pull request as ready for review July 31, 2026 00:38
Comment thread src/controllers/restore/migration.rs
Comment thread Cargo.toml Outdated
@dannash100
dannash100 requested a review from passcod July 31, 2026 04:01
# Conflicts:
#	.github/workflows/integration.yml
#	Cargo.toml
#	README.md
#	src/controllers/canopy/intent.rs
#	src/controllers/restore/builders.rs
#	src/controllers/restore/tests.rs
@dannash100
dannash100 merged commit 612de65 into main Aug 2, 2026
17 checks passed
@dannash100
dannash100 deleted the feat/migration-testing branch August 2, 2026 21:36
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.

2 participants