coder / coder/terraform-provider-coder

parameter validation errors should happen in the wizard instead of the workspace build

Open
#333 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
60
Forks
27
Avg merge
1d 21h
Merged PRs (30d)
2

Description

Given a parameter with a choice, when creating a Workspace, if the user deletes the default value in the field, in this example from `"0"` to `""`
```tf
data "coder_parameter" "home_data_disk_size" {
type = "number"
name = "Additional Home Data Volume Size"
mutable = true
default = 0
validation {
min = 0
max = 2048
monotonic = "increasing"
}
}
```
You get this error when the Terraform runs:
```console
Error: value "" is not a number
on .terraform/modules/platform_eng/data.tf line 487, in data "coder_parameter" "home_data_disk_size":
487: data "coder_parameter" "home_data_disk_size" {
```

I believe this should be validated when in the wizard instead. Either that or provide something like a boolean attribute in the `coder_parameter` schema for an option like non_empty

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how coder_parameter validation is defined and how parameter values move from the workspace wizard into the Terraform build. Compare the current handling of an empty value with the requested early validation, then identify the relevant tests or entry points. Done means the behavior and validation location are resolved for empty values, including whether a schema option is needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, terraform
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.