From 82aaa3996514aa74cd7078da095d7509fc91cf3d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 13:27:43 -0700 Subject: [PATCH 01/13] docs: update docs-devsite.sh to use latest node-js-rad version (#1454) Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> Source-Link: https://github.com/googleapis/synthtool/commit/b1ced7db5adee08cfa91d6b138679fceff32c004 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:0527a86c10b67742c409dc726ba9a31ec4e69b0006e3d7a49b0e6686c59cdaa9 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 3 ++- .kokoro/release/docs-devsite.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 0b836e119..21ad18bd7 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:e6d785d6de3cab027f6213d95ccedab4cab3811b0d3172b78db2216faa182e32 + digest: sha256:0527a86c10b67742c409dc726ba9a31ec4e69b0006e3d7a49b0e6686c59cdaa9 +# created: 2023-05-24T20:32:43.844586914Z diff --git a/.kokoro/release/docs-devsite.sh b/.kokoro/release/docs-devsite.sh index 2198e67fe..3596c1e4c 100755 --- a/.kokoro/release/docs-devsite.sh +++ b/.kokoro/release/docs-devsite.sh @@ -25,5 +25,6 @@ if [[ -z "$CREDENTIALS" ]]; then fi npm install -npm install --no-save @google-cloud/cloud-rad@^0.2.5 -npx @google-cloud/cloud-rad \ No newline at end of file +npm install --no-save @google-cloud/cloud-rad@^0.3.7 +# publish docs to devsite +npx @google-cloud/cloud-rad . cloud-rad From 115e317728c8ae6fa0e61f54d0087e26382d8230 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 11 Jul 2023 15:34:54 -0700 Subject: [PATCH 02/13] fix: add missing devDependency for compodoc (#1470) * fix: add missing devDependency for compodoc * build: try with skipLibCheck * build: revert skipLibCheck * build: install dependency for compodoc * fix(deps): pin compodoc --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f2e67a299..ca6e4ef99 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "retry-request": "^5.0.0" }, "devDependencies": { + "@babel/plugin-proposal-private-methods": "^7.18.6", "@compodoc/compodoc": "1.1.19", "@types/mocha": "^9.0.0", "@types/ncp": "^2.0.1", From 0a7dd948573bd9553a0e9548e9ab92dbcfcb7414 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 12 Jul 2023 23:20:05 +0200 Subject: [PATCH 03/13] fix(deps): update protobufjs (#1467) * fix: update protobufjs * chore: add exclusion to linkinator config --------- Co-authored-by: Alexander Fenster --- linkinator.config.json | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/linkinator.config.json b/linkinator.config.json index 29a223b6d..da66523a6 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -3,7 +3,8 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "docs/js/menu-wc_es5.js" ], "silent": true, "concurrency": 10 diff --git a/package.json b/package.json index ca6e4ef99..5095e7993 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "node-fetch": "^2.6.1", "object-hash": "^3.0.0", "proto3-json-serializer": "^1.0.0", - "protobufjs": "7.2.3", + "protobufjs": "7.2.4", "retry-request": "^5.0.0" }, "devDependencies": { From d2a5ccbf93a987bc4ae6fd6bc3e319ddf10d26f6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 13 Jul 2023 00:06:38 +0200 Subject: [PATCH 04/13] chore(deps): update dependency protobufjs to v7.2.4 [security] (#1473) * chore(deps): update dependency protobufjs to v7.2.4 [security] * chore: update linkinator config --------- Co-authored-by: Alexander Fenster --- linkinator.config.json | 3 +-- tools/package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/linkinator.config.json b/linkinator.config.json index da66523a6..29a223b6d 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -3,8 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "docs/js/menu-wc_es5.js" + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/tools/package.json b/tools/package.json index 53b34d894..6fb2517a0 100644 --- a/tools/package.json +++ b/tools/package.json @@ -44,7 +44,7 @@ "gts": "^3.1.1", "mocha": "^9.0.0", "ncp": "^2.0.0", - "protobufjs": "7.2.3", + "protobufjs": "7.2.4", "typescript": "^4.6.4" }, "engines": { From c1c4dc19da45780ade32178f9f7ac76e8bb5aef1 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 13 Jul 2023 10:00:57 -0700 Subject: [PATCH 05/13] test: run speech test from monorepo, use gapic-tools (#1472) --- test/system-test/test.clientlibs.ts | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/test/system-test/test.clientlibs.ts b/test/system-test/test.clientlibs.ts index efe822b80..f4be5b0a7 100644 --- a/test/system-test/test.clientlibs.ts +++ b/test/system-test/test.clientlibs.ts @@ -38,6 +38,9 @@ const gaxDir = path.resolve(__dirname, '..', '..', '..'); // eslint-disable-next-line @typescript-eslint/no-var-requires const pkg = require('../../../package.json'); const gaxTarball = path.join(gaxDir, `${pkg.name}-${pkg.version}.tgz`); +const toolsPkg = require('../../../tools/package.json'); +const toolsBasename = `${toolsPkg.name}-${toolsPkg.version}.tgz`; +const toolsTarball = path.join(gaxDir, toolsBasename); async function latestRelease( cwd: string, @@ -121,8 +124,7 @@ async function preparePackage( const packageJsonStr = (await readFile(packageJson)).toString(); const packageJsonObj = JSON.parse(packageJsonStr); packageJsonObj['dependencies']['google-gax'] = `file:${gaxTarball}`; - await writeFile(packageJson, JSON.stringify(packageJsonObj, null, ' ')); - packageJsonObj['dependencies']['google-gax'] = `file:${gaxTarball}`; + packageJsonObj['devDependencies']['gapic-tools'] = `file:${toolsTarball}`; await writeFile(packageJson, JSON.stringify(packageJsonObj, null, ' ')); await execa('npm', ['install'], { cwd: inMonorepo ? packagePath : packageName, @@ -176,10 +178,25 @@ describe('Run system tests for some libraries', () => { before(async () => { console.log('Packing google-gax...'); await execa('npm', ['pack'], {cwd: gaxDir, stdio: 'inherit'}); - if (!fs.existsSync(gaxTarball)) { throw new Error(`npm pack tarball ${gaxTarball} does not exist`); } + console.log('Packing gapic-tools...'); + await execa('npm', ['install'], { + cwd: path.join(gaxDir, 'tools'), + stdio: 'inherit', + }); + await execa('npm', ['pack'], { + cwd: path.join(gaxDir, 'tools'), + stdio: 'inherit', + }); + await fs.promises.rename( + path.join(gaxDir, 'tools', toolsBasename), + toolsTarball + ); + if (!fs.existsSync(toolsTarball)) { + throw new Error(`npm pack tarball ${toolsTarball} does not exist`); + } await rmrf(testDir); await mkdir(testDir); @@ -188,13 +205,13 @@ describe('Run system tests for some libraries', () => { }); // Speech has unary, LRO, and streaming - // Speech is not in the monorepo + // Speech is in the google-cloud-node monorepo describe('speech', () => { before(async () => { - await preparePackage('nodejs-speech', false); + await preparePackage('speech', true); }); it('should pass system tests', async function () { - const result = await runSystemTest('nodejs-speech', false); + const result = await runSystemTest('speech', true); if (result === TestResult.SKIP) { this.skip(); } else if (result === TestResult.FAIL) { From 4266f43922d0d582b8eced11f4a21c98a8b451fe Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 13 Jul 2023 10:18:06 -0700 Subject: [PATCH 06/13] fix: replace proto-over-HTTP with REGAPIC (#1471) --- client-libraries.md | 19 ++--- src/fallback.ts | 35 ++++----- src/fallbackProto.ts | 71 ------------------- src/paginationCalls/pageDescriptor.ts | 12 +++- src/streamArrayParser.ts | 2 +- test/browser-test/karma.conf.js | 4 +- test/browser-test/package.json | 3 + test/browser-test/test/test.endtoend.ts | 7 +- test/browser-test/test/test.grpc-fallback.ts | 28 ++++---- test/showcase-echo-client/package.json | 4 +- .../src/v1beta1/echo_client.ts | 17 +++-- test/test-application/src/index.ts | 42 ++++------- test/unit/grpc-fallback.ts | 23 ++++-- 13 files changed, 93 insertions(+), 174 deletions(-) delete mode 100644 src/fallbackProto.ts diff --git a/client-libraries.md b/client-libraries.md index 47d115672..d64cea055 100644 --- a/client-libraries.md +++ b/client-libraries.md @@ -99,31 +99,20 @@ binary tranport based on HTTP/2. It's Node.js implementation, #### HTTP/1.1 REST API mode -- `options.fallback`: `true`, `"rest"`, or `false`, use HTTP fallback mode. +- `options.fallback`: `true` or `false`, use HTTP fallback mode. Default value is `false`, unless the `window` object is defined. + For compatibility, you can pass any non-empty string, it will be considered + a `true` value. If you need to use the client library in non-Node.js environment or when gRPC cannot be used for any reason, you can use the HTTP/1.1 fallback mode. In this mode, a special browser-compatible transport implementation is used instead of -gRPC transport. - -There are two supported gRPC fallback modes: - -- set `options.fallback` to `"rest"`: the library will send and receive JSON - payload, HTTP/1.1 REST API endpoints will be used. This mode is recommended - for fallback. - -- set `options.fallback` to `true`: the library will send and receive serialized - protobuf payload to special endpoints accepting serialized protobufs over - HTTP/1.1. +gRPC transport. It will send and receive JSONs over HTTP. In browser context (if the `window` object is defined) the fallback mode is enabled automatically; set `options.fallback` to `false` if you need to override this behavior. -Note that `options.fallback` accepts boolean values (`true` and `false`) for -compatibility only. We recommend using `"rest"` to use HTTP/1.1 instead of gRPC. - ## Calling API methods In all examples below we assume that `client` is an instance of the client diff --git a/src/fallback.ts b/src/fallback.ts index 0f3046e66..cbc49dbff 100644 --- a/src/fallback.ts +++ b/src/fallback.ts @@ -35,7 +35,6 @@ import {GaxCall, GRPCCall} from './apitypes'; import {Descriptor, StreamDescriptor} from './descriptor'; import {createApiCall as _createApiCall} from './createApiCall'; import {FallbackServiceError} from './googleError'; -import * as fallbackProto from './fallbackProto'; import * as fallbackRest from './fallbackRest'; import {isNodeJS} from './featureDetection'; import {generateServiceStub} from './fallbackServiceStub'; @@ -94,7 +93,7 @@ export type AuthClient = export class GrpcClient { auth?: OAuth2Client | GoogleAuth; authClient?: AuthClient; - fallback: boolean | 'rest' | 'proto'; + fallback: boolean; grpcVersion: string; private static protoCache = new Map(); httpRules?: Array; @@ -119,7 +118,11 @@ export class GrpcClient { constructor( options: (GrpcClientOptions | {auth: OAuth2Client}) & { - fallback?: boolean | 'rest' | 'proto'; + /** + * Fallback mode to use instead of gRPC. + * A string is accepted for compatibility, all non-empty string values enable the HTTP REST fallback. + */ + fallback?: boolean | string; } = {} ) { if (!isNodeJS()) { @@ -135,7 +138,7 @@ export class GrpcClient { (options.auth as GoogleAuth) || new GoogleAuth(options as GoogleAuthOptions); } - this.fallback = options.fallback !== 'rest' ? 'proto' : 'rest'; + this.fallback = options.fallback ? true : false; this.grpcVersion = require('../../package.json').version; this.httpRules = (options as GrpcClientOptions).httpRules; this.numericEnums = (options as GrpcClientOptions).numericEnums ?? false; @@ -316,14 +319,8 @@ export class GrpcClient { servicePort = 443; } - const encoder = - this.fallback === 'rest' - ? fallbackRest.encodeRequest - : fallbackProto.encodeRequest; - const decoder = - this.fallback === 'rest' - ? fallbackRest.decodeResponse - : fallbackProto.decodeResponse; + const encoder = fallbackRest.encodeRequest; + const decoder = fallbackRest.decodeResponse; const serviceStub = generateServiceStub( methods, protocol, @@ -362,7 +359,7 @@ export class GrpcClient { export function lro(options: GrpcClientOptions) { options = Object.assign({scopes: []}, options); if (options.protoJson) { - options = Object.assign(options, {fallback: 'rest'}); + options = Object.assign(options, {fallback: true}); } const gaxGrpc = new GrpcClient(options); return new OperationsClientBuilder(gaxGrpc, options.protoJson); @@ -396,10 +393,10 @@ export function createApiCall( func: Promise | GRPCCall, settings: gax.CallSettings, descriptor?: Descriptor, - fallback?: boolean | 'proto' | 'rest' + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _fallback?: boolean | string // unused; for compatibility only ): GaxCall { if ( - (!fallback || fallback === 'rest') && descriptor && 'streaming' in descriptor && (descriptor as StreamDescriptor).type !== StreamType.SERVER_STREAMING @@ -410,14 +407,10 @@ export function createApiCall( ); }; } - if ( - (fallback === 'proto' || fallback === true) && // for legacy reasons, fallback === true means 'proto' - descriptor && - 'streaming' in descriptor - ) { + if (descriptor && 'streaming' in descriptor && !isNodeJS()) { return () => { throw new Error( - 'The gRPC-fallback (proto over HTTP) transport currently does not support streaming calls.' + 'Server streaming over the REST transport is only supported in Node.js.' ); }; } diff --git a/src/fallbackProto.ts b/src/fallbackProto.ts deleted file mode 100644 index bfaa5fc10..000000000 --- a/src/fallbackProto.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// proto-over-HTTP request encoding and decoding - -import {defaultToObjectOptions} from './fallback'; -import {FetchParameters} from './fallbackServiceStub'; -import {GoogleErrorDecoder} from './googleError'; - -export function encodeRequest( - rpc: protobuf.Method, - protocol: string, - servicePath: string, - servicePort: number, - request: {} -): FetchParameters { - const protoNamespaces: string[] = []; - let currNamespace = rpc.parent!; - while (currNamespace.name !== '') { - protoNamespaces.unshift(currNamespace.name); - currNamespace = currNamespace.parent!; - } - const protoServiceName = protoNamespaces.join('.'); - const rpcName = rpc.name; - - const headers: {[key: string]: string} = { - 'Content-Type': 'application/x-protobuf', - }; - - const method = 'POST'; - const requestMessage = rpc.resolvedRequestType!.fromObject(request); - const body = rpc.resolvedRequestType!.encode(requestMessage).finish(); - const url = `${protocol}://${servicePath}:${servicePort}/$rpc/${protoServiceName}/${rpcName}`; - - return { - method, - url, - headers, - body, - }; -} - -export function decodeResponse( - rpc: protobuf.Method, - ok: boolean, - response: Buffer | ArrayBuffer -): {} { - if (!ok) { - const statusDecoder = new GoogleErrorDecoder(); - const error = statusDecoder.decodeErrorFromBuffer(response); - throw error; - } - - const buffer = - response instanceof ArrayBuffer ? new Uint8Array(response) : response; - const message = rpc.resolvedResponseType!.decode(buffer); - return rpc.resolvedResponseType!.toObject(message, defaultToObjectOptions); -} diff --git a/src/paginationCalls/pageDescriptor.ts b/src/paginationCalls/pageDescriptor.ts index a4bf867b1..6bc0a9c46 100644 --- a/src/paginationCalls/pageDescriptor.ts +++ b/src/paginationCalls/pageDescriptor.ts @@ -81,7 +81,11 @@ export class PageDescriptor implements Descriptor { // emit full api response with every page. stream.emit('response', apiResp); for (let i = 0; i < resources.length; ++i) { - if ((stream as any)._readableState.ended) { + // TODO: rewrite without accessing stream internals + if ( + (stream as unknown as {_readableState: {ended: boolean}}) + ._readableState.ended + ) { return; } if (resources[i] === null) { @@ -93,7 +97,11 @@ export class PageDescriptor implements Descriptor { stream.end(); } } - if ((stream as any)._readableState.ended) { + // TODO: rewrite without accessing stream internals + if ( + (stream as unknown as {_readableState: {ended: boolean}})._readableState + .ended + ) { return; } if (!next) { diff --git a/src/streamArrayParser.ts b/src/streamArrayParser.ts index 697dc2521..7aa03c1f4 100644 --- a/src/streamArrayParser.ts +++ b/src/streamArrayParser.ts @@ -116,7 +116,7 @@ export class StreamArrayParser extends Transform { chunk.slice(objectStart, curIndex + 1), ]); try { - // HTTP reponse.ok is true. + // HTTP response.ok is true. const msgObj = decodeResponse(this.rpc, true, objBuff); this.push(msgObj); } catch (err) { diff --git a/test/browser-test/karma.conf.js b/test/browser-test/karma.conf.js index f34eacc0c..5754262b1 100644 --- a/test/browser-test/karma.conf.js +++ b/test/browser-test/karma.conf.js @@ -86,7 +86,9 @@ module.exports = function (config) { base: 'ChromeHeadless', // We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs // more permissions than Docker allows by default) - flags: isDocker ? ['--no-sandbox'] : [], + flags: isDocker + ? ['--no-sandbox', '--disable-web-security'] + : ['--disable-web-security'], }, }, diff --git a/test/browser-test/package.json b/test/browser-test/package.json index f98e7d39b..5171769db 100644 --- a/test/browser-test/package.json +++ b/test/browser-test/package.json @@ -7,6 +7,9 @@ "files": [ "build/test" ], + "engines": { + "node": ">=14" + }, "license": "Apache-2.0", "keywords": [], "scripts": { diff --git a/test/browser-test/test/test.endtoend.ts b/test/browser-test/test/test.endtoend.ts index f07cb3213..1d9556dbc 100644 --- a/test/browser-test/test/test.endtoend.ts +++ b/test/browser-test/test/test.endtoend.ts @@ -41,7 +41,7 @@ describe('Run tests against gRPC server', () => { const opts = { auth: authStub as unknown as GoogleAuth, protocol: 'http', - port: 1337, + port: 7469, }; // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -87,8 +87,11 @@ describe('Run tests against gRPC server', () => { const words = ['nobody', 'ever', 'reads', 'test', 'input']; const request = { content: words.join(' '), + pageSize: 2, }; - assert.throws(() => client.expand(request)); + assert.throws(() => { + client.expand(request); + }); }); it('should be able to call paging calls', async () => { diff --git a/test/browser-test/test/test.grpc-fallback.ts b/test/browser-test/test/test.grpc-fallback.ts index d9c9133b3..6cf85e725 100644 --- a/test/browser-test/test/test.grpc-fallback.ts +++ b/test/browser-test/test/test.grpc-fallback.ts @@ -23,7 +23,6 @@ import {protobuf, GoogleAuth, fallback} from 'google-gax'; import {EchoClient} from 'showcase-echo-client'; import echoProtoJson = require('showcase-echo-client/build/protos/protos.json'); -import statusProtoJson = require('google-gax/build/protos/status.json'); const authStub = { getClient: async () => { @@ -193,12 +192,13 @@ describe('grpc-fallback', () => { it('should make a request', async () => { const client = new EchoClient(opts); const requestObject = {content: 'test-content'}; - const responseType = protos.lookupType('EchoResponse'); - const response = responseType.create(requestObject); // request === response for EchoService + const response = requestObject; // response == request for Echo const fakeFetch = sinon.fake.resolves({ ok: true, arrayBuffer: () => { - return Promise.resolve(responseType.encode(response).finish()); + return Promise.resolve( + new TextEncoder().encode(JSON.stringify(response)) + ); }, }); // eslint-disable-next-line no-undef @@ -233,8 +233,7 @@ describe('grpc-fallback', () => { fallback.routingHeader.fromParams({ abc: 'def', }); - const responseType = protos.lookupType('EchoResponse'); - const response = responseType.create(requestObject); + const response = requestObject; // eslint-disable-next-line no-undef const savedFetch = window.fetch; // @ts-ignore @@ -245,7 +244,9 @@ describe('grpc-fallback', () => { return Promise.resolve({ ok: true, arrayBuffer: () => { - return Promise.resolve(responseType.encode(response).finish()); + return Promise.resolve( + new TextEncoder().encode(JSON.stringify(response)) + ); }, }); }; @@ -257,20 +258,17 @@ describe('grpc-fallback', () => { it('should handle an error', done => { const requestObject = {content: 'test-content'}; - // example of an actual google.rpc.Status error message returned by Language - // API const expectedError = Object.assign(new Error('Error message'), { - code: 3, + code: 400, statusDetails: [], }); const fakeFetch = sinon.fake.resolves({ ok: false, arrayBuffer: () => { - const root = protobuf.Root.fromJSON(statusProtoJson); - const statusType = root.lookupType('google.rpc.Status'); - const statusMessage = statusType.fromObject(expectedError); - return Promise.resolve(statusType.encode(statusMessage).finish()); + return Promise.resolve( + new TextEncoder().encode(JSON.stringify(expectedError)) + ); }, }); // eslint-disable-next-line no-undef @@ -279,8 +277,6 @@ describe('grpc-fallback', () => { gaxGrpc.createStub(echoService, stubOptions).then(echoStub => { echoStub.echo(requestObject, {}, {}, (err?: Error) => { assert(err instanceof Error); - assert.strictEqual(err.message, '3 INVALID_ARGUMENT: Error message'); - assert.strictEqual(JSON.stringify(err), JSON.stringify(expectedError)); done(); }); }); diff --git a/test/showcase-echo-client/package.json b/test/showcase-echo-client/package.json index 5a1f8a808..6c9213210 100644 --- a/test/showcase-echo-client/package.json +++ b/test/showcase-echo-client/package.json @@ -30,7 +30,7 @@ "scripts": { "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", - "prefetch": "rm -rf node_modules package-lock.json google-gax*.tgz && cd ../.. && npm pack && mv google-gax*.tgz test/showcase-echo-client/google-gax.tgz", + "prefetch": "rm -rf node_modules package-lock.json google-gax*.tgz gapic-tools*.tgz && cd ../.. && npm pack && mv google-gax*.tgz test/showcase-echo-client/google-gax.tgz && cd tools && npm install && npm pack && mv gapic-tools*.tgz ../test/showcase-echo-client/gapic-tools.tgz", "prepare": "npm run compile-protos && npm run compile" }, "dependencies": { @@ -38,7 +38,7 @@ }, "devDependencies": { "@types/node": "^16.0.0", - "gapic-tools": "^0.1.7", + "gapic-tools": "./gapic-tools.tgz", "typescript": "^4.5.5" }, "engines": { diff --git a/test/showcase-echo-client/src/v1beta1/echo_client.ts b/test/showcase-echo-client/src/v1beta1/echo_client.ts index 898c84887..5ba299f35 100644 --- a/test/showcase-echo-client/src/v1beta1/echo_client.ts +++ b/test/showcase-echo-client/src/v1beta1/echo_client.ts @@ -166,10 +166,10 @@ export class EchoClient { } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + if (opts.fallback) { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -224,15 +224,18 @@ export class EchoClient { this.descriptors.stream = { expand: new this._gaxModule.StreamDescriptor( gax.StreamType.SERVER_STREAMING, - opts.fallback === 'rest' + // legacy: opts.fallback can be a string or a boolean + opts.fallback ? true : false ), collect: new this._gaxModule.StreamDescriptor( gax.StreamType.CLIENT_STREAMING, - opts.fallback === 'rest' + // legacy: opts.fallback can be a string or a boolean + opts.fallback ? true : false ), chat: new this._gaxModule.StreamDescriptor( gax.StreamType.BIDI_STREAMING, - opts.fallback === 'rest' + // legacy: opts.fallback can be a string or a boolean + opts.fallback ? true : false ), }; @@ -244,7 +247,7 @@ export class EchoClient { auth: this.auth, grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }; - if (opts.fallback === 'rest') { + if (opts.fallback) { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [ { diff --git a/test/test-application/src/index.ts b/test/test-application/src/index.ts index cd6a9cb8c..7642dc242 100644 --- a/test/test-application/src/index.ts +++ b/test/test-application/src/index.ts @@ -41,14 +41,14 @@ async function testShowcase() { }, } as unknown as GoogleAuth; - const fallbackClientOpts = { + const restClientOpts = { fallback: true, protocol: 'http', - port: 1337, + port: 7469, auth: fakeGoogleAuth, }; - const restClientOpts = { + const restClientOptsCompat = { fallback: 'rest' as const, protocol: 'http', port: 7469, @@ -56,8 +56,8 @@ async function testShowcase() { }; const grpcClient = new EchoClient(grpcClientOpts); - const fallbackClient = new EchoClient(fallbackClientOpts); const restClient = new EchoClient(restClientOpts); + const restClientCompat = new EchoClient(restClientOptsCompat); // assuming gRPC server is started locally await testEcho(grpcClient); @@ -69,15 +69,6 @@ async function testShowcase() { await testChat(grpcClient); await testWait(grpcClient); - await testEcho(fallbackClient); - await testEchoError(fallbackClient); - await testExpandThrows(fallbackClient); // fallback does not support server streaming - await testPagedExpand(fallbackClient); - await testPagedExpandAsync(fallbackClient); - await testCollectThrows(fallbackClient); // fallback does not support client streaming - await testChatThrows(fallbackClient); // fallback does not support bidi streaming - await testWait(fallbackClient); - await testEcho(restClient); await testExpand(restClient); // REGAPIC supports server streaming await testPagedExpand(restClient); @@ -85,6 +76,14 @@ async function testShowcase() { await testCollectThrows(restClient); // REGAPIC does not support client streaming await testChatThrows(restClient); // REGAPIC does not support bidi streaming await testWait(restClient); + + await testEcho(restClientCompat); + await testExpand(restClientCompat); // REGAPIC supports server streaming + await testPagedExpand(restClientCompat); + await testPagedExpandAsync(restClientCompat); + await testCollectThrows(restClientCompat); // REGAPIC does not support client streaming + await testChatThrows(restClientCompat); // REGAPIC does not support bidi streaming + await testWait(restClientCompat); } async function testEcho(client: EchoClient) { @@ -182,23 +181,6 @@ async function testExpand(client: EchoClient) { }); } -async function testExpandThrows(client: EchoClient) { - const words = ['nobody', 'ever', 'reads', 'test', 'input']; - const request = { - content: words.join(' '), - }; - assert.throws(() => { - const stream = client.expand(request); - const result: string[] = []; - stream.on('data', (response: {content: string}) => { - result.push(response.content); - }); - stream.on('end', () => { - assert.deepStrictEqual(words, result); - }); - }, /currently does not support/); -} - async function testPagedExpand(client: EchoClient) { const words = ['nobody', 'ever', 'reads', 'test', 'input']; const request = { diff --git a/test/unit/grpc-fallback.ts b/test/unit/grpc-fallback.ts index e386c5eb6..53abfdb99 100644 --- a/test/unit/grpc-fallback.ts +++ b/test/unit/grpc-fallback.ts @@ -19,8 +19,6 @@ import * as assert from 'assert'; import {describe, it, beforeEach, afterEach, before, after} from 'mocha'; -import * as path from 'path'; -import * as fs from 'fs'; import * as nodeFetch from 'node-fetch'; import * as abortController from 'abort-controller'; import * as protobuf from 'protobufjs'; @@ -267,7 +265,7 @@ describe('grpc-fallback', () => { Promise.resolve({ ok: true, arrayBuffer: () => { - return Promise.resolve(responseType.encode(response).finish()); + return Promise.resolve(Buffer.from(JSON.stringify(response))); }, }) ); @@ -287,10 +285,23 @@ describe('grpc-fallback', () => { it('should handle an API error', done => { const requestObject = {content: 'test-content'}; // example of an actual google.rpc.Status error message returned by Language API - const fixtureName = path.resolve(__dirname, '..', 'fixtures', 'error.bin'); - const errorBin = fs.readFileSync(fixtureName); const expectedMessage = '3 INVALID_ARGUMENT: One of content, or gcs_content_uri must be set.'; + const jsonError = { + code: 400, // Bad request + message: expectedMessage, + details: [ + { + '@type': 'type.googleapis.com/google.rpc.BadRequest', + fieldViolations: [ + { + field: 'document.content', + description: 'Must have some text content to annotate.', + }, + ], + }, + ], + }; const expectedError = { code: 3, details: [ @@ -309,7 +320,7 @@ describe('grpc-fallback', () => { Promise.resolve({ ok: false, arrayBuffer: () => { - return Promise.resolve(errorBin); + return Promise.resolve(Buffer.from(JSON.stringify(jsonError))); }, }) ); From 48eed955e7329f55f9427a7bc0656cfe2af395e8 Mon Sep 17 00:00:00 2001 From: Megan Potter <57276408+feywind@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:47:46 -0400 Subject: [PATCH 07/13] fix: the return types for IAM service methods should be arrays, to match ReturnTuple (#1001) * fix: the return types for IAM service methods should be arrays, to match ReturnTuple * fix: update PR to current types * fix: also fix explicit typings for IAM * build: work around circular dependency with kms (second PR to follow) * docs: broken tsdoc --- src/iamService.ts | 18 +++++++++--------- src/protosList.json | 8 ++++++++ .../src/v1beta1/echo_client.ts | 6 +++--- test/system-test/test.clientlibs.ts | 5 +++-- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/iamService.ts b/src/iamService.ts index 2a3df9ba6..758536775 100644 --- a/src/iamService.ts +++ b/src/iamService.ts @@ -203,7 +203,7 @@ export class IamClient { getIamPolicy( request: protos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions - ): Promise; + ): Promise<[protos.google.iam.v1.Policy]>; getIamPolicy( request: protos.google.iam.v1.GetIamPolicyRequest, options: gax.CallOptions, @@ -235,7 +235,7 @@ export class IamClient { protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined > - ): Promise { + ): Promise<[protos.google.iam.v1.Policy]> { let options: gax.CallOptions; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback as unknown as Callback< @@ -262,7 +262,7 @@ export class IamClient { setIamPolicy( request: protos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions - ): Promise; + ): Promise<[protos.google.iam.v1.Policy]>; setIamPolicy( request: protos.google.iam.v1.SetIamPolicyRequest, options: gax.CallOptions, @@ -294,7 +294,7 @@ export class IamClient { protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined > - ): Promise { + ): Promise<[protos.google.iam.v1.Policy]> { let options: gax.CallOptions; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback as unknown as Callback< @@ -320,7 +320,7 @@ export class IamClient { testIamPermissions( request: protos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions - ): Promise; + ): Promise<[protos.google.iam.v1.TestIamPermissionsResponse]>; testIamPermissions( request: protos.google.iam.v1.TestIamPermissionsRequest, callback: Callback< @@ -352,7 +352,7 @@ export class IamClient { protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined > - ): Promise { + ): Promise<[protos.google.iam.v1.TestIamPermissionsResponse]> { let options: gax.CallOptions; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback as unknown as Callback< @@ -408,7 +408,7 @@ export interface IamClient { protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined > - ): Promise; + ): Promise<[protos.google.iam.v1.Policy]>; setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest): void; setIamPolicy( request: protos.google.iam.v1.SetIamPolicyRequest, @@ -424,7 +424,7 @@ export interface IamClient { protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined > - ): Promise; + ): Promise<[protos.google.iam.v1.Policy]>; testIamPermissions( request: protos.google.iam.v1.TestIamPermissionsRequest ): void; @@ -442,5 +442,5 @@ export interface IamClient { protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined > - ): Promise; + ): Promise<[protos.google.iam.v1.TestIamPermissionsResponse]>; } diff --git a/src/protosList.json b/src/protosList.json index 3990c90fc..631558bab 100644 --- a/src/protosList.json +++ b/src/protosList.json @@ -1,5 +1,7 @@ [ "google/api/annotations.proto", + "google/api/apikeys/v2/apikeys.proto", + "google/api/apikeys/v2/resources.proto", "google/api/auth.proto", "google/api/backend.proto", "google/api/billing.proto", @@ -45,6 +47,7 @@ "google/api/servicecontrol/v1/operation.proto", "google/api/servicecontrol/v1/quota_controller.proto", "google/api/servicecontrol/v1/service_controller.proto", + "google/api/servicecontrol/v2/service_controller.proto", "google/api/servicemanagement/v1/resources.proto", "google/api/servicemanagement/v1/servicemanager.proto", "google/api/serviceusage/v1/resources.proto", @@ -77,11 +80,14 @@ "google/monitoring/v3/query_service.proto", "google/monitoring/v3/service.proto", "google/monitoring/v3/service_service.proto", + "google/monitoring/v3/snooze.proto", + "google/monitoring/v3/snooze_service.proto", "google/monitoring/v3/span_context.proto", "google/monitoring/v3/uptime.proto", "google/monitoring/v3/uptime_service.proto", "google/protobuf/any.proto", "google/protobuf/api.proto", + "google/protobuf/bridge/message_set.proto", "google/protobuf/compiler/plugin.proto", "google/protobuf/compiler/ruby/ruby_generated_code.proto", "google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto", @@ -102,7 +108,9 @@ "google/protobuf/wrappers.proto", "google/rpc/code.proto", "google/rpc/context/attribute_context.proto", + "google/rpc/context/audit_context.proto", "google/rpc/error_details.proto", + "google/rpc/http.proto", "google/rpc/status.proto", "google/type/calendar_period.proto", "google/type/color.proto", diff --git a/test/showcase-echo-client/src/v1beta1/echo_client.ts b/test/showcase-echo-client/src/v1beta1/echo_client.ts index 5ba299f35..1d083a3a2 100644 --- a/test/showcase-echo-client/src/v1beta1/echo_client.ts +++ b/test/showcase-echo-client/src/v1beta1/echo_client.ts @@ -1111,7 +1111,7 @@ export class EchoClient { IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined > - ): Promise { + ): Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.getIamPolicy(request, options, callback); } @@ -1159,7 +1159,7 @@ export class EchoClient { IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined > - ): Promise { + ): Promise<[IamProtos.google.iam.v1.Policy]> { return this.iamClient.setIamPolicy(request, options, callback); } @@ -1208,7 +1208,7 @@ export class EchoClient { IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined > - ): Promise { + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { return this.iamClient.testIamPermissions(request, options, callback); } diff --git a/test/system-test/test.clientlibs.ts b/test/system-test/test.clientlibs.ts index f4be5b0a7..966ccc6b4 100644 --- a/test/system-test/test.clientlibs.ts +++ b/test/system-test/test.clientlibs.ts @@ -222,7 +222,8 @@ describe('Run system tests for some libraries', () => { // KMS api has IAM service injected from gax. All its IAM related test are in samples-test. // KMS is in the google-cloud-node monorepo - describe('kms', () => { + // Temporarily skipped to avoid circular dependency issue. + /*describe('kms', () => { before(async () => { await preparePackage('kms', true); }); @@ -234,5 +235,5 @@ describe('Run system tests for some libraries', () => { throw new Error('Test failed'); } }); - }); + });*/ }); From f4a46be2b6a1e2771085ca86f5ce64a1fbdb3c1a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jul 2023 03:57:35 +0200 Subject: [PATCH 08/13] chore(deps): update dependency c8 to v8 (#1457) --- package.json | 2 +- samples/package.json | 2 +- tools/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5095e7993..5102f9b1b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@types/rimraf": "^3.0.2", "@types/sinon": "^10.0.0", "@types/uglify-js": "^3.17.0", - "c8": "^7.0.0", + "c8": "^8.0.0", "codecov": "^3.1.0", "execa": "^5.0.0", "gapic-tools": "^0.1.7", diff --git a/samples/package.json b/samples/package.json index 1f790787a..7da11ffcd 100644 --- a/samples/package.json +++ b/samples/package.json @@ -17,7 +17,7 @@ "google-gax": "^4.0.0" }, "devDependencies": { - "c8": "^7.0.0", + "c8": "^8.0.0", "mocha": "^9.0.0" } } diff --git a/tools/package.json b/tools/package.json index 6fb2517a0..c53b23cc6 100644 --- a/tools/package.json +++ b/tools/package.json @@ -40,7 +40,7 @@ "@types/mocha": "^9.0.0", "@types/ncp": "^2.0.1", "@types/uglify-js": "^3.17.0", - "c8": "^7.0.0", + "c8": "^8.0.0", "gts": "^3.1.1", "mocha": "^9.0.0", "ncp": "^2.0.0", From f9f8b1328c38718bf621b92338b3d81297525aa6 Mon Sep 17 00:00:00 2001 From: Daniel Bankhead Date: Tue, 18 Jul 2023 15:37:51 -0700 Subject: [PATCH 09/13] Fix: `rimraf` version + remove conflicting types (#1475) * Fix: `rimraf` version + remove conflicting types * chore: refactor `rimraf` import * chore: clean up --- package.json | 3 +-- test/showcase-server/package.json | 2 +- test/showcase-server/src/index.ts | 6 +++--- test/system-test/test.clientlibs.ts | 5 ++--- tools/package.json | 5 ++--- tools/test/compileProtos.ts | 5 ++--- tools/test/minify.ts | 5 ++--- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 5102f9b1b..04f2c62ca 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "@types/object-hash": "^3.0.0", "@types/proxyquire": "^1.3.28", "@types/pumpify": "^1.4.1", - "@types/rimraf": "^3.0.2", "@types/sinon": "^10.0.0", "@types/uglify-js": "^3.17.0", "c8": "^8.0.0", @@ -50,7 +49,7 @@ "protobufjs-cli": "1.1.1", "proxyquire": "^2.0.1", "pumpify": "^2.0.0", - "rimraf": "^3.0.2", + "rimraf": "^5.0.1", "sinon": "^15.0.0", "stream-events": "^1.0.4", "ts-loader": "^8.0.0", diff --git a/test/showcase-server/package.json b/test/showcase-server/package.json index 0568a8651..f8d4dbfe5 100644 --- a/test/showcase-server/package.json +++ b/test/showcase-server/package.json @@ -19,7 +19,7 @@ "dependencies": { "download": "^8.0.0", "execa": "^5.0.0", - "rimraf": "^3.0.0" + "rimraf": "^5.0.1" }, "devDependencies": { "@types/download": "^8.0.1", diff --git a/test/showcase-server/src/index.ts b/test/showcase-server/src/index.ts index c67405814..943c283e0 100644 --- a/test/showcase-server/src/index.ts +++ b/test/showcase-server/src/index.ts @@ -18,11 +18,11 @@ import * as execa from 'execa'; import * as download from 'download'; import * as fs from 'fs'; import * as path from 'path'; -import * as rimraf from 'rimraf'; +import {rimraf} from 'rimraf'; import * as util from 'util'; const mkdir = util.promisify(fs.mkdir); -const rmrf = util.promisify(rimraf); + const timeout = 5000; // wait after the server launches function sleep(timeoutMs: number) { @@ -41,7 +41,7 @@ export class ShowcaseServer { const fallbackServerUrl = `https://github.com/googleapis/gapic-showcase/releases/download/v${showcaseVersion}/${tarballFilename}`; const binaryName = './gapic-showcase'; - await rmrf(testDir); + await rimraf(testDir); await mkdir(testDir); process.chdir(testDir); console.log(`Server will be run from ${testDir}.`); diff --git a/test/system-test/test.clientlibs.ts b/test/system-test/test.clientlibs.ts index 966ccc6b4..9391df900 100644 --- a/test/system-test/test.clientlibs.ts +++ b/test/system-test/test.clientlibs.ts @@ -17,11 +17,10 @@ import * as execa from 'execa'; import * as fs from 'fs'; import * as path from 'path'; -import * as rimraf from 'rimraf'; +import {rimraf} from 'rimraf'; import * as util from 'util'; import {describe, it, before} from 'mocha'; -const rmrf = util.promisify(rimraf); const mkdir = util.promisify(fs.mkdir); const readFile = util.promisify(fs.readFile); const writeFile = util.promisify(fs.writeFile); @@ -198,7 +197,7 @@ describe('Run system tests for some libraries', () => { throw new Error(`npm pack tarball ${toolsTarball} does not exist`); } - await rmrf(testDir); + await rimraf(testDir); await mkdir(testDir); process.chdir(testDir); console.log(`Running tests in ${testDir}.`); diff --git a/tools/package.json b/tools/package.json index c53b23cc6..abe693a75 100644 --- a/tools/package.json +++ b/tools/package.json @@ -28,12 +28,11 @@ "author": "Google API Authors", "license": "Apache-2.0", "dependencies": { - "@types/rimraf": "^3.0.2", "google-proto-files": "^3.0.0", "protobufjs-cli": "1.1.1", + "rimraf": "^5.0.1", "uglify-js": "^3.17.0", - "walkdir": "^0.4.0", - "rimraf": "^3.0.2" + "walkdir": "^0.4.0" }, "repository": "googleapis/gax-nodejs", "devDependencies": { diff --git a/tools/test/compileProtos.ts b/tools/test/compileProtos.ts index 87020b606..89b261a65 100644 --- a/tools/test/compileProtos.ts +++ b/tools/test/compileProtos.ts @@ -17,7 +17,7 @@ import * as assert from 'assert'; import {describe, it, beforeEach, afterEach} from 'mocha'; import * as fs from 'fs'; -import * as rimraf from 'rimraf'; +import {rimraf} from 'rimraf'; import * as util from 'util'; import * as path from 'path'; import * as protobuf from 'protobufjs'; @@ -25,7 +25,6 @@ import * as compileProtos from '../src/compileProtos'; const readFile = util.promisify(fs.readFile); const mkdir = util.promisify(fs.mkdir); -const rmrf = util.promisify(rimraf); const testDir = path.join(process.cwd(), '.compileProtos-test'); const resultDir = path.join(testDir, 'protos'); @@ -38,7 +37,7 @@ const expectedTSResultFile = path.join(resultDir, 'protos.d.ts'); describe('compileProtos tool', () => { beforeEach(async () => { if (fs.existsSync(testDir)) { - await rmrf(testDir); + await rimraf(testDir); } await mkdir(testDir); await mkdir(resultDir); diff --git a/tools/test/minify.ts b/tools/test/minify.ts index 14d86eebf..19f814b0f 100644 --- a/tools/test/minify.ts +++ b/tools/test/minify.ts @@ -16,19 +16,18 @@ import * as assert from 'assert'; import {describe, it, beforeEach} from 'mocha'; import * as fs from 'fs'; import {promises as fsp} from 'fs'; -import * as rimraf from 'rimraf'; +import {rimraf} from 'rimraf'; import * as path from 'path'; import * as minify from '../src/minify'; import {promisify} from 'util'; -const rmrf = promisify(rimraf); const testDir = path.join(process.cwd(), '.minify-test'); const fixturesDir = path.join(__dirname, '..', 'test', 'fixtures'); describe('minify tool', () => { beforeEach(async () => { if (fs.existsSync(testDir)) { - await rmrf(testDir); + await rimraf(testDir); } await fsp.mkdir(testDir); }); From 9e93eddc27fbb140a2bdaaef2e9d0db3a05921f4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:13:15 -0700 Subject: [PATCH 10/13] build: add extra test for Node 20, update windows tests (#1468) * build: add extra test for Node 20, update windows tests Source-Link: https://github.com/googleapis/synthtool/commit/38f5d4bfd5d51116a3cf7f260b8fe5d8a0046cfa Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:ef104a520c849ffde60495342ecf099dfb6256eab0fbd173228f447bc73d1aa9 Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/presubmit/node14/common.cfg | 24 +++++++++++++++++++++++ .kokoro/presubmit/node14/samples-test.cfg | 12 ++++++++++++ .kokoro/presubmit/node14/system-test.cfg | 12 ++++++++++++ .kokoro/presubmit/node14/test.cfg | 0 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .kokoro/presubmit/node14/common.cfg create mode 100644 .kokoro/presubmit/node14/samples-test.cfg create mode 100644 .kokoro/presubmit/node14/system-test.cfg create mode 100644 .kokoro/presubmit/node14/test.cfg diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 21ad18bd7..de4fa0a5d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:0527a86c10b67742c409dc726ba9a31ec4e69b0006e3d7a49b0e6686c59cdaa9 -# created: 2023-05-24T20:32:43.844586914Z + digest: sha256:ef104a520c849ffde60495342ecf099dfb6256eab0fbd173228f447bc73d1aa9 +# created: 2023-07-10T21:36:52.433664553Z diff --git a/.kokoro/presubmit/node14/common.cfg b/.kokoro/presubmit/node14/common.cfg new file mode 100644 index 000000000..bda58c77b --- /dev/null +++ b/.kokoro/presubmit/node14/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/gax-nodejs/.kokoro/test.sh" +} diff --git a/.kokoro/presubmit/node14/samples-test.cfg b/.kokoro/presubmit/node14/samples-test.cfg new file mode 100644 index 000000000..3fb9c46ca --- /dev/null +++ b/.kokoro/presubmit/node14/samples-test.cfg @@ -0,0 +1,12 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/gax-nodejs/.kokoro/samples-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/.kokoro/presubmit/node14/system-test.cfg b/.kokoro/presubmit/node14/system-test.cfg new file mode 100644 index 000000000..8a980142a --- /dev/null +++ b/.kokoro/presubmit/node14/system-test.cfg @@ -0,0 +1,12 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/gax-nodejs/.kokoro/system-test.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "long-door-651-kokoro-system-test-service-account" +} \ No newline at end of file diff --git a/.kokoro/presubmit/node14/test.cfg b/.kokoro/presubmit/node14/test.cfg new file mode 100644 index 000000000..e69de29bb From 8afdd591646a190fde38728f0df14c604643f5cc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jul 2023 23:38:15 +0200 Subject: [PATCH 11/13] fix(deps): update dependency google-auth-library to v9 (#1476) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 04f2c62ca..c780be947 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@types/long": "^4.0.0", "abort-controller": "^3.0.0", "duplexify": "^4.0.0", - "google-auth-library": "^8.0.2", + "google-auth-library": "^9.0.0", "node-fetch": "^2.6.1", "object-hash": "^3.0.0", "proto3-json-serializer": "^1.0.0", From 6401a88c50fa0eb3eb8a73cefc830896369c3330 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jul 2023 23:55:11 +0200 Subject: [PATCH 12/13] fix(deps): update dependency retry-request to v6 (#1477) Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c780be947..d1e31bbce 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "object-hash": "^3.0.0", "proto3-json-serializer": "^1.0.0", "protobufjs": "7.2.4", - "retry-request": "^5.0.0" + "retry-request": "^6.0.0" }, "devDependencies": { "@babel/plugin-proposal-private-methods": "^7.18.6", From 8663eb14f9c6c6ab3a6009f6725b347698f6e1f3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:16:53 -0700 Subject: [PATCH 13/13] chore(main): release 4.0.1 (#1474) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a6e87677..b39fe4041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ [1]: https://www.npmjs.com/package/gax-nodejs?activeTab=versions +## [4.0.1](https://github.com/googleapis/gax-nodejs/compare/v4.0.0...v4.0.1) (2023-07-21) + + +### Bug Fixes + +* `rimraf` version + remove conflicting types ([#1475](https://github.com/googleapis/gax-nodejs/issues/1475)) ([f9f8b13](https://github.com/googleapis/gax-nodejs/commit/f9f8b1328c38718bf621b92338b3d81297525aa6)) +* Add missing devDependency for compodoc ([#1470](https://github.com/googleapis/gax-nodejs/issues/1470)) ([115e317](https://github.com/googleapis/gax-nodejs/commit/115e317728c8ae6fa0e61f54d0087e26382d8230)) +* **deps:** Update dependency google-auth-library to v9 ([#1476](https://github.com/googleapis/gax-nodejs/issues/1476)) ([8afdd59](https://github.com/googleapis/gax-nodejs/commit/8afdd591646a190fde38728f0df14c604643f5cc)) +* **deps:** Update dependency retry-request to v6 ([#1477](https://github.com/googleapis/gax-nodejs/issues/1477)) ([6401a88](https://github.com/googleapis/gax-nodejs/commit/6401a88c50fa0eb3eb8a73cefc830896369c3330)) +* **deps:** Update protobufjs ([#1467](https://github.com/googleapis/gax-nodejs/issues/1467)) ([0a7dd94](https://github.com/googleapis/gax-nodejs/commit/0a7dd948573bd9553a0e9548e9ab92dbcfcb7414)) +* Replace proto-over-HTTP with REGAPIC ([#1471](https://github.com/googleapis/gax-nodejs/issues/1471)) ([4266f43](https://github.com/googleapis/gax-nodejs/commit/4266f43922d0d582b8eced11f4a21c98a8b451fe)) +* The return types for IAM service methods should be arrays, to match ReturnTuple ([#1001](https://github.com/googleapis/gax-nodejs/issues/1001)) ([48eed95](https://github.com/googleapis/gax-nodejs/commit/48eed955e7329f55f9427a7bc0656cfe2af395e8)) + ## [4.0.0](https://github.com/googleapis/gax-nodejs/compare/v3.6.0...v4.0.0) (2023-05-17) diff --git a/package.json b/package.json index d1e31bbce..a5a8e11b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-gax", - "version": "4.0.0", + "version": "4.0.1", "description": "Google API Extensions", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/samples/package.json b/samples/package.json index 7da11ffcd..57b594920 100644 --- a/samples/package.json +++ b/samples/package.json @@ -14,7 +14,7 @@ "*.js" ], "dependencies": { - "google-gax": "^4.0.0" + "google-gax": "^4.0.1" }, "devDependencies": { "c8": "^8.0.0",