Skip to content

Conversation

@hongalex
Copy link
Member

@hongalex hongalex commented Nov 5, 2024

This PR adds support for service name overriding (renaming).

This PR cannot be merged until the new client.proto changes land to support the renamed_services field and the actual code in generator.getServiceNameOverride is uncommented.

Pieces of the generator that are currently not changed by service renaming:

  • Custom operations (in genrest.go)
  • gencli
  • snippets

Diff for Pub/Sub is viewable here: https://github.com/googleapis/google-cloud-go/compare/main...hongalex:google-cloud-go:new-gapic-diff?expand=1

Fixes #1581

@hongalex hongalex added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 5, 2024
@hongalex hongalex requested review from a team November 5, 2024 00:52
@hongalex hongalex removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 9, 2024
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

Could you extend one of the existing tests to show this is working as expected?

Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

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

I noticed the following generated doc in the provided diff:

// NewTopicAdminClient creates a new publisher client based on gRPC.

Note: "new publisher client".
This seems acceptable to me for most cases, but I suppose it could result in some confusion depending on the original name.

@hongalex
Copy link
Member Author

Note: "new publisher client". This seems acceptable to me for most cases, but I suppose it could result in some confusion depending on the original name.

Yes, that was a one off where the code calls serv.GetName that I didn't catch before. I took a look again and it seems like the other references are fine. Please check the diff branch again.

@quartzmo
Copy link
Member

I still found one usage in the diff, if you want to look into it:

 NewTopicAdminRESTClient creates a new publisher rest client.

@hongalex hongalex requested review from codyoss and quartzmo December 12, 2024 08:12
@hongalex
Copy link
Member Author

@quartzmo that should be fixed now

@codyoss I added a test that generates a stub of the gRPC client with service renaming, which I think is sufficient.

@hongalex hongalex merged commit 8c5bc3d into googleapis:main Dec 16, 2024
7 checks passed
@hongalex hongalex deleted the feat-service-renaming branch April 29, 2025 18:46
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.

feat: support service overriding

3 participants