fix(api): seed default Cancelled state in the "cancelled" group#350
fix(api): seed default Cancelled state in the "cancelled" group#350cavidelizade wants to merge 1 commit into
Conversation
The default Cancelled state was seeded with the group "canceled" (one L) while the rest of the app matches on "cancelled" (two L). For every new project that made auto-close a silent no-op, kept cancelled issues out of auto-archive, and mis-bucketed them as backlog in cycle/module/epic progress, and it made cancelled issues read as open in open/closed filters. Fix the seed and add migration 000013 to correct existing rows. A test now asserts every default state uses a group in validStateGroups so this class of typo can't come back. Closes Devlaner#333 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe default Cancelled workflow state now uses the canonical ChangesCancelled state group correction
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The default "Cancelled" state was seeded with the group
"canceled"(one L) while the rest of the backend matches on"cancelled"(two L). Since it's the default for every new project, several things quietly broke.Linked issues
Closes #333
Type of change
fix:)Surface
apps/api/)apps/api/migrations/)What changed
state.go: seed the default Cancelled state with group"cancelled".000013:UPDATE states SET "group" = 'cancelled' WHERE "group" = 'canceled'to fix existing projects. The down migration is a documented no-op (reversing a typo fix isn't safe, we can't tell which rows were originally mistyped).TestDefaultProjectStatesUseValidGroups: asserts every default state's group is invalidStateGroups, so this kind of typo fails the build next time.What this fixes
With the wrong group, for every new project: auto-close silently did nothing (
CloseInactiveBeforematchesgroup = 'cancelled'), auto-archive skipped cancelled issues, progress charts counted cancelled work as backlog, and open/closed filters treated cancelled issues as open.Test plan
go test ./...green (new test included)go vet ./...cleanNNNNNN_name.{up,down}.sqlconvention and applies as a plain UPDATEAI assistance
Claude Code (Opus 4.8), and AI-assisted commits carry aCo-Authored-By:trailerSummary by CodeRabbit
cancelledvalue.