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

Improve version compatibility #224

Open
Tracked by #217
ammario opened this issue May 10, 2024 · 2 comments
Open
Tracked by #217

Improve version compatibility #224

ammario opened this issue May 10, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@ammario
Copy link
Member

ammario commented May 10, 2024

In coder/coder#13122 a user sees empty values when referencing ${data.coder_workspace.me.template_id} in their template. This happens because their coder server version is behind the provider, and this kind of issue will continue to appear as we implement more provider functionality (#220, #219).

There are two things we should do to fix this:

  1. In our docs under each attribute and resource, declare the Coder version requirements

  2. Replace code like:

    templateID := os.Getenv("CODER_WORKSPACE_TEMPLATE_ID")
    _ = rd.Set("template_id", templateID)
    templateName := os.Getenv("CODER_WORKSPACE_TEMPLATE_NAME")
    _ = rd.Set("template_name", templateName)
    templateVersion := os.Getenv("CODER_WORKSPACE_TEMPLATE_VERSION")
    _ = rd.Set("template_version", templateVersion)

with LookupEnv and fail the build when a value is missing instead of using blanks.

@coder-labeler coder-labeler bot added documentation Improvements or additions to documentation enhancement New feature or request labels May 10, 2024
@johnstcn
Copy link
Member

As an extra check, we could pass in the Coder version to the provisioner, and then check the version against the oldest version of Coder supported by the provisioner. WDYT?

@ammario
Copy link
Member Author

ammario commented May 26, 2024

As an extra check, we could pass in the Coder version to the provisioner, and then check the version against the oldest version of Coder supported by the provisioner. WDYT?

I think passing the version is a good idea, but I think we should add rules to convert old parameters into new ones instead of "breaking" at certain version boundaries.

We want to minimize upgrade anxiety caused by breakage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants