Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

feat: add gapic-version generator option#2440

Merged
parthea merged 11 commits intomainfrom
add-ability-to-set-gapic-version
Sep 24, 2025
Merged

feat: add gapic-version generator option#2440
parthea merged 11 commits intomainfrom
add-ability-to-set-gapic-version

Conversation

@parthea
Copy link
Copy Markdown
Contributor

@parthea parthea commented Sep 20, 2025

By allowing gapic_version.py files to include a specified version at time of generation, we will be able to reduce unnecessary diff when generating libraries. As an example, say the last release of google-cloud-library had version 1.2.99 when we run the python GAPIC generator the version will be reset to 0.0.0 or 0.1.0 since it is hard coded in the files below

https://github.com/googleapis/gapic-generator-python/blob/main/gapic/templates/%25namespace/%25name/gapic_version.py.j2

https://github.com/googleapis/gapic-generator-python/blob/main/gapic/templates/%25namespace/%25name_%25version/gapic_version.py.j2

# This is just a placeholder. release-please is responsible for
# updating the metadata file to the correct library version.
self.metadata_index.client_library.version = "0.1.0"

By adding a gapic-version option we will be able to eliminate the diff because the GAPIC generator will populate the desired version.

This work is needed for the librarian migration project in order to remove the need for one-time-generated-files as communicated in googleapis/librarian#1922 (comment)

This will also prevent issues like googleapis/librarian#2254 (comment) where an unexpected change in the dlp version number in snippet metadata caused incorrect conventional commits to be associated with the library.

Fixes googleapis/librarian#2271

@parthea parthea requested a review from a team September 20, 2025 13:40
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Sep 20, 2025
@parthea
Copy link
Copy Markdown
Contributor Author

parthea commented Sep 20, 2025

Needs fix from #2441

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Sep 20, 2025
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 20, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 20, 2025
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Sep 24, 2025
@parthea parthea enabled auto-merge (squash) September 24, 2025 17:13
@parthea parthea merged commit 75eb349 into main Sep 24, 2025
124 checks passed
@parthea parthea deleted the add-ability-to-set-gapic-version branch September 24, 2025 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

google-cloud-python: add ability to set client library version during GAPIC generation

3 participants