Skip to content

feat!: drop LegacyVariableName from coder parameter #8360

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 8 commits into from
Jul 7, 2023

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Jul 7, 2023

This PR catches up with changes introduced to terraform-provider-coder.

It looks big and scary, but in reality, it removes legacy_variable_name from API/database/proto, which was used only for migration purposes (not anymore).

@mtojek mtojek self-assigned this Jul 7, 2023
@mtojek mtojek changed the title feat: drop LegacyVariableName from coder parameter chore: drop LegacyVariableName from coder parameter Jul 7, 2023
@mtojek mtojek changed the title chore: drop LegacyVariableName from coder parameter feat!: drop LegacyVariableName from coder parameter Jul 7, 2023
@mtojek mtojek requested review from mafredri and johnstcn July 7, 2023 11:34
@mtojek mtojek marked this pull request as ready for review July 7, 2023 11:34
@@ -0,0 +1 @@
ALTER TABLE template_version_parameters DROP COLUMN legacy_variable_name;
Copy link
Member

@mafredri mafredri Jul 7, 2023

Choose a reason for hiding this comment

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

What could happen if legacy variables are still present when we upgrade? Should we somehow prevent this migration if any column has a non-empty value here?

I'm not sure what we should do, but perhaps something like this (granted the condition is needed).

DO $$
  BEGIN
    RAISE 'Bad things will happen!';
  END;
$$ LANGUAGE plpgsql;

Copy link
Member Author

Choose a reason for hiding this comment

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

Legacy variable names are not used since 2 minor releases (v0.24.0, v0.25.0). I would assume that we can just drop the column :) Users who forgot to migrate workspaces will not benefit from the legacy_variable_name property.

@@ -27,6 +27,8 @@ message RichParameterOption {

// RichParameter represents a variable that is exposed.
message RichParameter {
reserved 14;
Copy link
Member

Choose a reason for hiding this comment

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

Should we reserve the name as well? I doubt it will be a problem, but I'm overly cautious 😄.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, that's a safer approach 👍

@mtojek mtojek merged commit e088303 into main Jul 7, 2023
@mtojek mtojek deleted the drop-legacy-variable-name branch July 7, 2023 12:14
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2023
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.

3 participants