Skip to content
Prev Previous commit
Next Next commit
update BuildReasonMember to BuildReasonInitiator
  • Loading branch information
AbhineetJain committed Jun 17, 2022
commit 105ccfa0330cd3634324fdd8e2fe58ff21eaa706
4 changes: 2 additions & 2 deletions coderd/database/dump.sql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TYPE build_reason AS ENUM ('member', 'autostart', 'autostop');
CREATE TYPE build_reason AS ENUM ('initiator', 'autostart', 'autostop');

ALTER TABLE ONLY workspace_builds
ADD COLUMN IF NOT EXISTS reason build_reason NOT NULL DEFAULT 'member';
ADD COLUMN IF NOT EXISTS reason build_reason NOT NULL DEFAULT 'initiator';
2 changes: 1 addition & 1 deletion coderd/database/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coderd/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
InitiatorID: apiKey.UserID,
Transition: database.WorkspaceTransition(createBuild.Transition),
JobID: provisionerJob.ID,
Reason: database.BuildReasonMember,
Reason: database.BuildReasonInitiator,
})
if err != nil {
return xerrors.Errorf("insert workspace build: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion coderd/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
JobID: provisionerJob.ID,
BuildNumber: 1, // First build!
Deadline: time.Time{}, // provisionerd will set this upon success
Reason: database.BuildReasonMember,
Reason: database.BuildReasonInitiator,
})
if err != nil {
return xerrors.Errorf("insert workspace build: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion codersdk/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
type BuildReason string

const (
BuildReasonMember BuildReason = "member"
BuildReasonInitiator BuildReason = "initiator"
BuildReasonAutostart BuildReason = "autostart"
BuildReasonAutostop BuildReason = "autostop"
)
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export interface WorkspaceResource {
}

// From codersdk/workspacebuilds.go:22:6
export type BuildReason = "autostart" | "autostop" | "member"
export type BuildReason = "autostart" | "autostop" | "initiator"

// From codersdk/provisionerdaemons.go:23:6
export type LogLevel = "debug" | "error" | "info" | "trace" | "warn"
Expand Down
2 changes: 1 addition & 1 deletion site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const MockWorkspaceBuild: TypesGen.WorkspaceBuild = {
workspace_owner_name: MockUser.username,
workspace_id: "759f1d46-3174-453d-aa60-980a9c1442f3",
deadline: "2022-05-17T23:39:00.00Z",
reason: "member",
reason: "initiator",
}

export const MockWorkspaceBuildStop: TypesGen.WorkspaceBuild = {
Expand Down