chore: migrate google-cloud-aiplatform to librarian#8549
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the library configuration in .repo-metadata.json from GAPIC_COMBO to GAPIC_AUTO, which has resulted in the deletion of all handwritten helper files, tests, and schemas. The reviewer points out that manually editing generated client configuration files is prohibited and that removing these handwritten helper files is a major breaking change that must be reverted upstream in the generator.
| "issue_tracker": "https://issuetracker.google.com/issues/new?component=1130925&template=1637248", | ||
| "language": "nodejs", | ||
| "library_type": "GAPIC_COMBO", | ||
| "library_type": "GAPIC_AUTO", |
There was a problem hiding this comment.
Do not manually edit generated client configuration JSON files. Any changes or updates to .repo-metadata.json must be made upstream in the generator. Additionally, changing the library_type from GAPIC_COMBO to GAPIC_AUTO has resulted in the deletion of all handwritten helper files (helpers.ts, decorator.ts, value-converter.ts) and their tests, which is a major breaking change. Please revert this change upstream in the generator.
References
- Do not manually edit generated client configuration JSON files. Any changes or updates must be made upstream in the generator.
|
See googleapis/librarian#6280 for why this is deleting so much - I think we need to discuss it in more detail. |
a4e207d to
b37a9a7
Compare
|
I enriched the pull request description. |
|
Jon's #8666 is a new approach. |
Migration of
google-cloud-aiplatformto LibrarianThis PR migrates the
google-cloud-aiplatformpackage to use the Librarian generation workflow.Warning
This PR is currently a draft and contains breaking changes (detailed below) due to the removal of veneer helper files and schema proto definitions. These issues need to be resolved before merging.
User-facing Changes
If merged as-is, this PR introduces the following breaking changes:
google/cloud/aiplatform/v1/schema/...andv1beta1/schema/...are no longer compiled into theprotosbundle (protos.js/protos.json). Users will no longer be able to access these types via the exportedprotosnamespace.helpersexport and the automatically injected.toValue()(prototype) and.fromValue()(static) helper methods on AI Platform schema objects are removed.User Impact & Real-world Code References
Removing the schema proto definitions and veneer helpers will break existing user code that relies on type safety, instantiation, or value conversion for AI Platform schemas.
Below are the 3 main impacted cases, supported by real-world code references:
Case 1: Instantiating Schema Messages & using
toValue()Users instantiate schema classes directly to benefit from validation or default values, and then convert them to
google.protobuf.Valueusing.toValue().Impacted Code Example:
Real-world References:
Case 2: TypeScript Type Annotations
TypeScript users import the
protosnamespace to type-annotate their variables when constructing payloads.Impacted Code Example:
Case 3: Parsing Prediction Results & using
fromValue()When receiving prediction results, users use the static
.fromValue()method to convert the genericgoogle.protobuf.Valueback into a typed schema object.Impacted Code Example:
Real-world References:
Handwritten files being removed
The following handwritten files are currently removed in this PR.
packages/google-cloud-aiplatform/src/decorator.tsPurpose: Dynamically enhances generated proto message classes (listed in
enhanced-types.json) with.toValue()(instance method) and.fromValue()(static method) helpers.Last Commit:
danieljbruceon 2026-04-28 (Copyright update).Last Logic Change:
Eric Schmidton 2021-02-12.Impacted Code:
Click to view impacted user code
packages/google-cloud-aiplatform/src/helpers.tsPurpose: Implements the
toValueandfromValuewrapper functions that convert between JavaScript objects/Messages andgoogle.protobuf.Valueobjects.Last Commit:
danieljbruceon 2026-04-28 (Copyright update).Last Logic Change:
Eric Schmidton 2023-06-06.Impacted Code:
Click to view impacted user code
packages/google-cloud-aiplatform/src/value-converter.tsValuerepresentation (Struct, List, etc.).danieljbruceon 2026-04-28 (Copyright update).Eric Schmidton 2023-06-06.Why Librarian does not process the deleted protos
The proto files under
google/cloud/aiplatform/v[1|v1beta1]/schema/...are being deleted because the Librarian tool does not recursively scan subdirectories of the configured proto path by default.maxDepth = 1. Any subdirectory (likeschema/underv1/) is skipped:additional_protosin the package configuration.NodejsAPIconfiguration struct (language.go) only supports a list of individual file paths foradditional_protos. It does not support directory paths, meaning all schema proto files must be listed individually in the config to be preserved.