-
Notifications
You must be signed in to change notification settings - Fork 546
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
Feature: Codegen and support for transform endpoints #783
Merged
Conversation
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
* move provider to separate package * rename provider package to schema
* add make dev command * add code for path structure * add trailing slash to mv * Update codegen/generate.go Co-Authored-By: Michael Golowka <[email protected]> * Update codegen/generate.go Co-Authored-By: Michael Golowka <[email protected]> * Update codegen/generate.go Co-Authored-By: Michael Golowka <[email protected]> * add unset template type * resolve naming clash to fix tests * refactor test to use testcases rather than indexes * strip dev command because its redundant Co-authored-by: Michael Golowka <[email protected]>
* add code generation for a resource * Update cmd/generate/main.go Co-authored-by: Michael Golowka <[email protected]> * Update cmd/generate/main.go Co-authored-by: Michael Golowka <[email protected]> * Update cmd/generate/main.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/generate.go Co-authored-by: Michael Golowka <[email protected]> * incorporate feedback * Update codegen/templates_test.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/templates_test.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/templates.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/generate_test.go Co-authored-by: Michael Golowka <[email protected]> * changes from feedback * update tests * update var name * return err from parsing home dir * put test in t.Run * use errwrap * use filepath.Dir * more changes from feedback * more feedback * break parameter validation into its on method * more feedback * test table for Validate * use stringbuilder * rename file * expand upon path description * return err * expand upon err * add tests for path param func * strip unused test Co-authored-by: Michael Golowka <[email protected]>
* add code generation for a resource * generate /transform/transformation/{name} * 3. Add a generated data source (#750) * add a generated data source * add data source to endpoint registry * 4. Generate docs (#754) * generate docs * improve example hcl * 5. Add a /transform/alphabet/{name} resource (#755) * add a /transform/alphabet/{name} resource * 6. Add a /transform/encode/{role_name} data source (#756) * add a /transform/encode/{role_name} data source * 7. Add a resource for /transform/template/{name} (#757) * add a resource for /transform/template/{name} * strip TODO * improve README * run gen and fmt at once * improve script output * add tfType * encapsulate parameter grooming * increase test for format * add TestEntPreCheck * avoid pointers to templatable params * fix os.Exits from moving code
kalafut
changed the title
Feature: Codegen and support for multiple endpoints
Feature: Codegen and support for transform endpoints
Jun 29, 2020
* remove the jwt/config resource from the code generated files * remove jwt/config from the registry
Merging this in, thanks @tyrannosaurus-becks ! |
catsby
added a commit
that referenced
this pull request
Jul 20, 2020
Add new resources and data sources from #783 to CHANGELOG
dandandy
pushed a commit
to dandandy/terraform-provider-vault
that referenced
this pull request
Jun 17, 2021
* Move provider to separate package (hashicorp#737) * move provider to separate package * rename provider package to schema * Add directory structure (hashicorp#738) * add make dev command * add code for path structure * add trailing slash to mv * Update codegen/generate.go Co-Authored-By: Michael Golowka <[email protected]> * Update codegen/generate.go Co-Authored-By: Michael Golowka <[email protected]> * Update codegen/generate.go Co-Authored-By: Michael Golowka <[email protected]> * add unset template type * resolve naming clash to fix tests * refactor test to use testcases rather than indexes * strip dev command because its redundant Co-authored-by: Michael Golowka <[email protected]> * 1. Add code generation for a resource (hashicorp#746) * add code generation for a resource * Update cmd/generate/main.go Co-authored-by: Michael Golowka <[email protected]> * Update cmd/generate/main.go Co-authored-by: Michael Golowka <[email protected]> * Update cmd/generate/main.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/generate.go Co-authored-by: Michael Golowka <[email protected]> * incorporate feedback * Update codegen/templates_test.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/templates_test.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/templates.go Co-authored-by: Michael Golowka <[email protected]> * Update codegen/generate_test.go Co-authored-by: Michael Golowka <[email protected]> * changes from feedback * update tests * update var name * return err from parsing home dir * put test in t.Run * use errwrap * use filepath.Dir * more changes from feedback * more feedback * break parameter validation into its on method * more feedback * test table for Validate * use stringbuilder * rename file * expand upon path description * return err * expand upon err * add tests for path param func * strip unused test Co-authored-by: Michael Golowka <[email protected]> * Remaining code generation and endpoints (hashicorp#749) * add code generation for a resource * generate /transform/transformation/{name} * 3. Add a generated data source (hashicorp#750) * add a generated data source * add data source to endpoint registry * 4. Generate docs (hashicorp#754) * generate docs * improve example hcl * 5. Add a /transform/alphabet/{name} resource (hashicorp#755) * add a /transform/alphabet/{name} resource * 6. Add a /transform/encode/{role_name} data source (hashicorp#756) * add a /transform/encode/{role_name} data source * 7. Add a resource for /transform/template/{name} (hashicorp#757) * add a resource for /transform/template/{name} * strip TODO * improve README * run gen and fmt at once * improve script output * add tfType * encapsulate parameter grooming * increase test for format * add TestEntPreCheck * avoid pointers to templatable params * fix os.Exits from moving code * add resource that supports importing jwt config (hashicorp#780) * Remove _name suffix * remove the jwt/config resource from the code generated files (hashicorp#807) * remove the jwt/config resource from the code generated files * remove jwt/config from the registry * update documentation to remove _name, jwt config generated docs * update docs to remove _name and -name suffix * update links * update link src * doc format update * update docs to fix formatting * update template docs and add template to sidebar Co-authored-by: Michael Golowka <[email protected]> Co-authored-by: Clint <[email protected]> Co-authored-by: catsby <[email protected]>
dandandy
pushed a commit
to dandandy/terraform-provider-vault
that referenced
this pull request
Jun 17, 2021
Add new resources and data sources from hashicorp#783 to CHANGELOG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for a nascent code generation functionality. The intent of code generation is to speed up the development process, and to provide more standardized (and hopefully less buggy) code. As it's used for more resources and data sources, templates and logic will likely need to be tweaked to accommodate them. The codegen package includes a
README.md
describing how to use it properly.This PR also adds support for the following generated endpoints:
Update from @catsby 2020-07-01: This duplicated the existing"/auth/jwt/config"
as a resourceresource_jwt_auth
and was removed in remove the jwt/config resource from the code generated files #807"/transform/alphabet/{name}"
as a resource"/transform/decode/{role_name}"
as a data source"/transform/encode/{role_name}"
as a data source"/transform/role/{name}"
as a resource"/transform/template/{name}"
as a resource"/transform/transformation/{name}"
as a resourceSince this is a large PR, it's likely there will be a large number of comments/changes on the code. For those, please either 1) PR or commit them directly into this feature branch to add them to the present PR, or 2) close this PR, add more to the branch, and re-PR.
Thank you!
Related test output