Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rich parameters: remove old parameters #6075

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

Closed
4 tasks done
mtojek opened this issue Feb 7, 2023 · 4 comments
Closed
4 tasks done

Rich parameters: remove old parameters #6075

mtojek opened this issue Feb 7, 2023 · 4 comments
Labels
parameters Area: parameters

Comments

@mtojek
Copy link
Member

mtojek commented Feb 7, 2023

Extracted from: #5574

Blockers:

The goal of this issue is to deprecate and remove old parameters in favor of rich parameters.

To be reviewed and adjusted:

  • CLI
  • site/UI
  • Coder API
  • Database model

Once this issue is resolved, it won't be possible to use templates with old parameters, and all relevant workspaces must be switched to templates with rich parameters.

@mtojek mtojek mentioned this issue Feb 7, 2023
@mtojek
Copy link
Member Author

mtojek commented Feb 7, 2023

Once this issue is resolved, it won't be possible to use templates with old parameters, and all relevant workspaces must be switched to templates with rich parameters.

Hey @kylecarbs, I'd like to hear your thoughts about the execution here. Once we have all blockers resolved, should we just remove old parameters, or give users a month to move their workspaces. I would like to spend time on the implementation of auto-migrators as I'm sure that we won't cover all edge cases.

@bpmct
Copy link
Member

bpmct commented Feb 16, 2023

Let's give users 1 month to migrate their templates + display a warning for template admins that their workspace uses template parameters that will be deprecated by Current month+1).

I have some open questions, though:

  • If a user has a "region" legacy variable in their workspace, how can we safely transfer that existing value to a region parameter?
    • If they are re-prompted because it is empty, there is a risk they pick another region that destroys their instance. Perhaps ignore_changes=all could be used to protect these destructive actions?
  • If a deployment lays dormant for 6 months and then the user upgrades to the latest Coder version, is there a way for them to get their old template (and workspaces with legacy parameters) upgraded to rich parameters? In the meantime, will their old workspaces and templates be bricked?

@mtojek
Copy link
Member Author

mtojek commented Feb 16, 2023

If a user has a "region" legacy variable in their workspace, how can we safely transfer that existing value to a region parameter?

To be honest, this is one of those issues that are tangled and "expensive" to implement, so I'm rather hesitant. The migration to the new workspace will happen only once, and sometimes it's easier/better to just have a second pair of eyes instead of having a logic that may be buggy.
In this case, site UI and CLI would have to pull the old parameter schema and match param values with coder parameters based on the name.

If they are re-prompted because it is empty,

Currently, it's required to set a default value for coder_parameters, so the user won't be prompted. To have this feature, we need to implement the required property, and replace the standard Update workspace button with a dedicated form to prompt for undefined values. The idea behind "not prompting" was to simplify updates, it's a one-click now.

AFAIR We had a chat that some complex cases are more predictable/harmful to solve by creating the 2nd workspace.

If a deployment lays dormant for 6 months and then the user upgrades to the latest Coder version, is there a way for them to get their old template (and workspaces with legacy parameters) upgraded to rich parameters? In the meantime, will their old workspaces and templates be bricked?

There are a few paths:

  1. Once template admins switch their templates to coder parameters, they won't be able to mix them with legacy ones. BTW we had a bug report around this.
  2. Once template admins switch their templates to managed variables by using the feature_use_managed_variables flag, they won't be able to use TF variables the old way.
  3. Once we remove the logic responsible for processing rich parameters, all workspaces should be removed. I don't think that users will be able to use them. The coder shouldn't be able to start these workspaces.

@bpmct
Copy link
Member

bpmct commented Feb 16, 2023

All makes sense to me.

@mtojek mtojek added the parameters Area: parameters label Feb 28, 2023
@mtojek mtojek closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameters Area: parameters
Projects
None yet
Development

No branches or pull requests

2 participants