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

Open
Emyrk wants to merge1 commit intostevenmasley/sequential_query
base:stevenmasley/sequential_query
Choose a base branch
Loading
fromstevenmasley/dynamic_validate

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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stackon Graphite.
Learn more

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@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
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch froma7699f5 tof861c42CompareJune 23, 2025 06:07
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 5 times, most recently from1eb6528 to0e0829bCompareJune 23, 2025 12:28
"github.com/coder/coder/v2/coderd/dynamicparameters"
)

funcTestProvisionerVersionSupportsDynamicParameters(t*testing.T) {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This test is just moved

@EmyrkEmyrk requested a review fromCopilotJune 23, 2025 13:28
Copy link
Contributor

@CopilotCopilotAI 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 implements dynamic parameter validation for workspaces and updates various components to integrate file caching when loading terraform files. Key changes include modifications in dynamic parameter resolution logic, updates to tests and builders to pass a new file cache object, and corresponding adjustments in prebuild reconciler and lifecycle executor.

Reviewed Changes

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

Show a summary per file
FileDescription
enterprise/coderd/*Updated tests for dynamic parameter validation and added mutable flag tests.
coderd/dynamicparameters/*Added new dynamic parameter resolver and renderer with updates for immutable/ephemeral behavior.
coderd/wsbuilder/*, workspacebuilds.go, workspaces.goUpdated Build calls to pass file cache and adjust dynamic parameter rendering in workspace builds.
Various testdata files and util/sliceAdded new parameter test cases and utility functions.
cli/server.go, autobuild/*Integrated file cache into executor and server components.

@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch fromb65001e to852b282CompareJune 23, 2025 13:39
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch fromf861c42 to1d27539CompareJune 23, 2025 13:43
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 3 times, most recently from9bc40dd to0e3dc00CompareJune 23, 2025 14:23
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch 2 times, most recently froma51570a to4f52076CompareJune 23, 2025 15:20
@@ -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.
ifhcl.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
Validation to occur in coder/coder inside wsbuilder for all dynamicparameters.
@EmyrkEmyrkforce-pushed thestevenmasley/dynamic_validate branch fromc1d05a0 to129235bCompareJune 23, 2025 16:59
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
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