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

fix: data retention time parameters #2502

Merged
merged 14 commits into from Feb 20, 2024

Conversation

sfc-gh-jcieslak
Copy link
Collaborator

Fixes: #2356
Database retention time won't be set in the Read operation every time to avoid situations where Terraform expects the user to set it every time (if it's not set then it will always produce a plan, because of the Snowflake's data retention hierarchy).
It will only be set there only if:

  • it's not set in config and schema data retention value != database retention value

  • it's set in the config

  • acceptance tests added

pkg/resources/schema.go Fixed Show fixed Hide fixed
Copy link

Integration tests failure for 95b3dba6aa18f432dd78ff5d2485f8bcb842755b

Copy link

Integration tests failure for b075e0f9e9d809e9692c134f650409cac81abe4c

Copy link

Integration tests failure for c22869f57e9a76d3e9c653c1e852ab0c042ab266

Copy link

Integration tests failure for a4585d81f1a87ef21ec3173bb1074ab3e0c58072

pkg/resources/schema.go Show resolved Hide resolved
pkg/resources/schema.go Outdated Show resolved Hide resolved
pkg/resources/schema_acceptance_test.go Outdated Show resolved Hide resolved
pkg/resources/schema_acceptance_test.go Outdated Show resolved Hide resolved
pkg/resources/schema_acceptance_test.go Show resolved Hide resolved
pkg/resources/schema_acceptance_test.go Outdated Show resolved Hide resolved
@sfc-gh-jcieslak sfc-gh-jcieslak force-pushed the fix-data-retention-time-parameters branch from b075e0f to 46fc4c6 Compare February 19, 2024 10:56
@sfc-gh-jcieslak sfc-gh-jcieslak force-pushed the fix-data-retention-time-parameters branch from 46fc4c6 to 17413df Compare February 19, 2024 11:01
Copy link

Integration tests failure for 17413df5620d933e16173c71d8ec7c872d8161db

Copy link

Integration tests failure for 46fc4c6d94586f24b8186aa15729d180d217399c

pkg/resources/schema.go Outdated Show resolved Hide resolved
pkg/resources/schema.go Show resolved Hide resolved
pkg/resources/schema_acceptance_test.go Outdated Show resolved Hide resolved
Copy link

Integration tests failure for e78a506eb6b10c5ebb07bca9e182dbb42ede2afb

MIGRATION_GUIDE.md Show resolved Hide resolved
Copy link

Integration tests failure for 09b4b2f928e7add22d496e1545fe99a9a38a4423

Copy link

Integration tests failure for 13f800cbaccba2bacae9df5034c4a56e65d9a87b

Copy link

Integration tests failure for 09b4b2f928e7add22d496e1545fe99a9a38a4423

Copy link

Integration tests success for 09b4b2f928e7add22d496e1545fe99a9a38a4423

Copy link

Integration tests failure for 3ca6e8b4b416fee8833df42f835b0c6722092294

@sfc-gh-jcieslak sfc-gh-jcieslak merged commit 76abf21 into main Feb 20, 2024
8 of 9 checks passed
@sfc-gh-jcieslak sfc-gh-jcieslak deleted the fix-data-retention-time-parameters branch February 20, 2024 11:07
sfc-gh-jcieslak added a commit that referenced this pull request Feb 27, 2024
<!-- Feel free to delete comments as you fill this in -->
A follow-up for
#2502.
In this pr I applied the same changes to the Database and Table
resource. On the note side, I left some comments in the table resource.
There's still a deprecated data retention parameter that I would remove
because it wouldn't be used with the new implementation that always
expects a value (-1 if not set). We can add a note in the migration note
and change the description of the deprecated parameter stating that it
doesn't have any effect on the table configuration. Also in the database
tests I'm changing account-level data retention time which I think
shouldn't (but may) affect other tests. I would leave it anyway, because
on delete we set back the default value and crashes may occur, but very
rarely (I think).

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested
-->
* [x] acceptance tests
<!-- add more below if you think they are relevant -->
sfc-gh-jcieslak pushed a commit that referenced this pull request Feb 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.87.0](v0.86.0...v0.87.0)
(2024-02-28)


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

* Add network rule to the sdk
([#2526](#2526))
([b379565](b379565))
* supports collation of table column
([#2496](#2496))
([56771f1](56771f1))


### 🔧 **Misc**

* Clean up environment variables in tests and on CI
([#2543](#2543))
([9a10cb1](9a10cb1))
* replace warning in new grant resources with info log
([#2521](#2521))
([c3014b9](c3014b9))


### 🐛 **Bug fixes:**

* data retention days follow up
([#2566](#2566))
([7aba384](7aba384))
* data retention time parameters
([#2502](#2502))
([76abf21](76abf21))
* data retention time parameters follow-up
([#2530](#2530))
([5544544](5544544))
* Demote warning to info and set volatility for procedures and functions
([#2567](#2567))
([abaad7c](abaad7c)),
closes
[#2536](#2536)
* Fix ACCOUNT PARAMETERS option failover group resource
([#2522](#2522))
([61883f3](61883f3)),
closes
[#2517](#2517)
* Fix failover group alter syntax and suppression for pipe statement
([#2562](#2562))
([24d76c3](24d76c3))
* Fix few tests
([#2515](#2515))
([a523a6b](a523a6b))
* Fix provider config hierarchy
([#2551](#2551))
([677a12b](677a12b))
* Fix query_results in unsafe_execute resource
([#2512](#2512))
([94ca158](94ca158)),
closes
[#2491](#2491)
* Fix replication for database resource
([#2524](#2524))
([767fbce](767fbce)),
closes
[#2021](#2021)
* Fix show by id for external functions
([#2531](#2531))
([d910a84](d910a84)),
closes
[#2528](#2528)
* Fix various small problems
([#2552](#2552))
([f558ce6](f558ce6))
* Granting database roles
([#2511](#2511))
([dc27d64](dc27d64)),
closes
[#2402](#2402)
* grants on external volumes
([#2538](#2538))
([1de9a29](1de9a29))
* Handle old reference for table_id in table constraint resource
([#2558](#2558))
([d1e8912](d1e8912)),
closes
[#2535](#2535)
* loosen identifier field validation for account object identifiers
([#2564](#2564))
([a5ed8cd](a5ed8cd))

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

Snowflake objects created via terraform differs from "same" objects created via snowsight
2 participants