Skip to content

chore(internal/librarian/nodejs): derive package names in defaults - #7634

Merged
zhumin8 merged 3 commits into
googleapis:mainfrom
zhumin8:nodejs-derive-package-name-defaults-v2
Sep 21, 2026
Merged

zhumin8 merged 3 commits into
googleapis:mainfrom
zhumin8:nodejs-derive-package-name-defaults-v2

Conversation

@zhumin8

@zhumin8 zhumin8 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Derives standard Node.js package names (@google-cloud/) during defaults resolution instead of during generator argument construction. The generator now requires nodejs.package_name to be set and fails fast with an explanatory error when it is missing.

Non-cloud APIs and custom scopes are populated during library onboarding via custom package prefixes or configured explicitly in librarian.yaml. Moving derivation upstream establishes a single source of truth for the entire generation pipeline and removes redundant runtime guesswork.

This is re-apply of #7575, after googleapis/google-cloud-node#9321 is merged. Do not expect generation diff in google-cloud-node.

Fixes #7558

Derives standard Node.js package names (@google-cloud/<suffix>) during defaults resolution instead of during generator argument construction. The generator now requires nodejs.package_name to be set and fails fast with an explanatory error when it is missing.

Non-cloud APIs and custom scopes are populated during library onboarding via custom package prefixes or configured explicitly in librarian.yaml. Moving derivation upstream establishes a single source of truth for the entire generation pipeline and removes redundant runtime guesswork.

Fixes googleapis#7558

@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 introduces Node.js-specific default value population via a new nodejs.Fill function and enforces that a Node.js package name must be explicitly set or derived before generation. It removes the dynamic package name derivation during generation in favor of filling defaults upfront during the library initialization phase. Tests have been updated accordingly to use the new Fill function or provide explicit package names. There are no review comments, so I have no feedback to provide.

@zhumin8
zhumin8 marked this pull request as ready for review September 21, 2026 18:51
@zhumin8
zhumin8 requested a review from a team as a code owner September 21, 2026 18:52
@zhumin8
zhumin8 requested a review from JoeWang1127 September 21, 2026 18:52
Comment thread internal/librarian/library_test.go Resolved
@zhumin8
zhumin8 merged commit 6ae5819 into googleapis:main Sep 21, 2026
46 checks passed
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.

nodejs: derive package names in defaults and require package_name at generate

2 participants