Skip to content

feat: annotate resources withSchemaVersion #244

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 11 commits into from
Jun 25, 2024
Merged

feat: annotate resources withSchemaVersion #244

merged 11 commits into from
Jun 25, 2024

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Jun 25, 2024

Related: #224

Changes:

  • set SchemaVersion to 1 (first revision). One this is done, we can use StateUpgraders to transform the resource state
  • implement helpers to handle environment variables in a unified way

Re FIXMEs (actually more important than this PR):

Coder provisioner uses terraform-plugin-coder in different contexts - a dry run, a template run, a workspace build, etc. We can't use helpers.RequireEnv() in other modes than "workspace build", as the provisioner does not set these values (empty variable). If we switch to helpers.RequireEnv() now, "template import" will fail due to unset env values.
We can implement a workaround by passing the extra env variable CODER_WORKSPACE_BUILD_ID=.... If this variable is set, the plugin should presence the required env values.

@mtojek mtojek self-assigned this Jun 25, 2024
@mtojek mtojek changed the title feat: improve schema versioning feat: adopt SchemaVersion Jun 25, 2024
@mtojek mtojek changed the title feat: adopt SchemaVersion feat: set SchemaVersion Jun 25, 2024
@mtojek mtojek changed the title feat: set SchemaVersion feat: annotate resources withSchemaVersion Jun 25, 2024
@mtojek mtojek requested review from johnstcn and stirby June 25, 2024 11:56
@mtojek mtojek marked this pull request as ready for review June 25, 2024 11:58
@mtojek mtojek merged commit d51a4a7 into main Jun 25, 2024
12 checks passed
@mtojek mtojek deleted the 224-version-comp branch June 25, 2024 12:52
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
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.

2 participants