test: kitchen-sink round-trip fixture + 2 new fidelity-gap TODOs#87
Conversation
Second item from the PR #84 postmortem audit. One YAML fixture exercising as many supported attributes as fit in a small schema: init = desired = full schema (no-op apply), verify_no_drift: true confirms the catalog read → parser model round-trip closes for every attribute combination at once. Coverage matrix the fixture pins: - column: PK / AUTO_INCREMENT / NOT NULL / DEFAULT literal / DEFAULT CURRENT_TIMESTAMP / ON UPDATE / COMMENT / INVISIBLE / STORED GENERATED / VIRTUAL GENERATED equivalent - inline column-level UNIQUE - table-level CHECK with default ENFORCED - index: PRIMARY / UNIQUE with COMMENT / KEY with prefix length INVISIBLE / FULLTEXT with COMMENT - foreign key: ON DELETE CASCADE - table options: ENGINE / DEFAULT CHARSET / COLLATE / COMMENT - partitioning: RANGE with three partitions - views: simple SELECT and view with column alias list Two open round-trip drifts surfaced during the work and went into TODO.md instead of the fixture (so the kitchen-sink stays green and pins what does work): - inline column-level `REFERENCES` auto-names the FK `<table>_ibfk_<col>` while MySQL uses `<table>_ibfk_<n>`. The fixture uses an explicit named CONSTRAINT to side-step the drift. - generated-column expressions back-tick vitess-keyword identifiers (e.g. `name` becomes `` `name` ``) which the catalog round-trips but the parser doesn't, so a column called `name` referenced inside a STORED expression drifts forever. The fixture renames the column. Both drifts are now their own follow-up items. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
=======================================
Coverage 86.66% 86.66%
=======================================
Files 30 30
Lines 3277 3277
=======================================
Hits 2840 2840
Misses 269 269
Partials 168 168 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a comprehensive “kitchen-sink” apply fixture to exercise many MySQL DDL attributes in a single no-op round-trip test, and documents two newly discovered round-trip fidelity gaps in TODO.md from the PR #84 audit.
Changes:
- Add
testdata/apply/kitchen_sink_round_trip.yml, a no-opinit == desiredfixture withverify_no_drift: true. - Add two new fidelity-gap items to
TODO.md(inlineREFERENCESFK auto-naming drift; generated-column expression backtick drift with vitess keywords).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| TODO.md | Adds two newly discovered drift/fidelity-gap TODO items from the kitchen-sink work. |
| testdata/apply/kitchen_sink_round_trip.yml | Introduces a broad-coverage round-trip fixture intended to catch attribute-interaction regressions via verify_no_drift. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Five doc/comment accuracy nits, all valid:
- TODO.md "Generated-column expression drifts" entry had nested
back-ticks (`CONCAT(email, ' ', `name`)`) which closes the
Markdown code span early and breaks rendering. Switch to a
double-backtick code span so the inner literal back-ticks
display correctly.
- kitchen_sink_round_trip.yml's coverage matrix overstated what
the fixture actually pins. Fixed mismatches:
- "VIRTUAL GENERATED" / "per-column COLLATE" / "UNIQUE with
COMMENT" / "RANGE COLUMNS" claimed but not in the DDL.
- View with column alias list claimed to round-trip "clean" but
the alias list isn't compared (existing TODO entry).
Rewrite the matrix to faithfully describe what the DDL exercises
and add an "intentional omissions" footnote that points at
where each non-pinned attribute lives (existing sub-fixtures /
catalog tests / TODO entries). The fixture itself didn't change
shape, only the comments above it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Five of the six items from the PR #84 postmortem audit landed: - composed-state catalog tests → PR #86 - kitchen-sink round-trip → PR #87 - emitter ordering pins → PR #88 - diff cross-cutting → PR #89 - directive composition → PR #90 Drop the closed items. Keep `parseCreateTable` column-loop interactions under "Medium — test coverage gaps" — that one was scoped out of the kitchen-sink because the open shapes (inline `UNIQUE × DEFAULT`, inline `REFERENCES × NOT NULL × ON UPDATE`, inline `PK × column-level CHECK`) need direct parser unit tests, not a round-trip fixture. The kitchen-sink uses `email VARCHAR NOT NULL UNIQUE` (no DEFAULT), an explicit named CONSTRAINT FK (not inline REFERENCES), and a table-level CHECK (not the column-level shape that exercises the vitess promotion path), so the gap is real. The "Medium — silent diffs / fidelity gaps" section keeps the real open items, including the three new ones surfaced by the audit itself (REFERENCES auto-name, vitess-keyword identifier drift, CHECK referencing renamed column). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Second item from the PR #84 postmortem audit (TODO.md "Medium — test coverage audit", item 6). One YAML fixture exercising as many supported attributes as fit in a small schema:
init = desired = full schema(no-op apply),verify_no_drift: trueconfirms the catalog read → parser model round-trip closes for every attribute combination at once. Highest single-test ROI per the audit estimate.Coverage matrix the fixture pins:
Two open drifts surfaced and added to TODO.md
The first iteration of the fixture caught two real round-trip drifts that are independent open issues. They went into
TODO.mdinstead of the fixture (so the kitchen-sink stays green and pins what does work):REFERENCESauto-names the FK<table>_ibfk_<col>(parser side) while MySQL uses<table>_ibfk_<n>(catalog side). Every plan emits a redundant ADD CONSTRAINT. Workaround: explicit named CONSTRAINT (what the fixture uses now).CONCAT(email, ' ', name)round-trips asCONCAT(email, ' ',``name``)becausenameis in vitess's keyword list. Catalog stores the back-ticked form, parser doesn't. Workaround: rename the column to a non-keyword identifier.Test plan
make lintclean.make testall six packages green; new fixture rounds-trips clean against MySQL 8.0.namecolumn and inlineREFERENCES) intentionally failed — confirmed both drifts before adjusting the fixture and filing the TODO entries.🤖 Generated with Claude Code