feat: mark prebuilds as such and set their preset ids (#16965)

This pull request closes https://github.com/coder/internal/issues/513
This commit is contained in:
Sas Swart
2025-04-14 15:34:50 +02:00
committed by GitHub
parent 73f5af82ad
commit a98605913a
24 changed files with 613 additions and 315 deletions
+3 -2
View File
@@ -217,8 +217,9 @@ type CreateWorkspaceRequest struct {
TTLMillis *int64 `json:"ttl_ms,omitempty"`
// RichParameterValues allows for additional parameters to be provided
// during the initial provision.
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`
AutomaticUpdates AutomaticUpdates `json:"automatic_updates,omitempty"`
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`
AutomaticUpdates AutomaticUpdates `json:"automatic_updates,omitempty"`
TemplateVersionPresetID uuid.UUID `json:"template_version_preset_id,omitempty" format:"uuid"`
}
func (c *Client) OrganizationByName(ctx context.Context, name string) (Organization, error) {
+1
View File
@@ -73,6 +73,7 @@ type WorkspaceBuild struct {
Status WorkspaceStatus `json:"status" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted"`
DailyCost int32 `json:"daily_cost"`
MatchedProvisioners *MatchedProvisioners `json:"matched_provisioners,omitempty"`
TemplateVersionPresetID *uuid.UUID `json:"template_version_preset_id" format:"uuid"`
}
// WorkspaceResource describes resources used to create a workspace, for instance:
+2
View File
@@ -107,6 +107,8 @@ type CreateWorkspaceBuildRequest struct {
// Log level changes the default logging verbosity of a provider ("info" if empty).
LogLevel ProvisionerLogLevel `json:"log_level,omitempty" validate:"omitempty,oneof=debug"`
// TemplateVersionPresetID is the ID of the template version preset to use for the build.
TemplateVersionPresetID uuid.UUID `json:"template_version_preset_id,omitempty" format:"uuid"`
}
type WorkspaceOptions struct {