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

Commitce04f6c

Browse files
authored
fix(coderd): remove deprecated AITaskSidebarApp column (#20680)
This column was no longer used in `v2.28` and the codersdk fielddeprecated. Both can now be dropped in `v2.29`.Closescoder/internal#974
1 parent32e504c commitce04f6c

24 files changed

+127
-108
lines changed

‎coderd/apidoc/docs.go‎

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

‎coderd/apidoc/swagger.json‎

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

‎coderd/database/dbauthz/dbauthz_test.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ func (s *MethodTestSuite) TestWorkspace() {
21612161
})
21622162
res:=testutil.Fake(s.T(),faker, database.WorkspaceResource{JobID:b.JobID})
21632163
agt:=testutil.Fake(s.T(),faker, database.WorkspaceAgent{ResourceID:res.ID})
2164-
app:=testutil.Fake(s.T(),faker, database.WorkspaceApp{AgentID:agt.ID})
2164+
_=testutil.Fake(s.T(),faker, database.WorkspaceApp{AgentID:agt.ID})
21652165

21662166
dbm.EXPECT().GetWorkspaceByID(gomock.Any(),w.ID).Return(w,nil).AnyTimes()
21672167
dbm.EXPECT().GetWorkspaceBuildByID(gomock.Any(),b.ID).Return(b,nil).AnyTimes()
@@ -2170,7 +2170,6 @@ func (s *MethodTestSuite) TestWorkspace() {
21702170
ID:b.ID,
21712171
HasAITask: sql.NullBool{Bool:true,Valid:true},
21722172
HasExternalAgent: sql.NullBool{Bool:true,Valid:true},
2173-
SidebarAppID: uuid.NullUUID{UUID:app.ID,Valid:true},
21742173
UpdatedAt:b.UpdatedAt,
21752174
}).Asserts(w,policy.ActionUpdate)
21762175
}))

‎coderd/database/dbfake/dbfake.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ func (b WorkspaceBuildBuilder) doInTX() WorkspaceResponse {
189189
Bool:true,
190190
Valid:true,
191191
}
192-
b.seed.AITaskSidebarAppID= uuid.NullUUID{UUID:b.taskAppID,Valid:true}
193192
}
194193

195194
resp:=WorkspaceResponse{

‎coderd/database/dbgen/dbgen.go‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ func WorkspaceBuild(t testing.TB, db database.Store, orig database.WorkspaceBuil
451451
buildID:=takeFirst(orig.ID,uuid.New())
452452
jobID:=takeFirst(orig.JobID,uuid.New())
453453
hasAITask:=takeFirst(orig.HasAITask, sql.NullBool{})
454-
sidebarAppID:=takeFirst(orig.AITaskSidebarAppID, uuid.NullUUID{})
455454
hasExternalAgent:=takeFirst(orig.HasExternalAgent, sql.NullBool{})
456455
varbuild database.WorkspaceBuild
457456
err:=db.InTx(func(db database.Store)error {
@@ -491,7 +490,6 @@ func WorkspaceBuild(t testing.TB, db database.Store, orig database.WorkspaceBuil
491490
ID:buildID,
492491
HasAITask:hasAITask,
493492
HasExternalAgent:hasExternalAgent,
494-
SidebarAppID:sidebarAppID,
495493
UpdatedAt:dbtime.Now(),
496494
}))
497495
}

‎coderd/database/dump.sql‎

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

‎coderd/database/foreign_key_constraint.go‎

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ALTERTABLE workspace_builds ADD COLUMN ai_task_sidebar_app_id UUID;
2+
ALTERTABLE workspace_builds ADDCONSTRAINT workspace_builds_ai_task_sidebar_app_id_fkeyFOREIGN KEY (ai_task_sidebar_app_id)REFERENCES workspace_apps(id);
3+
4+
DROPVIEW workspace_build_with_user;
5+
-- Restore view.
6+
CREATEVIEWworkspace_build_with_userAS
7+
SELECT
8+
workspace_builds.id,
9+
workspace_builds.created_at,
10+
workspace_builds.updated_at,
11+
workspace_builds.workspace_id,
12+
workspace_builds.template_version_id,
13+
workspace_builds.build_number,
14+
workspace_builds.transition,
15+
workspace_builds.initiator_id,
16+
workspace_builds.provisioner_state,
17+
workspace_builds.job_id,
18+
workspace_builds.deadline,
19+
workspace_builds.reason,
20+
workspace_builds.daily_cost,
21+
workspace_builds.max_deadline,
22+
workspace_builds.template_version_preset_id,
23+
workspace_builds.has_ai_task,
24+
workspace_builds.ai_task_sidebar_app_id,
25+
workspace_builds.has_external_agent,
26+
COALESCE(
27+
visible_users.avatar_url,
28+
'' ::text
29+
)AS initiator_by_avatar_url,
30+
COALESCE(
31+
visible_users.username,
32+
'' ::text
33+
)AS initiator_by_username,
34+
COALESCE(visible_users.name,'' ::text)AS initiator_by_name
35+
FROM
36+
(
37+
workspace_builds
38+
LEFT JOIN visible_usersON (
39+
(
40+
workspace_builds.initiator_id=visible_users.id
41+
)
42+
)
43+
);
44+
45+
COMMENT ON VIEW workspace_build_with_user IS'Joins in the username + avatar url of the initiated by user.';
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
-- We're dropping the ai_task_sidebar_app_id column.
2+
DROPVIEW workspace_build_with_user;
3+
CREATEVIEWworkspace_build_with_userAS
4+
SELECT
5+
workspace_builds.id,
6+
workspace_builds.created_at,
7+
workspace_builds.updated_at,
8+
workspace_builds.workspace_id,
9+
workspace_builds.template_version_id,
10+
workspace_builds.build_number,
11+
workspace_builds.transition,
12+
workspace_builds.initiator_id,
13+
workspace_builds.provisioner_state,
14+
workspace_builds.job_id,
15+
workspace_builds.deadline,
16+
workspace_builds.reason,
17+
workspace_builds.daily_cost,
18+
workspace_builds.max_deadline,
19+
workspace_builds.template_version_preset_id,
20+
workspace_builds.has_ai_task,
21+
workspace_builds.has_external_agent,
22+
COALESCE(
23+
visible_users.avatar_url,
24+
'' ::text
25+
)AS initiator_by_avatar_url,
26+
COALESCE(
27+
visible_users.username,
28+
'' ::text
29+
)AS initiator_by_username,
30+
COALESCE(visible_users.name,'' ::text)AS initiator_by_name
31+
FROM
32+
(
33+
workspace_builds
34+
LEFT JOIN visible_usersON (
35+
(
36+
workspace_builds.initiator_id=visible_users.id
37+
)
38+
)
39+
);
40+
41+
COMMENT ON VIEW workspace_build_with_user IS'Joins in the username + avatar url of the initiated by user.';
42+
43+
ALTERTABLE workspace_builds DROP COLUMN ai_task_sidebar_app_id;

‎coderd/database/models.go‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp