From 45b985436ff968e8f7d05272c41103859692a509 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Jun 2023 07:08:06 +0200 Subject: [PATCH 1/6] chore(deps): update dependency c8 to v8 (#1865) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b26e7e4b6..f0b70b18b 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@types/through2": "^2.0.34", "@types/uuid": "^9.0.0", "binary-search-bounds": "^2.0.4", - "c8": "^7.0.0", + "c8": "^8.0.0", "codecov": "^3.0.2", "concat-stream": "^2.0.0", "dedent": "^0.7.0", From a858e955934b947fbc3e63642fd98a40971244b0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:44:03 +0530 Subject: [PATCH 2/6] chore: upgrade to Node 14 (#1875) Source-Link: https://github.com/googleapis/synthtool/commit/2d2d5e5c4e0eb30b0a7c2c95576e4e89c8443b35 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:bfa6fdba19aa7d105167d01fb51f5fd8285e8cd9fca264e43aff849e9e7fa36c Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/common.cfg | 2 +- .kokoro/continuous/node14/common.cfg | 24 ++++++++++++++++++++++ .kokoro/continuous/node14/lint.cfg | 4 ++++ .kokoro/continuous/node14/samples-test.cfg | 12 +++++++++++ .kokoro/continuous/node14/system-test.cfg | 12 +++++++++++ .kokoro/continuous/node14/test.cfg | 0 .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 .kokoro/release/docs.cfg | 2 +- .kokoro/release/publish.cfg | 2 +- .kokoro/samples-test.sh | 2 +- .kokoro/system-test.sh | 2 +- .kokoro/test.sh | 2 +- 16 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 .kokoro/continuous/node14/common.cfg create mode 100644 .kokoro/continuous/node14/lint.cfg create mode 100644 .kokoro/continuous/node14/samples-test.cfg create mode 100644 .kokoro/continuous/node14/system-test.cfg create mode 100644 .kokoro/continuous/node14/test.cfg 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..9e959ba15 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:bfa6fdba19aa7d105167d01fb51f5fd8285e8cd9fca264e43aff849e9e7fa36c +# created: 2023-07-06T17:45:12.014855061Z diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 4cde3552f..02d5a407d 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -16,7 +16,7 @@ build_file: "nodejs-spanner/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/continuous/node14/common.cfg b/.kokoro/continuous/node14/common.cfg new file mode 100644 index 000000000..02d5a407d --- /dev/null +++ b/.kokoro/continuous/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: "nodejs-spanner/.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/nodejs-spanner/.kokoro/test.sh" +} diff --git a/.kokoro/continuous/node14/lint.cfg b/.kokoro/continuous/node14/lint.cfg new file mode 100644 index 000000000..629ea4ddf --- /dev/null +++ b/.kokoro/continuous/node14/lint.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-spanner/.kokoro/lint.sh" +} diff --git a/.kokoro/continuous/node14/samples-test.cfg b/.kokoro/continuous/node14/samples-test.cfg new file mode 100644 index 000000000..aa8319f41 --- /dev/null +++ b/.kokoro/continuous/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/nodejs-spanner/.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/continuous/node14/system-test.cfg b/.kokoro/continuous/node14/system-test.cfg new file mode 100644 index 000000000..f8dd221bf --- /dev/null +++ b/.kokoro/continuous/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/nodejs-spanner/.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/continuous/node14/test.cfg b/.kokoro/continuous/node14/test.cfg new file mode 100644 index 000000000..e69de29bb diff --git a/.kokoro/presubmit/node14/common.cfg b/.kokoro/presubmit/node14/common.cfg new file mode 100644 index 000000000..02d5a407d --- /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: "nodejs-spanner/.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/nodejs-spanner/.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..aa8319f41 --- /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/nodejs-spanner/.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..f8dd221bf --- /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/nodejs-spanner/.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 diff --git a/.kokoro/release/docs.cfg b/.kokoro/release/docs.cfg index fabed27ff..fb73026f0 100644 --- a/.kokoro/release/docs.cfg +++ b/.kokoro/release/docs.cfg @@ -11,7 +11,7 @@ before_action { # doc publications use a Python image. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } # Download trampoline resources. diff --git a/.kokoro/release/publish.cfg b/.kokoro/release/publish.cfg index 7617f60bb..54f8f8a51 100644 --- a/.kokoro/release/publish.cfg +++ b/.kokoro/release/publish.cfg @@ -30,7 +30,7 @@ build_file: "nodejs-spanner/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 806c00822..8c5d108cb 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -56,7 +56,7 @@ fi # codecov combines coverage across integration and unit tests. Include # the logic below for any environment you wish to collect coverage for: -COVERAGE_NODE=12 +COVERAGE_NODE=14 if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then NYC_BIN=./node_modules/nyc/bin/nyc.js if [ -f "$NYC_BIN" ]; then diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh index 0201e9dfd..0b3043d26 100755 --- a/.kokoro/system-test.sh +++ b/.kokoro/system-test.sh @@ -49,7 +49,7 @@ npm run system-test # codecov combines coverage across integration and unit tests. Include # the logic below for any environment you wish to collect coverage for: -COVERAGE_NODE=12 +COVERAGE_NODE=14 if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then NYC_BIN=./node_modules/nyc/bin/nyc.js if [ -f "$NYC_BIN" ]; then diff --git a/.kokoro/test.sh b/.kokoro/test.sh index a5c7ac04c..862d478d3 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -39,7 +39,7 @@ npm test # codecov combines coverage across integration and unit tests. Include # the logic below for any environment you wish to collect coverage for: -COVERAGE_NODE=12 +COVERAGE_NODE=14 if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then NYC_BIN=./node_modules/nyc/bin/nyc.js if [ -f "$NYC_BIN" ]; then From 24e321f6327cfdfc191a84bb47d80a156eff5be9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Jul 2023 09:07:02 +0200 Subject: [PATCH 3/6] fix(deps): update dependency yargs to v17 (#1866) --- samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/package.json b/samples/package.json index 890a398a4..8213bd73c 100644 --- a/samples/package.json +++ b/samples/package.json @@ -17,7 +17,7 @@ "@google-cloud/kms": "^3.0.0", "@google-cloud/precise-date": "^3.0.0", "@google-cloud/spanner": "^6.12.0", - "yargs": "^16.0.0" + "yargs": "^17.0.0" }, "devDependencies": { "chai": "^4.2.0", From 5e407c071a69f5ef39e7277671e4393cb12f44b8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 15 Jul 2023 09:39:59 +0200 Subject: [PATCH 4/6] chore(deps): update actions/setup-node action to v3 (#1864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update actions/setup-node action to v3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: surbhigarg92 --- .github/workflows/system-tests-against-emulator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/system-tests-against-emulator.yaml b/.github/workflows/system-tests-against-emulator.yaml index 9d97c113c..58fbbeabc 100644 --- a/.github/workflows/system-tests-against-emulator.yaml +++ b/.github/workflows/system-tests-against-emulator.yaml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 10 - run: node --version From 87cd5e6ecdf6d888dd0e7fe712b7070c58b32d42 Mon Sep 17 00:00:00 2001 From: surbhigarg92 Date: Fri, 21 Jul 2023 06:34:33 +0000 Subject: [PATCH 5/6] feat: Enable leader aware routing by default (#1851) --- src/index.ts | 10 +++++----- test/spanner.ts | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/index.ts b/src/index.ts index 558382ba7..76eccc6b3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -108,8 +108,8 @@ export type GetInstanceConfigOperationsCallback = PagedCallback< /** * Session pool configuration options. - * @property {boolean} [routeToLeaderEnabled=False] If set to true leader aware routing will be enabled. - * Enabling leader aware routing would route all requests in RW/PDML transactions to leader region. + * @property {boolean} [routeToLeaderEnabled=True] If set to false leader aware routing will be disabled. + * Disabling leader aware routing would route all requests in RW/PDML transactions to any region. */ export interface SpannerOptions extends GrpcClientOptions { apiEndpoint?: string; @@ -216,7 +216,7 @@ class Spanner extends GrpcService { projectIdReplaced_: boolean; projectFormattedName_: string; resourceHeader_: {[k: string]: string}; - routeToLeaderEnabled = false; + routeToLeaderEnabled = true; /** * Placeholder used to auto populate a column with the commit timestamp. @@ -318,8 +318,8 @@ class Spanner extends GrpcService { } as {} as GrpcServiceConfig; super(config, options); - if (options.routeToLeaderEnabled === true) { - this.routeToLeaderEnabled = true; + if (options.routeToLeaderEnabled === false) { + this.routeToLeaderEnabled = false; } this.options = options; diff --git a/test/spanner.ts b/test/spanner.ts index 322566389..2ca4697f0 100644 --- a/test/spanner.ts +++ b/test/spanner.ts @@ -1491,14 +1491,14 @@ describe('Spanner with mock server', () => { }); describe('LeaderAwareRouting', () => { - let spannerWithLAREnabled: Spanner; - let instanceWithLAREnabled: Instance; + let spannerWithLARDisabled: Spanner; + let instanceWithLARDisabled: Instance; - function newTestDatabaseWithLAREnabled( + function newTestDatabaseWithLARDisabled( options?: SessionPoolOptions, queryOptions?: IQueryOptions ): Database { - return instanceWithLAREnabled.database( + return instanceWithLARDisabled.database( `database-${dbCounter++}`, options, queryOptions @@ -1506,18 +1506,18 @@ describe('Spanner with mock server', () => { } before(() => { - spannerWithLAREnabled = new Spanner({ + spannerWithLARDisabled = new Spanner({ servicePath: 'localhost', port, sslCreds: grpc.credentials.createInsecure(), - routeToLeaderEnabled: true, + routeToLeaderEnabled: false, }); // Gets a reference to a Cloud Spanner instance and database - instanceWithLAREnabled = spannerWithLAREnabled.instance('instance'); + instanceWithLARDisabled = spannerWithLARDisabled.instance('instance'); }); it('should execute with leader aware routing enabled in a read/write transaction', async () => { - const database = newTestDatabaseWithLAREnabled(); + const database = newTestDatabase(); await database.runTransactionAsync(async tx => { await tx!.runUpdate({ sql: insertSql, @@ -1539,7 +1539,7 @@ describe('Spanner with mock server', () => { }); it('should execute with leader aware routing disabled in a read/write transaction', async () => { - const database = newTestDatabase(); + const database = newTestDatabaseWithLARDisabled(); await database.runTransactionAsync(async tx => { await tx!.runUpdate({ sql: insertSql, From 1ff14d84307dc842cdf18ed11c23b4336d73e40e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 07:50:12 +0000 Subject: [PATCH 6/6] chore(main): release 6.13.0 (#1878) :robot: I have created a release *beep* *boop* --- ## [6.13.0](https://togithub.com/googleapis/nodejs-spanner/compare/v6.12.0...v6.13.0) (2023-07-21) ### Features * Enable leader aware routing by default. This update contains performance optimisations that will reduce the latency of read/write transactions that originate from a region other than the default leader region. ([87cd5e6](https://togithub.com/googleapis/nodejs-spanner/commit/87cd5e6ecdf6d888dd0e7fe712b7070c58b32d42)) ### Bug Fixes * **deps:** Update dependency yargs to v17 ([#1866](https://togithub.com/googleapis/nodejs-spanner/issues/1866)) ([24e321f](https://togithub.com/googleapis/nodejs-spanner/commit/24e321f6327cfdfc191a84bb47d80a156eff5be9)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0655049d7..1998ef225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions +## [6.13.0](https://github.com/googleapis/nodejs-spanner/compare/v6.12.0...v6.13.0) (2023-07-21) + + +### Features + +* Enable leader aware routing by default. This update contains performance optimisations that will reduce the latency of read/write transactions that originate from a region other than the default leader region. ([87cd5e6](https://github.com/googleapis/nodejs-spanner/commit/87cd5e6ecdf6d888dd0e7fe712b7070c58b32d42)) + + +### Bug Fixes + +* **deps:** Update dependency yargs to v17 ([#1866](https://github.com/googleapis/nodejs-spanner/issues/1866)) ([24e321f](https://github.com/googleapis/nodejs-spanner/commit/24e321f6327cfdfc191a84bb47d80a156eff5be9)) + ## [6.12.0](https://github.com/googleapis/nodejs-spanner/compare/v6.11.0...v6.12.0) (2023-06-19) diff --git a/package.json b/package.json index f0b70b18b..1739d3443 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/spanner", "description": "Cloud Spanner Client Library for Node.js", - "version": "6.12.0", + "version": "6.13.0", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/samples/package.json b/samples/package.json index 8213bd73c..029520e17 100644 --- a/samples/package.json +++ b/samples/package.json @@ -16,7 +16,7 @@ "dependencies": { "@google-cloud/kms": "^3.0.0", "@google-cloud/precise-date": "^3.0.0", - "@google-cloud/spanner": "^6.12.0", + "@google-cloud/spanner": "^6.13.0", "yargs": "^17.0.0" }, "devDependencies": {