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

feat: implement dynamic parameter validation#18482

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/dynamic_validate
Jun 23, 2025

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedJun 20, 2025
edited
Loading

What does this do?

This does parameter validation for dynamic parameters inwsbuilder. All input parameters are validated incoder/coder before being sent to terraform.

The heart of this PR isResolveParameters.

What else changes?

wsbuilder now needs to load the terraform files into memory to succeed. This does add a larger memory requirement to workspace builds.

Future work

  • Sort autostart handling workspaces by template version id. So workspaces with the same template version only load the terraform files once from the db, and store them in the cache.

@EmyrkGraphite App
Copy link
MemberAuthor

Emyrk commentedJun 20, 2025
edited
Loading

@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch fromab677c2 to6a480d0CompareJune 20, 2025 20:25
@EmyrkEmyrkforce-pushed thestevenmasley/parameters_to_preview branch from46d2751 to635c56bCompareJune 22, 2025 01:03
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 7 times, most recently from3522bb0 to24b830bCompareJune 22, 2025 22:47
@EmyrkEmyrk changed the base branch fromstevenmasley/parameters_to_preview tographite-base/18482June 23, 2025 01:39
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch from24b830b to1991e91CompareJune 23, 2025 01:40
@EmyrkEmyrk changed the base branch fromgraphite-base/18482 tostevenmasley/sequential_queryJune 23, 2025 01:40
@EmyrkEmyrk changed the base branch fromstevenmasley/sequential_query tographite-base/18482June 23, 2025 02:47
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch from1991e91 to95aacbfCompareJune 23, 2025 02:47
@EmyrkEmyrkforce-pushed thegraphite-base/18482 branch from077e337 tod7398d9CompareJune 23, 2025 02:47
@EmyrkEmyrk changed the base branch fromgraphite-base/18482 tostevenmasley/deadlock_fetchJune 23, 2025 02:47
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 4 times, most recently from2889dac to0a26d90CompareJune 23, 2025 03:27
@EmyrkEmyrkforce-pushed thestevenmasley/deadlock_fetch branch fromd7398d9 to353f193CompareJune 23, 2025 03:27
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch from0a26d90 toff6d2deCompareJune 23, 2025 03:38
@EmyrkEmyrkforce-pushed thestevenmasley/deadlock_fetch branch from353f193 to2a37b9bCompareJune 23, 2025 03:38
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 2 times, most recently from81d451c to9ae5ec8CompareJune 23, 2025 04:50
@@ -35,6 +36,7 @@ type Executor struct {
ctx context.Context
db database.Store
ps pubsub.Pubsub
fileCache*files.Cache
Copy link
Member

Choose a reason for hiding this comment

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

TIL this is a thing!

Comment on lines +146 to +149
// TODO: Fix the `hcl.Diagnostics(...)` type casting. It should not be needed.
if hcl.Diagnostics(parameter.Diagnostics).HasErrors() {
// All validation errors are raised here.
diags = diags.Extend(hcl.Diagnostics(parameter.Diagnostics))
}
Copy link
Member

Choose a reason for hiding this comment

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

follow-up issue?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll do you one better:#18501

Just trying to break out some of the diffs

johnstcn reacted with heart emoji
Severity: hcl.DiagError,
Summary: "Immutable parameter changed",
Detail: fmt.Sprintf("Parameter %q is not mutable, so it can't be updated after creating a workspace.", parameter.Name),
Subject: src,
Copy link
Member

Choose a reason for hiding this comment

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

Nice 👍

@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch from4f52076 toff96e32CompareJune 23, 2025 16:11
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch from1d27539 toac9d0e6CompareJune 23, 2025 16:32
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 2 times, most recently fromba8cf59 toc1d05a0CompareJune 23, 2025 16:45
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch 3 times, most recently from1e1cb20 tocb43418CompareJune 23, 2025 16:59
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch fromc1d05a0 to129235bCompareJune 23, 2025 16:59
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch fromcb43418 toa908ce6CompareJune 23, 2025 17:04
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch from129235b to6a5ee9eCompareJune 23, 2025 17:04
@EmyrkEmyrk changed the base branch fromstevenmasley/sequential_query tographite-base/18482June 23, 2025 17:17
Validation to occur in coder/coder inside wsbuilder for all dynamicparameters.
@EmyrkEmyrkforce-pushed thegraphite-base/18482 branch froma908ce6 to7254c08CompareJune 23, 2025 17:18
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch from6a5ee9e to0523a2fCompareJune 23, 2025 17:18
@graphite-appgraphite-appbot changed the base branch fromgraphite-base/18482 tomainJune 23, 2025 17:18
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 2 times, most recently fromf4e5548 to0523a2fCompareJune 23, 2025 17:18
@EmyrkEmyrk merged commit82af2e0 intomainJun 23, 2025
50 of 90 checks passed
@EmyrkGraphite App
Copy link
MemberAuthor

Merge activity

@EmyrkEmyrk deleted the stevenmasley/dynamic_validate branchJune 23, 2025 17:35
@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.

2 participants
@Emyrk@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp