- Notifications
You must be signed in to change notification settings - Fork1.1k
chore: set wsbuilder to use preview parameters#18474
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
6122995 tob5002b0CompareEmyrk commentedJun 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
b5002b0 to46d2751Compare46d2751 to635c56bCompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR updates the workspace builder to use the richerpreviewtypes.Parameter for dynamic parameter validation and adjusts related conversion and diagnostics logic.
- Switched
Builderto load and convert frompreviewtypes.Parameterinstead ofdatabase.TemplateVersionParameter - Appended default‐value diagnostics in the static loader
- Added preview→SDK conversion helpers in
db2sdk
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| coderd/wsbuilder/wsbuilder.go | Replaced DB parameter types withpreviewtypes.Parameter and updated conversion calls |
| coderd/dynamicparameters/static.go | Injected default‐value diagnostics and removed inline diagnostics in conversion fn |
| coderd/database/db2sdk/db2sdk.go | AddedTemplateVersionParameterFromPreview and related option converter |
Comments suppressed due to low confidence (2)
coderd/database/db2sdk/db2sdk.go:100
- Add unit tests covering
TemplateVersionParameterFromPreview, especially around different validation rules and option conversions.
func TemplateVersionParameterFromPreview(param previewtypes.Parameter) (codersdk.TemplateVersionParameter, error) {coderd/dynamicparameters/static.go:145
- The per-parameter conversion no longer appends validation diagnostics; consider restoring or centralizing that step to ensure non-default validations are captured.
_, param.FormType, _ = provider.ValidateFormType(provider.OptionType(param.Type), len(param.Options), param.FormType)Uh oh!
There was an error while loading.Please reload this page.
635c56b tob7985e3CompareDynamic parameter validation relies on the preview parameter types.These types have more information than the database. So convertingfrom `db -> preview` is lossless. The other way around is not
b7985e3 to467aca3Compare659b787 intomainUh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
Use richer
previewtypes.Parameterforwsbuilder. This is a pre-requirement to adding dynamic parameter validation.The richer type contains more information than the
dbparameter, so the conversion is lossless.Note: This just pulls out some of the diff of the larger PR in the stack