Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate findings block approval, with three documentation nits outstanding.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a consolidated MySQL/Spirit guide covering primary-key tradeoffs and progress behavior, with supporting animation assets and plan-comment links.
Changes:
- Adds Spirit documentation, animation sources, and cross-references.
- Links primary-key findings to guidance in plan comments.
- Consolidates progress documentation and updates tests/templates.
Review findings:
- Moderate (3 votes): Rollback comments do not populate
HasPrimaryKeyFindings. - Moderate (3 votes): The animation renderer uses a macOS-only Chrome path by default.
- Nits: Correct the Spirit URL, progress label, and canonical collation example.
File summaries
| File | Summary |
|---|---|
TEMPLATES.md |
Updates rendered plan guidance. |
scripts/render-spirit-primary-keys.cjs |
Generates the primary-key animation. |
README.md |
Links to the Spirit guide. |
pkg/webhook/templates/rollback.go |
Adds rollback guidance rendering. |
pkg/webhook/templates/preview.go |
Updates preview lint metadata. |
pkg/webhook/templates/plan.go |
Renders primary-key guidance. |
pkg/webhook/templates/lint_test.go |
Tests guidance visibility and folding. |
pkg/webhook/plan.go |
Detects primary-key findings. |
pkg/webhook/plan_test.go |
Tests finding detection and error handling. |
docs/spirit.md |
Adds the consolidated Spirit guide. |
docs/spirit_progress.md |
Redirects to the consolidated guide. |
docs/lint-and-safety-levels.md |
Links primary-key guidance. |
docs/engines.md |
Updates Spirit documentation links. |
docs/architecture.md |
Updates the progress documentation reference. |
docs/.toc-manifest |
Registers the consolidated guide. |
assets/src/spirit-primary-keys.html |
Defines the animation source. |
assets/src/README-spirit-primary-keys.md |
Documents animation generation. |
Review details
Suppressed comments (3)
docs/engines.md:24
- The
Built oncolumn now links to SchemaBot's guide rather than the Spirit dependency; unlike the other rows, it no longer takes the reader to the engine this column names. Keep the upstream Spirit URL here and link the new guide separately.
| Spirit | MySQL | [Spirit](spirit.md) |
docs/spirit.md:434
- The estimate-exceeded renderer does not label rows
Active: the standard CLI/TUI path defaults toFinalizing copy(pkg/cmd/internal/templates/progress.go:247), and the PR renderer uses the same label. This example therefore does not match the user-visible output; change the label toFinalizing copy.
docs/spirit.md:54 - This copyable
CREATE TABLEexample usesutf8mb4_0900_bin, but the repository's canonical Spirit-compatibleSHOW CREATE TABLEformat usesutf8mb4_0900_ai_ci(as required by the schema conventions and the other SQL examples). Keep the guide's example in that canonical format.
- Files reviewed: 17/18 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1376, ed540df. Non-blockingRollback comment can show a "Related guidance" link with no matching finding text. rollback.go:43 calls The guidance sweep missed General suggestionsThe The one thing that could have broken, verifiedGuide ordering could have varied with environment or finding order, making the comment non-deterministic across re-plans. It does not: Verified correct
This review was generated by Claude Code (claude-opus-5). |
A comment linked a guide for every rule the plan carried, whether or not it showed the finding behind it. On the rollback comment, which renders the lint fold and no unsafe section, an error-severity finding arrived as a bare "Related guidance" link with nothing above it naming the rule. The apply-blocked comment had the opposite gap: it shows the error findings as the unsafe changes --allow-unsafe consents to, and linked no guide for them at the moment the operator decides. Each comment now passes the rules it discloses, so a link and the text that explains it travel together. The apply-blocked comment also carries the lint fold its own doc comment already promised. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1376, 52bf243. Re-review of the delta only: Verdict: 2 findings — 0 blocking, 2 non-blocking (stale doc comment + dead write on the rollback path). Non-blockingThe
The one thing that could have broken, verifiedRemoving the Verified correct
This review was generated by Claude Code (claude-opus-5). |
…t use The rollback comment shows the lint fold and no unsafe section, so it links guides for the rules its warnings name. Collecting every severity's rule IDs on that path fed nothing, and the doc comment above the builder promised a guidance path for error-severity rules that no longer exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1376, de858ca. Re-review of the delta only: Verdict: clean — approve. The one thing that could have broken, verifiedDropping the Verified correct
This review was generated by Claude Code (claude-opus-5). |
|
🤖 Both addressed in The doc comment did state the opposite of the code. The Thanks for walking the Replied by Claude Code (claude-opus-5). |
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1376, 33092bf. Re-review of the delta only: Verdict: 1 finding — 1 non-blocking (engine-gated guidance link). Non-blockingThe The one thing that could have broken, verifiedThe Verified correct
This review was generated by Claude Code (claude-opus-5). |
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1376, 15906af. Verdict: 2 findings — both general suggestions (CLI sweep gap, renderer error handling). General suggestionsThe CLI plan output was left out of the guidance sweep. The The one thing that could have broken, verified
Verified correct
This review was generated by Claude Code (claude-opus-5). |
morgo
left a comment
There was a problem hiding this comment.
🤖 Approving on Morgan's behalf (agent review).
Reviewed the whole PR at bdea57a0, not just the delta since @Kiran01bm's approval (I had not reviewed this one before). The delta since 15906af9 is docs/mysql.md +5/-2: narrowing the native-DDL claim to "for a single-table ALTER, Spirit first tries instant DDL, then its supported subset of native in-place operations", and adding the talk link. Both accurate.
The invariant this PR rests on holds. The claim is "link a lint guide only where the finding is shown". Traced it rather than taking it on faith:
rename_columnisErrorseverity inblock/spirit(pkg/lint/lint_rename_column.go);primary_keyiswarning. So the registry exercises both severity paths.pkg/engine/spirit/spirit.go:589setschange.IsUnsafe = trueon the same change the error-severity violations were attached to, so an error-severity finding always materialises as anUnsafeChange— it cannot be inLintRuleNameswithout the unsafe section showing it.RenderPlanCommentgates both the unsafe section and the lint fold on!IsLocked, anddisclosesEverySeverity()returns an empty scope onIsLocked. Consistent.writeEnvironmentPlanSectionrenders both sections unconditionally, andbuildPlanCommentDatanever setsIsLocked, so the multi-env and unsafe-blocked paths are consistent too.- Rollback correctly uses
disclosesNonErrorsOnly(): that comment has no unsafe section, sorename_columngets no link there. - The
totalChanges == 0early returns can't strand a link — lint findings attach to planned changes, so zero changes implies zero findings.
Docs verified, not assumed:
docs/mysql.md:90## Choosing a primary keyanddocs/pre-merge-workflow.md:304### Renaming a column or tableboth exist, and slugify to the anchors the guides point at.https://www.youtube.com/watch?v=-d-NOzKZxdIresolves to "MySQL Belgian Days 2024 - Introducing Spirit by Morgan Tocker". Right video.- The
docs/spirit_progress.mddeletion (-447) is fully accounted for, not lost: all 11 architecture headings relocated under#### Spirit progress architectureindocs/architecture.md(demoted one level), and the TUI rendering reference relocated intodocs/mysql.md.docs/.toc-manifestswaps the two correctly and there are no dangling references to the old path anywhere at this head.
CI at bdea57a0: 41/41 SUCCESS, no failures and no cancelled-run phantoms.
Two nits, neither blocking:
-
pkg/webhook/templates/plan.go:1603— the new guidance loop testsdata.Errors[env] == ""(value emptiness) while the render branch immediately above at :1585 testserrMsg, hasErr := data.Errors[env](key presence), as does the pre-existing :1792. They diverge only if an empty-string error is ever stored; all three writers go throughuserFacingError(err)on a non-nil error, so it's unreachable today. Matching the existing predicate would keep the two in lockstep by construction. -
The
IsLockedshort-circuit lives insidedisclosesEverySeverity(), butRenderUnsafeChangesBlockedcallswriteLintViolationswith noIsLockedgate of its own. Inert now (buildPlanCommentDatanever setsIsLocked), but a future caller that did would render findings with the guidance silently dropped — the one direction the registry's design is trying to rule out.
One observation, no action needed: the guide URLs are absolute against blob/main, so they only resolve once this merges. Expected for the merge-to-main flow; just means a build deployed from this branch would 404 those links.
No github.com/squareup/ references in any added line — public-repo separation clean.
Why
Primary key lint findings need a clear path to understanding the tradeoffs. MySQL users also need practical progress guidance without reading engine internals.
What
docs/mysql.mdfor primary key choices, why index adds copy the table, and progress displays; move implementation details intodocs/architecture.mdHow
primary_keyrename_columnMap lint rule IDs to guides in a shared registry. Collect findings across severities and environments, then show each guide once outside collapsed findings. Preserve rule IDs in rollback plans too.
Risk
Low risk: changes affect documentation, comment rendering, and the GIF renderer. Schema execution, lint severity, and approval requirements are unchanged.
Testing
Inspected the workflow GIFs at copy, interruption, recovery, and cutover boundaries. Regenerated the plan previews below. Smoke-tested the renderer's Chrome launch options with default channel discovery and an explicit
CHROMEpath on macOS; both passed.Choosing an execution path
Table-copy lifecycle
SchemaBot orchestration and Spirit checkpoint recovery
Primary key animation
Existing varchar primary key: advisory warning
Schema Change Plan — Staging
Database:
testapp| Type:MySQL| Schema Name:testappRequested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from
abcdef1💡 Lint Warnings: 1 advisory finding
customers: Primary key columnidhas typevarchar📖 Related guidance:
📋 Plan: 1 table to alter
New varchar primary key: issue requiring acknowledgement
Schema Change Plan — Staging
Database:
testapp| Type:MySQL| Schema Name:testappRequested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from
abcdef1customers: Primary key columnidhas typevarchar📖 Related guidance:
📋 Plan: 1 table to create
Aggregated guidance: six warnings and one issue, two guides
Schema Change Plan — Staging
Database:
testapp| Type:MySQL| Schema Name:testappRequested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from
abcdef1users: Column rename detected in tableusers:emailtoemail_address. Renaming a column cannot be done atomically across application pods, and ORMs that generate column names at compile time (e.g. jOOQ) will break until code is recompiled💡 Lint Warnings: 6 advisory findings
customersidhas typevarcharordersidhas typevarcharinvoicesidhas typevarcharshipmentsidhas typevarcharsessionsidhas typevarchareventsidhas typevarchar📖 Related guidance:
📋 Plan: 7 tables to alter
Apply blocked for unsafe changes: the findings and their guides, above the flag
📋 Plan: 2 tables to alter
💡 Lint Warnings: 1 advisory finding
orders: Columncreated_atusesTIMESTAMPwhich overflows on 2038-01-19. Consider usingDATETIMEinstead.📖 Related guidance:
⛔ Apply rejected: 3 unsafe changes detected
orders: Primary key columnidhas typeintorders: Columncreated_atusesTIMESTAMPwhich overflows on 2038-01-19. Consider usingDATETIMEinstead.users: Column rename detected in tableusers:emailtoemail_address. Renaming a column cannot be done atomically across application pods, and ORMs that generate column names at compile time (e.g. jOOQ) will break until code is recompiled🚨 To proceed with these destructive changes, re-run with
--allow-unsafe:A rollback comment renders the lint fold and no unsafe section, so its error-severity findings go unshown there and their guides stay unlinked rather than arriving as a link with nothing above it naming the rule.
Bigger picture
Keep engine guides useful for everyday work, with architecture deep dives and upstream references one click away. Additional lint rules can share guides without repeating links.
Generated with Codex