-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Refactor code generators #7734
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
Refactor code generators #7734
Conversation
@@ -0,0 +1,167 @@ | |||
{{- /*gotype: go.temporal.io/server/cmd/tools/gendynamicconfig.dynamicConfigData*/ -}} |
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.
This line enables intellisense in GoLand.
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.
ooh, very cool. I'm jealous of that, the template has been frustrating to edit
func generateFrontendOrAdminClient(w io.Writer, service service) { | ||
writeTemplatedCode(w, service, ` | ||
func generateFrontendOrAdminClient(w io.Writer, service service) error { | ||
writeTemplatedCode(w, service, `// Code generated by cmd/tools/genrpcwrappers. DO NOT EDIT. |
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.
All templates here also can be extracted to separate files, but it is too much work. Maybe later.
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.
awesome, this is much nicer!
{{end -}} | ||
} | ||
{{- end}} | ||
{{- else}} | ||
return nil | ||
{{- end -}} | ||
{{- end}} |
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 hope it didn't take that long to get all the {{- and -}} correct 😳
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.
Well, I mostly just copied it from what you had. But yes, spent some time on it :-)
{{ if $T.IsGeneric -}} | ||
type {{$P.Name}}TypedSetting[T any] setting[T, func({{$P.GoArgs}})] | ||
|
||
// New{{$P.Name}}TypedSetting creates a setting that uses mapstructure to handle complex structured |
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.
aw, this is going to conflict with 7052 that's almost ready. I'll handle the conflicts
@@ -0,0 +1,167 @@ | |||
{{- /*gotype: go.temporal.io/server/cmd/tools/gendynamicconfig.dynamicConfigData*/ -}} |
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.
ooh, very cool. I'm jealous of that, the template has been frustrating to edit
63c318e
to
e8c8dad
Compare
* main: (22 commits) Add host health metrics gauge (temporalio#7728) add rule expiration check (temporalio#7749) Add activity options to the pending activity info (temporalio#7727) Enable DLQ V2 for replication (temporalio#7746) chore: be smarter about when to use Stringer vs String (temporalio#7743) versioning entity workflows: enabling auto-restart pt1 (temporalio#7715) Refactor code generators (temporalio#7734) allow passive to generate replication tasks (temporalio#7713) Validate links in completion callbacks (temporalio#7726) CHASM: Engine Update/ReadComponent implementation (temporalio#7696) Enable transition history in dev env and tests (temporalio#7737) chore: Add Stringer tags (temporalio#7738) Add internal pod health check to DeepHealthCheck (temporalio#7709) Rename internal CHASM task processing interface (temporalio#7730) [Frontend] Log slow gRPC requests (temporalio#7718) Remove cap for dynamic config callback pool (temporalio#7723) Refactor updateworkflowoptions package (temporalio#7725) Remove a bunch of redundant utf-8 validation (temporalio#7720) [CHASM] Pure task processing - GetPureTasks, ExecutePureTasks (temporalio#7701) Send ActivityReset flag to the worker in heartbeat response (temporalio#7677) ...
What changed?
Refactor code generators:
codegen
package.All generated files are almost unchanged (removed leading empty line).
Why?
Better maintainability.
How did you test it?