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

Commit73cf135

Browse files
committed
chore: minor comment fixes
1 parent29cc88e commit73cf135

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

‎coderd/database/dbauthz/dbauthz.go‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,9 +2942,9 @@ func (q *querier) GetTemplateByID(ctx context.Context, id uuid.UUID) (database.T
29422942
returnfetch(q.log,q.auth,q.db.GetTemplateByID)(ctx,id)
29432943
}
29442944

2945-
// GetTemplateByIDWithLock acquires an exclusive lock on the template and returnsit.
2946-
// This method MUST be called within a transaction, otherwise the lock
2947-
//will be released immediately afteracquisition, defeating its purpose.
2945+
// GetTemplateByIDWithLock acquires an exclusive lock on the templaterowand returnsthe template data.
2946+
// This method MUST be called within a transaction, otherwise the lock will be released immediately after
2947+
// acquisition, defeating its purpose.
29482948
func (q*querier)GetTemplateByIDWithLock(ctx context.Context,id uuid.UUID) (database.TemplateTable,error) {
29492949
act,ok:=ActorFromContext(ctx)
29502950
if!ok {
@@ -4855,7 +4855,6 @@ func (q *querier) UpdateOrganizationDeletedByID(ctx context.Context, arg databas
48554855
func (q*querier)UpdatePrebuildProvisionerJobWithCancel(ctx context.Context,arg database.UpdatePrebuildProvisionerJobWithCancelParams) ([]uuid.UUID,error) {
48564856
// This is a system-only operation for canceling pending prebuild-related jobs
48574857
// when a new template version is promoted.
4858-
// User authorization is checked at the template promotion level.
48594858
iferr:=q.authorizeContext(ctx,policy.ActionRead,rbac.ResourceSystem);err!=nil {
48604859
return []uuid.UUID{},err
48614860
}

‎coderd/database/dbfake/dbfake.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (b WorkspaceBuildBuilder) Do() WorkspaceResponse {
234234

235235
switchb.jobStatus {
236236
casedatabase.ProvisionerJobStatusPending:
237-
//Created provisionerjobs are created in pending status
237+
//Provisionerjobs are created in'pending' status
238238
b.logger.Debug(context.Background(),"pending the provisioner job")
239239
casedatabase.ProvisionerJobStatusRunning:
240240
// might need to do this multiple times if we got a template version
@@ -261,6 +261,7 @@ func (b WorkspaceBuildBuilder) Do() WorkspaceResponse {
261261
}
262262
}
263263
casedatabase.ProvisionerJobStatusCanceled:
264+
// Set provisioner job status to 'canceled'
264265
b.logger.Debug(context.Background(),"canceling the provisioner job")
265266
err=b.db.UpdateProvisionerJobWithCancelByID(ownerCtx, database.UpdateProvisionerJobWithCancelByIDParams{
266267
ID:jobID,

‎coderd/templateversions_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,8 @@ func TestPatchActiveTemplateVersion(t *testing.T) {
13491349
// Setup
13501350
db,ps:=dbtestutil.NewDB(t)
13511351
client,_,_:=coderdtest.NewWithAPI(t,&coderdtest.Options{
1352-
//Explicitly not includingprovisioner daemons, as we don't want the jobs to be processed
1353-
//Jobs operations will be simulatedviathe database model
1352+
//Excludeprovisioner daemons to prevent automatic job processing.
1353+
//Job operations will be simulateddirectly throughthe database model.
13541354
IncludeProvisionerDaemon:false,
13551355
Database:db,
13561356
Pubsub:ps,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp