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

Commitdfec884

Browse files
authored
Merge branch 'prebuilds-db' into 16930
2 parentse5117d7 +73f99e8 commitdfec884

File tree

9 files changed

+230
-197
lines changed

9 files changed

+230
-197
lines changed

‎coderd/database/dbauthz/dbauthz.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,13 +1137,13 @@ func (q *querier) BulkMarkNotificationMessagesSent(ctx context.Context, arg data
11371137
returnq.db.BulkMarkNotificationMessagesSent(ctx,arg)
11381138
}
11391139

1140-
func (q*querier)ClaimPrebuild(ctx context.Context,newOwnerID database.ClaimPrebuildParams) (database.ClaimPrebuildRow,error) {
1140+
func (q*querier)ClaimPrebuiltWorkspace(ctx context.Context,newOwnerID database.ClaimPrebuiltWorkspaceParams) (database.ClaimPrebuiltWorkspaceRow,error) {
11411141
iferr:=q.authorizeContext(ctx,policy.ActionUpdate,rbac.ResourceWorkspace);err!=nil {
1142-
return database.ClaimPrebuildRow{
1142+
return database.ClaimPrebuiltWorkspaceRow{
11431143
ID:uuid.Nil,
11441144
},err
11451145
}
1146-
returnq.db.ClaimPrebuild(ctx,newOwnerID)
1146+
returnq.db.ClaimPrebuiltWorkspace(ctx,newOwnerID)
11471147
}
11481148

11491149
func (q*querier)CleanTailnetCoordinators(ctx context.Context)error {
@@ -2298,11 +2298,11 @@ func (q *querier) GetReplicasUpdatedAfter(ctx context.Context, updatedAt time.Ti
22982298
returnq.db.GetReplicasUpdatedAfter(ctx,updatedAt)
22992299
}
23002300

2301-
func (q*querier)GetRunningPrebuilds(ctx context.Context) ([]database.GetRunningPrebuildsRow,error) {
2301+
func (q*querier)GetRunningPrebuiltWorkspaces(ctx context.Context) ([]database.GetRunningPrebuiltWorkspacesRow,error) {
23022302
iferr:=q.authorizeContext(ctx,policy.ActionRead,rbac.ResourceTemplate);err!=nil {
23032303
returnnil,err
23042304
}
2305-
returnq.db.GetRunningPrebuilds(ctx)
2305+
returnq.db.GetRunningPrebuiltWorkspaces(ctx)
23062306
}
23072307

23082308
func (q*querier)GetRuntimeConfig(ctx context.Context,keystring) (string,error) {

‎coderd/database/dbauthz/dbauthz_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4800,8 +4800,8 @@ func (s *MethodTestSuite) TestNotifications() {
48004800
}
48014801

48024802
func (s*MethodTestSuite)TestPrebuilds() {
4803-
s.Run("ClaimPrebuild",s.Subtest(func(db database.Store,check*expects) {
4804-
check.Args(database.ClaimPrebuildParams{}).
4803+
s.Run("ClaimPrebuiltWorkspace",s.Subtest(func(db database.Store,check*expects) {
4804+
check.Args(database.ClaimPrebuiltWorkspaceParams{}).
48054805
Asserts(rbac.ResourceWorkspace,policy.ActionUpdate).
48064806
ErrorsWithInMemDB(dbmem.ErrUnimplemented).
48074807
ErrorsWithPG(sql.ErrNoRows)
@@ -4821,7 +4821,7 @@ func (s *MethodTestSuite) TestPrebuilds() {
48214821
Asserts(rbac.ResourceTemplate,policy.ActionRead).
48224822
ErrorsWithInMemDB(dbmem.ErrUnimplemented)
48234823
}))
4824-
s.Run("GetRunningPrebuilds",s.Subtest(func(_ database.Store,check*expects) {
4824+
s.Run("GetRunningPrebuiltWorkspaces",s.Subtest(func(_ database.Store,check*expects) {
48254825
check.Args().
48264826
Asserts(rbac.ResourceTemplate,policy.ActionRead).
48274827
ErrorsWithInMemDB(dbmem.ErrUnimplemented)

‎coderd/database/dbmem/dbmem.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,8 +1740,8 @@ func (*FakeQuerier) BulkMarkNotificationMessagesSent(_ context.Context, arg data
17401740
returnint64(len(arg.IDs)),nil
17411741
}
17421742

1743-
func (*FakeQuerier)ClaimPrebuild(_ context.Context,_ database.ClaimPrebuildParams) (database.ClaimPrebuildRow,error) {
1744-
return database.ClaimPrebuildRow{},ErrUnimplemented
1743+
func (q*FakeQuerier)ClaimPrebuiltWorkspace(ctx context.Context,arg database.ClaimPrebuiltWorkspaceParams) (database.ClaimPrebuiltWorkspaceRow,error) {
1744+
return database.ClaimPrebuiltWorkspaceRow{},ErrUnimplemented
17451745
}
17461746

17471747
func (*FakeQuerier)CleanTailnetCoordinators(_ context.Context)error {
@@ -4880,7 +4880,7 @@ func (q *FakeQuerier) GetReplicasUpdatedAfter(_ context.Context, updatedAt time.
48804880
returnreplicas,nil
48814881
}
48824882

4883-
func (*FakeQuerier)GetRunningPrebuilds(_ context.Context) ([]database.GetRunningPrebuildsRow,error) {
4883+
func (q*FakeQuerier)GetRunningPrebuiltWorkspaces(ctx context.Context) ([]database.GetRunningPrebuiltWorkspacesRow,error) {
48844884
returnnil,ErrUnimplemented
48854885
}
48864886

‎coderd/database/dbmetrics/querymetrics.go‎

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

‎coderd/database/dbmock/dbmock.go‎

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

‎coderd/database/querier.go‎

Lines changed: 6 additions & 5 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