File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ const (
19
19
WorkspaceTransitionDelete WorkspaceTransition = "delete"
20
20
)
21
21
22
+ type BuildReason string
23
+
24
+ const (
25
+ BuildReasonMember BuildReason = "member"
26
+ BuildReasonAutostart BuildReason = "autostart"
27
+ BuildReasonAutostop BuildReason = "autostop"
28
+ )
29
+
22
30
// WorkspaceBuild is an at-point representation of a workspace state.
23
31
// BuildNumbers start at 1 and increase by 1 for each subsequent build
24
32
type WorkspaceBuild struct {
@@ -37,6 +45,7 @@ type WorkspaceBuild struct {
37
45
InitiatorUsername string `json:"initiator_name"`
38
46
Job ProvisionerJob `json:"job"`
39
47
Deadline time.Time `json:"deadline"`
48
+ Reason BuildReason `db:"reason" json:"reason"`
40
49
}
41
50
42
51
// WorkspaceBuild returns a single workspace build for a workspace.
Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ export interface WorkspaceApp {
443
443
readonly icon ?: string
444
444
}
445
445
446
- // From codersdk/workspacebuilds.go:24 :6
446
+ // From codersdk/workspacebuilds.go:32 :6
447
447
export interface WorkspaceBuild {
448
448
readonly id : string
449
449
readonly created_at : string
@@ -460,6 +460,7 @@ export interface WorkspaceBuild {
460
460
readonly initiator_name : string
461
461
readonly job : ProvisionerJob
462
462
readonly deadline : string
463
+ readonly reason : BuildReason
463
464
}
464
465
465
466
// From codersdk/workspaces.go:84:6
@@ -488,6 +489,9 @@ export interface WorkspaceResource {
488
489
readonly agents ?: WorkspaceAgent [ ]
489
490
}
490
491
492
+ // From codersdk/workspacebuilds.go:22:6
493
+ export type BuildReason = "autostart" | "autostop" | "member"
494
+
491
495
// From codersdk/provisionerdaemons.go:23:6
492
496
export type LogLevel = "debug" | "error" | "info" | "trace" | "warn"
493
497
Original file line number Diff line number Diff line change @@ -144,8 +144,8 @@ export const MockWorkspaceBuild: TypesGen.WorkspaceBuild = {
144
144
build_number : 1 ,
145
145
created_at : "2022-05-17T17:39:01.382927298Z" ,
146
146
id : "1" ,
147
- initiator_id : "" ,
148
- initiator_name : "" ,
147
+ initiator_id : MockUser . id ,
148
+ initiator_name : MockUser . username ,
149
149
job : MockProvisionerJob ,
150
150
name : "a-workspace-build" ,
151
151
template_version_id : "" ,
@@ -156,6 +156,7 @@ export const MockWorkspaceBuild: TypesGen.WorkspaceBuild = {
156
156
workspace_owner_name : MockUser . username ,
157
157
workspace_id : "759f1d46-3174-453d-aa60-980a9c1442f3" ,
158
158
deadline : "2022-05-17T23:39:00.00Z" ,
159
+ reason : "member" ,
159
160
}
160
161
161
162
export const MockWorkspaceBuildStop : TypesGen . WorkspaceBuild = {
You can’t perform that action at this time.
0 commit comments