Skip to content

php: librarian add derives an invalid component output for a nested Google\Cloud\ namespace #7901

Closed

Description

@zhumin8

Context

Onboarding google/cloud/saasplatform/saasservicemgmt/v1 to googleapis/google-cloud-php as a new component, with Librarian v0.51.0 and googleapis 856bc831c5. The proto has php_namespace = "Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\V1".

What happened

  1. librarian add set output: SaasPlatform\SaasServiceMgmt in librarian.yaml. componentName() in internal/librarian/php/init.go only removes the Google\Cloud\ prefix and keeps the rest unchanged; non-Cloud namespaces have their backslashes removed.
  2. librarian generate exited 0 and created a top-level directory named SaasPlatform\SaasServiceMgmt/, with a literal backslash. The same string appeared in the root composer.json psr-4 entries, the .repo-metadata-full.json key and the component's extra.component.path.
  3. Workaround: output: SaasPlatformSaasServiceMgmt was set by hand before generate (feat(SaasPlatformSaasServiceMgmt): add google/cloud/saasplatform/saasservicemgmt/v1 google-cloud-php#9846). This matches existing nested components such as BigQueryDataTransfer and BeyondCorpAppConnections.

Why it hasn't come up before

It needs all three of:

  • a new PHP component (existing libraries all set output explicitly);
  • created with librarian add;
  • a Google\Cloud\ namespace more than one level deep.

🤖 Filed by an AI agent on behalf of zhumin.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added a commit that references this issue on Nov 18, 2026
    fd62ad3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions