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

feat: Add change_tracking, row access policy and aggregation policy to views #2988

Merged
merged 17 commits into from
Aug 28, 2024

Conversation

sfc-gh-jmichalak
Copy link
Collaborator

@sfc-gh-jmichalak sfc-gh-jmichalak commented Aug 9, 2024

  • remove tag
  • add new fields:
    • row_access_policy
    • aggregation_policy
    • change_tracking
    • show and desc outputs
  • improve formatting in generator because previously code generated for resources with multiple required fields was incorrect
  • rename sdk.DoubleQuotedString to sdk.Column
  • update SQL parsing function (and created a ticket for using proper columns in the future)
  • change bools to BooleanString (except or_replace and copy_grants, this will be done in a follow up)

There are some issues regarding docs and view behavior - they were added to our internal docs.

Test Plan

  • acceptance tests

References

https://docs.snowflake.com/en/sql-reference/sql/create-view
https://docs.snowflake.com/en/sql-reference/sql/alter-view

TODO (next pr)

  • add remaining fields (data metric functions, data metric schedules, and columns)
  • use new methods for handling IDs
  • remove or_replace and improve handling of copy_grants
  • PolicyKind in PolicyReference

Copy link

github-actions bot commented Aug 9, 2024

Integration tests failure for e8ad8ae9bb79fc07bd2a40737dc14874ad288880

Copy link

github-actions bot commented Aug 9, 2024

Integration tests failure for 72901b993a99d452eb0353f8466b22383e970208

Copy link

github-actions bot commented Aug 9, 2024

Integration tests failure for 9024b1edd6b694bcd52fd5d3001e5f21ce0abf17

pkg/resources/common.go Outdated Show resolved Hide resolved
pkg/resources/view.go Outdated Show resolved Hide resolved
pkg/resources/view.go Show resolved Hide resolved
pkg/resources/view.go Outdated Show resolved Hide resolved
pkg/resources/view.go Show resolved Hide resolved
pkg/resources/view_acceptance_test.go Show resolved Hide resolved
pkg/resources/view_acceptance_test.go Show resolved Hide resolved
pkg/resources/view_acceptance_test.go Outdated Show resolved Hide resolved
pkg/sdk/policy_references.go Show resolved Hide resolved
pkg/snowflake/parser.go Outdated Show resolved Hide resolved
pkg/sdk/views_gen.go Outdated Show resolved Hide resolved
pkg/resources/view.go Show resolved Hide resolved
pkg/resources/view.go Outdated Show resolved Hide resolved
pkg/resources/view.go Outdated Show resolved Hide resolved
pkg/resources/view.go Outdated Show resolved Hide resolved
pkg/resources/view_acceptance_test.go Show resolved Hide resolved
pkg/resources/view_acceptance_test.go Show resolved Hide resolved
Copy link

Integration tests failure for 20af1d735b119df026e504b624261e4d45dec946

Copy link

Integration tests failure for 2422b666a4f86edee87072be6d46e419423d7bcb

docs/resources/view.md Outdated Show resolved Hide resolved
docs/resources/view.md Outdated Show resolved Hide resolved
docs/resources/view.md Outdated Show resolved Hide resolved
pkg/resources/view_acceptance_test.go Show resolved Hide resolved
Copy link

Integration tests failure for d066e546a3b34dcb2ec5626b355383a1170c08ee

