-
Notifications
You must be signed in to change notification settings - Fork 925
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ab677c2
to
6a480d0
Compare
46d2751
to
635c56b
Compare
3522bb0
to
24b830b
Compare
24b830b
to
1991e91
Compare
1991e91
to
95aacbf
Compare
077e337
to
d7398d9
Compare
2889dac
to
0a26d90
Compare
d7398d9
to
353f193
Compare
0a26d90
to
ff6d2de
Compare
353f193
to
2a37b9b
Compare
81d451c
to
9ae5ec8
Compare
9bc40dd
to
0e3dc00
Compare
a51570a
to
4f52076
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!
// 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)) | ||
} |
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
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
to
ff96e32
Compare
1d27539
to
ac9d0e6
Compare
ba8cf59
to
c1d05a0
Compare
1e1cb20
to
cb43418
Compare
c1d05a0
to
129235b
Compare
cb43418
to
a908ce6
Compare
129235b
to
6a5ee9e
Compare
Validation to occur in coder/coder inside wsbuilder for all dynamic parameters.
a908ce6
to
7254c08
Compare
6a5ee9e
to
0523a2f
Compare
f4e5548
to
0523a2f
Compare
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