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

fix(internal/gengapic): add workaround for operation collision #1397

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

codyoss
Copy link
Member

@codyoss codyoss commented Sep 21, 2023

We have a service that is not yet released that uses the same RPC name across two services in the same proto package. Our Operation wrapper identifiers are not scoped to a service so this causes issues when generated a client that does this. For now this is for one client, which may change before GA, so a hacky solution is fine. But we should keep this in the back of our minds should we ever v2 our libraries this is something we would want to avoid.

We have a service that is not yet released that uses the same RPC
name across two services in the same proto package. Our Operation
wrapper identifiers are not scoped to a service so this causes
issues when generated a client that does this. For now this is for
one client, which may change before GA, so a hacky solution is fine.
But we should keep this in the back of our minds should we ever v2
our libraries this is something we would want to avoid.
@codyoss codyoss requested review from a team as code owners September 21, 2023 20:52
@codyoss codyoss added the automerge Summon MOG for automerging label Sep 21, 2023
internal/gengapic/lro.go Outdated Show resolved Hide resolved
if eHTTP, ok := proto.GetExtension(m.GetOptions(), annotations.E_Http).(*annotations.HttpRule); ok && eHTTP != nil && eHTTP.Pattern != nil {
switch t := eHTTP.Pattern.(type) {
case *annotations.HttpRule_Post:
if t.Post == "/v1beta1/{parent=projects/*/locations/*/featureGroups/*}/features" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems at least a tiny bit possible that someday another RPC will match this pattern...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may, but I believe it is unlikely. Ideally this code gets deleted in the next couple of months. If we end up having to do this for the v1 service we can make the logic tighter at that time. I was trying to avoid passing a lot more info throughout the stack if possible so this is easy to unwind.

@gcf-merge-on-green gcf-merge-on-green bot merged commit edb3b8f into googleapis:main Sep 21, 2023
7 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Summon MOG for automerging label Sep 21, 2023
codyoss added a commit that referenced this pull request Sep 22, 2023
@codyoss codyoss deleted the aiplat-hack branch September 22, 2023 18:58
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.

None yet

3 participants