Repository navigation
refactor(tool/cmd/migrate): derive php component names during migration - #7214
Merged
zhumin8 merged 5 commits intoAug 7, 2026
Merged
Conversation
Update findPHPLibraries in tool/cmd/migrate/php.go to use php.ComponentNameForLibrary from internal/librarian/php. If a library's folder name matches the derived component name, component_name is omitted from librarian.yaml. Only libraries with custom component name overrides retain component_name in configuration. Export ComponentNameForLibrary in internal/librarian/php to enable reuse by the migrate tool.
Contributor
There was a problem hiding this comment.
Code Review
This pull request exports ComponentNameForLibrary from the PHP package to dynamically derive component names during migration, skipping libraries where derivation fails and conditionally setting overrides. Feedback suggests using an exact case-sensitive comparison (derivedComp != name) instead of strings.EqualFold to ensure case differences are preserved as explicit overrides, which is critical for case-sensitive filesystems and PHP PSR-4 autoloading.
zhumin8
marked this pull request as ready for review
August 6, 2026 04:09
JoeWang1127
approved these changes
Aug 6, 2026
zhumin8
enabled auto-merge (squash)
August 7, 2026 01:38
sofisl
pushed a commit
to sofisl/librarian
that referenced
this pull request
Aug 10, 2026
…on (googleapis#7214) If a library's folder name matches the derived component name, component_name is omitted from librarian.yaml. Only libraries with custom component name overrides retain component_name in configuration. Exported `php.ComponentNameForLibrary` to reuse in migrate, added a TODO to remove it after migration is done. Test run shows 46 overrides remaining. See more details in https://paste.googleplex.com/6321381083054080. Fixes googleapis#7025
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.
If a library's folder name matches the derived component name, component_name is omitted from librarian.yaml. Only libraries with custom component name overrides retain component_name in configuration.
Exported
php.ComponentNameForLibraryto reuse in migrate, added a TODO to remove it after migration is done.Test run shows 46 overrides remaining. See more details in https://paste.googleplex.com/6321381083054080.
Fixes #7025