-
Notifications
You must be signed in to change notification settings - Fork 426
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
chore: Continue random ids rework #2819
Conversation
Integration tests failure for 2b7c8fa61eea2a35d8378fb62e88da489f63406c |
Integration tests failure for 811cd292fa59158a9042cddd5d965cfa80e08e5d |
Integration tests success for 5f2c544fade76d20900a02fe53c096a7666e984f |
CREATING_ISSUES.md
Outdated
- AccountObjectIdentifier - `<name>` | ||
- DatabaseObjectIdentifier - `<database>.<name>` | ||
- SchemaObjectIdentifier - `<database>.<schema>.<name>` | ||
- NewTableColumnIdentifier - `<database>.<schema>.<table>.<name>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a constructor name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, fixed
@@ -114,6 +116,31 @@ func (c *RoleClient) GrantOwnershipOnAccountObject(t *testing.T, roleId sdk.Acco | |||
require.NoError(t, err) | |||
} | |||
|
|||
// TODO: move later to grants client | |||
func (c *RoleClient) RevokeCurrentGrantsFromSchemaObject(t *testing.T, roleId sdk.AccountObjectIdentifier, objectId sdk.SchemaObjectIdentifier, objectType sdk.ObjectType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename it to MoveOwnershipAndRevokeCurrentGrantsFromSchemaObject
? It's a long name, but it mentions that it's calling grant ownership
rather than revoke privileges from
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the signature to func (c *RoleClient) GrantOwnershipOnSchemaObject(t *testing.T, roleId sdk.AccountObjectIdentifier, objectId sdk.SchemaObjectIdentifier, objectType sdk.ObjectType, outboundPrivileges sdk.OwnershipCurrentGrantsOutboundPrivileges)
instead
@@ -107,7 +107,7 @@ func ReadSchema(d *schema.ResourceData, meta interface{}) error { | |||
ctx := context.Background() | |||
id := helpers.DecodeSnowflakeID(d.Id()).(sdk.DatabaseObjectIdentifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this cast could be done in a helper function, we have a switch inside anyway, so we could return proper type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be refined during the identifiers rework, this is the current approach.
Also, the DecodeSnowflakeId function is currently returning the interface (and internally the values are cast), so the cast here is necessary with the current implementation.
Integration tests failure for c07fea1b59c5609c49ecf4cbd61d24f2385aa7e9 |
🤖 I have created a release *beep* *boop* --- ## [0.92.0](v0.91.0...v0.92.0) (2024-06-06) ### 🎉 **What's new:** * Add Api Authentication security integration to sdk ([#2840](#2840)) ([57a07ee](57a07ee)) * Add External Oauth security integration to sdk ([#2835](#2835)) ([82d1c09](82d1c09)) * add network rules ([#2746](#2746)) ([c79fa29](c79fa29)) * Add SCIM and SAML2 security integrations to sdk ([#2799](#2799)) ([1312ff1](1312ff1)) * Add Snowflake Oauth security integration to sdk ([#2830](#2830)) ([b576f29](b576f29)) * Database resource v1 readiness ([#2834](#2834)) ([30fe136](30fe136)) * Database SDK upgrade ([#2814](#2814)) ([750fe37](750fe37)) ### 🔧 **Misc** * accept non-pointer values in the generated builder methods ([#2816](#2816)) ([c29fbf1](c29fbf1)) * Add a script for creating labels ([#2778](#2778)) ([ce0fbad](ce0fbad)) * Adjust before 0.92.0 ([#2857](#2857)) ([0598656](0598656)) * Continue random ids rework ([#2819](#2819)) ([f20940c](f20940c)) * Random ids rework part3 ([#2833](#2833)) ([36ead85](36ead85)) * Random ids rework part4 ([#2837](#2837)) ([64518a3](64518a3)) * Update issue for table and warehouse redesign state ([#2845](#2845)) ([149e55e](149e55e)) ### 🐛 **Bug fixes:** * Fix failing integration tests ([#2832](#2832)) ([2e2ca6c](2e2ca6c)) * Fix QUOTED_IDENTIFIERS_IGNORE_CASE parameter test ([#2841](#2841)) ([92ad1d3](92ad1d3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Continuation of #2747 (topics connected with
NewAccountObjectIdentifier
):alterMaterializedViewQueryExternally
- moved to test helpercheckDatabaseAndSchemaDataRetentionTime
- id part reworked, method left for assertions introductioncheckDatabaseSchemaAndTableDataRetentionTime
- id part reworked, method left for assertions introductionunsafe_execute_acceptance_test.go
- id part reworked, some methods left for assertions introductionalterViewOwnershipExternally
- moved to test helperapp_role_1
- test role name extracted and parametrized in testsfilter_by_role
,stproc1
,sp_pi
,filterByRole
,records
- added to procedure reworksdk.NewAccountObjectIdentifier("S3_STORAGE_INTEGRATION")
,sdk.NewAccountObjectIdentifier("GCP_STORAGE_INTEGRATION")
,sdk.NewAccountObjectIdentifier("AZURE_STORAGE_INTEGRATION")
- precreated integrations extractedsdk.NewAccountObjectIdentifier("does_not_exist")
and similar - extractedStill left (connected with
NewAccountObjectIdentifier
):CreateDatabaseWithName
(and other similar helpers)setup_test.go
Additional changes:
CurrentRole
andCurrentUser
to idsDatabaseId()
andSchemaId()
helpers to identifiers and convenience methods to use them