-
Notifications
You must be signed in to change notification settings - Fork 925
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6122995
to
b5002b0
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b5002b0
to
46d2751
Compare
46d2751
to
635c56b
Compare
There 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 richer previewtypes.Parameter
for dynamic parameter validation and adjusts related conversion and diagnostics logic.
- Switched
Builder
to load and convert frompreviewtypes.Parameter
instead 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 with previewtypes.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 | Added TemplateVersionParameterFromPreview 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)
635c56b
to
b7985e3
Compare
Dynamic parameter validation relies on the preview parameter types. These types have more information than the database. So converting from `db -> preview` is lossless. The other way around is not
b7985e3
to
467aca3
Compare
Use richer
previewtypes.Parameter
forwsbuilder
. This is a pre-requirement to adding dynamic parameter validation.The richer type contains more information than the
db
parameter, so the conversion is lossless.Note: This just pulls out some of the diff of the larger PR in the stack