Susana Ferreira
734299de71
fix: disallow lifecycle endpoints for prebuilt workspaces ( #19264 )
...
## Description
This PR updates the API to prevent lifecycle configuration endpoints
from being used on prebuilt workspaces. Since prebuilds are managed by
the reconciliation loop and do not participate in the regular workspace
lifecycle, they must not support per-workspace overrides for fields like
deadline, TTL, autostart, or dormancy.
Attempting to use these endpoints on a prebuilt workspace will now
return a clear validation error (`409 Conflict`) with an appropriate
explanation. This prevents accidental misconfiguration and preserves the
lifecycle separation between prebuilds and regular workspaces.
## Changes
The following endpoints now return an error if the target workspace is a
prebuild:
* `PUT /workspaces/{workspace}/extend`
* `PUT /workspaces/{workspace}/ttl`
* `PUT /workspaces/{workspace}/autostart`
* `PUT /workspaces/{workspace}/dormant`
Update endpoints logic to use the API clock in order to allow time
mocking in tests.
Related with:
* Issue: https://github.com/coder/coder/issues/18898
* PR: https://github.com/coder/coder/pull/19252
2025-08-14 11:30:19 +01:00
..
2025-07-15 14:36:06 +10:00
2025-06-20 13:16:55 -06:00
2025-08-07 15:58:59 -04:00
2025-06-20 13:16:55 -06:00
2024-09-18 21:47:53 +10:00
2025-07-15 16:08:42 +10:00
2025-08-13 12:45:46 +01:00
2023-10-30 19:44:29 +00:00
2025-06-20 13:16:55 -06:00
2025-07-31 15:05:09 +00:00
2025-07-15 14:36:06 +10:00
2025-05-27 16:05:03 +04:00
2025-08-14 11:32:53 +02:00
2025-06-24 19:01:29 +10:00
2025-07-30 15:28:56 +02:00
2025-04-16 10:37:09 -06:00
2025-06-26 12:28:00 -06:00
2025-07-08 15:46:39 -06:00
2025-06-20 13:16:55 -06:00
2025-07-03 08:33:45 -05:00
2025-08-07 13:58:39 -05:00
2025-06-26 12:28:00 -06:00
2025-06-20 13:16:55 -06:00
2025-06-20 13:16:55 -06:00
2025-08-04 14:11:22 +02:00
2025-06-20 13:16:55 -06:00
2025-08-07 20:05:32 +00:00
2025-07-20 16:22:52 +02:00
2025-05-19 12:05:35 +04:00
2024-05-13 14:37:51 -04:00
2025-08-07 20:05:32 +00:00
2025-08-13 12:45:46 +01:00
2025-08-11 14:48:31 +03:00
2025-06-20 13:16:55 -06:00
2025-08-13 12:45:46 +01:00
2024-07-25 16:08:12 -05:00
2025-06-17 09:00:32 -08:00
2025-03-18 00:02:47 +01:00
2025-08-07 15:58:59 -04:00
2025-06-20 13:16:55 -06:00
2025-07-08 14:31:05 +00:00
2025-08-07 11:00:31 +10:00
2025-08-06 11:45:07 -05:00
2025-06-26 15:54:52 +02:00
2025-07-21 13:02:31 -05:00
2025-06-20 13:16:55 -06:00
2025-07-08 14:32:46 +00:00
2025-06-20 13:16:55 -06:00
2025-07-29 15:24:11 +01:00
2025-06-26 12:28:00 -06:00
2025-07-30 13:42:39 -07:00
2025-06-20 13:16:55 -06:00
2025-07-30 19:09:53 -05:00
2025-03-31 10:55:44 -04:00
2024-11-18 14:09:22 +04:00
2025-08-12 11:23:55 +01:00
2025-08-12 11:23:55 +01:00
2025-06-06 17:36:30 +02:00
2025-06-06 17:36:30 +02:00
2024-08-01 12:07:19 -05:00
2025-07-15 16:08:42 +10:00
2025-07-15 14:55:34 +10:00
2025-06-20 13:16:55 -06:00
2025-06-16 13:40:45 +00:00
2025-06-20 13:16:55 -06:00
2025-01-08 15:38:37 +00:00
2025-08-12 11:23:55 +01:00
2025-04-09 09:21:17 +01:00
2025-04-09 09:21:17 +01:00
2024-02-27 16:33:32 +00:00
2025-06-25 13:03:32 +00:00
2024-06-11 12:22:59 +10:00
2025-04-22 16:21:15 +00:00
2025-06-24 09:14:41 +01:00
2025-05-15 15:32:52 +01:00
2024-09-10 15:58:50 +01:00
2025-07-30 13:55:30 -07:00
2025-07-30 13:55:30 -07:00
2025-05-15 15:32:52 +01:00
2025-05-15 15:32:52 +01:00
2025-06-20 13:16:55 -06:00
2025-06-20 13:16:55 -06:00
2025-06-12 13:50:50 +03:00
2025-06-20 13:16:55 -06:00
2025-07-28 20:41:49 -05:00
2025-03-26 01:56:39 -05:00
2025-08-04 14:11:22 +02:00
2025-04-28 14:51:33 -06:00
2025-08-08 12:18:07 +01:00
2025-03-05 22:43:18 +01:00
2025-03-05 22:43:18 +01:00
2025-07-03 18:33:47 +02:00
2025-07-02 19:14:54 +02:00
2025-07-03 18:33:47 +02:00
2025-07-03 18:33:47 +02:00
2025-07-03 20:41:47 +02:00
2025-07-20 16:22:52 +02:00
2024-07-25 16:07:53 -05:00
2024-08-28 13:24:28 -05:00
2025-07-15 14:55:34 +10:00
2025-07-15 14:55:34 +10:00
2025-07-28 20:41:49 -05:00
2025-06-20 13:00:39 -05:00
2025-06-24 12:19:19 +02:00
2025-07-28 15:02:26 +01:00
2025-02-26 21:06:51 +02:00
2025-02-18 14:14:30 +00:00
2025-06-20 13:16:55 -06:00
2025-05-19 16:05:39 +01:00
2025-07-30 19:09:53 -05:00
2024-07-25 16:07:53 -05:00
2025-06-16 13:40:45 +00:00
2025-06-20 13:16:55 -06:00
2025-07-17 20:17:44 +10:00
2025-08-12 11:37:44 -05:00
2025-08-12 11:37:44 -05:00
2025-07-30 15:28:56 +02:00
2025-07-30 19:09:53 -05:00
2025-06-20 13:16:55 -06:00
2025-06-20 13:16:55 -06:00
2025-04-08 14:15:14 -05:00
2025-08-07 16:31:27 +10:00
2025-08-11 12:20:02 -07:00
2025-03-27 10:03:53 +00:00
2025-03-27 10:03:53 +00:00
2024-10-22 09:20:54 -05:00
2025-06-18 14:07:53 +00:00
2025-07-14 21:35:35 +01:00
2025-07-29 15:24:11 +01:00
2025-04-16 10:37:09 -06:00
2025-05-20 17:07:50 +02:00
2025-08-07 13:58:39 -05:00
2025-06-20 13:16:55 -06:00
2024-10-25 17:14:35 +01:00
2025-07-22 13:11:27 +02:00
2025-07-22 13:11:27 +02:00
2024-01-18 09:44:05 -06:00
2024-01-18 09:44:05 -06:00
2025-02-20 05:09:26 +00:00
2025-08-07 17:09:46 -06:00
2025-08-14 11:30:19 +01:00
2025-04-16 10:37:09 -06:00
2025-03-26 01:56:39 -05:00