Rehearses the parallel-column exit - #124
Merged
Merged
Conversation
A new test file walks the migrate-from-cloak guide's parallel-column exit on the runbook's integrations table, one describe block per "Parallel step" 0 to 8, each asserting what that section says the host sees: the census and the old-column format query, the vault error at an unprovisioned workspace's own row, the dual write, the dry run, write and verify output through the mix tasks, the cut-over read and the pinned column after the drop. It reuses the fixtures the parallel plan test added; nothing is duplicated. The in-place walk gains step 0 and step 1 blocks and loses nothing. Walking step 3 found the guide inexact: an update writes the pair of the field it changes, not both columns of the row, and a stale pair is invisible to the pass and to verification. The guide's Expected and If-it-differs lines now say so, and the walk asserts both. Test and guide only; no library change and no fragment. Refs: ece-6ler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rehearses the migrate-from-cloak guide's parallel-column exit end to end, and adds steps 0 and 1 to the in-place walk.
What changes
test/encryptor/ecto/runbook_parallel_walk_test.exs(new): one describe block per "Parallel step" 0 to 8 of the guide, against the runbook's integrations table and its three<field>_encryptedpairs, each test asserting what that section says the host sees:{:raised, Encryptor.Ecto.EncryptError}, and the same dry run is clean once it is provisioned;NULL, and the step 3 schema reads such a row;mix encryptor.ecto.migrate --mode dry-runoutput, whole, with nothing written; the release task's shape, both vaults started insideEcto.Migrator.with_repo/2;--mode writeoutput, whole, old columns byte for byte, the plan's integrity query before and after; a halted pass and its resume;mix encryptor.ecto.verify --sample allexits 1 before the pass and prints the whole green block after it, with nolegacy_loadevent;"column"is not the one the pass wrote under raisesDecryptErroron a verified row;source:pluscolumn:, and withoutcolumn:the read is refused.test/encryptor/ecto/runbook_test.exs: new "step 0" and "step 1" describe blocks (the pre-pass format census; the unprovisioned workspace's failure at its own row, then clean once provisioned). Additions only: no existing test is removed or reworded.docs/guides/migrate-from-cloak.md, "Parallel step 3": the Expected and If-it-differs lines corrected (see Provenance).The walk reuses the fixtures the parallel plan test added (
ParallelIntegration,CutOverIntegration,ParallelMigrationand the fixture migration with the_encryptedcolumns); the one test-local schema is the step 8 trap, a field renamed back onto the new column withoutcolumn:. It is a sibling file rather than an extension ofrunbook_parallel_test.exsbecause that file is organised by plan-level property and this one by runbook step, as ruled by the operator, 2026-09-29.Provenance
NULLafter an update an uncovered write path; an update writes the pair of each field it changes only, so a field it leaves alone keeps aNULLpair until step 5. It also said an uncovered write path "keeps producing rows step 6 reports"; a stale pair left by a write past the changeset is already in the target state to both the pass andverify/2, so step 6 never reports it. The guide now says both, and the second step 3 test asserts both.lib/change, no record, no changelog fragment (test harness and documentation are excluded bychangelog.d/README.md).Review
Own review against the bead: every describe maps to one "Parallel step" heading, 0 to 8; each quoted output the tests assert (the dry-run, write and verify blocks) is the task's full output compared with
==; the step 0 query is compared toEncryptor.Ecto.Migrator.Census.queries/2's rendered format query; the step 8 pinned field matches the guide'ssource:/column:line. Each new test carries a sabotage note naming a mutation that was applied and turned that test red on an assertion, and the source was restored byte-equal after each.Gate
Full
mix qualitygreen on this tree, database arm included (ECTO_REQUIRE_DATABASE=1):Refs: ece-6ler