Repository navigation
ci(release): add devtools/freeze-migrations - #1466
Conversation
1c9f7fd to
e787960
Compare
fd44cee to
ad3f616
Compare
e787960 to
894cd08
Compare
ad3f616 to
a82b895
Compare
894cd08 to
3b94c94
Compare
a82b895 to
85b663f
Compare
3b94c94 to
48b2cb6
Compare
85b663f to
39288eb
Compare
LeeroyHannigan
left a comment
There was a problem hiding this comment.
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.1refused the breaking migration and wrote nothing.--release-version 1.1.0wrote 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
Fakereports 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 offreeze-migrationskept only the last backend's set, no test would fail. A--release-version 1.1.1with migration 12 unfrozen would then freeze it. A case where onlymongodbreports 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 fromcheck-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.
The base branch was changed.
LeeroyHannigan
left a comment
There was a problem hiding this comment.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
…-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.
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.
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'sRELEASEDtable 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'sthe_released_bodies_match_their_checksumstest prints (CONTRIBUTING.md, "Adding a catalog migration", step 7). That has been done by hand.The script:
RELEASEDtable, runscargo fmton the four crates, and runs the four tests again;It reads the registry with
read_registry()fromdevtools/check-released-through, which it loads as a module, so the registry patterns and their messages exist once.check-released-throughprints the same output as before.With
--release-version X.Y.Zit refuses to freeze a breaking migration in a patch release from 1.0 on, whichdocs/versioning.mdforbids, and says to release X.Y+1.0 instead, with aRelease-Asfooter at the end of the message of a commit merged tomain. 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
RELEASEDentries removed), the script refuses--release-version 1.0.1without writing anything, and with1.1.0it 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
cargo test --workspace): not run; the four checksum tests pass, and the devtools unit tests passcargo fmt --check): no Rust changecargo clippy -- -W clippy::pedantic): no Rust changeStoragetrait, auth model, on-diskformat, 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.