From bc7662b0e931b9ef4f360bb86de5920e5b1df18b Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Wed, 31 Jul 2024 17:44:13 +0200 Subject: [PATCH 1/4] Add nuking user and update other nukes --- .../testprofiles/testing_config_profiles.go | 2 + pkg/sdk/client_integration_test.go | 10 +- pkg/sdk/helper_test.go | 23 +++- pkg/sdk/sweepers_test.go | 103 +++++++++++++----- 4 files changed, 100 insertions(+), 38 deletions(-) diff --git a/pkg/acceptance/testprofiles/testing_config_profiles.go b/pkg/acceptance/testprofiles/testing_config_profiles.go index 0fbef504ca..6bca3093c1 100644 --- a/pkg/acceptance/testprofiles/testing_config_profiles.go +++ b/pkg/acceptance/testprofiles/testing_config_profiles.go @@ -3,5 +3,7 @@ package testprofiles const ( Default = "default" Secondary = "secondary_test_account" + Third = "third_test_account" + Fourth = "fourth_test_account" IncorrectUserAndPassword = "incorrect_test_profile" ) diff --git a/pkg/sdk/client_integration_test.go b/pkg/sdk/client_integration_test.go index c7192517c5..57522f9fae 100644 --- a/pkg/sdk/client_integration_test.go +++ b/pkg/sdk/client_integration_test.go @@ -66,26 +66,26 @@ func TestClient_NewClient(t *testing.T) { } func TestClient_ping(t *testing.T) { - client := testClient(t) + client := defaultTestClient(t) err := client.Ping() require.NoError(t, err) } func TestClient_close(t *testing.T) { - client := testClient(t) + client := defaultTestClient(t) err := client.Close() require.NoError(t, err) } func TestClient_exec(t *testing.T) { - client := testClient(t) + client := defaultTestClient(t) ctx := context.Background() _, err := client.exec(ctx, "SELECT 1") require.NoError(t, err) } func TestClient_query(t *testing.T) { - client := testClient(t) + client := defaultTestClient(t) ctx := context.Background() rows := []struct { One int `db:"ONE"` @@ -98,7 +98,7 @@ func TestClient_query(t *testing.T) { } func TestClient_queryOne(t *testing.T) { - client := testClient(t) + client := defaultTestClient(t) ctx := context.Background() row := struct { One int `db:"ONE"` diff --git a/pkg/sdk/helper_test.go b/pkg/sdk/helper_test.go index adfe806f45..f72a0dee66 100644 --- a/pkg/sdk/helper_test.go +++ b/pkg/sdk/helper_test.go @@ -6,7 +6,7 @@ import ( "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/testprofiles" ) -func testClient(t *testing.T) *Client { +func defaultTestClient(t *testing.T) *Client { t.Helper() client, err := NewDefaultClient() @@ -19,14 +19,29 @@ func testClient(t *testing.T) *Client { func testSecondaryClient(t *testing.T) *Client { t.Helper() + return testClient(t, testprofiles.Secondary) +} + +func testThirdClient(t *testing.T) *Client { + t.Helper() + return testClient(t, testprofiles.Third) +} + +func testFourthClient(t *testing.T) *Client { + t.Helper() + return testClient(t, testprofiles.Fourth) +} + +func testClient(t *testing.T, profile string) *Client { + t.Helper() - config, err := ProfileConfig(testprofiles.Secondary) + config, err := ProfileConfig(profile) if err != nil { - t.Skipf("Snowflake secondary account not configured. Must be set in ~./snowflake/config.yml with profile name: %s", testprofiles.Secondary) + t.Skipf("Snowflake %s profile not configured. Must be set in ~./snowflake/config.yml", profile) } client, err := NewClient(config) if err != nil { - t.Skipf("Snowflake secondary account not configured. Must be set in ~./snowflake/config.yml with profile name: %s", testprofiles.Secondary) + t.Skipf("Snowflake %s profile not configured. Must be set in ~./snowflake/config.yml", profile) } return client diff --git a/pkg/sdk/sweepers_test.go b/pkg/sdk/sweepers_test.go index 354711780c..ce95a94e8c 100644 --- a/pkg/sdk/sweepers_test.go +++ b/pkg/sdk/sweepers_test.go @@ -2,8 +2,10 @@ package sdk import ( "context" + "errors" "fmt" "log" + "slices" "testing" "time" @@ -17,7 +19,7 @@ func TestSweepAll(t *testing.T) { testenvs.AssertEnvSet(t, string(testenvs.TestObjectsSuffix)) t.Run("sweep after tests", func(t *testing.T) { - client := testClient(t) + client := defaultTestClient(t) secondaryClient := testSecondaryClient(t) err := SweepAfterIntegrationTests(client, random.IntegrationTestsSuffix) @@ -37,38 +39,38 @@ func TestSweepAll(t *testing.T) { func Test_Sweeper_NukeStaleObjects(t *testing.T) { _ = testenvs.GetOrSkipTest(t, testenvs.EnableSweep) - t.Run("sweep integration test precreated objects", func(t *testing.T) { - client := testClient(t) - secondaryClient := testSecondaryClient(t) + client := defaultTestClient(t) + secondaryClient := testSecondaryClient(t) + thirdClient := testThirdClient(t) + fourthClient := testFourthClient(t) - err := nukeWarehouses(client, "int_test_wh_%")() - assert.NoError(t, err) - - err = nukeWarehouses(secondaryClient, "int_test_wh_%")() - assert.NoError(t, err) + allClients := []*Client{client, secondaryClient, thirdClient, fourthClient} - err = nukeDatabases(client, "int_test_db_%")() - assert.NoError(t, err) + t.Run("sweep integration test precreated objects", func(t *testing.T) { + for _, c := range allClients { + err := nukeWarehouses(c, "int_test_wh_%")() + assert.NoError(t, err) - err = nukeDatabases(secondaryClient, "int_test_db_%")() - assert.NoError(t, err) + err = nukeDatabases(c, "int_test_db_%")() + assert.NoError(t, err) + } }) t.Run("sweep acceptance tests precreated objects", func(t *testing.T) { - client := testClient(t) - secondaryClient := testSecondaryClient(t) - - err := nukeWarehouses(client, "acc_test_wh_%")() - assert.NoError(t, err) - - err = nukeWarehouses(secondaryClient, "acc_test_wh_%")() - assert.NoError(t, err) + for _, c := range allClients { + err := nukeWarehouses(c, "acc_test_wh_%")() + assert.NoError(t, err) - err = nukeDatabases(client, "acc_test_db_%")() - assert.NoError(t, err) + err = nukeDatabases(c, "acc_test_db_%")() + assert.NoError(t, err) + } + }) - err = nukeDatabases(secondaryClient, "acc_test_db_%")() - assert.NoError(t, err) + t.Run("sweep users", func(t *testing.T) { + for _, c := range allClients { + err := nukeUsers(c)() + assert.NoError(t, err) + } }) // TODO [SNOW-955520]: nuke stale objects (e.g. created more than 2 weeks ago) @@ -84,19 +86,21 @@ func nukeWarehouses(client *Client, prefix string) func() error { if err != nil { return fmt.Errorf("sweeping warehouses ended with error, err = %w", err) } + var errs []error log.Printf("[DEBUG] Found %d warehouses matching search criteria\n", len(whs)) for idx, wh := range whs { log.Printf("[DEBUG] Processing warehouse [%d/%d]: %s...\n", idx+1, len(whs), wh.ID().FullyQualifiedName()) if wh.Name != "SNOWFLAKE" && wh.CreatedOn.Before(time.Now().Add(-4*time.Hour)) { log.Printf("[DEBUG] Dropping warehouse %s, created at: %s\n", wh.ID().FullyQualifiedName(), wh.CreatedOn.String()) if err := client.Warehouses.Drop(ctx, wh.ID(), &DropWarehouseOptions{IfExists: Bool(true)}); err != nil { - return fmt.Errorf("sweeping warehouse %s ended with error, err = %w", wh.ID().FullyQualifiedName(), err) + log.Printf("[DEBUG] Dropping warehouse %s, resulted in error %v\n", wh.ID().FullyQualifiedName(), err) + errs = append(errs, fmt.Errorf("sweeping warehouse %s ended with error, err = %w", wh.ID().FullyQualifiedName(), err)) } } else { log.Printf("[DEBUG] Skipping warehouse %s, created at: %s\n", wh.ID().FullyQualifiedName(), wh.CreatedOn.String()) } } - return nil + return errors.Join(errs...) } } @@ -109,18 +113,59 @@ func nukeDatabases(client *Client, prefix string) func() error { if err != nil { return fmt.Errorf("sweeping databases ended with error, err = %w", err) } + var errs []error log.Printf("[DEBUG] Found %d databases matching search criteria\n", len(dbs)) for idx, db := range dbs { log.Printf("[DEBUG] Processing database [%d/%d]: %s...\n", idx+1, len(dbs), db.ID().FullyQualifiedName()) if db.Name != "SNOWFLAKE" && db.CreatedOn.Before(time.Now().Add(-4*time.Hour)) { log.Printf("[DEBUG] Dropping database %s, created at: %s\n", db.ID().FullyQualifiedName(), db.CreatedOn.String()) if err := client.Databases.Drop(ctx, db.ID(), &DropDatabaseOptions{IfExists: Bool(true)}); err != nil { - return fmt.Errorf("sweeping database %s ended with error, err = %w", db.ID().FullyQualifiedName(), err) + log.Printf("[DEBUG] Dropping database %s, resulted in error %v\n", db.ID().FullyQualifiedName(), err) + errs = append(errs, fmt.Errorf("sweeping database %s ended with error, err = %w", db.ID().FullyQualifiedName(), err)) } } else { log.Printf("[DEBUG] Skipping database %s, created at: %s\n", db.ID().FullyQualifiedName(), db.CreatedOn.String()) } } - return nil + return errors.Join(errs...) + } +} + +func nukeUsers(client *Client) func() error { + protectedUsers := []string{ + "SNOWFLAKE", + "ARTUR_SAWICKI", + "ARTUR_SAWICKI_LEGACY", + "JAKUB_MICHALAK", + "JAKUB_MICHALAK_LEGACY", + "JAN_CIESLAK", + "JAN_CIESLAK_LEGACY", + "TERRAFORM_SVC_ACCOUNT", + "TEST_CI_SERVICE_USER", + } + + return func() error { + log.Println("[DEBUG] Nuking users") + ctx := context.Background() + + users, err := client.Users.Show(ctx, &ShowUserOptions{}) + if err != nil { + return fmt.Errorf("sweeping users ended with error, err = %w", err) + } + var errs []error + log.Printf("[DEBUG] Found %d users\n", len(users)) + for idx, user := range users { + log.Printf("[DEBUG] Processing user [%d/%d]: %s...\n", idx+1, len(users), user.ID().FullyQualifiedName()) + if !slices.Contains(protectedUsers, user.Name) && user.CreatedOn.Before(time.Now().Add(-2*time.Hour)) { + log.Printf("[DEBUG] Dropping user %s\n", user.ID().FullyQualifiedName()) + if err := client.Users.Drop(ctx, user.ID(), &DropUserOptions{IfExists: Bool(true)}); err != nil { + log.Printf("[DEBUG] Dropping user %s, resulted in error %v\n", user.ID().FullyQualifiedName(), err) + errs = append(errs, fmt.Errorf("sweeping user %s ended with error, err = %w", user.ID().FullyQualifiedName(), err)) + } + } else { + log.Printf("[DEBUG] Skipping user %s\n", user.ID().FullyQualifiedName()) + } + } + return errors.Join(errs...) } } From 50dc81136043084025ec9de2b1c3cc21431623dd Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Wed, 31 Jul 2024 18:22:15 +0200 Subject: [PATCH 2/4] Add manual nuking of all databases and warehouses --- pkg/sdk/sweepers_test.go | 45 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/pkg/sdk/sweepers_test.go b/pkg/sdk/sweepers_test.go index ce95a94e8c..c8e46b2855 100644 --- a/pkg/sdk/sweepers_test.go +++ b/pkg/sdk/sweepers_test.go @@ -73,16 +73,44 @@ func Test_Sweeper_NukeStaleObjects(t *testing.T) { } }) + // TODO [SNOW-955520]: + t.Run("sweep databases", func(t *testing.T) { + t.Skipf("Used for manual sweeping; will be addressed during SNOW-955520") + for _, c := range allClients { + err := nukeDatabases(c, "")() + assert.NoError(t, err) + } + }) + + // TODO [SNOW-955520]: + t.Run("sweep warehouses", func(t *testing.T) { + t.Skipf("Used for manual sweeping; will be addressed during SNOW-955520") + for _, c := range allClients { + err := nukeWarehouses(c, "")() + assert.NoError(t, err) + } + }) + // TODO [SNOW-955520]: nuke stale objects (e.g. created more than 2 weeks ago) } // TODO [SNOW-955520]: generalize nuke methods (sweepers too) func nukeWarehouses(client *Client, prefix string) func() error { + protectedWarehouses := []string{ + "SNOWFLAKE", + "SYSTEM$STREAMLIT_NOTEBOOK_WH", + } + return func() error { log.Printf("[DEBUG] Nuking warehouses with prefix %s\n", prefix) ctx := context.Background() - whs, err := client.Warehouses.Show(ctx, &ShowWarehouseOptions{Like: &Like{Pattern: String(prefix)}}) + var like *Like = nil + if prefix != "" { + like = &Like{Pattern: String(prefix)} + } + + whs, err := client.Warehouses.Show(ctx, &ShowWarehouseOptions{Like: like}) if err != nil { return fmt.Errorf("sweeping warehouses ended with error, err = %w", err) } @@ -90,7 +118,7 @@ func nukeWarehouses(client *Client, prefix string) func() error { log.Printf("[DEBUG] Found %d warehouses matching search criteria\n", len(whs)) for idx, wh := range whs { log.Printf("[DEBUG] Processing warehouse [%d/%d]: %s...\n", idx+1, len(whs), wh.ID().FullyQualifiedName()) - if wh.Name != "SNOWFLAKE" && wh.CreatedOn.Before(time.Now().Add(-4*time.Hour)) { + if !slices.Contains(protectedWarehouses, wh.Name) && wh.CreatedOn.Before(time.Now().Add(-2*time.Hour)) { log.Printf("[DEBUG] Dropping warehouse %s, created at: %s\n", wh.ID().FullyQualifiedName(), wh.CreatedOn.String()) if err := client.Warehouses.Drop(ctx, wh.ID(), &DropWarehouseOptions{IfExists: Bool(true)}); err != nil { log.Printf("[DEBUG] Dropping warehouse %s, resulted in error %v\n", wh.ID().FullyQualifiedName(), err) @@ -105,11 +133,20 @@ func nukeWarehouses(client *Client, prefix string) func() error { } func nukeDatabases(client *Client, prefix string) func() error { + protectedDatabases := []string{ + "SNOWFLAKE", + "MFA_ENFORCEMENT_POLICY", + } + return func() error { log.Printf("[DEBUG] Nuking databases with prefix %s\n", prefix) ctx := context.Background() - dbs, err := client.Databases.Show(ctx, &ShowDatabasesOptions{Like: &Like{Pattern: String(prefix)}}) + var like *Like = nil + if prefix != "" { + like = &Like{Pattern: String(prefix)} + } + dbs, err := client.Databases.Show(ctx, &ShowDatabasesOptions{Like: like}) if err != nil { return fmt.Errorf("sweeping databases ended with error, err = %w", err) } @@ -117,7 +154,7 @@ func nukeDatabases(client *Client, prefix string) func() error { log.Printf("[DEBUG] Found %d databases matching search criteria\n", len(dbs)) for idx, db := range dbs { log.Printf("[DEBUG] Processing database [%d/%d]: %s...\n", idx+1, len(dbs), db.ID().FullyQualifiedName()) - if db.Name != "SNOWFLAKE" && db.CreatedOn.Before(time.Now().Add(-4*time.Hour)) { + if !slices.Contains(protectedDatabases, db.Name) && db.CreatedOn.Before(time.Now().Add(-2*time.Hour)) { log.Printf("[DEBUG] Dropping database %s, created at: %s\n", db.ID().FullyQualifiedName(), db.CreatedOn.String()) if err := client.Databases.Drop(ctx, db.ID(), &DropDatabaseOptions{IfExists: Bool(true)}); err != nil { log.Printf("[DEBUG] Dropping database %s, resulted in error %v\n", db.ID().FullyQualifiedName(), err) From 25560ac72371aa9c6108183e94424e163cec5f41 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Fri, 2 Aug 2024 12:35:03 +0200 Subject: [PATCH 3/4] Fix after review --- pkg/acceptance/testing.go | 8 +++++--- pkg/sdk/helper_test.go | 6 +++--- pkg/sdk/sweepers_test.go | 26 +++++++++++++++++-------- pkg/sdk/testint/setup_test.go | 8 +++++--- v1-preparations/ESSENTIAL_GA_OBJECTS.MD | 7 ++++--- 5 files changed, 35 insertions(+), 20 deletions(-) diff --git a/pkg/acceptance/testing.go b/pkg/acceptance/testing.go index 510b881439..44ccdd24bf 100644 --- a/pkg/acceptance/testing.go +++ b/pkg/acceptance/testing.go @@ -24,10 +24,12 @@ import ( "github.com/snowflakedb/gosnowflake" ) +const AcceptanceTestPrefix = "acc_test_" + var ( - TestDatabaseName = "acc_test_db_" + random.AcceptanceTestsSuffix - TestSchemaName = "acc_test_sc_" + random.AcceptanceTestsSuffix - TestWarehouseName = "acc_test_wh_" + random.AcceptanceTestsSuffix + TestDatabaseName = fmt.Sprintf("%sdb_%s", AcceptanceTestPrefix, random.AcceptanceTestsSuffix) + TestSchemaName = fmt.Sprintf("%ssc_%s", AcceptanceTestPrefix, random.AcceptanceTestsSuffix) + TestWarehouseName = fmt.Sprintf("%swh_%s", AcceptanceTestPrefix, random.AcceptanceTestsSuffix) ) var ( diff --git a/pkg/sdk/helper_test.go b/pkg/sdk/helper_test.go index f72a0dee66..fd82cb3665 100644 --- a/pkg/sdk/helper_test.go +++ b/pkg/sdk/helper_test.go @@ -17,17 +17,17 @@ func defaultTestClient(t *testing.T) *Client { return client } -func testSecondaryClient(t *testing.T) *Client { +func secondaryTestClient(t *testing.T) *Client { t.Helper() return testClient(t, testprofiles.Secondary) } -func testThirdClient(t *testing.T) *Client { +func thirdTestClient(t *testing.T) *Client { t.Helper() return testClient(t, testprofiles.Third) } -func testFourthClient(t *testing.T) *Client { +func fourthTestClient(t *testing.T) *Client { t.Helper() return testClient(t, testprofiles.Fourth) } diff --git a/pkg/sdk/sweepers_test.go b/pkg/sdk/sweepers_test.go index c8e46b2855..a8a263a3d6 100644 --- a/pkg/sdk/sweepers_test.go +++ b/pkg/sdk/sweepers_test.go @@ -20,7 +20,7 @@ func TestSweepAll(t *testing.T) { t.Run("sweep after tests", func(t *testing.T) { client := defaultTestClient(t) - secondaryClient := testSecondaryClient(t) + secondaryClient := secondaryTestClient(t) err := SweepAfterIntegrationTests(client, random.IntegrationTestsSuffix) assert.NoError(t, err) @@ -40,28 +40,38 @@ func Test_Sweeper_NukeStaleObjects(t *testing.T) { _ = testenvs.GetOrSkipTest(t, testenvs.EnableSweep) client := defaultTestClient(t) - secondaryClient := testSecondaryClient(t) - thirdClient := testThirdClient(t) - fourthClient := testFourthClient(t) + secondaryClient := secondaryTestClient(t) + thirdClient := thirdTestClient(t) + fourthClient := fourthTestClient(t) allClients := []*Client{client, secondaryClient, thirdClient, fourthClient} + // can't use extracted IntegrationTestPrefix and AcceptanceTestPrefix until sweepers reside in the SDK package (cyclic) + const integrationTestPrefix = "int_test_" + const acceptanceTestPrefix = "acc_test_" + t.Run("sweep integration test precreated objects", func(t *testing.T) { + integrationTestWarehousesPrefix := fmt.Sprintf("%swh_%", integrationTestPrefix) + integrationTestDatabasesPrefix := fmt.Sprintf("%sdb_%", integrationTestPrefix) + for _, c := range allClients { - err := nukeWarehouses(c, "int_test_wh_%")() + err := nukeWarehouses(c, integrationTestWarehousesPrefix)() assert.NoError(t, err) - err = nukeDatabases(c, "int_test_db_%")() + err = nukeDatabases(c, integrationTestDatabasesPrefix)() assert.NoError(t, err) } }) t.Run("sweep acceptance tests precreated objects", func(t *testing.T) { + acceptanceTestWarehousesPrefix := fmt.Sprintf("%swh_%", acceptanceTestPrefix) + acceptanceTestDatabasesPrefix := fmt.Sprintf("%sdb_%", acceptanceTestPrefix) + for _, c := range allClients { - err := nukeWarehouses(c, "acc_test_wh_%")() + err := nukeWarehouses(c, acceptanceTestWarehousesPrefix)() assert.NoError(t, err) - err = nukeDatabases(c, "acc_test_db_%")() + err = nukeDatabases(c, acceptanceTestDatabasesPrefix)() assert.NoError(t, err) } }) diff --git a/pkg/sdk/testint/setup_test.go b/pkg/sdk/testint/setup_test.go index 3e7425aa51..d09be1d489 100644 --- a/pkg/sdk/testint/setup_test.go +++ b/pkg/sdk/testint/setup_test.go @@ -17,10 +17,12 @@ import ( "github.com/snowflakedb/gosnowflake" ) +const IntegrationTestPrefix = "int_test_" + var ( - TestWarehouseName = "int_test_wh_" + random.IntegrationTestsSuffix - TestDatabaseName = "int_test_db_" + random.IntegrationTestsSuffix - TestSchemaName = "int_test_sc_" + random.IntegrationTestsSuffix + TestWarehouseName = fmt.Sprintf("%swh_%s", IntegrationTestPrefix, random.IntegrationTestsSuffix) + TestDatabaseName = fmt.Sprintf("%sdb_%s", IntegrationTestPrefix, random.IntegrationTestsSuffix) + TestSchemaName = fmt.Sprintf("%ssc_%s", IntegrationTestPrefix, random.IntegrationTestsSuffix) NonExistingAccountObjectIdentifier = sdk.NewAccountObjectIdentifier("does_not_exist") NonExistingDatabaseObjectIdentifier = sdk.NewDatabaseObjectIdentifier(TestDatabaseName, "does_not_exist") diff --git a/v1-preparations/ESSENTIAL_GA_OBJECTS.MD b/v1-preparations/ESSENTIAL_GA_OBJECTS.MD index 9956a2baa6..e468373d56 100644 --- a/v1-preparations/ESSENTIAL_GA_OBJECTS.MD +++ b/v1-preparations/ESSENTIAL_GA_OBJECTS.MD @@ -3,6 +3,7 @@ This table represents the current state of preparing the essential objects for the V1 of the provider. Status is one of: + - ✅ - done
- 🚀 - V1 release candidate
- ❌ - not started
@@ -19,7 +20,7 @@ newer provider versions. We will address these while working on the given object | NETWORK POLICY | 👨‍💻 | - | | RESOURCE MONITOR | ❌ | [#1990](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1990), [#1832](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1832), [#1821](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1821), [#1754](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1754), [#1716](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1716), [#1714](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1714), [#1624](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1624), [#1500](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1500), [#1175](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1175) | | ROLE | 👨‍💻 | - | -| SECURITY INTEGRATION | 🚀 | [#2855](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2855), [#2719](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2719), [#2568](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2568), [#2177](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2177), [#1851](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1851), [#1773](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1773), [#1741](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1741), [#1637](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1637), [#1503](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1503), [#1498](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1498), [#1421](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1421), [#1224](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1224) | +| SECURITY INTEGRATION | 🚀 | [#2855](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2855), [#2719](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2719), [#2568](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2568), [#2177](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2177), [#1851](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1851), [#1773](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1773), [#1741](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1741), [#1637](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1637), [#1503](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1503), [#1498](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1498), [#1421](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1421), [#1224](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1224) | | USER | 👨‍💻 | [#2942](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2942), [#2938](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2938), [#2902](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2902), [#2817](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2817), [#2662](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2662), [#1572](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1572), [#1535](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1535), [#1155](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1155) | | WAREHOUSE | 🚀 | issues in the older versions: [resources](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues?q=label%3Aresource%3Awarehouse+) and [datasources](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues?q=label%3Adata_source%3Awarehouses+) | | FUNCTION | ❌ | [2859](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2859), [#2735](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2735), [#2426](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2426), [#1479](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1479), [#1393](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1393), [#1208](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1208), [#1079](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1079) | @@ -28,10 +29,10 @@ newer provider versions. We will address these while working on the given object | ROW ACCESS POLICY | ❌ | [#2053](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2053), [#1600](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1600), [#1151](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1151) | | SCHEMA | 👨‍💻 | [#2826](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2826), [#2211](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2211), [#1243](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1243), [#506](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/506) | | STAGE | ❌ | [#2818](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2818), [#2505](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2505), [#1911](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1911), [#1903](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1903), [#1795](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1795), [#1705](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1705), [#1544](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1544), [#1491](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1491), [#1087](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1087), [#265](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/265) | -| STREAM | ❌ | [#2413](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2413), [#2201](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2201), [#1150](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1150) | +| STREAM | ❌ | [#2975](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2975), [#2413](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2413), [#2201](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2201), [#1150](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1150) | | STREAMLIT | 👨‍💻 | [#1933](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1933) | | TABLE | ❌ | [#2844](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2844), [#2839](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2839), [#2735](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2735), [#2733](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2733), [#2683](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2683), [#2676](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2676), [#2674](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2674), [#2629](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2629), [#2418](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2418), [#2415](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2415), [#2406](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2406), [#2236](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2236), [#2035](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2035), [#1823](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1823), [#1799](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1799), [#1764](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1764), [#1600](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1600), [#1387](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1387), [#1272](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1272), [#1271](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1271), [#1248](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1248), [#1241](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1241), [#1146](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1146), [#1032](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1032), [#420](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/420) | -| TAG | ❌ | [#2943](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2902), [#2598](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2598), [#1910](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1910), [#1909](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1909), [#1862](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1862), [#1806](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1806), [#1657](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1657), [#1496](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1496), [#1443](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1443), [#1394](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1394), [#1372](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1372), [#1074](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1074) | +| TAG | ❌ | [#2943](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2902), [#2598](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2598), [#1910](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1910), [#1909](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1909), [#1862](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1862), [#1806](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1806), [#1657](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1657), [#1496](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1496), [#1443](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1443), [#1394](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1394), [#1372](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1372), [#1074](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1074) | | TASK | ❌ | [#1419](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1419), [#1250](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1250), [#1194](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1194), [#1088](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1088) | | VIEW | ❌ | [#2430](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2430), [#2085](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2085), [#2055](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2055), [#2031](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2031), [#1526](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1526), [#1253](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1253), [#1049](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1049) | | snowflake_unsafe_execute | ❌ | [#2934](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2934) | From 37401403b927be620bf8469e9859e76c40bfa269 Mon Sep 17 00:00:00 2001 From: Artur Sawicki Date: Fri, 2 Aug 2024 12:37:57 +0200 Subject: [PATCH 4/4] Run pre-push --- pkg/sdk/sweepers_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/sdk/sweepers_test.go b/pkg/sdk/sweepers_test.go index a8a263a3d6..e50031cd74 100644 --- a/pkg/sdk/sweepers_test.go +++ b/pkg/sdk/sweepers_test.go @@ -51,8 +51,8 @@ func Test_Sweeper_NukeStaleObjects(t *testing.T) { const acceptanceTestPrefix = "acc_test_" t.Run("sweep integration test precreated objects", func(t *testing.T) { - integrationTestWarehousesPrefix := fmt.Sprintf("%swh_%", integrationTestPrefix) - integrationTestDatabasesPrefix := fmt.Sprintf("%sdb_%", integrationTestPrefix) + integrationTestWarehousesPrefix := fmt.Sprintf("%swh_%%", integrationTestPrefix) + integrationTestDatabasesPrefix := fmt.Sprintf("%sdb_%%", integrationTestPrefix) for _, c := range allClients { err := nukeWarehouses(c, integrationTestWarehousesPrefix)() @@ -64,8 +64,8 @@ func Test_Sweeper_NukeStaleObjects(t *testing.T) { }) t.Run("sweep acceptance tests precreated objects", func(t *testing.T) { - acceptanceTestWarehousesPrefix := fmt.Sprintf("%swh_%", acceptanceTestPrefix) - acceptanceTestDatabasesPrefix := fmt.Sprintf("%sdb_%", acceptanceTestPrefix) + acceptanceTestWarehousesPrefix := fmt.Sprintf("%swh_%%", acceptanceTestPrefix) + acceptanceTestDatabasesPrefix := fmt.Sprintf("%sdb_%%", acceptanceTestPrefix) for _, c := range allClients { err := nukeWarehouses(c, acceptanceTestWarehousesPrefix)()