Skip to content

Commit e771c05

Browse files
committed
WIP
1 parent 968bd24 commit e771c05

File tree

8 files changed

+123
-3
lines changed

8 files changed

+123
-3
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,10 @@ func (q *querier) GetExternalAuthLinksByUserID(ctx context.Context, userID uuid.
14341434
return fetchWithPostFilter(q.auth, policy.ActionReadPersonal, q.db.GetExternalAuthLinksByUserID)(ctx, userID)
14351435
}
14361436

1437+
func (q *querier) GetFailedWorkspaceBuildsByTemplateID(ctx context.Context, arg database.GetFailedWorkspaceBuildsByTemplateIDParams) ([]database.WorkspaceBuild, error) {
1438+
panic("not implemented")
1439+
}
1440+
14371441
func (q *querier) GetFileByHashAndCreator(ctx context.Context, arg database.GetFileByHashAndCreatorParams) (database.File, error) {
14381442
file, err := q.db.GetFileByHashAndCreator(ctx, arg)
14391443
if err != nil {

coderd/database/dbmem/dbmem.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,15 @@ func (q *FakeQuerier) GetExternalAuthLinksByUserID(_ context.Context, userID uui
25112511
return gals, nil
25122512
}
25132513

2514+
func (q *FakeQuerier) GetFailedWorkspaceBuildsByTemplateID(ctx context.Context, arg database.GetFailedWorkspaceBuildsByTemplateIDParams) ([]database.WorkspaceBuild, error) {
2515+
err := validateDatabaseType(arg)
2516+
if err != nil {
2517+
return nil, err
2518+
}
2519+
2520+
panic("not implemented")
2521+
}
2522+
25142523
func (q *FakeQuerier) GetFileByHashAndCreator(_ context.Context, arg database.GetFileByHashAndCreatorParams) (database.File, error) {
25152524
if err := validateDatabaseType(arg); err != nil {
25162525
return database.File{}, err

coderd/database/dbmetrics/dbmetrics.go

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

coderd/database/dbmock/dbmock.go

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

coderd/database/models.go

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

coderd/database/querier.go

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

coderd/database/queries.sql.go

Lines changed: 66 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/workspacebuilds.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,22 @@ WHERE
179179
wb.transition = 'start'::workspace_transition
180180
AND
181181
pj.completed_at IS NOT NULL;
182+
183+
-- name: GetFailedWorkspaceBuildsByTemplateID :many
184+
SELECT
185+
wb.*
186+
FROM
187+
workspace_build_with_user AS wb
188+
JOIN
189+
workspaces AS w
190+
ON
191+
wb.workspace_id = w.id
192+
JOIN
193+
provisioner_jobs AS pj
194+
ON
195+
wb.job_id = pj.id
196+
WHERE
197+
w.template_id = $1
198+
AND wb.created_at > $2
199+
AND pj.completed_at IS NOT NULL
200+
AND pj.job_status = 'failed';

0 commit comments

Comments
 (0)