Skip to content

Release QA 5: upgrade path: the candidate on a database every past release wrote #43

Open

Description

@alexbeeken

"Critical workflows don't break on a new release package" is mostly about the database that is already there: a learner's accounts, progress, courses and share links from version N have to survive the binary of version N+1, and the migration must run once and only once. Today that is checked by cargo test on a schema made by the current code, never on a database an older release actually wrote.

Do:

  1. scripts/release-qa/fixtures/learn-<version>.db (+ .key): a small database written by each released binary, made by running package-smoke.sh (Release QA 1: package-smoke.sh checks one release tarball on the machine it runs on #39) on that release with KEEP_DB=<path>. It holds the owner, one invited learner, progress on two lessons, one hand-made course with a share link that was opened, one invitation link not yet used. A few hundred KiB each; add one per release from 0.1.1 on.
  2. scripts/release-qa/upgrade-check.sh <tarball>: for each fixture older than the tarball, copy it to a temp dir, start the candidate on it (package-smoke.sh --db), and check: the server starts; PRAGMA user_version went from the fixture's version to the candidate's; both accounts sign in; the learner's progress is unchanged (/api/progress compared with what the fixture's progress.json recorded when it was made); the shared course is still on the learner's list; the unused invitation link still registers; the second start changes nothing.
  3. The other direction: the previous release's binary started on a database the candidate migrated must refuse cleanly with a message naming the newer schema, not corrupt it. Check the exit code and that the file's checksum is unchanged.
  4. arch-matrix.sh (Release QA 3: a Compose rig (scripts/release-qa/compose.yaml) runs every architecture's tarball under QEMU, with qa, e2e and simulator profiles #41) and vm.sh update (Release QA 4: full VMs with systemd per architecture (Lima): install, update, roll back, uninstall #42) call it, so an upgrade is checked on every architecture, and the VM path checks learn.db.before-<version> is a readable copy.
  5. docs/testing.md says how to add the fixture for a new release, as a step in docs/self-hosting.md "Releases".

Done when upgrade-check.sh dist/skrongle-0.1.2-aarch64.tar.gz passes against the 0.1.1 fixture and fails when a migration is removed from MIGRATIONS.

Activity

  1. alexbeeken commented on Nov 12, 2026

    @alexbeeken
    OwnerAuthor

    Groomed 2026-11-12: what is left, and where

    Done on main: upgrade-check.sh, fixtures for 0.1.1 to 0.3.0, the rig and matrix.sh calling it, the fix for the log line (#179), and scripts/release-qa/vm.sh (#180).

    Since #165 an update makes no copy of the database; every migration has a .down.sql and skrongle migrate takes the schema back (read src/db.rs migrate_command and docs/self-hosting.md "Updating"). main is now at schema v8 and the published 0.3.0 is at v5, so going back across a schema change can be tested for the first time. Nothing tests it today.

    Left

    1. upgrade-check.sh: after a fixture is migrated up and checked, take it back down to the fixture's own schema the documented way (skrongle migrate … with the candidate binary), then start the old release binary on it and check it starts, the owner and the learner sign in and the progress is what the fixture recorded. Only for old releases whose binary can be downloaded for the architecture (the script already knows how to skip one that was never built). Releases that predate a way back for their schema step: read which .down.sql files exist and say note for a step that cannot be undone, never FAIL.
    2. vm.sh update: the "go back" step used the published release with the same schema as the candidate. With a v8 candidate, going back to 0.3.0 must follow docs/self-hosting.md "Updating" for a schema change (migrate down first, then update.sh 0.3.0). Make the step do that and check sign-in after it. If the docs' steps do not work as written, fix the docs or the script and say which was wrong.
    3. The download of an old tarball failed once with "cannot be downloaded" and worked on the next run: give old_binary two retries with a short wait before it reports a failure.
    4. docs/testing.md ("Release QA", the upgrade check and "VMs") and scripts/release-qa/fixtures/README.md describe the new checks.

    Prove: scripts/build-pi.sh aarch64 && scripts/package-release.sh <version> aarch64, then scripts/release-qa/matrix.sh dist aarch64 (upgrade column ok, with the new "back to vN" lines in results/release-qa/<version>/aarch64.upgrade.log), and scripts/release-qa/vm.sh aarch64 up, install, update, down. Lima rule: only ever touch instances named skrongle-qa-<arch>; never colima. Do not install software with brew; x86_64 VMs need QEMU, which is not installed, so leave them.

    Do not touch compose.yaml, entrypoint.sh, e2e-run.sh or matrix.sh's e2e part (another agent, #41) beyond what calling the new check needs.

    Part of #43 and Part of #42.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions