feat(cloud): add ruby-cloud-renamed-from for renamed wrapper gems - #1342
Merged
Conversation
suztomo
marked this pull request as ready for review
September 3, 2026 23:03
aandreassa
approved these changes
Sep 4, 2026
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for the
ruby-cloud-renamed-fromgenerator parameter (aliased to:gem.:renamed_from).Background & Motivation
In most Google Cloud Ruby client libraries, a wrapper gem shares its exact package name with the service (e.g.
google-cloud-storagewrapsgoogle-cloud-storage-v1).However, in certain cases a wrapper gem cannot be published under its canonical name due to naming conflicts on RubyGems.org:
google-cloud-run: RubyGems already had a pre-existing gem namedgoogle_cloud_run. Because RubyGems treats underscores and hyphens as equivalent for gem registration collisions,google-cloud-runcould not be registered. The wrapper gem was therefore renamed togoogle-cloud-run-client.google-iam: RubyGems already had an unrelated gem namedgoogle-iamregistered in 2011. The wrapper gem was therefore renamed togoogle-iam-client.In both cases:
<canonical-name>-client(e.g.google-cloud-run-client,google-iam-client).google-cloud-run-v2,google-iam-v2).Google::Cloud::Run,Google::Iam).Google::Cloud::Run::Client::VERSION,Google::Iam::Client::VERSIONinlib/.../client/version.rb).Previously, this required an
.owlbot.rbpost-processor script in each gem to rewrite gemspecs, entrypoints, READMEs, and version requires. By addingruby-cloud-renamed-from, the generator handles this natively for Librarian onboarding.Generator Behavior with
ruby-cloud-renamed-fromWhen
ruby-cloud-renamed-fromis specified:gem.namespace: usesGoogle::Cloud::Run(orGoogle::Iam) rather than deriving from-client.gem.gem_namespace: usesGoogle::Cloud::Run::Client(orGoogle::Iam::Client) for version constants.gem.version_name_full:Google::Cloud::Run::Client::VERSION.gem.versioned_gems: derives dependencies matching<renamed_from>-v*(e.g.,google-cloud-run-v2) instead of<name>-v*.gem.google_cloud_short_name: stripsgoogle-cloud-fromrenamed_from(yields"run").gem.version_name_fullin require guards.<renamed_from>-v*.Resolves googleapis/librarian#7447.
Preview PR in google-cloud-ruby: googleapis/google-cloud-ruby#36528