Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdddc3e

Browse files
authored
fix: change auto-start to automatically update workspaces (#6053)
Fixes#6049.
1 parentd6947ae commitbdddc3e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎coderd/autobuild/executor/lifecycle_executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func build(ctx context.Context, store database.Store, workspace database.Workspa
295295
CreatedAt:now,
296296
UpdatedAt:now,
297297
WorkspaceID:workspace.ID,
298-
TemplateVersionID:priorHistory.TemplateVersionID,
298+
TemplateVersionID:template.ActiveVersionID,
299299
BuildNumber:priorBuildNumber+1,
300300
ProvisionerState:priorHistory.ProvisionerState,
301301
InitiatorID:workspace.OwnerID,

‎coderd/autobuild/executor/lifecycle_executor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ func TestExecutorAutostartTemplateUpdated(t *testing.T) {
9999
close(tickCh)
100100
}()
101101

102-
// Then: the workspaceshould bestarted using theprevious template version,andnot theupdated version.
102+
// Then: the workspaceisstarted using thenew template version, not theold one.
103103
stats:=<-statsCh
104104
assert.NoError(t,stats.Error)
105105
assert.Len(t,stats.Transitions,1)
106106
assert.Contains(t,stats.Transitions,workspace.ID)
107107
assert.Equal(t,database.WorkspaceTransitionStart,stats.Transitions[workspace.ID])
108108
ws:=coderdtest.MustWorkspace(t,client,workspace.ID)
109-
assert.Equal(t,workspace.LatestBuild.TemplateVersionID,ws.LatestBuild.TemplateVersionID,"expected workspace build to be using theold template version")
109+
assert.Equal(t,newVersion.ID,ws.LatestBuild.TemplateVersionID,"expected workspace build to be using thenew template version")
110110
}
111111

112112
funcTestExecutorAutostartAlreadyRunning(t*testing.T) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp