feat: migrate google-cloud-speech to librarian (keep helpers)#8648
Open
suztomo wants to merge 2 commits into
Open
feat: migrate google-cloud-speech to librarian (keep helpers)#8648suztomo wants to merge 2 commits into
suztomo wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the configuration and metadata for the @google-cloud/speech package. Key changes include modifying librarian.yaml to retain specific helper and index files, updating .repo-metadata.json with new API descriptions and documentation links, and removing outdated OwlBot and Prettier configuration files along with several system test files. Additionally, copyright years are updated in helper and test files. There are no review comments, and I have no feedback to provide.
Member
Author
|
All checks have passed. |
Member
Author
|
Superseding #8635 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR migrates the
google-cloud-speechpackage to use Librarian for code generation, while preserving the customstreamingRecognizehelper and its tests to avoid breaking changes and preserve test coverage.This is a follow-up to the initial attempt in #8635, which removed the helper and tests.
Highlights
google-cloud-speechby removingskip_generate: trueinlibrarian.yaml.keepconfiguration inlibrarian.yamlto preserve:src/helpers.ts(custom helper)src/index.ts(mixin logic)test/helpers.test.ts(unit tests)system-test/fixtures/streamingRecognize/input.wav(test fixture)system-test/speech_system_test.jsetc. (legacy system tests).OwlBot.yaml) and other obsolete configs.Detailed Rationale for
keepListWhy is
src/helpers.tskept?src/helpers.tscontains the customstreamingRecognizehelper. In the initial attempt (#8635), this helper was removed to transition to a fully auto-generated client. However, this helper is exposed to users and removing it introduces a major breaking change.The Breaking Change:
The custom helper wraps the raw gRPC stream. Without it:
streamingConfigdirectly as the first argument tostreamingRecognize(config).stream.write(audioBuffer)or.pipe()). Instead, users must writeStreamingRecognizeRequestobjects directly, wrapping the audio in{audioContent: buffer}.Keeping
src/helpers.tspreserves this helper and avoids these breaking changes.Why is
src/index.tskept?src/index.tscontains the runtime mixin logic that injects the helper into the generated clients:If
src/index.tsis not in thekeeplist, Librarian will overwrite it with a default generated index file that only contains standard exports.Without the mixin logic in
src/index.ts, the custom helper inhelpers.tsis never bound to theSpeechClientprototype at runtime. Callingclient.streamingRecognize()would fail (as the generated method is renamed to_streamingRecognizebylibrarian.jsto avoid conflicts, leavingstreamingRecognizeundefined).Why are the system tests and
input.wavkept?We preserve the legacy system tests (
system-test/speech_system_test.js,system-test/speech_typescript_system_test.ts, etc.) and the associated test fixture (system-test/fixtures/streamingRecognize/input.wav) to maintain test coverage for the preserved helper. These tests verify thestreamingRecognizehelper functionality at a system level.Note: We may delete these legacy system tests later (see Librarian #6377).
Detailed Rationale for Deleted Files
Why was
prettier.config.jsdeleted?prettier.config.jswas deleted because it is redundant.It previously contained:
This is identical to the standard Google TypeScript Style (GTS) config. The monorepo has a root
.prettierrc.cjsthat extendsgts/.prettierrc.json. With this package-level config removed, Prettier will correctly fall back to the root config, ensuring consistent formatting across the entire repository without maintaining redundant local configuration files.User-facing Changes
None. The custom
streamingRecognizehelper and its mixin logic are preserved, so behavior is identical to pre-migration.