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: Introduce assertions generators part1 #2952

Merged
merged 63 commits into from
Jul 24, 2024

Conversation

sfc-gh-asawicki
Copy link
Collaborator

@sfc-gh-asawicki sfc-gh-asawicki commented Jul 22, 2024

The first part of generators cleanup and assertions/config builders generation.

Notable changes:

  • new assertion type (snowflake object parameters)
    • created manually first but changed to generation during the work on the PR
    • used to replace multiple checks in users integration test
    • generated currently for user and warehouse only
  • convenience method to add assertions (instead of appending manually)
  • gencommons package extracted
    • contains the essential parts for the next generators creation
    • template helper funcs extracted
    • writing to file extracted
    • common skeleton for the gen flow extracted and described
    • common mappings/extractors moved
    • added common invocation flags (to reduce output)
    • improved error handling
  • the above package used in three generators:
    • the one for show output schemas reworked
    • added two new ones for object and object parameters assertions
      • used in tests
      • replaced the old ones nicely
  • example of generating only a subset of objects added
  • SDK
    • ParameterTypeSnowflakeDefault added for the default level
    • WarehouseParameter type added (maybe we will get rid of it with the parameters rework; for now used only in the generated assertions and not in the warehouse resource implementation - added as next step)

Next steps:

  • use WarehouseParameter type in warehouse resource and datasource
  • add a common extractor for schemas
  • with the above extractor, generate resource assertions, show output assertions, resource parameters assertions, and config builders

@sfc-gh-asawicki sfc-gh-asawicki changed the title feat: Assertions generators part1 feat: Introduce assertions generators part1 Jul 22, 2024
Copy link

Integration tests failure for edfddf2b5a0fdd6286e4328ee7f7be99043b3856

Copy link

Integration tests failure for 3015e4b2c5cd1b1d74bcad5e0acb3626af0ff272

Copy link

Integration tests failure for b3582700d3ebf9a49082e703fda4754716979b5f

Copy link

Integration tests failure for cef6917b6b32c75861078ad79c5434c97cb27792

@sfc-gh-asawicki sfc-gh-asawicki marked this pull request as ready for review July 23, 2024 09:01
pkg/sdk/poc/main.go Outdated Show resolved Hide resolved
pkg/schemas/gen/model.go Show resolved Hide resolved
pkg/schemas/gen/README.md Show resolved Hide resolved
pkg/internal/gencommons/mapper_commons.go Outdated Show resolved Hide resolved
pkg/internal/gencommons/README.md Outdated Show resolved Hide resolved
pkg/internal/gencommons/README.md Outdated Show resolved Hide resolved
pkg/internal/gencommons/generator.go Outdated Show resolved Hide resolved
pkg/internal/gencommons/generator.go Outdated Show resolved Hide resolved
Copy link

Integration tests failure for 962dbddd5c4fa5d418a5e68a8878376bdfdc3a6d

@sfc-gh-asawicki sfc-gh-asawicki merged commit 1582a9f into main Jul 24, 2024
9 of 10 checks passed
@sfc-gh-asawicki sfc-gh-asawicki deleted the assertions-generators-part1 branch July 24, 2024 10:40
sfc-gh-asawicki added a commit that referenced this pull request Jul 25, 2024
Continuation to
#2952.

Main features:
- missing generators (4) added
- definitions of generateable objects extracted to allow an easier reuse
- common extractor for schemas added
sfc-gh-jcieslak pushed a commit that referenced this pull request Jul 26, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.94.0](v0.93.0...v0.94.0)
(2024-07-26)


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

* Add missing session parameters
([#2936](#2936))
([4ce662d](4ce662d))
* Adjust user SDK
([#2947](#2947))
([1127bb3](1127bb3))
* Better tests poc
([#2917](#2917))
([ef496c2](ef496c2))
* Introduce assertions generators part1
([#2952](#2952))
([1582a9f](1582a9f))
* Introduce assertions generators part2
([#2956](#2956))
([f715e8a](f715e8a))
* network policy v1 readiness
([#2914](#2914))
([3408c3f](3408c3f))
* Rework schema datasource
([#2954](#2954))
([f70e40e](f70e40e))
* Rework schema resource
([#2955](#2955))
([400a5c8](400a5c8))
* Role v1 readiness
([#2916](#2916))
([32c7690](32c7690))
* Schema SDK upgrade
([#2945](#2945))
([bca0836](bca0836))
* Streamlit v1 readiness
([#2930](#2930))
([aa42260](aa42260))


### 🔧 **Misc**

* Remove deprecation from unsafe execute
([#2941](#2941))
([ed712d7](ed712d7))
* Update documentation
([#2931](#2931))
([da98bc3](da98bc3))


### 🐛 **Bug fixes:**

* ATTRIBUTE set(string) parsing for cortex search service
([#2953](#2953))
([70a1c9a](70a1c9a))
* external function header parsing and add missing privileges
([#2961](#2961))
([9d882fe](9d882fe))
* Fix sync_password field for Azure scim clients
([#2950](#2950))
([6781133](6781133))
* Fix tests and relax warehouse validations
([#2959](#2959))
([dd01ce9](dd01ce9)),
closes
[#2948](#2948)

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