fix(github): remove dead MySQL DROP INDEX guidance from plan comments - #1223
Draft
aparajon wants to merge 1 commit into
Draft
fix(github): remove dead MySQL DROP INDEX guidance from plan comments#1223aparajon wants to merge 1 commit into
aparajon wants to merge 1 commit into
Conversation
Spirit's unsafe classification treats index drops as safe (no data loss), so unsafe-change reasons never contain a "DROP INDEX" fragment; index drops surface through the invisible_index_before_drop linter, whose message carries no such fragment either. The plan-comment guidance branch keyed off counting "DROP INDEX" in unsafe reasons was therefore reachable only from a hand-written preview fixture, never from a real plan. Remove the guidance branch, its unsafeDropIndexUsageTargets helper, the Drop Index Blocked preview scenario, and the tests asserting the guidance. The DROP COLUMN / DROP TABLE application-usage guidance is unchanged, and keeps a rendered-output test of its own. TEMPLATES.md is regenerated; the regen also picks up the cancelled-shard glyph from an earlier change that had not been regenerated into the file. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes unreachable “DROP INDEX” destructive-drop guidance from the GitHub plan/blocked-unsafe comment rendering, along with the associated preview scenario and tests, because real unsafe-change reasons do not include DROP INDEX.
Changes:
- Removed the dead
DROP INDEXguidance branch and helper (unsafeDropIndexUsageTargets) from the plan comment renderer; simplifiedwriteUnsafeWarning/writeUnsafeDropGuidancesignatures accordingly. - Removed the “Drop Index Blocked” preview scenario and all CLI preview registrations for it.
- Regenerated
TEMPLATES.mdto drop the removed scenario and to reflect the updated cancelled-shard glyph.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TEMPLATES.md | Removes the “Drop Index Blocked” rendered template; updates cancelled glyph rendering in regenerated output. |
| pkg/webhook/templates/preview.go | Deletes the PreviewCommentDropIndexBlocked fixture. |
| pkg/webhook/templates/plan.go | Removes dead drop-index guidance logic; simplifies unsafe-warning/guidance helpers and call sites. |
| pkg/webhook/templates/apply_test.go | Deletes tests for removed drop-index guidance; keeps drop-column guidance test. |
| pkg/webhook/templates/apply_commands.go | Updates call to writeUnsafeDropGuidance after signature change. |
| pkg/cmd/internal/templates/preview.go | Removes the comment_drop_index_blocked preview type constant. |
| pkg/cmd/internal/templates/preview_dispatch.go | Removes CLI dispatch case for the deleted drop-index preview. |
| pkg/cmd/internal/templates/preview_comment.go | Removes the drop-index preview from “preview all comment templates” output lists. |
| pkg/cmd/commands/preview.go | Removes the drop-index preview from the supported preview set and help text. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Spirit's unsafe classification treats index drops as safe (no data loss), so unsafe-change reasons never contain a "DROP INDEX" fragment — index drops surface through the
invisible_index_before_droplinter, whose message carries no such fragment either. That made the plan-comment guidance branch keyed off counting "DROP INDEX" in unsafe reasons reachable only from a hand-written preview fixture, never from a real plan.unsafeDropIndexUsageTargetshelper from the plan-comment renderer;writeUnsafeWarning/writeUnsafeDropGuidancedrop their now-unusedisMySQLparameter.Drop Column Blocked (guidance that remains, unchanged)
Schema Change Plan — Staging
Database:
testapp| Type:MySQL| Schema Name:testappRequested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from
abcdef1📋 Plan: 1 table to alter
⛔ Apply rejected: 1 unsafe change detected
customers: Unsafe operation detected: DROP COLUMNnicknameDestructive drop guidance:
Before allowing a destructive drop, first deploy application code that no longer reads from or writes to the dropped column.
🚨 To proceed with these destructive changes, re-run with
--allow-unsafe:This PR was written by Claude Code (Claude Fable 5).
🤖 Generated with Claude Code