Skip to content
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

rich parameters: import values from legacy parameters #6368

Closed
mtojek opened this issue Feb 28, 2023 · 5 comments · Fixed by #6556
Closed

rich parameters: import values from legacy parameters #6368

mtojek opened this issue Feb 28, 2023 · 5 comments · Fixed by #6556
Assignees
Labels
parameters Area: parameters

Comments

@mtojek
Copy link
Member

mtojek commented Feb 28, 2023

The idea here is to import values from legacy parameters to make the migration smoother. coder_parameters should use the matching value of a legacy parameter before switching to default.

@kylecarbs has an idea to introduce legacy_variable_name or legacy_name to mark the legacy name.

@mtojek
Copy link
Member Author

mtojek commented Mar 7, 2023

Hey @bpmct! The legacy_variable should be present in the v0.6.16 release of terraform-provider-coder (baking now). I think that you can try to migrate some old template (if you have a candidate) 👍

@mtojek mtojek closed this as completed Mar 9, 2023
@mtojek
Copy link
Member Author

mtojek commented Mar 9, 2023

Reopening as I found this buggy, need more time to spend on this

@mtojek mtojek reopened this Mar 9, 2023
@mtojek
Copy link
Member Author

mtojek commented Mar 9, 2023

Related: coder/terraform-provider-coder#109 (review)

Ok, I've done more research. Unfortunately, this PR is insufficient, and we also need to sneak the legacy_parameter_name property for migration purposes.

The legacy_variable property works well with targetting the default value, but if only we need to switch from the old parameter to coder_parameter (strip reference to a legacy variable), the coder_parameter loses context, and takes the default. This is due to the fact that we pass all build parameter values externally, and there is no mechanism/logic to pull the legacy variable value.

@mtojek
Copy link
Member Author

mtojek commented Mar 9, 2023

cc @kylecarbs if you have any alternative idea how to approach this problem ^

@kylecarbs
Copy link
Member

No additional thoughts, the above makes sense. I think it's fine to have the legacy_parameter_name property in for now, it makes a lot of sense for users.

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

Successfully merging a pull request may close this issue.

3 participants