@@ -41,6 +42,7 @@ func (e *ViewSelectStatementExtractor) Extract() (string, error) {
e.consumeToken("if not exists")
e.consumeSpace()
e.consumeID()
// TODO column list
Copy link
Collaborator

Choose a reason for hiding this comment

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

any issue number for this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Next PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oke

pkg/resources/doc_helpers.go Outdated Show resolved Hide resolved
Copy link

Integration tests failure for e496a747f4bda5886be0d5cd980357f0f7e8500e

Copy link

Integration tests failure for 7488d9d72713b7aeb3416577f022267b0386d692

Copy link

Integration tests failure for 81d93bba020a66e095d04e4fe51d5c55e647b545

Copy link

Integration tests failure for 81d93bba020a66e095d04e4fe51d5c55e647b545

1 similar comment
Copy link

Integration tests failure for 81d93bba020a66e095d04e4fe51d5c55e647b545

Copy link

Integration tests failure for 54e85ddd3b9e05448468fd1f1d5e4ba3b8752653

Copy link

Integration tests cancelled for 08c509378636ccad8008fa433ebb218fd9b900d1

Copy link

Integration tests failure for f316ff8e9d76a4bab24e1973696dfcd8f4be12db

pkg/resources/view.go Outdated Show resolved Hide resolved
Copy link

Integration tests failure for c28d4e9265604aa2e0447b470ffb1f57495b6a49

Copy link

Integration tests failure for d7955e73be81f9574547e8b16d9621039d357834

Copy link

Integration tests failure for 86228f2b99fc3c0a9436ea768e15c7cc6e2c0be5

@sfc-gh-jmichalak sfc-gh-jmichalak merged commit 1f88bb1 into main Aug 28, 2024
8 of 9 checks passed
@sfc-gh-jmichalak sfc-gh-jmichalak deleted the view-tmp branch August 28, 2024 09:16
sfc-gh-jcieslak pushed a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.95.0](v0.94.1...v0.95.0)
(2024-09-04)


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

* Add change_tracking, row access policy and aggregation policy to views
([#2988](#2988))
([1f88bb1](1f88bb1))
* Add fully_qualified_name to all resources
([#2990](#2990))
([1b0462f](1b0462f))
* Add identifier parsers
([#2957](#2957))
([824ec52](824ec52))
* Add identifier with arguments
([#2979](#2979))
([00ae1c5](00ae1c5))
* Add timeouts block to cortex
([#3004](#3004))
([34d764b](34d764b))
* Add user parameters to resource
([#2968](#2968))
([f4ae380](f4ae380))
* Conclude user rework
([#3036](#3036))
([23e4625](23e4625))
* database role v1 readiness
([#3014](#3014))
([c4db255](c4db255))
* Identifier with arguments for procedure and external function
([#2987](#2987))
([f13cc5c](f13cc5c))
* Rework user resource
([#3026](#3026))
([bde2638](bde2638)),
closes
[#1572](#1572)
* Rework users datasource
([#3030](#3030))
([751239b](751239b)),
closes
[#2902](#2902)
* Upgrade view sdk
([#2969](#2969))
([ef2d50a](ef2d50a))
* View rework part 2
([#3021](#3021))
([e05377d](e05377d))
* View rework part 3
([#3023](#3023))
([195b41c](195b41c))


### 🔧 **Misc**

* Add annotation about fully_qualified_name and fix handling granteeName
([#3009](#3009))
([94e6345](94e6345))
* Apply identifier conventions
([#2996](#2996))
([5cbea84](5cbea84))
* apply identifier conventions to grants
([#3008](#3008))
([d7780ae](d7780ae))
* Clean collection utils
([#3028](#3028))
([426ddb1](426ddb1))
* Clean old assertions
([#3029](#3029))
([ad657eb](ad657eb))
* Conclude identifiers rework
([#3011](#3011))
([c1b53f3](c1b53f3))
* Improve user test and add manual test for user default database and
role
([#3035](#3035))
([6cb0b4e](6cb0b4e))
* Use new identifier with arguments in function, external function and
procedure grants
([#3002](#3002))
([5053f8b](5053f8b))
* User improvements
([#3034](#3034))
([65b64d7](65b64d7))


### 🐛 **Bug fixes:**

* database tests and introduce a new parameter
([#2981](#2981))
([3bae7f6](3bae7f6))
* Fix custom diffs for fields with diff supression
([#3032](#3032))
([2499602](2499602))
* Fix default secondary roles after BCR 2024_07
([#3040](#3040))
([2ca465a](2ca465a)),
closes
[#3038](#3038)
* Fix issues 2972 and 3007
([#3020](#3020))
([1772387](1772387))
* Fix known user resource issues
([#3013](#3013))
([a5dfeac](a5dfeac))
* identifier issues
([#2998](#2998))
([6fb76b7](6fb76b7))
* minor issues
([#3027](#3027))
([467b06e](467b06e)),
closes
[#3015](#3015)
[#2807](#2807)
[#3025](#3025)
* Nuke users
([#2971](#2971))
([0d90cc9](0d90cc9))

---
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