Skip to content

fix(cli): remove prompt for immutable parameters on start and restart #9173

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

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Aug 18, 2023

Fixes: #9171

@mtojek mtojek self-assigned this Aug 18, 2023
@mtojek mtojek changed the title fix(cli): do not ask for immutable parameters on start and restart fix(cli): remove prompt for immutable parameters on start and restart Aug 18, 2023
@mtojek mtojek requested a review from mafredri August 18, 2023 12:03
@mtojek mtojek marked this pull request as ready for review August 18, 2023 12:03
@mtojek mtojek merged commit 669ae9d into main Aug 18, 2023
@mtojek mtojek deleted the 9171-bug branch August 18, 2023 12:06
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2023
tvp.Required ||
(action == WorkspaceCreate && tvp.Required) ||
(action == WorkspaceCreate && !tvp.Ephemeral) ||
(action == WorkspaceUpdate && tvp.Required) ||
Copy link
Member

Choose a reason for hiding this comment

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

Do we need something like && (tvp.Ephemeral || tvp.Mutable) here?

Copy link
Member Author

Choose a reason for hiding this comment

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

tvp.Ephemeral is included in tvp.Ephemeral && pr.promptBuildOptions

Regarding tvp.Mutable, it depends on the action:

  • WorkspaceCreate: does not matter, we ask for every parameter*
  • WorkspaceUpdate: skip immutables unless they are used for the first time
  • WorkspaceStart and WorkspaceRestart: skip immutables

*- we need to check also conditions for ephemerals

BTW if you spot any weird parameter condition, please let me know. I will adjust the logic and embrace with unit tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coder CLI asking for input on immutable parameters, resulting in start/restart from CLI being broken
3 participants