Skip to content

chore: remove multi-organization and custom role experiment #14862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove db from tests that do no need it
  • Loading branch information
Emyrk committed Sep 27, 2024
commit aea3688474ed69918f2fc42b54d0982d673f313c
2 changes: 0 additions & 2 deletions enterprise/cli/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ func TestEnterpriseCreate(t *testing.T) {
// setupMultipleOrganizations creates an extra organization, assigns a member
// both organizations, and optionally creates templates in each organization.
setupMultipleOrganizations := func(t *testing.T, args setupArgs) setupData {
dv := coderdtest.DeploymentValues(t)
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
// This only affects the first org.
IncludeProvisionerDaemon: true,
},
Expand Down
14 changes: 0 additions & 14 deletions enterprise/cli/organization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ func TestEditOrganizationRoles(t *testing.T) {
t.Run("JSON", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
client, owner := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down Expand Up @@ -68,12 +63,7 @@ func TestEditOrganizationRoles(t *testing.T) {
t.Run("InvalidRole", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
client, owner := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down Expand Up @@ -119,11 +109,9 @@ func TestShowOrganizations(t *testing.T) {
t.Run("OnlyID", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
IncludeProvisionerDaemon: true,
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
Expand Down Expand Up @@ -158,11 +146,9 @@ func TestShowOrganizations(t *testing.T) {

t.Run("UsingFlag", func(t *testing.T) {
t.Parallel()
dv := coderdtest.DeploymentValues(t)
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
IncludeProvisionerDaemon: true,
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
Expand Down
15 changes: 0 additions & 15 deletions enterprise/cli/organizationmembers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ func TestRemoveOrganizationMembers(t *testing.T) {

t.Run("OK", func(t *testing.T) {
t.Parallel()
dv := coderdtest.DeploymentValues(t)

ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureMultipleOrganizations: 1,
Expand Down Expand Up @@ -78,12 +74,7 @@ func TestEnterpriseListOrganizationMembers(t *testing.T) {
t.Run("CustomRole", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down Expand Up @@ -129,13 +120,7 @@ func TestAssignOrganizationMemberRole(t *testing.T) {

t.Run("OK", func(t *testing.T) {
t.Parallel()
dv := coderdtest.DeploymentValues(t)
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}

ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down
15 changes: 1 addition & 14 deletions enterprise/cli/organizationsettings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/require"

"github.com/coder/coder/v2/cli/clitest"
"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/coderd/rbac"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
Expand All @@ -24,12 +23,7 @@ func TestUpdateGroupSync(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)

owner, first := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureMultipleOrganizations: 1,
Expand Down Expand Up @@ -80,12 +74,7 @@ func TestUpdateRoleSync(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)

owner, _ := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureMultipleOrganizations: 1,
Expand Down Expand Up @@ -123,6 +112,4 @@ func TestUpdateRoleSync(t *testing.T) {
inv.Stdout = buf
err = inv.WithContext(ctx).Run()
require.NoError(t, err)
require.JSONEq(t, string(expectedData), buf.String())
})
}
require.JSONE
28 changes: 0 additions & 28 deletions enterprise/cli/provisionerdaemonstart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
client, _ := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
Expand Down Expand Up @@ -69,11 +65,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) {

t.Run("AnotherOrgByNameWithUser", func(t *testing.T) {
t.Parallel()
dv := coderdtest.DeploymentValues(t)
client, _ := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
Expand Down Expand Up @@ -222,11 +214,7 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) {

t.Run("ScopeUserAnotherOrg", func(t *testing.T) {
t.Parallel()
dv := coderdtest.DeploymentValues(t)
client, _ := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
Expand Down Expand Up @@ -270,7 +258,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
dv := coderdtest.DeploymentValues(t)
client, user := coderdenttest.New(t, &coderdenttest.Options{
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Expand All @@ -279,9 +266,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
codersdk.FeatureMultipleOrganizations: 1,
},
},
Options: &coderdtest.Options{
DeploymentValues: dv,
},
})
// nolint:gocritic // test
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
Expand Down Expand Up @@ -315,7 +299,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
dv := coderdtest.DeploymentValues(t)
client, user := coderdenttest.New(t, &coderdenttest.Options{
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Expand All @@ -324,9 +307,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
codersdk.FeatureMultipleOrganizations: 1,
},
},
Options: &coderdtest.Options{
DeploymentValues: dv,
},
})
// nolint:gocritic // test
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
Expand All @@ -345,7 +325,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
dv := coderdtest.DeploymentValues(t)
client, user := coderdenttest.New(t, &coderdenttest.Options{
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Expand All @@ -354,9 +333,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
codersdk.FeatureMultipleOrganizations: 1,
},
},
Options: &coderdtest.Options{
DeploymentValues: dv,
},
})
// nolint:gocritic // test
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
Expand All @@ -375,7 +351,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
dv := coderdtest.DeploymentValues(t)
client, _ := coderdenttest.New(t, &coderdenttest.Options{
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Expand All @@ -384,9 +359,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
codersdk.FeatureMultipleOrganizations: 1,
},
},
Options: &coderdtest.Options{
DeploymentValues: dv,
},
})
anotherOrg := coderdenttest.CreateOrganization(t, client, coderdenttest.CreateOrganizationOptions{})
// nolint:gocritic // test
Expand Down
4 changes: 0 additions & 4 deletions enterprise/cli/provisionerkeys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ func TestProvisionerKeys(t *testing.T) {
t.Run("CRUD", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
client, owner := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureMultipleOrganizations: 1,
Expand Down
2 changes: 0 additions & 2 deletions enterprise/cli/templatecreate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ func TestTemplateCreate(t *testing.T) {
t.Run("SecondOrganization", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
// This only affects the first org.
IncludeProvisionerDaemon: false,
},
Expand Down
2 changes: 0 additions & 2 deletions enterprise/cli/templatelist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ func TestEnterpriseListTemplates(t *testing.T) {
t.Run("MultiOrg", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
client, owner := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
IncludeProvisionerDaemon: true,
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
Expand Down
5 changes: 0 additions & 5 deletions enterprise/coderd/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"

"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
"github.com/coder/coder/v2/enterprise/coderd/license"
Expand All @@ -20,11 +19,7 @@ func TestEnterpriseAuditLogs(t *testing.T) {
t.Parallel()

ctx := context.Background()
dv := coderdtest.DeploymentValues(t)
client, user := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureMultipleOrganizations: 1,
Expand Down
1 change: 0 additions & 1 deletion enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
r.Use(
apiKeyMiddleware,
api.RequireFeatureMW(codersdk.FeatureCustomRoles),
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentCustomRoles),
httpmw.ExtractOrganizationParam(api.Database),
)
r.Post("/organizations/{organization}/members/roles", api.postOrgRoles)
Expand Down
25 changes: 0 additions & 25 deletions enterprise/coderd/idpsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ func TestGetGroupSyncConfig(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)

owner, db, user := coderdenttest.NewWithDatabase(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down Expand Up @@ -93,11 +88,7 @@ func TestPostGroupSyncConfig(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
owner, user := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand All @@ -124,11 +115,7 @@ func TestPostGroupSyncConfig(t *testing.T) {
t.Run("NotAuthorized", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
owner, user := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down Expand Up @@ -159,11 +146,7 @@ func TestGetRoleSyncConfig(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
owner, _, _, user := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down Expand Up @@ -197,11 +180,7 @@ func TestPostRoleSyncConfig(t *testing.T) {
t.Run("OK", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
owner, user := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand All @@ -228,11 +207,7 @@ func TestPostRoleSyncConfig(t *testing.T) {
t.Run("NotAuthorized", func(t *testing.T) {
t.Parallel()

dv := coderdtest.DeploymentValues(t)
owner, user := coderdenttest.New(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureCustomRoles: 1,
Expand Down
Loading