-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Improve config builders (#3207)
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) - multiline values (using <<EOT...EOT) are handled far from ideally but work for now References: - https://developer.hashicorp.com/terraform/language/syntax/json - https://github.com/hashicorp/hcl/blob/56a9aee5207dbaed7f061cd926b96fc159d26ea0/json/spec.md 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)
- Loading branch information
1 parent
5d4ed3b
commit 425787c
Showing
51 changed files
with
2,817 additions
and
707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.