Skip to content

ci(release): add devtools/freeze-migrations - #1466

Merged
robinnsc merged 1 commit into
mainfrom
ci/freeze-migrations
Dec 3, 2026
Merged

robinnsc merged 1 commit into
mainfrom
ci/freeze-migrations

Conversation

@robinnsc

@robinnsc robinnsc commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Release automation (#1395), PR 3 of 6. #1464 (PR title check) and #1465 (signing in a called workflow) have merged. Stack: #1466 freeze-migrations ← #1467 release-please ← #1468 rehearsal ← #1469 release-publish. Merge in that order. Its base is main.

What

Adds devtools/freeze-migrations, which does the migration freeze of a release PR, and points CONTRIBUTING.md and packaging/README.md at it. Nothing runs it yet; a maintainer can run it by hand.

Background: catalog migrations at or below RELEASED_THROUGH (crates/storage/src/migrations/registry.rs) are frozen. Each backend's RELEASED table pins their checksums, and the release gates refuse a tag whose bound is below the last migration. A release that ships a new migration raises the bound and pastes the lines that each backend's the_released_bodies_match_their_checksums test prints (CONTRIBUTING.md, "Adding a catalog migration", step 7). That has been done by hand.

The script:

  • runs the four checksum tests with the bound unchanged and takes the lines for the migrations above the bound;
  • raises the bound, inserts the lines at the end of each RELEASED table, runs cargo fmt on the four crates, and runs the four tests again;
  • changes nothing when the bound is already the last id.

It reads the registry with read_registry() from devtools/check-released-through, which it loads as a module, so the registry patterns and their messages exist once. check-released-through prints the same output as before.

With --release-version X.Y.Z it refuses to freeze a breaking migration in a patch release from 1.0 on, which docs/versioning.md forbids, and says to release X.Y+1.0 instead, with a Release-As footer at the end of the message of a commit merged to main. A 0.x release may carry one, as the document allows. Every check that can refuse runs before the first write.

Why

Part of #1395: the job that completes the release PR will run this script, so the freeze no longer depends on someone remembering step 7. devtools/check-released-through's refusal now names the script.

Testing done

  • Unit tests replace cargo with a fake and need no Rust toolchain. A mutation run left one mutant alive, a union of the backends' breaking sets that kept only the last backend's; a per-backend case now kills it.
  • Round trip on the real crates: with migration 12 unfrozen (bound 11, its RELEASED entries removed), the script refuses --release-version 1.0.1 without writing anything, and with 1.1.0 it reproduces the committed tables and bound byte for byte. A second run reports nothing to freeze. CONTRIBUTING.md step 7 shows how to repeat this.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace): not run; the four checksum tests pass, and the devtools unit tests pass
  • Code is formatted (cargo fmt --check): no Rust change
  • Clippy is clean (cargo clippy -- -W clippy::pedantic): no Rust change
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

ADR / RFC: n/a: CI and release tooling only; the design is discussed in #1395

Breaking changes

None.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

@robinnsc robinnsc self-assigned this Nov 25, 2026
@robinnsc
robinnsc force-pushed the ci/sign-in-called-workflow branch from 1c9f7fd to e787960 Compare November 29, 2026 01:33
@robinnsc
robinnsc force-pushed the ci/freeze-migrations branch from fd44cee to ad3f616 Compare November 29, 2026 01:33
@robinnsc
robinnsc force-pushed the ci/sign-in-called-workflow branch from e787960 to 894cd08 Compare November 30, 2026 21:55
@robinnsc
robinnsc force-pushed the ci/freeze-migrations branch from ad3f616 to a82b895 Compare November 30, 2026 21:56
@robinnsc
robinnsc marked this pull request as ready for review November 30, 2026 21:56
@robinnsc
robinnsc force-pushed the ci/sign-in-called-workflow branch from 894cd08 to 3b94c94 Compare December 1, 2026 18:55
@robinnsc
robinnsc force-pushed the ci/freeze-migrations branch from a82b895 to 85b663f Compare December 1, 2026 18:55
@robinnsc
robinnsc force-pushed the ci/sign-in-called-workflow branch from 3b94c94 to 48b2cb6 Compare December 2, 2026 06:56
@robinnsc
robinnsc force-pushed the ci/freeze-migrations branch from 85b663f to 39288eb Compare December 2, 2026 06:56
LeeroyHannigan
LeeroyHannigan previously approved these changes Dec 2, 2026

