From a9269624a70aa6305599cc0af079d0225ed6af50 Mon Sep 17 00:00:00 2001 From: Denis DelGrosso <85250797+ddelgrosso1@users.noreply.github.com> Date: Tue, 19 Apr 2022 16:22:13 -0400 Subject: [PATCH] build!: drop node 10 from engines list, update typescript to 4.6.3 (#477) --- .github/sync-repo-settings.yaml | 2 +- .github/workflows/ci.yaml | 2 +- .kokoro/continuous/node10/common.cfg | 34 ---------------------- .kokoro/continuous/node10/docs.cfg | 4 --- .kokoro/continuous/node10/lint.cfg | 4 --- .kokoro/continuous/node10/samples-test.cfg | 7 ----- .kokoro/continuous/node10/system-test.cfg | 7 ----- .kokoro/continuous/node10/test.cfg | 9 ------ .kokoro/continuous/node8/common.cfg | 24 --------------- .kokoro/continuous/node8/test.cfg | 0 package.json | 8 ++--- src/gaxios.ts | 2 +- test/test.retry.ts | 3 +- 13 files changed, 9 insertions(+), 97 deletions(-) delete mode 100644 .kokoro/continuous/node10/common.cfg delete mode 100644 .kokoro/continuous/node10/docs.cfg delete mode 100644 .kokoro/continuous/node10/lint.cfg delete mode 100644 .kokoro/continuous/node10/samples-test.cfg delete mode 100644 .kokoro/continuous/node10/system-test.cfg delete mode 100644 .kokoro/continuous/node10/test.cfg delete mode 100644 .kokoro/continuous/node8/common.cfg delete mode 100644 .kokoro/continuous/node8/test.cfg diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 1b362683..d1e8b5e6 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -9,9 +9,9 @@ branchProtectionRules: - "ci/kokoro: System test" - docs - lint - - test (10) - test (12) - test (14) + - test (16) - cla/google - windows - OwlBot Post Processor diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25251dbb..f447b84a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [10, 12, 14] + node: [12, 14, 16] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/.kokoro/continuous/node10/common.cfg b/.kokoro/continuous/node10/common.cfg deleted file mode 100644 index 07b2c643..00000000 --- a/.kokoro/continuous/node10/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Bring in codecov.io token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "gaxios/.kokoro/trampoline_v2.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gaxios/.kokoro/test.sh" -} diff --git a/.kokoro/continuous/node10/docs.cfg b/.kokoro/continuous/node10/docs.cfg deleted file mode 100644 index b6acac59..00000000 --- a/.kokoro/continuous/node10/docs.cfg +++ /dev/null @@ -1,4 +0,0 @@ -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gaxios/.kokoro/docs.sh" -} diff --git a/.kokoro/continuous/node10/lint.cfg b/.kokoro/continuous/node10/lint.cfg deleted file mode 100644 index 16e4d2d2..00000000 --- a/.kokoro/continuous/node10/lint.cfg +++ /dev/null @@ -1,4 +0,0 @@ -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gaxios/.kokoro/lint.sh" -} diff --git a/.kokoro/continuous/node10/samples-test.cfg b/.kokoro/continuous/node10/samples-test.cfg deleted file mode 100644 index 751512a8..00000000 --- a/.kokoro/continuous/node10/samples-test.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# 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/gaxios/.kokoro/samples-test.sh" -} diff --git a/.kokoro/continuous/node10/system-test.cfg b/.kokoro/continuous/node10/system-test.cfg deleted file mode 100644 index 4c32b607..00000000 --- a/.kokoro/continuous/node10/system-test.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# 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/gaxios/.kokoro/system-test.sh" -} diff --git a/.kokoro/continuous/node10/test.cfg b/.kokoro/continuous/node10/test.cfg deleted file mode 100644 index 609c0cf0..00000000 --- a/.kokoro/continuous/node10/test.cfg +++ /dev/null @@ -1,9 +0,0 @@ -# Bring in codecov.io token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} diff --git a/.kokoro/continuous/node8/common.cfg b/.kokoro/continuous/node8/common.cfg deleted file mode 100644 index 4c7837b4..00000000 --- a/.kokoro/continuous/node8/common.cfg +++ /dev/null @@ -1,24 +0,0 @@ -# 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: "gaxios/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" -} -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gaxios/.kokoro/test.sh" -} diff --git a/.kokoro/continuous/node8/test.cfg b/.kokoro/continuous/node8/test.cfg deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index a7304d9a..b13a7729 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "google" ], "engines": { - "node": ">=10" + "node": ">=12" }, "author": "Google, LLC", "license": "Apache-2.0", @@ -46,7 +46,7 @@ "@types/multiparty": "0.0.33", "@types/mv": "^2.1.0", "@types/ncp": "^2.0.1", - "@types/node": "^16.11.3", + "@types/node": "^17.0.23", "@types/node-fetch": "^2.5.7", "@types/sinon": "^10.0.0", "@types/tmp": "0.2.3", @@ -58,7 +58,7 @@ "execa": "^5.0.0", "express": "^4.16.4", "form-data": "^4.0.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "is-docker": "^2.0.0", "karma": "^6.0.0", "karma-chrome-launcher": "^3.0.0", @@ -80,7 +80,7 @@ "stream-browserify": "^3.0.0", "tmp": "0.2.1", "ts-loader": "^8.0.0", - "typescript": "^3.8.3", + "typescript": "^4.6.3", "uuid": "^8.0.0", "webpack": "^5.35.0", "webpack-cli": "^4.0.0" diff --git a/src/gaxios.ts b/src/gaxios.ts index 0b1eff89..44c72a74 100644 --- a/src/gaxios.ts +++ b/src/gaxios.ts @@ -165,7 +165,7 @@ export class Gaxios { } catch (e) { const err = e as GaxiosError; err.config = opts; - const {shouldRetry, config} = await getRetryConfig(e); + const {shouldRetry, config} = await getRetryConfig(err); if (shouldRetry && config) { err.config.retryConfig!.currentRetryAttempt = config.retryConfig!.currentRetryAttempt; diff --git a/test/test.retry.ts b/test/test.retry.ts index 4fda2457..6ed94c45 100644 --- a/test/test.retry.ts +++ b/test/test.retry.ts @@ -104,7 +104,8 @@ describe('🛸 retry & exponential backoff', () => { try { await req; throw Error('unreachable'); - } catch (err) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (err: any) { assert(err.config); assert.strictEqual(err.config.retryConfig.currentRetryAttempt, 0); }