Description
Template Update Policies meta-issue
Background
Currently, developers have to opt-in to workspace updates. Many organizations want to enforce workspace updates to keep all developers on the latest version of a template. There are several benefits to this approach:
- Avoid "it works on my
machineworkspace" scenarios - Ensure security patches are rolled out across all workspaces
There are also use cases for developers to "roll back" or "opt in" to non-promoted workspace versions:
- Try an experimental template before it is rolled out to all users (e.g. "upgrade to golang 20")
- Work on an older/legacy version of the codebase or branch, which relied on an older template
Solution
We are going to add the following:
-
Template-level setting whether users can change version
-
Workspace-level setting whether workspace should “automatically update”
- By default, this would be checked
- This setting can only be modified if users can change version
-
Add note in “change version”
Selecting this version will disable auto-updates for your workspace
-
We could potentially show whether auto-updates are enabled/disabled here or under the “version” tab
-
Autostart behavior:
- If user cannot change version, then attempt to autostart with new version
- If variables are compatible, start
- Otherwise, autostart fails, user has to manually start and enter new variables
- If user can change version and has auto-updates enabled
- If variables are compatible, start with new version
- Otherwise, autostart fails, user has to manually start and enter new variables
- If user can change version and auto-updates are disabled
- Start with the existing workspace version
- If user cannot change version, then attempt to autostart with new version
These notes were taken from our internal RFC
- Start behavior
- If user cannot change version, always start with new version
- Otherwise, start with the new version if automatic updates are enabled
Task breakdown
- workspace "automatic updates" setting #7463
- workspace "automatic update" front end settings #7465
- template setting allowing/disabling version selection #7466
- allow enabling / disabling template version selection on the front end #7467
- CLI commands to set workspace automatic updates #7480
- CLI commands to enable/disable template version selection #7481
- Dashboard prompts user to manually update if autostart fails because of incompatible parameter values #10098
- docs for Template Update Policies #10570