Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Emyrk merged 1 commit intomainfromstevenmasley/parameters_to_preview
Jun 23, 2025

Conversation

@Emyrk
Copy link
Member

@EmyrkEmyrk commentedJun 20, 2025
edited
Loading

Use richerpreviewtypes.Parameter forwsbuilder. This is a pre-requirement to adding dynamic parameter validation.

The richer type contains more information than thedb parameter, so the conversion is lossless.

Note: This just pulls out some of the diff of the larger PR in the stack

@EmyrkEmyrkforce-pushed thestevenmasley/parameters_to_preview branch 2 times, most recently from6122995 tob5002b0CompareJune 20, 2025 16:09
@EmyrkGraphite App
Copy link
MemberAuthor

Emyrk commentedJun 20, 2025
edited
Loading

Base automatically changed fromstevenmasley/dynamic_param_pkg tomainJune 20, 2025 18:00
@EmyrkEmyrkforce-pushed thestevenmasley/parameters_to_preview branch fromb5002b0 to46d2751CompareJune 20, 2025 18:30
@EmyrkEmyrkforce-pushed thestevenmasley/parameters_to_preview branch from46d2751 to635c56bCompareJune 22, 2025 01:03
@EmyrkEmyrk changed the titlechore: wsbuilder to use preview parameterschore: set wsbuilder to use preview parametersJun 23, 2025
@EmyrkEmyrk requested a review fromCopilotJune 23, 2025 06:02
Copy link
Contributor

CopilotAI left a 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.

  • SwitchedBuilder to load and convert frompreviewtypes.Parameter instead ofdatabase.TemplateVersionParameter
  • Appended default‐value diagnostics in the static loader
  • Added preview→SDK conversion helpers indb2sdk

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
coderd/wsbuilder/wsbuilder.goReplaced DB parameter types withpreviewtypes.Parameter and updated conversion calls
coderd/dynamicparameters/static.goInjected default‐value diagnostics and removed inline diagnostics in conversion fn
coderd/database/db2sdk/db2sdk.goAddedTemplateVersionParameterFromPreview and related option converter
Comments suppressed due to low confidence (2)

coderd/database/db2sdk/db2sdk.go:100

  • Add unit tests coveringTemplateVersionParameterFromPreview, 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)

@EmyrkEmyrkforce-pushed thestevenmasley/parameters_to_preview branch from635c56b tob7985e3CompareJune 23, 2025 06:07
Dynamic 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
@EmyrkEmyrk merged commit659b787 intomainJun 23, 2025
30 checks passed
@EmyrkEmyrk deleted the stevenmasley/parameters_to_preview branchJune 23, 2025 16:31
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 23, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

Copilot code reviewCopilotCopilot left review comments

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@EmyrkEmyrk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Emyrk@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp