-
Notifications
You must be signed in to change notification settings - Fork 887
feat(coderd): support ephemeral parameters #8367
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
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.
The change looks good to me, and it appears to open up some very interesting possibilities.
I just have a few nits about naming, but I'm wary about the changes in go.mod
and go.sum
. As far as I can tell, this shouldn't require any dependency changes?
Required: true, | ||
Ephemeral: true, |
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 is an interesting use-case - a required ephemeral value could be the equivalent of a TOS checkbox when building a workspace e.g. "I solemnly swear to not use this workspace for evil. [x]"
go.mod
Outdated
github.com/bep/godartsass/v2 v2.0.0 // indirect | ||
github.com/hashicorp/go-plugin v1.4.4 // indirect | ||
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect | ||
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect | ||
github.com/oklog/run v1.0.0 // indirect |
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.
🤔 Is this related to your change?
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'm concerned too, but if you copy go.mod
and go.sum
from main here, and then run go mod tidy
, this is the result.
EDIT:
Actually it looks the main branch requires go mod tidy
?
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.
Perhaps we should add tidy
as a lint/gen check?
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.
Sounds about right, but rather in a separate PR.
require.Equal(t, "", v) | ||
} | ||
|
||
func TestParameterResolver_ValidateResolve_Ephemeral_RequiredButMissing(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.
What about a case where required = true, but there's also a default value set? Is this possible and should we test it?
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.
Related: #6828
This PR enables support for
ephemeral
parameters on the backend level. The value of an ephemeral parameter is not persisted between workspace builds, and it returns to default. Ephemeral parameters can't be immutable by definition (restricted by the schema in terraform-provider-coder).Follow-up issues/PRs:
ephemeral
parametersephemeral
parameters