Skip to content
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: Replace parsing function for saving granted object names #2813

Merged
merged 6 commits into from
May 16, 2024

Conversation

sfc-gh-jcieslak
Copy link
Collaborator

@sfc-gh-jcieslak sfc-gh-jcieslak commented May 16, 2024

Add better parsing of identifiers returned by SHOW GRANTS. It should resolve some of our issues with failing tests (they sometimes fail because they depend on the generated name of a resource and whether they will be quoted in the output provided by Snowflake).

New ParseObjectIdentifier function is based on DecodeSnowflakeParameterID function used in resources. As a fallback (because ParseObjectIdentifier can fail) NewObjectIdentifierFromFullyQualifiedName will be used.

@sfc-gh-jcieslak sfc-gh-jcieslak force-pushed the better-show-grants-identifier-parsing branch from 71a09fd to b5a1a69 Compare May 16, 2024 09:30
Copy link

Integration tests failure for 71a09fd6163e97f561cc69ae6172329e76568a8d

Copy link

Integration tests failure for b5a1a69a533b5c62773b49fcb60773d9bb5a27ab

@sfc-gh-jcieslak sfc-gh-jcieslak force-pushed the better-show-grants-identifier-parsing branch from fc1dc0b to 2d5e8d9 Compare May 16, 2024 11:05
Copy link

Integration tests failure for 4a8b235ca07bf0f38556dff2d363b96602fb35ca

Copy link

Integration tests failure for 8c947f1d294cc30f8d1e4d73062ffde50c4be53e

Copy link

Integration tests failure for fc1dc0bd48a257c21cd73379215a26b2cfc8accf

Copy link

Integration tests failure for 2d5e8d999d4b610a197ba0f8764a897528513a79

@@ -511,7 +515,7 @@ func TestAcc_GrantOwnership_OnFuture_InSchema_ToAccountRole(t *testing.T) {
In: &sdk.ShowGrantsIn{
Schema: sdk.Pointer(sdk.NewDatabaseObjectIdentifier(databaseName, schemaName)),
},
}, sdk.ObjectTypeTable, accountRoleName, fmt.Sprintf("%s.%s.<TABLE>", databaseName, schemaName)),
}, sdk.ObjectTypeTable, accountRoleName, fmt.Sprintf("\"%s\".\"%s\".\"<TABLE>\"", databaseName, schemaName)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: use ` for readability

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@sfc-gh-asawicki sfc-gh-asawicki self-requested a review May 16, 2024 12:31
Copy link

Integration tests cancelled for ed4b2a8d7830a122fc3b65381d3d5016d36ebee7

Copy link

Integration tests cancelled for 31c635fa2ce64e6bdddc32edc6c5b213666e323f

@sfc-gh-jcieslak sfc-gh-jcieslak merged commit 175cfc7 into main May 16, 2024
6 of 8 checks passed
@sfc-gh-jcieslak sfc-gh-jcieslak deleted the better-show-grants-identifier-parsing branch May 16, 2024 12:46
sfc-gh-jmichalak pushed a commit that referenced this pull request May 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.91.0](v0.90.0...v0.91.0)
(2024-05-16)


### 🎉 **What's new:**

* add snowflake_grant_application_role resource
([#2690](#2690))
([838d241](838d241))
* datasource database role
([#2731](#2731))
([319ddc3](319ddc3))


### 🔧 **Misc**

* Add few documentation adjustments
([#2789](#2789))
([6db8bf3](6db8bf3))
* Bump dependencies
([#2802](#2802))
([54ea6bc](54ea6bc))
* Replace parsing function for saving granted object names
([#2813](#2813))
([175cfc7](175cfc7))


### 🐛 **Bug fixes:**

* Fix sweepers
([#2800](#2800))
([a01115e](a01115e))
* Invoke SetId immediately after alert creation
([#2786](#2786))
([181b4d0](181b4d0))
* Update the tests after snowflake bugfix
([#2806](#2806))
([6843c1a](6843c1a))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants