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

Commit3115866

Browse files
committed
fix(coderd): remove deprecated AITaskSidebarApp column
Closescoder/internal#974
1 parentab93943 commit3115866

24 files changed

+126
-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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
ALTERTABLE workspace_builds ADD COLUMN ai_task_sidebar_app_id UUID;
2+
3+
DROPVIEW workspace_build_with_user;
4+
-- Restore view.
5+
CREATEVIEWworkspace_build_with_userAS
6+
SELECT
7+
workspace_builds.id,
8+
workspace_builds.created_at,
9+
workspace_builds.updated_at,
10+
workspace_builds.workspace_id,
11+
workspace_builds.template_version_id,
12+
workspace_builds.build_number,
13+
workspace_builds.transition,
14+
workspace_builds.initiator_id,
15+
workspace_builds.provisioner_state,
16+
workspace_builds.job_id,
17+
workspace_builds.deadline,
18+
workspace_builds.reason,
19+
workspace_builds.daily_cost,
20+
workspace_builds.max_deadline,
21+
workspace_builds.template_version_preset_id,
22+
workspace_builds.has_ai_task,
23+
workspace_builds.ai_task_sidebar_app_id,
24+
workspace_builds.has_external_agent,
25+
COALESCE(
26+
visible_users.avatar_url,
27+
'' ::text
28+
)AS initiator_by_avatar_url,
29+
COALESCE(
30+
visible_users.username,
31+
'' ::text
32+
)AS initiator_by_username,
33+
COALESCE(visible_users.name,'' ::text)AS initiator_by_name
34+
FROM
35+
(
36+
workspace_builds
37+
LEFT JOIN visible_usersON (
38+
(
39+
workspace_builds.initiator_id=visible_users.id
40+
)
41+
)
42+
);
43+
44+
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