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

Commit207c80f

Browse files
committed
feat: add is_prebuild flag to workspace API response
1 parent95ca5f7 commit207c80f

File tree

11 files changed

+30
-15
lines changed

11 files changed

+30
-15
lines changed

‎cli/testdata/coder_list_--output_json.golden‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"automatic_updates": "never",
8787
"allow_renames": false,
8888
"favorite": false,
89-
"next_start_at": "====[timestamp]====="
89+
"next_start_at": "====[timestamp]=====",
90+
"is_prebuild": false
9091
}
9192
]

‎coderd/apidoc/docs.go‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/workspaces.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,6 +2231,12 @@ func convertWorkspace(
22312231
iflatestAppStatus.ID==uuid.Nil {
22322232
appStatus=nil
22332233
}
2234+
2235+
isPrebuild:=false
2236+
ifworkspace.OwnerID==database.PrebuildsSystemUserID {
2237+
isPrebuild=true
2238+
}
2239+
22342240
return codersdk.Workspace{
22352241
ID:workspace.ID,
22362242
CreatedAt:workspace.CreatedAt,
@@ -2265,6 +2271,7 @@ func convertWorkspace(
22652271
AllowRenames:allowRenames,
22662272
Favorite:requesterFavorite,
22672273
NextStartAt:nextStartAt,
2274+
IsPrebuild:isPrebuild,
22682275
},nil
22692276
}
22702277

‎codersdk/workspaces.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type Workspace struct {
6666
AllowRenamesbool`json:"allow_renames"`
6767
Favoritebool`json:"favorite"`
6868
NextStartAt*time.Time`json:"next_start_at" format:"date-time"`
69+
IsPrebuildbool`json:"is_prebuild"`
6970
}
7071

7172
func (wWorkspace)FullName()string {

‎docs/reference/api/schemas.md‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎docs/reference/api/workspaces.md‎

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎site/src/api/typesGenerated.ts‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎site/src/modules/workspaces/prebuilds.ts‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceSchedulePage.tsx‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { Link } from "components/Link/Link";
1111
import{Loader}from"components/Loader/Loader";
1212
import{PageHeader,PageHeaderTitle}from"components/PageHeader/PageHeader";
1313
importdayjsfrom"dayjs";
14-
import{isPrebuiltWorkspace}from"modules/workspaces/prebuilds";
1514
import{
1615
scheduleChanged,
1716
scheduleToAutostart,
@@ -98,13 +97,10 @@ const WorkspaceSchedulePage: FC = () => {
9897
)}
9998

10099
{template&&
101-
// Prebuilt workspaces have their own scheduling system,
102-
// so we avoid showing the workspace-level schedule settings form.
103-
// Instead, show an informational message with a link to the relevant docs.
104-
(isPrebuiltWorkspace(workspace) ?(
100+
(workspace.is_prebuild ?(
105101
<Alertseverity="info">
106-
Prebuilt workspacesdo not supportworkspace-level scheduling. For
107-
prebuilt workspace specific scheduling refer to the{" "}
102+
Prebuilt workspacesignoreworkspace-level scheduling until they are claimed.
103+
Forprebuilt workspace specific scheduling refer to the{" "}
108104
<Link
109105
title="Prebuilt Workspaces Scheduling"
110106
href={docs(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp