Make Speech client use autogen layer#1631
Make Speech client use autogen layer#1631stephenplusplus merged 3 commits intogoogleapis:masterfrom jmdobry:gax-speech
Conversation
|
// @jmuk Is it possible to update gax-nodejs to expect camelcase args instead of snake? JS convention is generally camelcase. These are the options we had to provide to grpc to enable this: https://github.com/GoogleCloudPlatform/google-cloud-node/blob/95881d2a83904be5f2e4ebc24ee93369db212ac4/packages/common/src/grpc-service.js#L755 |
packages/speech/src/index.js
Outdated
| }; | ||
|
|
||
| common.GrpcService.call(this, config, options); | ||
| this.api = new v1beta1(options).speechApi(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| }; | ||
|
|
||
| common.GrpcService.call(this, config, options); | ||
| this.api = { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/speech/src/index.js
Outdated
|
|
||
| common.GrpcService.call(this, config, options); | ||
| this.api = { | ||
| speechApi: v1beta1(options).speechApi() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Just adding the |
Anything to call out here, or are you going to file something somewhere else? |
|
Regarding camel case, it looks like Regarding pagination, will file elsewhere. |
|
There's a new release of gax out (0.7.0) which camelCases and upgrades to gRPC@1.0. I believe we're now just waiting on the API files to be generated. |
|
I'll wait for that PR to be merged then. |
|
The PR with the re-generated files has been merged. |
packages/speech/src/index.js
Outdated
| }; | ||
|
|
||
| self.request(protoOpts, reqOpts, function(err, apiResponse) { | ||
| self.api.Speech.syncRecognize(config, foundFile, function(err, apiResponse) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Updated |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jackspeak](https://togithub.com/isaacs/jackspeak) | [`3.4.0` -> `3.4.3`](https://renovatebot.com/diffs/npm/jackspeak/3.4.0/3.4.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>isaacs/jackspeak (jackspeak)</summary> ### [`v3.4.3`](https://togithub.com/isaacs/jackspeak/compare/v3.4.2...v3.4.3) [Compare Source](https://togithub.com/isaacs/jackspeak/compare/v3.4.2...v3.4.3) ### [`v3.4.2`](https://togithub.com/isaacs/jackspeak/compare/v3.4.1...v3.4.2) [Compare Source](https://togithub.com/isaacs/jackspeak/compare/v3.4.1...v3.4.2) ### [`v3.4.1`](https://togithub.com/isaacs/jackspeak/compare/v3.4.0...v3.4.1) [Compare Source](https://togithub.com/isaacs/jackspeak/compare/v3.4.0...v3.4.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/gax-nodejs). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jackspeak](https://togithub.com/isaacs/jackspeak) | [`3.4.0` -> `3.4.3`](https://renovatebot.com/diffs/npm/jackspeak/3.4.0/3.4.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>isaacs/jackspeak (jackspeak)</summary> ### [`v3.4.3`](https://togithub.com/isaacs/jackspeak/compare/v3.4.2...v3.4.3) [Compare Source](https://togithub.com/isaacs/jackspeak/compare/v3.4.2...v3.4.3) ### [`v3.4.2`](https://togithub.com/isaacs/jackspeak/compare/v3.4.1...v3.4.2) [Compare Source](https://togithub.com/isaacs/jackspeak/compare/v3.4.1...v3.4.2) ### [`v3.4.1`](https://togithub.com/isaacs/jackspeak/compare/v3.4.0...v3.4.1) [Compare Source](https://togithub.com/isaacs/jackspeak/compare/v3.4.0...v3.4.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/gax-nodejs). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | [`^10.6.0` -> `^10.7.0`](https://renovatebot.com/diffs/npm/mocha/10.6.0/10.7.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mochajs/mocha (mocha)</summary> ### [`v10.7.0`](https://togithub.com/mochajs/mocha/blob/HEAD/CHANGELOG.md#1070--2024-07-20) [Compare Source](https://togithub.com/mochajs/mocha/compare/v10.6.1...v10.7.0) ##### 🎉 Enhancements - [#​4771](https://togithub.com/mochajs/mocha/pull/4771) feat: add option to not fail on failing test suite ([**@​ilgonmic**](https://togithub.com/ilgonmic)) ### [`v10.6.1`](https://togithub.com/mochajs/mocha/blob/HEAD/CHANGELOG.md#1061--2024-07-20) [Compare Source](https://togithub.com/mochajs/mocha/compare/v10.6.0...v10.6.1) ##### 🐛 Fixes - [#​3825](https://togithub.com/mochajs/mocha/pull/3825) fix: do not exit when only unref'd timer is present in test code ([**@​boneskull**](https://togithub.com/boneskull)) - [#​5040](https://togithub.com/mochajs/mocha/pull/5040) fix: support canonical module ([**@​JacobLey**](https://togithub.com/JacobLey)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/gapic-generator-typescript). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
…ection (#1631) ## Description This PR adds source code changes with plumbing so that client side metric collection can be done for unary calls. No client side metrics are actually collected yet for readModifyWriteRow or checkAndMutate calls, but future PRs will use this plumbing to collect metrics for those calls. A test is provided that makes a fake method on the table to demonstrate how a method would collect these metrics to serve as an example. ## Impact Doesn't change the way the client library works. Just provides support for when we open a PR that collects client side metrics for unary calls. ## Testing A unit test is created that adds a fake method to a table that does a basic unary readModifyWriteRow call. It ensures that the metrics make it to the test metrics handler correctly. ## Additional Information **Changes:** `src/interceptor.ts`: This file contains code for attaching interceptors to a call that will call the correct metrics collector methods when data arrives `src/client-side-metrics/operation-metrics-collector.ts`: The types are cleaned up in this file. None of the functionality has changed in this file `system-test/read-modify-write-row-interceptors.ts`: This adds a test that ensures the plumbing for collecting metadata trailers and headers works as intended for unary calls.
…ection (#1631) ## Description This PR adds source code changes with plumbing so that client side metric collection can be done for unary calls. No client side metrics are actually collected yet for readModifyWriteRow or checkAndMutate calls, but future PRs will use this plumbing to collect metrics for those calls. A test is provided that makes a fake method on the table to demonstrate how a method would collect these metrics to serve as an example. ## Impact Doesn't change the way the client library works. Just provides support for when we open a PR that collects client side metrics for unary calls. ## Testing A unit test is created that adds a fake method to a table that does a basic unary readModifyWriteRow call. It ensures that the metrics make it to the test metrics handler correctly. ## Additional Information **Changes:** `src/interceptor.ts`: This file contains code for attaching interceptors to a call that will call the correct metrics collector methods when data arrives `src/client-side-metrics/operation-metrics-collector.ts`: The types are cleaned up in this file. None of the functionality has changed in this file `system-test/read-modify-write-row-interceptors.ts`: This adds a test that ensures the plumbing for collecting metadata trailers and headers works as intended for unary calls.
…ection (#1631) ## Description This PR adds source code changes with plumbing so that client side metric collection can be done for unary calls. No client side metrics are actually collected yet for readModifyWriteRow or checkAndMutate calls, but future PRs will use this plumbing to collect metrics for those calls. A test is provided that makes a fake method on the table to demonstrate how a method would collect these metrics to serve as an example. ## Impact Doesn't change the way the client library works. Just provides support for when we open a PR that collects client side metrics for unary calls. ## Testing A unit test is created that adds a fake method to a table that does a basic unary readModifyWriteRow call. It ensures that the metrics make it to the test metrics handler correctly. ## Additional Information **Changes:** `src/interceptor.ts`: This file contains code for attaching interceptors to a call that will call the correct metrics collector methods when data arrives `src/client-side-metrics/operation-metrics-collector.ts`: The types are cleaned up in this file. None of the functionality has changed in this file `system-test/read-modify-write-row-interceptors.ts`: This adds a test that ensures the plumbing for collecting metadata trailers and headers works as intended for unary calls.
My initial attempt at using the autogen layer in the handwritten layer. I have a concern:
It would appear that
gax-nodejsdoes not translate camel case option names into the snake case names defined the proto. WheresampleRateworked before, thy tests forrecognizeandcreateRecognitionStreamstarted failing until I switched it tosample_rate.Other than that it seems to work fine.
I found some other
gax-nodejsusability issues with pagination that don't apply here.