- Notifications
You must be signed in to change notification settings - Fork1.1k
Commit8567ecb
authored
fix: set prebuilds lifecycle parameters on creation and claim (#19252)
## DescriptionThis PR ensures that prebuilt workspaces are properly excluded from thelifecycle executor and treated as a separate class of workspaces, fullymanaged by the prebuild reconciliation loop.It introduces two lifecycle guarantees:* When a prebuilt workspace is created (i.e., when the workspace buildcompletes), all lifecycle-related fields are unset, ensuring theworkspace does not participate in TTL, autostop, autostart, dormancy, orauto-deletion logic.* When a prebuilt workspace is claimed, it transitions into a regularuser workspace. At this point, all lifecycle fields are correctlypopulated according to template-level configurations, allowing theworkspace to be managed by the lifecycle executor as expected.## Changes* Prebuilt workspaces now have all lifecycle-relevant fields unsetduring creation* When a prebuild is claimed:* Lifecycle fields are set based on template and workspace levelconfigurations. This ensures a clean transition into the standardworkspace lifecycle flow.* Updated lifecycle-related SQL update queries to explicitly excludeprebuilt workspaces.## Relates Related issue:#18898To reduce the scope of this PR and make the review process moremanageable, the original implementation has been split into thefollowing focused PRs:*#19259*#19263*#19264*#19265These PRs should be considered in conjunction with this one tounderstand the complete set of lifecycle separation changes for prebuiltworkspaces.1 parentf17ab92 commit8567ecb
File tree
14 files changed
+485
-303
lines changed- coderd
- autobuild
- database
- dbgen
- queries
- prebuilds
- provisionerdserver
- enterprise/coderd
- prebuilds
- schedule
14 files changed
+485
-303
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | | - | |
| 1254 | + | |
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1263 | 1271 | | |
1264 | 1272 | | |
1265 | 1273 | | |
| |||
1269 | 1277 | | |
1270 | 1278 | | |
1271 | 1279 | | |
1272 | | - | |
| 1280 | + | |
1273 | 1281 | | |
1274 | 1282 | | |
1275 | 1283 | | |
| |||
1336 | 1344 | | |
1337 | 1345 | | |
1338 | 1346 | | |
1339 | | - | |
| 1347 | + | |
1340 | 1348 | | |
1341 | 1349 | | |
1342 | 1350 | | |
| |||
1353 | 1361 | | |
1354 | 1362 | | |
1355 | 1363 | | |
1356 | | - | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
1357 | 1373 | | |
1358 | 1374 | | |
1359 | 1375 | | |
| |||
1374 | 1390 | | |
1375 | 1391 | | |
1376 | 1392 | | |
1377 | | - | |
| 1393 | + | |
1378 | 1394 | | |
1379 | 1395 | | |
1380 | 1396 | | |
| |||
1486 | 1502 | | |
1487 | 1503 | | |
1488 | 1504 | | |
1489 | | - | |
1490 | | - | |
| 1505 | + | |
| 1506 | + | |
1491 | 1507 | | |
1492 | 1508 | | |
1493 | 1509 | | |
| |||
1524 | 1540 | | |
1525 | 1541 | | |
1526 | 1542 | | |
1527 | | - | |
| 1543 | + | |
1528 | 1544 | | |
| 1545 | + | |
1529 | 1546 | | |
1530 | 1547 | | |
1531 | 1548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1436 | 1436 | | |
1437 | 1437 | | |
1438 | 1438 | | |
1439 | | - | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1440 | 1450 | | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1444 | 1458 | | |
1445 | 1459 | | |
1446 | 1460 | | |
| |||
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | 20 | | |
8 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
522 | 526 | | |
523 | 527 | | |
524 | 528 | | |
525 | 529 | | |
526 | 530 | | |
527 | 531 | | |
528 | 532 | | |
529 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
| |||
550 | 558 | | |
551 | 559 | | |
552 | 560 | | |
553 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
554 | 566 | | |
555 | 567 | | |
556 | 568 | | |
557 | | - | |
| 569 | + | |
558 | 570 | | |
559 | | - | |
| 571 | + | |
560 | 572 | | |
561 | | - | |
| 573 | + | |
562 | 574 | | |
563 | 575 | | |
564 | 576 | | |
| |||
791 | 803 | | |
792 | 804 | | |
793 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
794 | 810 | | |
795 | 811 | | |
796 | 812 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
58 | 69 | | |
59 | 70 | | |
0 commit comments
Comments
(0)