Skip to content

chore: remove dynamic-parameters experiment #18290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 12, 2025

Conversation

jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Jun 9, 2025

No description provided.

@jaaydenh jaaydenh self-assigned this Jun 9, 2025
jaaydenh and others added 5 commits June 9, 2025 14:47
- Regenerated TypeScript types to remove dynamic-parameters experiment
- Updated useDynamicParametersOptOut hook to always return optedOut: true
  since the experiment was removed
- This fixes test failures related to dynamic parameters functionality

Co-authored-by: jaaydenh <1858163+jaaydenh@users.noreply.github.com>
Copy link
Contributor

blink-so bot commented Jun 10, 2025

Fix for Test Failures

I've identified and fixed the test failures in this PR. The issues were:

1. TestPatchTemplateMeta/ClassicParameterFlow

The test was expecting UseClassicParameterFlow to be false by default, but the new migration (000334_dynamic_parameters_opt_out.up.sql) sets it to true. I updated the test assertion to expect the correct default value.

2. TestDynamicParametersWithTerraformValues/RebuildParameters

The test was expecting dynamic parameters to work, but with use_classic_parameter_flow now defaulting to true, dynamic parameters are disabled by default. I updated the test setup to explicitly enable dynamic parameters by setting UseClassicParameterFlow to false for the test templates.

Changes Made:

  • Updated coderd/templates_test.go line 1550 to expect true instead of false
  • Updated coderd/parameters_test.go to explicitly disable classic parameter flow in tests that require dynamic parameters
  • Fixed variable shadowing issues introduced by the changes

The fix has been pushed to a separate branch: https://github.com/coder/coder/tree/pr-18290

These changes ensure the tests align with the new default behavior where templates opt out of dynamic parameters by default.

@jaaydenh jaaydenh requested a review from Emyrk June 11, 2025 09:39
@@ -249,6 +249,7 @@ func TestDynamicParametersWithTerraformValues(t *testing.T) {
Value: "GO",
},
}
request.EnableDynamicParameters = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really set the template to dynamic params, because we are going to drop this field soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it here: 414801d

Comment on lines 1044 to 1067
func (b *Builder) usingDynamicParameters() bool {
vals, err := b.getTemplateTerraformValues()
if b.dynamicParametersEnabled != nil {
return *b.dynamicParametersEnabled
}

tpl, err := b.getTemplate()
if err != nil {
return false // Let another part of the code get this error
}
if tpl.UseClassicParameterFlow {
return false
}

if !ProvisionerVersionSupportsDynamicParameters(vals.ProvisionerdVersion) {
vals, err := b.getTemplateTerraformValues()
if err != nil {
return false
}

if b.dynamicParametersEnabled != nil {
return *b.dynamicParametersEnabled
if !ProvisionerVersionSupportsDynamicParameters(vals.ProvisionerdVersion) {
return false
}

tpl, err := b.getTemplate()
if err != nil {
return false // Let another part of the code get this error
}
return !tpl.UseClassicParameterFlow
return true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jaaydenh jaaydenh marked this pull request as ready for review June 11, 2025 20:24
@coder coder deleted a comment from blink-so bot Jun 12, 2025
@jaaydenh jaaydenh requested a review from Emyrk June 12, 2025 12:00
@jaaydenh jaaydenh merged commit f126931 into main Jun 12, 2025
86 of 91 checks passed
@jaaydenh jaaydenh deleted the jaaydenh/remove-dynamic-params-experiment branch June 12, 2025 16:15
@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants