-
Notifications
You must be signed in to change notification settings - Fork 188
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
chore: new scaffold command for creating resources/data sources #1739
Conversation
This looks really cool! I am sure we can further improve it, but LGTM what you have here. Nice job! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
case DataSourceCmd: | ||
return []FileGeneration{ | ||
{ | ||
TemplatePath: "tools/scaffold/template/datasource.tmpl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be nice to generate also a test file for resources / data sources, even mostly empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, added template file for acceptance tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
case ResourceCmd: | ||
return []FileGeneration{ | ||
{ | ||
TemplatePath: "tools/scaffold/template/resource.tmpl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at the moment it is great to run the tool with go run and having the templates in a folder.
in the future if we want to create a binary for the tool we may want to use "embed" to have all template files in the binary
|
Description
Link to any related issue(s): CLOUDP-214957
Summary: A new make command was defined to scaffold go files associated to a new resource, singular data source, or plural data source. This will speed up development and ensure consistency in the files and code structure of new implementations.
As part of reviewing I suggest running the command locally to see the files that are generated and the code guidelines that are defined.
Type of change:
Required Checklist:
Further comments