fix(kanban): avoid fragile failure-column renames (salvage #20848) - #20855
Merged
Conversation
- Expand migration comment to name the primary failure mode (missing column OperationalError from #20842) ahead of the secondary SQLite schema-reparse concern; also document the stale-cols-snapshot invariant - Add clarifying comments on from_row() legacy fallback branches noting they are belt-and-suspenders dead code post-migration - Add task_events comment in existing test explaining why the table is required by the migrator - Add test_legacy_migration_no_legacy_columns_at_all: Scenario A — explicitly asserts the exact #20842 crash no longer occurs and that consecutive_failures defaults to 0 on a DB that never had spawn_failures - Add test_legacy_migration_both_columns_already_present: Scenario D — asserts the migration is a no-op when both columns already exist, preserving the existing counter value
kshitijk4poor
force-pushed
the
fix/kanban-20848-salvage
branch
from
May 6, 2026 18:24
b1d11e5 to
7b7967e
Compare
This was referenced May 6, 2026
1 task
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.
Salvage of #20848 by @helix4u onto current
main.What this fixes
After the #20410 update (unified Kanban failure counter), existing users' Kanban dispatcher crashed immediately on startup with:
The #20410 migration used
ALTER TABLE ... RENAME COLUMN spawn_failures TO consecutive_failures. This worked on DBs that hadspawn_failures, but crashed on older installs that never had that column at all. Reported in issue #20842 by @emm3ttarmstrong.This PR replaces the fragile
RENAME COLUMNwith an ADD-first-then-copy approach:ALTER TABLE ADD COLUMN consecutive_failures(safe even ifspawn_failuresnever existed)UPDATE ... SET consecutive_failures = COALESCE(spawn_failures, 0)when the legacy column existsAdditive on top of helix4u's original fix. All four DB shapes are handled:
spawn_failuresonly) — ADD + COPY ✅consecutive_failures) — full no-op ✅Changes from original PR
colssnapshot invariantfrom_row()legacy fallbacks explaining they are belt-and-suspenders dead code post-migrationtask_eventscomment in test fixture explaining why the table is requiredtest_legacy_migration_no_legacy_columns_at_all— explicit Scenario A regression test for the exact Kanban migration fails after update: no such column spawn_failures #20842 crashtest_legacy_migration_both_columns_already_present— Scenario D test asserting migration is a no-op when both columns existTests
162 passed, 1 skipped — up from 160 in the original PR.
Fixes #20842
Closes #20848