@LeeroyHannigan LeeroyHannigan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I read the change against #1465's head 48b2cb6. freeze_migrations_test.py passed 3 of 3 runs, and so did the whole devtools suite as scripts-test.yml runs it (195 tests). I also ran the script on the real crates, with migration 12 taken out of the four RELEASED tables and the bound set to 11:

  • --release-version 1.0.1 refused the breaking migration and wrote nothing.
  • --release-version 1.1.0 wrote back the bound and all four tables byte for byte, with the MongoDB fingerprint.
  • A second run found nothing to freeze.

The test failed on each of four broken versions of the script. Two skipped the checksum refusal (before and after the freeze), one skipped the patch-release refusal, and one treated a 0.x release as a patch release.

Two small points, neither of them a condition:

  • The test's Fake reports one kind per migration for all four backends (line 92). On the real tree the backends disagree: migration 12 is breaking only on MongoDB. If line 164 of freeze-migrations kept only the last backend's set, no test would fail. A --release-version 1.1.1 with migration 12 unfrozen would then freeze it. A case where only mongodb reports a migration as breaking would catch that.
  • Lines 41 and 43 repeat the two patterns of check-released-through (its lines 35 and 40). Line 97 repeats its message for a missing bound (its line 37). Line 141 repeats its refusal of a bound above the last migration (its line 53). If one copy changes, the tag gate and the freeze can disagree on the last migration. The script could load the parse from check-released-through, as the test loads the script. If the copy stays, please say why in the description.

I found no other open PR that freezes migrations or changes check-released-through.

Base automatically changed from ci/sign-in-called-workflow to main December 3, 2026 00:06
@robinnsc
robinnsc dismissed LeeroyHannigan’s stale review December 3, 2026 00:06

The base branch was changed.

LeeroyHannigan
LeeroyHannigan previously approved these changes Dec 3, 2026

@LeeroyHannigan LeeroyHannigan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve again. #1465 merged at 00:06 UTC as a squash, and GitHub then moved this PR's base to main, which dismissed my approval. The branch did not change: its head is still 39288eb, the commit I approved.

Merged into main at c444cfc, this branch changes the same five files in the same way as it did on #1465's head, with no conflict. A merge into main applies only this PR's own change.

One note, not a condition. Because #1465 landed as a squash, this PR's commit list now holds #1465's commit 48b2cb6 too, and its file list shows 16 files. A squash merge here puts every commit message in the commit body, so that message would reach main a second time. A rebase onto main would drop the commit, but #1467 to #1469 sit on this branch, so the choice is yours.

CI passed at this head, 60 of 60.

This adds devtools/freeze-migrations, which does the migration freeze
of a release PR, and points CONTRIBUTING.md and packaging/README.md at
it. Nothing runs it yet; a maintainer can run it by hand.

A release that ships a catalog migration raises RELEASED_THROUGH to the
last migration id and pastes the checksum lines that each backend's
the_released_bodies_match_their_checksums test prints into its RELEASED
table (CONTRIBUTING.md, "Adding a catalog migration", step 7). That has
been done by hand in each release PR.

The script runs the four tests with the bound unchanged and takes the
lines for the migrations above the bound. It then raises the bound,
inserts the lines before each table's closing bracket, runs cargo fmt
on the four crates and runs the four tests again. It changes nothing
when the bound is already the last id.

With --release-version X.Y.Z it refuses to freeze a breaking migration
in a patch release from 1.0 on, which docs/versioning.md forbids, and
says to release X.Y+1.0 instead, with a Release-As footer at the end of
the message of a commit merged to main. A 0.x release may carry a
breaking migration, as the document allows. The version is checked
before anything else. Every check that can refuse the freeze runs
before the first write, so such a refusal leaves the tree as it was.
If cargo fmt or the tests fail after the freeze, the files stay written
for inspection; git checkout -- crates/ undoes them.

