Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e211f4

Browse files
committed
chore: remove per request dynamic parameters opt in and rely on template
When in experimental this was used as an escape hatch. Removed to be consistent with the template author's intentions
1 parent 4f52076 commit 3e211f4

File tree

5 files changed

+4
-29
lines changed

5 files changed

+4
-29
lines changed

coderd/workspacebuilds.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,6 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
385385
builder = builder.State(createBuild.ProvisionerState)
386386
}
387387

388-
if createBuild.EnableDynamicParameters != nil {
389-
builder = builder.DynamicParameters(*createBuild.EnableDynamicParameters)
390-
}
391-
392388
workspaceBuild, provisionerJob, provisionerDaemons, err = builder.Build(
393389
ctx,
394390
tx,

coderd/workspaces.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,6 @@ func createWorkspace(
717717
builder = builder.MarkPrebuiltWorkspaceClaim()
718718
}
719719

720-
if req.EnableDynamicParameters {
721-
builder = builder.DynamicParameters(req.EnableDynamicParameters)
722-
}
723-
724720
workspaceBuild, provisionerJob, provisionerDaemons, err = builder.Build(
725721
ctx,
726722
db,

coderd/wsbuilder/wsbuilder.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ type Builder struct {
5757
deploymentValues *codersdk.DeploymentValues
5858
experiments codersdk.Experiments
5959

60-
richParameterValues []codersdk.WorkspaceBuildParameter
61-
// dynamicParametersEnabled is non-nil if set externally
62-
dynamicParametersEnabled *bool
63-
initiator uuid.UUID
64-
reason database.BuildReason
65-
templateVersionPresetID uuid.UUID
60+
richParameterValues []codersdk.WorkspaceBuildParameter
61+
initiator uuid.UUID
62+
reason database.BuildReason
63+
templateVersionPresetID uuid.UUID
6664

6765
// used during build, makes function arguments less verbose
6866
ctx context.Context
@@ -204,12 +202,6 @@ func (b Builder) MarkPrebuiltWorkspaceClaim() Builder {
204202
return b
205203
}
206204

207-
func (b Builder) DynamicParameters(using bool) Builder {
208-
// nolint: revive
209-
b.dynamicParametersEnabled = ptr.Ref(using)
210-
return b
211-
}
212-
213205
// SetLastWorkspaceBuildInTx prepopulates the Builder's cache with the last workspace build. This allows us
214206
// to avoid a repeated database query when the Builder's caller also needs the workspace build, e.g. auto-start &
215207
// auto-stop.
@@ -1211,10 +1203,6 @@ func (b *Builder) checkRunningBuild() error {
12111203
}
12121204

12131205
func (b *Builder) usingDynamicParameters() bool {
1214-
if b.dynamicParametersEnabled != nil {
1215-
return *b.dynamicParametersEnabled
1216-
}
1217-
12181206
tpl, err := b.getTemplate()
12191207
if err != nil {
12201208
return false // Let another part of the code get this error

codersdk/organizations.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ type CreateWorkspaceRequest struct {
227227
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`
228228
AutomaticUpdates AutomaticUpdates `json:"automatic_updates,omitempty"`
229229
TemplateVersionPresetID uuid.UUID `json:"template_version_preset_id,omitempty" format:"uuid"`
230-
EnableDynamicParameters bool `json:"enable_dynamic_parameters,omitempty"`
231230
}
232231

233232
func (c *Client) OrganizationByName(ctx context.Context, name string) (Organization, error) {

codersdk/workspaces.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ type CreateWorkspaceBuildRequest struct {
110110
LogLevel ProvisionerLogLevel `json:"log_level,omitempty" validate:"omitempty,oneof=debug"`
111111
// TemplateVersionPresetID is the ID of the template version preset to use for the build.
112112
TemplateVersionPresetID uuid.UUID `json:"template_version_preset_id,omitempty" format:"uuid"`
113-
// EnableDynamicParameters skips some of the static parameter checking.
114-
// It will default to whatever the template has marked as the default experience.
115-
// Requires the "dynamic-experiment" to be used.
116-
EnableDynamicParameters *bool `json:"enable_dynamic_parameters,omitempty"`
117113
}
118114

119115
type WorkspaceOptions struct {

0 commit comments

Comments
 (0)