Commit 25af21b
authored
feat!: remove has_ai_task and the task build reasons (#29085)
Drops the `has_ai_task` column from `template_versions` and
`workspace_builds` (with its index and view projections) and removes the
three task build reasons (`task_auto_pause`, `task_manual_pause`,
`task_resume`) from the `build_reason` enum. Existing rows are remapped
before the enum swap: automatic pauses become `autostop`, manual pauses
and resumes become `initiator`, and
`workspace_build_orchestrations.child_reason` follows the same mapping.
The query filters, provisionerdserver flag writes, and audit ignore
entries for the column go with it.
**Migration cost:** recreating `build_reason` rewrites
`workspace_builds`. `TestMigration000593TaskBuildReasonRewriteTiming`
seeds 1,000 workspaces, 100,000 builds (30,000 with task reasons) and
5,000 orchestrations and asserts the migration stays under a two-minute
bound; locally it takes about 0.7 to 1.0 s. The test is skipped under
`-short`.
**Breaking change:** the down migration re-adds `has_ai_task` as `false`
and restores the enum values; remapped reasons keep their new values.
**Review changes:** the migration test now asserts only the row remaps
(schema and enum introspection removed per review); renumbered from
000592 to 000593.
**Stack context:** Coder Tasks removal stack (CODAGT-642): #28743
frontend → #28788 CLI → #28789 API → #28790 provisioner → #29084
notifications → **#29085 build reasons** → #29086 tables → #28750
permissions. The last four PRs replace the single data-drop migration
that used to live in #28750; each carries one concern and its own
migration number.
> Created by Xum (AI agent) on behalf of @ibetitsmike.1 parent f809776 commit 25af21b
18 files changed
Lines changed: 516 additions & 179 deletions
File tree
- coderd
- database
- dbauthz
- dbfake
- dbgen
- migrations
- queries
- provisionerdserver
- docs/admin/security
- enterprise/audit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8335 | 8335 | | |
8336 | 8336 | | |
8337 | 8337 | | |
8338 | | - | |
| 8338 | + | |
8339 | 8339 | | |
8340 | 8340 | | |
8341 | 8341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2906 | 2906 | | |
2907 | 2907 | | |
2908 | 2908 | | |
2909 | | - | |
| 2909 | + | |
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
| |||
4453 | 4453 | | |
4454 | 4454 | | |
4455 | 4455 | | |
4456 | | - | |
4457 | 4456 | | |
4458 | 4457 | | |
4459 | 4458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | 300 | | |
308 | 301 | | |
309 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
940 | 939 | | |
941 | 940 | | |
942 | 941 | | |
| |||
971 | 970 | | |
972 | 971 | | |
973 | 972 | | |
974 | | - | |
| 973 | + | |
975 | 974 | | |
976 | 975 | | |
977 | | - | |
978 | 976 | | |
979 | 977 | | |
980 | 978 | | |
| |||
1592 | 1590 | | |
1593 | 1591 | | |
1594 | 1592 | | |
1595 | | - | |
1596 | 1593 | | |
1597 | 1594 | | |
1598 | 1595 | | |
| |||
1614 | 1611 | | |
1615 | 1612 | | |
1616 | 1613 | | |
1617 | | - | |
| 1614 | + | |
1618 | 1615 | | |
1619 | 1616 | | |
1620 | | - | |
1621 | 1617 | | |
1622 | 1618 | | |
1623 | 1619 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
Lines changed: 99 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
0 commit comments