Skip to content

fix(test): repair source-tier migration assertions after v9 landed - #2810

Merged
Sinity merged 1 commit into
masterfrom
fix/migration-test-assertions
Jul 13, 2026
Merged

Sinity merged 1 commit into
masterfrom
fix/migration-test-assertions

Conversation

@Sinity

@Sinity Sinity commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Repairs 3 failing source-tier durable migration tests on master, introduced
by an incomplete fix-forward during merge-conductor rebase work on PR #2800.

Problem

PR #2794 (origin-interop) claimed source-tier migration slot 008 for
capture_mode. PR #2800 (beads-ingest) also numbered its own migration
008, requiring a rebase to renumber it to 009 (and preserve the
capture_mode column through the copy-forward rebuild it performs). The
test-file edits accompanying that rebase were made to the working tree
after the rebase commit but never actually git added/committed, so
PR #2800 merged without them. master currently fails:

  • test_source_tier_v2_migrates_to_v3_dropping_pending_blob_refs
  • test_source_tier_v3_adds_publication_reservations_with_verified_backup_receipt
  • test_source_tier_v7_expands_origin_checks_with_verified_backup

Solution

  • Updated the two applied_versions/to_version literal assertions to
    include migration 9 (was pinned to the old 8-step chain).
  • test_source_tier_v7_expands_origin_checks_with_verified_backup relied on
    the workspace_env fixture's ArchiveStore pre-creating source.db at
    the current schema (already including capture_mode, since
    CREATE TABLE IF NOT EXISTS silently no-ops against it) before the test's
    own stripped-down "v7" DDL ever ran. Under a forced PRAGMA user_version=7 stamp, migration 8's ALTER TABLE ADD COLUMN capture_mode
    then hit a real duplicate column name error. Added
    db_path.unlink(missing_ok=True) before the executescript, matching the
    pattern _create_source_v1 already uses in the same file for the same
    fixture.

Verification

  • devtools test tests/unit/storage/test_durable_migrations.py — 33 passed.
  • devtools verify --quick — 15/15 checks green.

Problem: PR #2800 (beads-ingest) added durable source-tier migration 009
(after PR #2794 claimed slot 008 for capture_mode first, requiring a
merge-conductor rebase to renumber). The rebase's fix-forward edits to
tests/unit/storage/test_durable_migrations.py were made to the working
tree after the rebase commit but never actually committed, so PR #2800
merged without them — leaving master with 3 failing migration tests:

- test_source_tier_v2_migrates_to_v3_dropping_pending_blob_refs and
  test_source_tier_v3_adds_publication_reservations_with_verified_backup_receipt
  asserted the old 8-step applied_versions tuple instead of the current
  9-step chain.
- test_source_tier_v7_expands_origin_checks_with_verified_backup relied on
  the workspace_env fixture's ArchiveStore pre-creating source.db at the
  CURRENT schema (already including capture_mode via CREATE TABLE IF NOT
  EXISTS no-op), so its stripped-down "v7" DDL was silently never applied
  and migration 8's ALTER TABLE ADD COLUMN capture_mode hit a real
  duplicate-column error under a forced PRAGMA user_version=7 stamp.

What changed: updated the two applied_versions/to_version literals to
include version 9, and added db_path.unlink(missing_ok=True) before the
v7 test's executescript, matching the pattern _create_source_v1 already
uses in the same file for the same fixture.

Verification: devtools test tests/unit/storage/test_durable_migrations.py
-> 33 passed. devtools verify --quick -> 15/15 checks green.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8ebadc5d-09e3-4806-8219-bf0e86d9cad6

📥 Commits

Reviewing files that changed from the base of the PR and between b0dc23e and efb9dd0.

📒 Files selected for processing (1)
  • tests/unit/storage/test_durable_migrations.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/migration-test-assertions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit 98f6125 into master Jul 13, 2026
3 of 12 checks passed
@Sinity
Sinity deleted the fix/migration-test-assertions branch July 13, 2026 00:11
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.

1 participant