Skip to content

Commit 3b10e89

Browse files
authored
Revert "fix: change auto-start to automatically update workspaces (#6053)" (#7084)
This reverts commit bdddc3e.
1 parent 9d39371 commit 3b10e89

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

coderd/autobuild/executor/lifecycle_executor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func build(ctx context.Context, store database.Store, workspace database.Workspa
308308
CreatedAt: now,
309309
UpdatedAt: now,
310310
WorkspaceID: workspace.ID,
311-
TemplateVersionID: template.ActiveVersionID,
311+
TemplateVersionID: priorHistory.TemplateVersionID,
312312
BuildNumber: priorBuildNumber + 1,
313313
ProvisionerState: priorHistory.ProvisionerState,
314314
InitiatorID: workspace.OwnerID,

coderd/autobuild/executor/lifecycle_executor_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ func TestExecutorAutostartTemplateUpdated(t *testing.T) {
9797
close(tickCh)
9898
}()
9999

100-
// Then: the workspace is started using the new template version, not the old one.
100+
// Then: the workspace should be started using the previous template version, and not the updated version.
101101
stats := <-statsCh
102102
assert.NoError(t, stats.Error)
103103
assert.Len(t, stats.Transitions, 1)
104104
assert.Contains(t, stats.Transitions, workspace.ID)
105105
assert.Equal(t, database.WorkspaceTransitionStart, stats.Transitions[workspace.ID])
106106
ws := coderdtest.MustWorkspace(t, client, workspace.ID)
107-
assert.Equal(t, newVersion.ID, ws.LatestBuild.TemplateVersionID, "expected workspace build to be using the new template version")
107+
assert.Equal(t, workspace.LatestBuild.TemplateVersionID, ws.LatestBuild.TemplateVersionID, "expected workspace build to be using the old template version")
108108
}
109109

110110
func TestExecutorAutostartAlreadyRunning(t *testing.T) {

0 commit comments

Comments
 (0)