steid

@jamesgill /

steid/plans/releases.md
Markdown9.7 KBRendered·Source·Blame·History·Raw
1# Releases
2
3What each release shipped, so **"the previous release's schema"** is a fact rather than
4a guess. Every migration must be one the previous release's binary can run against —
5the rule, and why, is in [`architecture.md`]architecture.md#migrations.
6
7Add a row when a release is cut, in the same commit that bumps `Cargo.toml`, together
8with its `RELEASES` row, which `cargo test` now enforces
9([below]#where-each-releases-set-actually-lives).
10
11| Version | Date | Commit | Migrations it shipped |
12|---|---|---|---|
13| 0.1.0 | 2026-07-31 | `1111df1` | *(none — no `migrations/` directory yet)* |
14| 0.2.0 | 2026-09-04 | `7fb0b5e` | `…093030_create_orgs` · `…093031_create_users` · `…093032_create_memberships` · `…093033_create_sessions` · `…093034_add_org_bio` · `…093035_create_repositories` · `20260828120000_create_tokens` · `20260829090000_add_repository_recency` |
15| 0.3.0 | 2026-09-06 | `768d679` | *(none new — same set as 0.2.0)* |
16| 0.4.0 | 2026-09-06 | `219c396` | `20260906120100_add_repository_import` · `…120200_create_issues` · `…120201_create_issue_comments` · `…120300_create_push_events` · `…120301_create_webhooks` · `…120302_create_webhook_deliveries` · `…120400_add_repository_archived` · `…140100_add_token_lifecycle` · `…140200_create_labels` · `…140201_create_issue_labels` · `…180100_create_pull_requests` · `…180101_create_pull_request_comments` · `…190000_create_pull_request_labels` |
17| 0.5.0 | 2026-09-10 | `b942dad` | `20260908090500_create_password_resets` *(see [which bytes]#which-bytes-each-release-shipped)* |
18| 0.6.0 | 2026-09-20 | `c3543e3` | *(none new — same set as 0.5.0)* |
19| 0.7.0 | 2026-09-26 | `3f411b5` | *(none new — same set as 0.5.0)* |
20| 0.8.0 | 2026-09-27 | `bac1a59` | `20260927100000_create_instance_settings` |
21| 0.8.1 | 2026-10-02 | *cut, not published — the commit that sets `Cargo.toml` to 0.8.1* | *(none new — same set as 0.8.0)* |
22
23The `…` stands for the leading `202609061` / `20260804` of the timestamp; the full file
24names are in `migrations/`.
25
260.6.0 is the first release published from **`https://releases.steid.dev`**
27([decision 0009]decisions/0009-releases-from-releases-steid-dev.md) and the first
28version cloud-init can install headlessly. `Cargo.toml` and `install.sh` have said
290.6.0 since the boot-time owner landed (2026-09-13); the release was not cut until the
30host existed, so no artefact has ever carried 0.6.0 and the number is published as-is
31rather than bumped. `jpgill.dev` still serves up to 0.5.0 at the old path and mirrors
320.6.0 onwards.
33
340.7.0 is the control plane's three asks — `steid restore --replace`,
35`install.sh --operator-token`, and `disk` on `/api/instance` — and is the upgrade target
36the control plane's own upgrade step needs in order to have ever run against a box.
37It was cut on 2026-09-26 and **published on 2026-09-27**.
38
390.8.0 is organisations and home, the first slice of milestone 7. It was cut on
402026-09-27 and **published on 2026-09-28**, both architectures; `install.sh`'s default
41moved to it in `b0c6058`.
42
43**0.8.0 adds one migration** — `20260927100000_create_instance_settings.sql`, the
44single-row table holding `home_org_id`. It is an **expand** step and nothing else: a
45`create table` plus the one `insert` that seeds the row, no column added to an existing
46table, nothing dropped or renamed. The previous release's binary neither reads nor
47writes it, and reads nothing it changes, so the old process can keep serving while the
48new one migrates — which is the rule `architecture.md` states. Everything before it
49shipped with 0.5.0; 0.6.0 and 0.7.0 add none.
50
51> **Correction, 2026-10-01: that does not make a rollback safe.** An old process that is
52> *already running* keeps serving, but a 0.7.0 binary *started* against this database
53> refuses to boot: sqlx's default `ignore_missing: false` exits with `VersionMissing` on
54> an applied migration it does not know. So 0.8.0 → 0.7.0 can never roll back, and the
55> first rollback that can work is from the release after **0.8.1**, which is to carry
56> `set_ignore_missing(true)`. See
57> [launch 1.2]../../plans/launch.md#phase-1-before-anything-else.
58
590.8.1 is that fix. `migrate()` now ignores an applied migration it does not know and
60still refuses an edited one it does (`set_ignore_missing(true)`), so a box upgraded
61across a migration can be rolled back onto 0.8.1 or anything later. It ships no
62migration. **Cut on 2026-10-02 and not published**: publishing is the author's
63(`./release.sh --all`, then `./deploy.sh --publish-s3-only`). `install.sh`'s default
64moved to 0.8.1 in the cut, as it did for 0.7.0, so a publish uploads the script that
65matches it. Re-publishing the root `install.sh` on its own before the 0.8.1 artefacts are
66up would send every fresh install to a 404.
67
68## Unreleased
69
70Nothing since 0.8.1.
71
72## Where each release's set actually lives
73
74Every release since 0.5.0 is a row of `RELEASES` in
75`src/infrastructure/database_compat_tests.rs`: its version, its **cumulative** file list
76(`RELEASED_0_5_0`, `RELEASED_0_8_0`) and a SHA-256 over those files' bytes. That is the
77authoritative copy. Three tests read it:
78
79- `a_shipped_migration_is_never_edited` re-hashes each set, so editing any migration that
80 has shipped — a comment counts, because sqlx checksums the whole file — fails the build
81 and names the first release that shipped it. 0.5.0's set holds everything earlier, so
82 every migration that has ever shipped is covered.
83- `every_released_set_is_a_prefix_of_the_migrations_on_disk` catches a mistyped name and
84 a migration back-dated in front of a released one.
85- `the_version_in_cargo_toml_has_a_releases_row` fails while `Cargo.toml` names a version
86 with no row (since 2026-10-02). The other two check only the rows that exist, which is
87 how 0.8.0 shipped unpinned until 0.8.1's step added its row after the fact. So the
88 version moves only in the cut commit, and no longer runs ahead of the cut as it did for
89 0.6.0.
90
91The table above is the human record and must agree with it. **When a release is cut**,
92in the cut commit: add its row here, and add a `RELEASES` row with the digest of its set
93at that commit. A release that shipped no migration reuses the previous list — 0.6.0 and
940.7.0 point at `RELEASED_0_5_0`, 0.8.1 at `RELEASED_0_8_0` — and one that shipped any gets a new
95`RELEASED_<version>` with the full cumulative list. A digest is never changed to make the
96test pass. The `RELEASES` row is enforced; the row in this table is not.
97
98The replay test (`the_current_reads_work_against_the_last_released_schema`) still
99replays 0.5.0's set, not 0.8.0's; see `current.md`.
100
101## Which bytes each release shipped
102
103There are no tags, so each release's migration bytes were established on 2026-10-02 from
104git and, where the artefact is still in the author's `dist/`, from the binary itself:
105`sqlx::migrate!` embeds each migration's SQL and its SHA-384, so a binary says exactly
106which bytes it will check a database against.
107
108- **Git.** `git log --diff-filter=M --follow` on every migration finds two edits ever,
109 both to `20260906120200_create_issues.sql` and both to one comment line: `640bbc8`
110 (2026-09-08) renamed `SqliteIssueRepo::next_number` to `SqliteRepoRepo::next_number`,
111 and `a6819c2` (2026-09-10 22:58) put the 0.4.0 bytes back. No migration was ever
112 deleted or renamed. Comparing `git show <release>:migrations/<file>` with HEAD, every
113 file at `219c396` (0.4.0), `a6819c2`, `c3543e3` (0.6.0), `3f411b5` (0.7.0) and
114 `bac1a59` (0.8.0) is byte-identical to HEAD.
115- **The binaries.** The local 0.4.0, 0.5.0, 0.7.0 and 0.8.0 tarballs (each matching its
116 `.sha256`) embed the SHA-384 of HEAD's bytes for every migration they carry, and no
117 migration SQL beyond those files.
118
119| Release | Set | SHA-256 pinned | Evidence | Settled? |
120|---|---|---|---|---|
121| 0.5.0 | 22 files | `e94827d7…` | The cut commit `b942dad` still held `640bbc8`'s edited comment (that tree hashes to `01521714…`). Both local 0.5.0 artefacts — aarch64 built 22:59 on 2026-09-10, a minute after `a6819c2`, and x86_64 built overnight — embed the **restored** bytes, not the edited ones. | **Yes, published too** (2026-10-02). The `.sha256` files `jpgill.dev` serves read `20844e9e…` (aarch64) and `ed6b4a60…` (x86_64), the local artefacts' own. So a box first installed at 0.5.0 holds the restored bytes and upgrades without `VersionMismatch`. |
122| 0.6.0 | 0.5.0's | `e94827d7…` | Git only: `c3543e3`'s tree, and no commit between `a6819c2` and `a140f84` touches `migrations/`. No 0.6.0 artefact is on the laptop. | From the committed tree. A build from an uncommitted tree cannot be ruled out, though the 0.5.0 and 0.7.0 binaries on either side embed the same bytes. |
123| 0.7.0 | 0.5.0's | `e94827d7…` | Every commit from the cut `3f411b5` to `1e37af7`, the last before 0.8.0's migration (`a140f84`), holds the same 22 files at the same bytes, and `20e5b4e` touches no migration. Both local artefacts (16:25 and 16:27 BST, 2026-09-27) embed exactly those 22 and not `instance_settings`. They also carry the copy `20e5b4e` replaced ("Currently building", no new meta description), and the console's D7 record puts the publish at 15:22–15:27 UTC, before `20e5b4e` was committed at 19:12 UTC. So `20e5b4e` is not in these binaries. | **Yes, published too** (2026-10-02): `releases.steid.dev`'s `.sha256` files read `e7fec909…` (aarch64) and `8dcd8c00…` (x86_64), the local artefacts' own. The x86_64 tarball was uploaded twice, five minutes apart (launch 5.2). What is served now is the local build, and the earlier object version was not checked. |
124| 0.8.0 | 23 files | `6761cb04…` | `bac1a59`'s tree; both local artefacts (2026-09-28) embed the same 23. | Yes, for the local artefacts. |
125
126Comparing a published `.sha256` with the local one is a read of the release host, which
127was not done here.