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: Improve config builders #3207

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open

Conversation

sfc-gh-asawicki
Copy link
Collaborator

@sfc-gh-asawicki sfc-gh-asawicki commented Nov 19, 2024

Improve how we build config models:

  • explore HCL v1 lib
  • generate provider config builder
  • generate datasource config builder
  • generate config using hcl v1 lib
  • support objects, lists, and sets
  • use provider config in provider setup tests
  • use datasource generated config in one test for databases datasource
  • use support for objects and lists in one view resource acceptance test
  • extract nullVariable to own file
  • cleanup in bettertestspoc/config directory
  • add all datasources to provider/datasources
  • deprecate old config builder and config variables from config methods - undeprecated for now because of linter (and I could not quickly find how to disable it; will do in a follow-up)

References:

TODOs (next PRs - soon):

  • rename package model to resourcemodel
  • add generating MarshalJSON() function
  • migrate resources to new config generation method (above needed first)
  • improve unquoteDependsOnReferences method

TODOs (next PRs - later, left as next steps in readme):

  • add config builders for other block types (Variable, Output, Localsl, Module, Terraform)
  • add provider to resource/datasource models (use in the grant_ownership_acceptance_test)
  • explore HCL v2 in more detail (especially struct tags generation; probably with migration to plugin framework because of schema models)
  • introduce some common interface for all three existing models (ResourceModel, DatasourceModel, and ProviderModel)
  • rename ResourceSchemaDetails (because it is used for the datasources and provider too)
  • consider duplicating the builders template from resource (currently same template used for datasources and provider)
  • consider merging ResourceModel with DatasourceModel (currently the implementation is really similar)

Copy link

Integration tests failure for 840b92891397cd45eb33354465382f5433b00e79

@sfc-gh-asawicki sfc-gh-asawicki marked this pull request as ready for review November 19, 2024 14:58
Copy link

Integration tests failure for 669caa19edfd70b33c6a05ed012821cd311c430e

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.

1 participant