Skip to content

test(migrate): prove every native capability row runs without a rewrite - #221

Open
aparajon wants to merge 8 commits into
mainfrom
armand/no-rewrite-claims-proven
Open

aparajon wants to merge 8 commits into
mainfrom
armand/no-rewrite-claims-proven

Conversation

@aparajon

@aparajon aparajon commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Why

docs/capabilities.md is the public promise of what pg-sprite runs in place. A row that says migrate executes a change natively also claims the table is not rewritten. Until now that claim was checked one class at a time, as in #196, so a wrong row could stand until someone hit it. The array type-change and domain bugs were both that kind of gap.

What

  • A new integration test takes each capability row whose migrate door executes natively, runs statements of that row's shape through migrate.Run, and fails if any table in the fixture schema got a new filenode.
  • A coverage test fails when a natively executed row has neither cases nor a stated reason a filenode cannot speak to it. A row added later fails CI until someone classifies it.
  • The partitioned-parent foreign key is supported from PostgreSQL 18. On older servers the test requires its typed refusal instead.

It reads the matrix as corrected by #188, which marks the rows migrate refuses (attach, detach, drop index, reindex) as refused.

🤖 Generated with Claude Code

Kiran01bm and others added 5 commits October 17, 2026 09:10
The matrix published attach/detach partition and drop/reindex as
migrate-supported, but migrate refuses all four. A guard test now runs
every migrate-supported row through migrate.Run.
Keep drop-index as refused by migrate and fold in main's replica-identity
refusals in its notes and in limitations; regenerate the capabilities page
from the merged matrix.
Regenerate the capabilities page from the merged matrix, which now also
carries main's add-column rewrite rows.
Test that every migrate: refused row refuses with its published reason, fix the two
drifted tokens, and drop stale supported claims. Document --force, dry-run and diff
caveats for attach/detach/drop-index, and define the ❌ mark uniformly.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The completeness guard accepts empty case lists and exemption reasons, allowing classifications without coverage or explanation.

1 open issue
What changed in this PR

Adds capability-driven integration coverage to verify that native schema changes preserve table storage, and corrects partition-operation support claims.

Changes:

  • Tests native capability rows through migrate.Run using before-and-after filenodes.
  • Adds a completeness guard for test cases and exemptions.
  • Marks partition attach and detach as planned rather than supported.
File Description
pkg/​migrate/​no_rewrite_integration_test.go Adds native-operation tests and coverage checks.
pkg/​capabilities/​capabilities.yaml Corrects partition-operation statuses and refusal details.
docs/​capabilities.md Updates the generated matrix and support totals.

Review effort: Balanced

Comment thread pkg/migrate/no_rewrite_integration_test.go
@aparajon
aparajon force-pushed the armand/no-rewrite-claims-proven branch from 807f850 to 96c78b9 Compare October 17, 2026 06:14
Each capability row whose imperative front door executes natively claims
the change leaves the table's storage in place. A new integration test
runs statements of every such row's shape through migrate.Run and fails
if any table in the fixture schema gets a new filenode, and a coverage
test fails when a natively executed row has no cases or exemption.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aparajon
aparajon changed the base branch from main to kiran01bm/fix-capabilities-refused-rows October 17, 2026 06:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from kiran01bm/fix-capabilities-refused-rows to main October 17, 2026 06:42
…ims-proven

# Conflicts:
#	docs/capabilities.md
#	pkg/capabilities/capabilities.yaml
@aparajon
aparajon marked this pull request as ready for review October 17, 2026 18:59
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.

3 participants