-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat(generator): automatic longrunning
mixin
#812
feat(generator): automatic longrunning
mixin
#812
Conversation
Some services need the `longrunning` mixin, but their service config YAML file does not provide it. Automatically add it when needed.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #812 +/- ##
=======================================
Coverage 95.57% 95.57%
=======================================
Files 36 36
Lines 1357 1357
=======================================
Hits 1297 1297
Misses 60 60 ☔ View full report in Codecov by Sentry. |
a39e33b
to
45787bd
Compare
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.
Took a few tries, but I think it is fixed now. PTAL.
hasLongrunning := false | ||
for _, api := range serviceConfig.GetApis() { | ||
// Only insert the service if needed. We want to preserve the order | ||
// to make the generated code reproducible, so we cannot use a map. |
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.
yeah this is a fun Go quirk. I often find myself getting keys, sorting them, and iterating for the same effect. (what you have is fine)
Some services need the
longrunning
mixin, but their service config YAML filedoes not provide it. Automatically add it when needed.
Fixes #781