The unit tests replace cargo with a fake and need no Rust toolchain.
With migration 12 unfrozen on the real crates, the script refuses
--release-version 1.0.1 without writing, and with 1.1.0 it reproduces
the committed tables and bound exactly. Step 7 of CONTRIBUTING.md now
shows the commands the script runs and how to repeat that check.

This is part of the release automation tracked in #1395: the job that
completes the release PR will run it.

devtools/check-released-through's refusal now names
devtools/freeze-migrations. The registry reader moves into a function
of check-released-through, and freeze-migrations loads it from there,
so the release gate and the freeze read the bound and the last
migration with one copy of the patterns and messages. A test case has
a migration that one backend alone reports as breaking, as migration
12 is breaking only on MongoDB.

The keyless signing selftests name #1469 where they mention
release-publish.yml, which that PR adds, and the called selftest says
why it builds its own image: a digest the caller also signed would let
the caller's identity verify it.

Signed-off-by: Scott Robinson <robinnsc@amazon.com>
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 5826e1b. This branch last had main at c8e66fb. Since
then, four PRs merged into main: #1446, #1531, #1466 and #1087.

One file conflicted. In docs/manuals/07-upgrade-manual.md, #1087 added
its v1.2.0 entry after the other v1.2.0 entries of main, where this
branch has its entry. The merge keeps the entries of main first, then
the entry of this branch.

Git merged crates/wasm-adapter/parity/corpus.json with no conflict:
#1087 adds a Scan case, and the 15 checks that this branch changes are
in other cases. The diff of this branch against main does not change in
that file.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 5826e1b. This branch last had main at c8e66fb. Since
then, four PRs merged into main: #1446, #1531, #1466 and #1087.

One file conflicted. In docs/manuals/07-upgrade-manual.md, #1087 added
its v1.2.0 entry after the other v1.2.0 entries of main, where this
branch has its entry. The merge keeps the entries of main first, then
the entry of this branch.

Main changed no other file that this branch changes.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 5826e1b, three commits past c057660: #1531, #1466 and
#1087. In docs/manuals/07-upgrade-manual.md, #1531 adds a v1.2.0 entry
at the top of "Behavior Changes by Release", and git merged it with no
conflict. #1087 adds its v1.2.0 entry after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries. No other file has
changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 5826e1b, three commits past c057660: #1531, #1466 and
#1087. In docs/manuals/07-upgrade-manual.md, #1531 adds a v1.2.0 entry
at the top of "Behavior Changes by Release", and git merged it with no
conflict. #1087 adds its v1.2.0 entry after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries.

Git merged three other files with no conflict:

- crates/storage-sqlite/src/data/data_engine.rs: #1087 changes
  scan_key_in_segment to compute the segment from the key, with no read
  of the data table. This branch maps the error of a dropped data table
  to StorageError::TableNotFound in the other data-plane calls, and it
  does not change scan_key_in_segment.
- crates/storage-sqlite/src/lib.rs: #1087 declares the
  scan_segment_tests module, and this branch declares
  deleting_window_data_tests.
- crates/storage-cassandra/tests/direct_integration.rs: #1531 declares
  the update_item_retry module, and this branch declares
  deleting_window.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 5826e1b, three commits past c057660: #1531, #1466 and
#1087. In docs/manuals/07-upgrade-manual.md, #1531 adds a v1.2.0 entry
at the top of "Behavior Changes by Release", and git merged it with no
conflict. #1087 adds its v1.2.0 entry after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries.

No other file has changes on both sides. #1087 changes how SQLite puts
items in parallel Scan segments. This branch changes the Scan request
checks in crates/engine, and #1087 changes no file in that crate.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 5826e1b, three commits past c057660: #1531, #1466 and
#1087. In docs/manuals/07-upgrade-manual.md, #1531 adds a v1.2.0 entry
at the top of "Behavior Changes by Release", and git merged it with no
conflict. #1087 adds its v1.2.0 entry after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries. No other file has
changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, four commits past db8a90d: #1466, #1087, #768
and #1296. #1087 adds its v1.2.0 entry to
docs/manuals/07-upgrade-manual.md after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries.

Git merged three other files with no conflict:

