Skip to content
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

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Jan 24, 2025

Some services need the longrunning mixin, but their service config YAML file
does not provide it. Automatically add it when needed.

Fixes #781

Some services need the `longrunning` mixin, but their service config YAML file
does not provide it. Automatically add it when needed.
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.57%. Comparing base (f4bda3d) to head (ab15562).
Report is 7 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@coryan coryan marked this pull request as ready for review January 24, 2025 01:58
@coryan coryan requested review from codyoss and julieqiu January 24, 2025 01:58
generator/internal/parser/protobuf.go Outdated Show resolved Hide resolved
generator/internal/parser/mixin.go Outdated Show resolved Hide resolved
@coryan coryan force-pushed the feat-generator-automatic-mixins branch from a39e33b to 45787bd Compare January 24, 2025 15:37
Copy link
Contributor Author

@coryan coryan left a 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.

generator/internal/parser/mixin.go Outdated Show resolved Hide resolved
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.
Copy link
Member

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)

@coryan coryan merged commit 33b8ab7 into googleapis:main Jan 24, 2025
15 checks passed
@coryan coryan deleted the feat-generator-automatic-mixins branch January 24, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing LRO mixin in some APIs
2 participants