Skip to content

refactor(tool/cmd/migrate): derive php component names during migration - #7214

Merged
zhumin8 merged 5 commits into
googleapis:mainfrom
zhumin8:migrate-clean-up-derive-compname
Aug 7, 2026
Merged

zhumin8 merged 5 commits into
googleapis:mainfrom
zhumin8:migrate-clean-up-derive-compname

Conversation

@zhumin8

@zhumin8 zhumin8 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

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 #7025

zhumin8 added 2 commits August 6, 2026 03:41
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread tool/cmd/migrate/php.go Resolved
@zhumin8
zhumin8 marked this pull request as ready for review August 6, 2026 04:09
@zhumin8
zhumin8 requested a review from a team as a code owner August 6, 2026 04:09
@zhumin8
zhumin8 requested review from JoeWang1127 and sofisl August 6, 2026 04:09
@JoeWang1127 JoeWang1127 changed the title refactor(tool/cmd/migrate): derive php component names during migratio refactor(tool/cmd/migrate): derive php component names during migration Aug 6, 2026
@zhumin8
zhumin8 enabled auto-merge (squash) August 7, 2026 01:38
@zhumin8
zhumin8 merged commit 2803d88 into googleapis:main Aug 7, 2026
40 checks passed
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
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.

php(generate): derive component name on the fly as output dir

2 participants