- CONTRIBUTING.md: #1466 describes devtools/freeze-migrations in the
  step that freezes the released bodies. This branch gives the example
  migration the id 14 and adds migration 13 to the list of ids in use.
- crates/storage-mongodb/src/data_engine.rs: #1087 computes the
  parallel Scan segment with scan_segment in scan_key_in_segment and in
  scan_impl. This branch changes other functions.
- crates/storage/src/util/mod.rs: #1087 declares and exports
  scan_segment, and this branch declares and exports control_chars.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, five commits past c057660: #1531, #1466, #1087,
#768 and #1296. In docs/manuals/07-upgrade-manual.md, #1531 adds a
v1.2.0 entry at the top of "Behavior Changes by Release", and git
merged it with no conflict. #1087 adds its v1.2.0 entry after the other
v1.2.0 entries of main, where this branch has its entry. That is the one
conflict. The merge keeps both entries without change: the entry of
#1087 first, then the entry of this branch, before the v1.1.0 entries.

Git merged crates/storage-sqlite/src/data/query_scan.rs with no
conflict. #1087 replaces the rowid rule of the parallel Scan with the
SQL function extenddb_scan_segment. It computes the segment of a start
key from the key alone. This branch sets creation_date_time in
the TableKeyInfo of the test helper key_info. The tests that #1087 adds
in crates/storage-sqlite/src/scan_segment_tests.rs build each
TableKeyInfo from a clone, so they need no change for the new field.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, six commits past c8e66fb: #1446, #1531, #1466,
#1087, #768 and #1296. In docs/manuals/07-upgrade-manual.md, #1446 and
#1531 add v1.2.0 entries at the top of "Behavior Changes by Release",
and git merged them with no conflict. #1087 adds its v1.2.0 entry after
the other v1.2.0 entries of main, where this branch has its entry. That
is the one conflict. The merge keeps both entries without change: the
entry of #1087 first, then the entry of this branch, before the v1.1.0
entries.

Git merged five other files with no conflict:

- crates/storage-cassandra/tests/direct_integration.rs: #1531 declares
  the update_item_retry module, and this branch declares
  gsi_backfilling.
- crates/storage-mongodb/src/table_engine.rs: #1446 changes DeleteTable.
  It marks the table DELETING by table_id, and it removes the tags and
  the table document in one transaction. This branch changes
  create_table_impl_inner, index_info_by_table_id_impl and
  doc_to_table_description_in.
- crates/storage-sqlite/src/lib.rs: #1087 declares the
  scan_segment_tests module, and this branch declares
  gsi_backfilling_tests.
- crates/storage-sqlite/src/store.rs: #1087 registers
  extenddb_scan_segment on each connection of the pool. This branch
  adds the gsi_backfills field and gsi_creating_phase_delay.
- crates/storage/src/lib.rs: #1087 rewrites the doc comment of
  scan_key_in_segment, and this branch declares the gsi_backfill
  module.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, five commits past c057660: #1531, #1466, #1087,
#768 and #1296. In docs/manuals/07-upgrade-manual.md, #1531 adds a
v1.2.0 entry at the top of "Behavior Changes by Release", and git
merged it with no conflict. #1087 adds its v1.2.0 entry after the other
v1.2.0 entries of main, where this branch has its entry. That is the one
conflict. The merge keeps both entries without change: the entry of
#1087 first, then the entry of this branch, before the v1.1.0 entries.

Git merged two other files with no conflict:

- crates/storage-mongodb/src/data_engine.rs: #1087 computes the
  parallel Scan segment with scan_segment in scan_key_in_segment and in
  scan_impl. This branch changes the write functions and their retries
  at other lines.
- crates/storage/src/lib.rs: #1087 rewrites the doc comment of
  scan_key_in_segment, and this branch declares the request_clock
  module.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, six commits past c8e66fb: #1446, #1531, #1466,
#1087, #768 and #1296. In docs/manuals/07-upgrade-manual.md, #1446 and
#1531 add v1.2.0 entries at the top of "Behavior Changes by Release",
and git merged them with no conflict. #1087 adds its v1.2.0 entry after
the other v1.2.0 entries of main, where this branch has its entry. That
is the one conflict. The merge keeps both entries without change: the
entry of #1087 first, then the entry of this branch, before the v1.1.0
entries.

