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

Commit38436e1

Browse files
committed
Review comments
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent6f1d961 commit38436e1

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

‎coderd/database/querier.go‎

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

‎coderd/database/querier_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/stretchr/testify/require"
1616

1717
"cdr.dev/slog/sloggers/slogtest"
18+
1819
"github.com/coder/coder/v2/coderd/coderdtest"
1920
"github.com/coder/coder/v2/coderd/database"
2021
"github.com/coder/coder/v2/coderd/database/db2sdk"
@@ -3474,6 +3475,5 @@ func TestOrganizationDeleteTrigger(t *testing.T) {
34743475

34753476
funcrequireUsersMatch(t testing.TB,expected []database.User,found []database.GetUsersRow,msgstring) {
34763477
t.Helper()
3477-
foundUsers:=database.ConvertUserRows(found)
3478-
require.ElementsMatch(t,expected,foundUsers,msg)
3478+
require.ElementsMatch(t,expected,database.ConvertUserRows(found),msg)
34793479
}

‎coderd/database/queries.sql.go‎

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

‎coderd/database/queries/prebuilds.sql‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ FROM workspace_prebuilds p
1515
LEFT JOIN template_version_presets tvp_curr
1616
ONtvp_curr.id=p.current_preset_id-- See https://github.com/coder/internal/issues/398.
1717
WHERE (b.transition='start'::workspace_transition
18-
-- Jobs that are not in terminal states.
1918
ANDpj.job_status='succeeded'::provisioner_job_status);
2019

2120
-- name: GetTemplatePresetsWithPrebuilds :many
@@ -79,7 +78,6 @@ WHERE lb.rn <= lb.desired_instances -- Fetch the last N builds, where N is the n
7978
GROUP BYlb.template_version_id,lb.preset_id,lb.job_status;
8079

8180
-- name: ClaimPrebuild :one
82-
-- TODO: rewrite to use named CTE instead?
8381
UPDATE workspaces w
8482
SET owner_id= @new_user_id::uuid,
8583
name= @new_name::text,
@@ -95,7 +93,7 @@ WHERE w.id IN (SELECT p.id
9593
ANDb.template_version_preset_id= @preset_id::uuid
9694
ANDp.lifecycle_state='ready'::workspace_agent_lifecycle_state
9795
ORDER BY random()
98-
LIMIT1 FORUPDATE OF p SKIP LOCKED)
96+
LIMIT1 FORUPDATE OF p SKIP LOCKED)-- Ensure that a concurrent request will not select the same prebuild.
9997
RETURNINGw.id,w.name;
10098

10199
-- name: InsertPresetPrebuild :one

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp