Skip to content

Commit d80b5fc

Browse files
refactor!: remove TaskAppID from codersdk.WorkspaceBuild (#20583)
Remove the `TaskAppID` field from `codersdk.WorkspaceBuild`. Consumers can instead use the new `codersdk.Task` data model for this information.
1 parent 197b422 commit d80b5fc

File tree

12 files changed

+121
-145
lines changed

12 files changed

+121
-145
lines changed

coderd/apidoc/docs.go

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

coderd/apidoc/swagger.json

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

coderd/workspacebuilds.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,6 @@ func (api *API) convertWorkspaceBuild(
12281228
TemplateVersionPresetID: presetID,
12291229
HasAITask: hasAITask,
12301230
AITaskSidebarAppID: taskAppID,
1231-
TaskAppID: taskAppID,
12321231
HasExternalAgent: hasExternalAgent,
12331232
}, nil
12341233
}

codersdk/workspacebuilds.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ type WorkspaceBuild struct {
8989
MatchedProvisioners *MatchedProvisioners `json:"matched_provisioners,omitempty"`
9090
TemplateVersionPresetID *uuid.UUID `json:"template_version_preset_id" format:"uuid"`
9191
HasAITask *bool `json:"has_ai_task,omitempty"`
92-
// Deprecated: This field has been replaced with `TaskAppID`
92+
// Deprecated: This field has been replaced with `Task.WorkspaceAppID`
9393
AITaskSidebarAppID *uuid.UUID `json:"ai_task_sidebar_app_id,omitempty" format:"uuid"`
94-
TaskAppID *uuid.UUID `json:"task_app_id,omitempty" format:"uuid"`
9594
HasExternalAgent *bool `json:"has_external_agent,omitempty"`
9695
}
9796

docs/reference/api/builds.md

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

docs/reference/api/schemas.md

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

docs/reference/api/workspaces.md

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

site/src/api/typesGenerated.ts

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

site/src/pages/TaskPage/TaskApps.stories.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
MockPrimaryWorkspaceProxy,
3+
MockTask,
34
MockUserOwner,
45
MockWorkspace,
56
MockWorkspaceAgent,
@@ -8,7 +9,7 @@ import {
89
} from "testHelpers/entities";
910
import { withAuthProvider, withProxyProvider } from "testHelpers/storybook";
1011
import type { Meta, StoryObj } from "@storybook/react-vite";
11-
import type { Workspace, WorkspaceApp } from "api/typesGenerated";
12+
import type { Task, Workspace, WorkspaceApp } from "api/typesGenerated";
1213
import { getPreferredProxy } from "contexts/ProxyContext";
1314
import kebabCase from "lodash/kebabCase";
1415
import { TaskApps } from "./TaskApps";
@@ -19,6 +20,11 @@ const mockExternalApp: WorkspaceApp = {
1920
health: "healthy",
2021
};
2122

23+
const mockTask: Task = {
24+
...MockTask,
25+
workspace_app_id: null,
26+
};
27+
2228
const meta: Meta<typeof TaskApps> = {
2329
title: "pages/TaskPage/TaskApps",
2430
component: TaskApps,
@@ -33,24 +39,28 @@ type Story = StoryObj<typeof TaskApps>;
3339

3440
export const NoEmbeddedApps: Story = {
3541
args: {
42+
task: mockTask,
3643
workspace: mockWorkspaceWithApps([]),
3744
},
3845
};
3946

4047
export const WithExternalAppsOnly: Story = {
4148
args: {
49+
task: mockTask,
4250
workspace: mockWorkspaceWithApps([mockExternalApp]),
4351
},
4452
};
4553

4654
export const WithEmbeddedApps: Story = {
4755
args: {
56+
task: mockTask,
4857
workspace: mockWorkspaceWithApps([mockEmbeddedApp()]),
4958
},
5059
};
5160

5261
export const WithMixedApps: Story = {
5362
args: {
63+
task: mockTask,
5464
workspace: mockWorkspaceWithApps([mockEmbeddedApp(), mockExternalApp]),
5565
},
5666
};
@@ -69,6 +79,7 @@ export const WithWildcardWarning: Story = {
6979
user: MockUserOwner,
7080
},
7181
args: {
82+
task: mockTask,
7283
workspace: mockWorkspaceWithApps([
7384
{
7485
...mockEmbeddedApp(),
@@ -80,6 +91,7 @@ export const WithWildcardWarning: Story = {
8091

8192
export const WithManyEmbeddedApps: Story = {
8293
args: {
94+
task: mockTask,
8395
workspace: mockWorkspaceWithApps([
8496
mockEmbeddedApp("Code Server"),
8597
mockEmbeddedApp("Jupyter Notebook"),

0 commit comments

Comments
 (0)