Git merged four other files with no conflict:

- Cargo.lock: #1087 adds crc32fast to the dependencies of
  extenddb-storage, and this branch adds form_urlencoded and tempfile to
  the dependencies of extenddb-storage-sqlite.
- crates/storage-sqlite/Cargo.toml: #1087 rewrites the comments of
  libsqlite3-sys and sqlite-wasm-rs. This branch adds form_urlencoded
  and the tempfile dev-dependency.
- crates/storage-sqlite/src/lib.rs: #1087 declares the
  scan_segment_tests module, and this branch declares file_mode and
  sqlite_uri.
- crates/storage-sqlite/src/store.rs: #1087 registers
  extenddb_scan_segment on each connection of the pool, in
  after_connect. This branch calls file_mode::prepare before the pool
  connects, and it removes the mode change after the connect. The pool
  keeps the after_connect of main.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, four commits past db8a90d: #1466, #1087, #768
and #1296. #1087 adds its v1.2.0 entry to
docs/manuals/07-upgrade-manual.md after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries.

Git merged two other files with no conflict:

- crates/storage-mongodb/src/data_engine.rs: #1087 computes the
  parallel Scan segment with scan_segment in scan_key_in_segment and in
  scan_impl. This branch changes the TransactWriteItems functions at
  other lines.
- crates/storage/src/lib.rs: #1087 rewrites the doc comment of
  scan_key_in_segment, and this branch adds the transact exports.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 44a7b79, six commits past c8e66fb: #1446, #1531, #1466,
#1087, #768 and #1296. In docs/manuals/07-upgrade-manual.md, #1446 and
#1531 add v1.2.0 entries at the top of "Behavior Changes by Release",
and git merged them with no conflict. #1087 adds its v1.2.0 entry after
the other v1.2.0 entries of main, where this branch has its entry. That
is the one conflict. The merge keeps both entries without change: the
entry of #1087 first, then the entry of this branch, before the v1.1.0
entries. No other file has changes on both sides.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
…-time

The merge takes f583547, the last head of #1093 before main merged
it as 1e2ebdd. The last merge took b8f73c4. Since then, #1093
merged main at 1174651, eight PRs past db8a90d: #1466, #1087,
#768, #1296, #1485, #1228, #1325 and #1443. Git merged without a
conflict. Two files of this branch have changes on both sides:

- crates/storage/src/util/mod.rs: #1087 declares and exports
  scan_segment, and this branch declares and exports throughput.
- docs/differences-from-dynamodb.md: #1443 changes the
  control_plane_delay_seconds default to 0.25 in two rows, and this
  branch adds the LastIncreaseDateTime row to the Control Plane table.
LeeroyHannigan added a commit that referenced this pull request Dec 4, 2026
Main is at 1e2ebdd, ten commits past db8a90d: #1466, #1087,
#768, #1296, #1485, #1228, #1325, #1443, #1269 and the squash commit
of #1093.

One file conflicted: docs/manuals/07-upgrade-manual.md. #1093 adds its
v1.2.0 entry at the top of "Behavior Changes by Release", where this
branch has its entry. The merge keeps both entries without change. The
entry of this branch stays first. The entry of #1093 comes next, above
the other v1.2.0 entries of main. #1087 adds its entry after the other
v1.2.0 entries of main, and git merged it with no conflict.

Git merged four other files with no conflict:

- crates/core/src/validation/mod.rs: #1228 adds the pattern clause for
  an empty value in validate_name_member. This branch declares the
  table_name_length module near the top of the file.
- crates/server/src/table_name_gate.rs: #1296 adds has_no_table_member
  and an arm of check_table_name_chars for the six operations that have
  no table member. This branch checks none of those operations.
- crates/wasm-adapter/parity/corpus.json: #1087 adds a Scan case, and
  #1228 changes the text of a ListBackups case. This branch changes
  other cases.
- docs/manuals/10-security-model.md: #1325 adds the
  Content-Security-Policy line of the console. This branch changes the
  line on the requests that get an answer before the IAM decision.
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