Skip to content

Commit d684971

Browse files
committed
Moving prebuilds owner ID to OSS package to prevent AGPL-violating imports
...and other linter appeasements Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent 92910aa commit d684971

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

coderd/database/dbgen/dbgen.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,9 +1181,10 @@ func PresetParameter(t testing.TB, db database.Store, seed database.InsertPreset
11811181

11821182
func PresetPrebuild(t testing.TB, db database.Store, seed database.InsertPresetPrebuildParams) database.TemplateVersionPresetPrebuild {
11831183
prebuild, err := db.InsertPresetPrebuild(genCtx, database.InsertPresetPrebuildParams{
1184-
ID: takeFirst(seed.ID, uuid.New()),
1185-
PresetID: takeFirst(seed.PresetID, uuid.New()),
1186-
DesiredInstances: takeFirst(seed.DesiredInstances, 1),
1184+
ID: takeFirst(seed.ID, uuid.New()),
1185+
PresetID: takeFirst(seed.PresetID, uuid.New()),
1186+
DesiredInstances: takeFirst(seed.DesiredInstances, 1),
1187+
InvalidateAfterSecs: 0,
11871188
})
11881189
require.NoError(t, err, "insert preset prebuild")
11891190
return prebuild

coderd/members_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package coderd_test
33
import (
44
"testing"
55

6-
"github.com/coder/coder/v2/coderd/database/dbtestutil"
7-
"github.com/coder/coder/v2/enterprise/coderd/prebuilds"
8-
96
"github.com/google/uuid"
107
"github.com/stretchr/testify/require"
118

9+
"github.com/coder/coder/v2/coderd/database/dbtestutil"
10+
"github.com/coder/coder/v2/coderd/prebuilds"
11+
1212
"github.com/coder/coder/v2/coderd/coderdtest"
1313
"github.com/coder/coder/v2/coderd/database/db2sdk"
1414
"github.com/coder/coder/v2/coderd/rbac"
@@ -56,12 +56,13 @@ func TestListMembers(t *testing.T) {
5656
t.Parallel()
5757

5858
t.Run("OK", func(t *testing.T) {
59+
t.Parallel()
60+
5961
// TODO: we should not be returning the prebuilds user in OrganizationMembers, and this is not returned in dbmem.
6062
if !dbtestutil.WillUsePostgres() {
6163
t.Skip("This test requires postgres")
6264
}
6365

64-
t.Parallel()
6566
owner := coderdtest.New(t, nil)
6667
first := coderdtest.CreateFirstUser(t, owner)
6768

File renamed without changes.

enterprise/coderd/groups_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"time"
88

99
"github.com/coder/coder/v2/coderd/database/dbtestutil"
10-
"github.com/coder/coder/v2/enterprise/coderd/prebuilds"
10+
"github.com/coder/coder/v2/coderd/prebuilds"
1111

1212
"github.com/google/uuid"
1313
"github.com/stretchr/testify/require"
@@ -840,6 +840,7 @@ func TestGroup(t *testing.T) {
840840
_, user2 := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
841841
ctx := testutil.Context(t, testutil.WaitLong)
842842

843+
// nolint:gocritic // "This client is operating as the owner user" is fine in this case.
843844
prebuildsUser, err := client.User(ctx, prebuilds.OwnerID.String())
844845
require.NoError(t, err)
845846
// The 'Everyone' group always has an ID that matches the organization ID.

enterprise/coderd/roles_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"testing"
99

1010
"github.com/coder/coder/v2/coderd/database/dbtestutil"
11-
"github.com/coder/coder/v2/enterprise/coderd/prebuilds"
11+
"github.com/coder/coder/v2/coderd/prebuilds"
1212

1313
"github.com/google/uuid"
1414
"github.com/stretchr/testify/require"

0 commit comments

Comments
 (0)