Skip to content

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

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

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

Conversation

@zhumin8

@zhumin8 zhumin8 commented Sep 11, 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.

Fixes #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 configuration population, deriving standard @google-cloud/ package names from library names, and updates the generator to require a package name. It also removes obsolete dynamic derivation helpers and updates tests to use the new defaults-filling mechanism. The feedback suggests improving a test assertion in library_test.go to prevent potential nil pointer dereferences and to follow Go testing best practices by using t.Error instead of t.Fatal for assertions.

Comment thread internal/librarian/library_test.go Resolved
@zhumin8
zhumin8 marked this pull request as ready for review September 11, 2026 20:14
@zhumin8
zhumin8 requested a review from a team as a code owner September 11, 2026 20:14
Comment thread internal/librarian/nodejs/default.go Resolved
Comment thread internal/librarian/nodejs/generate.go Resolved
Comment thread internal/librarian/library_test.go Resolved
@zhumin8
zhumin8 merged commit 30b0cda into googleapis:main Sep 11, 2026
46 checks passed
zhumin8 added a commit that referenced this pull request Sep 11, 2026
zhumin8 added a commit that referenced this pull request Sep 21, 2026
…7634)

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.

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