-
Notifications
You must be signed in to change notification settings - Fork 767
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
Update access controlled frontend handlers to generated code #5588
Conversation
Pull Request Test Coverage Report for Build 018cff2a-bd14-4de8-b238-97c80de94d35
💛 - Coveralls |
service/frontend/adminHandler.go
Outdated
@@ -19,6 +19,7 @@ | |||
// THE SOFTWARE. | |||
|
|||
//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination adminHandler_mock.go -package frontend github.com/uber/cadence/service/frontend AdminHandler | |||
//go:generate gowrap gen -g -p . -i AdminHandler -t ./templates/accesscontrolled.tmpl -o ./access_controlled_admin_gen.go -v handler=AccessControlled |
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 propose to separate code from generated code. Could you move generated files into a subfolder?
Also, naming convention for generated files is _generated.go #5574
I don't think it is set in stone, but coverage wise, I think we should be consistent
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.
Originally, I put them in a separate package but realized that introduced a cyclic dependency.
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 should be fine that generated files are in same folder but let's follow same suffix convention "_generated.go"
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 need to do another refactoring to remove the cyclic dependency.
service/frontend/adminHandler.go
Outdated
@@ -19,6 +19,7 @@ | |||
// THE SOFTWARE. | |||
|
|||
//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination adminHandler_mock.go -package frontend github.com/uber/cadence/service/frontend AdminHandler | |||
//go:generate gowrap gen -g -p . -i AdminHandler -t ./templates/accesscontrolled.tmpl -o ./access_controlled_admin_gen.go -v handler=AccessControlled |
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 should be fine that generated files are in same folder but let's follow same suffix convention "_generated.go"
5d9fc96
to
3f1f1c4
Compare
3f1f1c4
to
8756042
Compare
What changed?
Behavior changes:
Why?
To eliminate manual work.
How did you test it?
unit test
Potential risks
Release notes
Documentation Changes