- Notifications
You must be signed in to change notification settings - Fork924
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
base:stevenmasley/sequential_query
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Emyrk 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.
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.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
ab677c2
to6a480d0
Compare46d2751
to635c56b
Compare3522bb0
to24b830b
Compare24b830b
to1991e91
Compare1991e91
to95aacbf
Compare2889dac
to0a26d90
Compared7398d9
to353f193
Compare0a26d90
toff6d2de
Compare353f193
to2a37b9b
Compare81d451c
to9ae5ec8
Comparea7699f5
tof861c42
Compare1eb6528
to0e0829b
Compare"github.com/coder/coder/v2/coderd/dynamicparameters" | ||
) | ||
funcTestProvisionerVersionSupportsDynamicParameters(t*testing.T) { |
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.
This test is just moved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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 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
File | Description |
---|---|
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.go | Updated Build calls to pass file cache and adjust dynamic parameter rendering in workspace builds. |
Various testdata files and util/slice | Added new parameter test cases and utility functions. |
cli/server.go, autobuild/* | Integrated file cache into executor and server components. |
Uh oh!
There was an error while loading.Please reload this page.
b65001e
to852b282
Comparef861c42
to1d27539
Compare9bc40dd
to0e3dc00
Comparea51570a
to4f52076
Compare@@ -35,6 +36,7 @@ type Executor struct { | |||
ctx context.Context | |||
db database.Store | |||
ps pubsub.Pubsub | |||
fileCache*files.Cache |
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.
TIL this is a thing!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
// 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)) | ||
} |
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.
follow-up issue?
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.
I'll do you one better:#18501
Just trying to break out some of the diffs
Uh oh!
There was an error while loading.Please reload this page.
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, |
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.
Nice 👍
4f52076
toff96e32
Compare1d27539
toac9d0e6
Compareba8cf59
toc1d05a0
Compare1e1cb20
tocb43418
CompareValidation to occur in coder/coder inside wsbuilder for all dynamicparameters.
c1d05a0
to129235b
Compare
Uh oh!
There was an error while loading.Please reload this page.
What does this do?
This does parameter validation for dynamic parameters in
wsbuilder
. All input parameters are validated incoder/coder
before being sent to terraform.The heart of this PR is
ResolveParameters
.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