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(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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 23 commits intomainfrom6828-support-ephemeral-parameters
Jul 10, 2023

Conversation

mtojek
Copy link
Member

@mtojekmtojek commentedJul 7, 2023
edited
Loading

Related:#6828

This PR enables support forephemeral 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 interraform-provider-coder).

data"coder_parameter""force-rebuild" {name="force-rebuild"type="bool"display_name="Force rebuild"description="Rebuild the project code"default="false"mutable=trueephemeral=true}

Follow-up issues/PRs:

  • CLI support forephemeral parameters
  • Adjust site to supportephemeral parameters

@mtojekmtojek self-assigned thisJul 7, 2023
@mtojekmtojek marked this pull request as ready for reviewJuly 10, 2023 10:50
Copy link
Member

@johnstcnjohnstcn left a 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 ingo.mod andgo.sum. As far as I can tell, this shouldn't require any dependency changes?

mtojek reacted with thumbs up emoji
Comment on lines +335 to +336
Required: true,
Ephemeral: true,
Copy link
Member

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]"

mtojek reacted with laugh emoji
go.mod Outdated
Comment on lines 362 to 366
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
Copy link
Member

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?

Copy link
MemberAuthor

@mtojekmtojekJul 10, 2023
edited
Loading

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 copygo.mod andgo.sum from main here, and then rungo mod tidy, this is the result.

EDIT:

Actually it looks the main branch requiresgo mod tidy?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should addtidy as a lint/gen check?

johnstcn reacted with thumbs up emoji
Copy link
MemberAuthor

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.

johnstcn reacted with thumbs up emoji
@mtojekmtojek mentioned this pull requestJul 10, 2023
require.Equal(t, "", v)
}

func TestParameterResolver_ValidateResolve_Ephemeral_RequiredButMissing(t *testing.T) {
Copy link
Member

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?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It is not possible asrequired is a computed property, the opposite ofoptional, convertedhere.

mafredri reacted with thumbs up emoji
@mtojekmtojek merged commit9f2a931 intomainJul 10, 2023
@mtojekmtojek deleted the 6828-support-ephemeral-parameters branchJuly 10, 2023 11:44
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 10, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mtojekmtojek

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mtojek@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp