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

chore: modify parameter dynamic immutability behavior#18583

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
Emyrk merged 11 commits intomainfromstevenmasley/immutable_original
Jul 9, 2025

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedJun 25, 2025
edited
Loading

Parametermutablity is determined by the current state. So a previouslyimmutable parameter can becomemutable.

Terraform:

data"coder_parameter""isimmutable" {name="isimmutable"type="bool"mutable=truedefault="true"}data"coder_parameter""immutable" {name="immutable"type="string"mutable=data.coder_parameter.isimmutable.value=="false"default="Hello World"}

Trivial Case:

  1. Workspace built withisimmutable = true &immutable = "bar"
  2. Workspace updatesimmutable = foo
    1. Breaks, because you cannot update an immutable value

Immutability source from the past

  1. Workspace built withisimmutable = true &immutable = "bar"
  2. Workspace updatesimmutable = foo &isimmutable = false
    1. This works because at validation time,mutable = true

Why ignore the previous parameter state?

Ignoring previous state is vastly simplier and more intuitive. If the previous parametermutability affected the current build, then questions such as, "What if the last build failed? Do we take the last successful build?", etc.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelJul 3, 2025
@EmyrkEmyrk reopened thisJul 7, 2025
@EmyrkEmyrkforce-pushed thestevenmasley/immutable_original branch fromb12a492 to7e4ef44CompareJuly 7, 2025 15:41
@EmyrkEmyrk marked this pull request as ready for reviewJuly 7, 2025 16:56
@EmyrkEmyrk changed the titlefeat: test parameter immutability validationchore: parameter dynamic immutability behaviorJul 7, 2025
@EmyrkEmyrk changed the titlechore: parameter dynamic immutability behaviorchore: modify parameter dynamic immutability behaviorJul 7, 2025
@EmyrkEmyrk requested a review fromCopilotJuly 7, 2025 17:06
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 updates dynamic parameter immutability so that a parameter’s mutability is determined solely by its current state rather than its prior state.

  • Adds a Terraform test scenario for dynamic immutability intestdata.
  • Introduces two new integration tests (PreviouslyImmutable,PreviouslyMutable) and a unit test (BecameImmutable) to capture dynamic behavior.
  • RefactorsResolveParameters to drop the oldoriginalValues map and usepreviousValuesMap directly when validating immutability.

Reviewed Changes

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

FileDescription
enterprise/coderd/testdata/parameters/dynamicimmutable/main.tfAdds Terraform snippet for dynamic immutability testing.
enterprise/coderd/dynamicparameters_test.goAdds integration tests covering parameters that flip mutability.
coderd/dynamicparameters/resolver_test.goAdds a unit test for a parameter transitioning from mutable to immutable.
coderd/dynamicparameters/resolver.goRemoves theoriginalValues cache and usespreviousValuesMap for immutability checks.

@EmyrkEmyrk requested a review fromaslilacJuly 7, 2025 17:10
@EmyrkEmyrk marked this pull request as draftJuly 7, 2025 17:17
@EmyrkEmyrk removed the request for review fromaslilacJuly 7, 2025 17:17
@github-actionsgithub-actionsbot removed the staleThis issue is like stale bread. labelJul 8, 2025
@EmyrkEmyrk marked this pull request as ready for reviewJuly 8, 2025 15:26
@EmyrkEmyrk requested a review fromaslilacJuly 8, 2025 15:27
@EmyrkEmyrk merged commit00ba027 intomainJul 9, 2025
36 checks passed
@EmyrkEmyrk deleted the stevenmasley/immutable_original branchJuly 9, 2025 14:45
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 9, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

Copilot code reviewCopilotCopilot left review comments

@aslilacaslilacaslilac 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@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp