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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Pr suggestions
  • Loading branch information
Emyrk committed May 14, 2025
commit 155f2cffad8eb1f4b28a2e2658c44f7d71d4957e
10 changes: 5 additions & 5 deletions coderd/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,24 @@ func (api *API) getWorkspaceOwnerData(
// returns a warning diagnostic. Only versions 1.5+ return the module & plan data
// required.
func parameterProvisionerVersionDiagnostic(tf database.TemplateVersionTerraformValue) hcl.Diagnostics {
missingMetaData := hcl.Diagnostic{
missingMetadata := hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "This template version is missing required metadata to support dynamic parameters. Go back to the classic creation flow.",
Copy link
Member

Choose a reason for hiding this comment

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

hmm. I don't like this. I would much prefer if we could have a way to expose this naturally to the frontend, forcing it over to the classic form. why make everyone click the "dynamic parameters suck" button? that's a super bad first impression

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, it is unfortunate. I want to get this in first, just to get an error up if someone toggles on dev and get this detection in. I will build on this experience.

We just need something now, otherwise it fails silently.

Detail: "To restore full functionality, please re-import the terraform as a new template version.",
}

if tf.ProvisionerdVersion == "" {
return hcl.Diagnostics{&missingMetaData}
return hcl.Diagnostics{&missingMetadata}
}

major, minor, err := apiversion.Parse(tf.ProvisionerdVersion)
if err != nil || tf.ProvisionerdVersion == "" {
return hcl.Diagnostics{&missingMetaData}
return hcl.Diagnostics{&missingMetadata}
} else if major < 1 || (major == 1 && minor < 5) {
missingMetaData.Detail = "This template version requires provisioner v1.5 or newer to support dynamic parameters. " +
missingMetadata.Detail = "This template version does not support dynamic parameters. " +
"Some options may be missing or incorrect. " +
"Please contact an administrator to update the provisioner and re-import the template version."
return hcl.Diagnostics{&missingMetaData}
return hcl.Diagnostics{&missingMetadata}
}

return nil
Expand Down
Loading