diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 21ad18bd..a3d003c6 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:e08f9a3757808cdaf7a377e962308c65c4d7eff12db206d4fae702dd50d43430 +# created: 2023-08-03T18:46:14.719706948Z diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 0be16649..accde8ce 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -34,7 +34,7 @@ branchProtectionRules: - "cla/google" - "docs" - "lint" - - "test (12)" - "test (14)" - "test (16)" + - "test (18)" - "system-test" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 457c72c3..3902369d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [12, 14, 16] + node: [14, 16, 18] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/.github/workflows/ci2.yaml b/.github/workflows/ci2.yaml index cbe7730d..3ea1729b 100644 --- a/.github/workflows/ci2.yaml +++ b/.github/workflows/ci2.yaml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 12 + node-version: 14 - run: npm install - run: npm run system-test - name: coverage diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index e4b4075a..3db21693 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -16,7 +16,7 @@ build_file: "cloud-profiler-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:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/continuous/node13/common.cfg b/.kokoro/continuous/node13/common.cfg deleted file mode 100644 index 884185a7..00000000 --- a/.kokoro/continuous/node13/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: "cloud-profiler-nodejs/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:13-user" -} -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/cloud-profiler-nodejs/.kokoro/test.sh" -} diff --git a/.kokoro/continuous/node12/common.cfg b/.kokoro/continuous/node14/common.cfg similarity index 89% rename from .kokoro/continuous/node12/common.cfg rename to .kokoro/continuous/node14/common.cfg index e4b4075a..3db21693 100644 --- a/.kokoro/continuous/node12/common.cfg +++ b/.kokoro/continuous/node14/common.cfg @@ -16,7 +16,7 @@ build_file: "cloud-profiler-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:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/continuous/node12/lint.cfg b/.kokoro/continuous/node14/lint.cfg similarity index 100% rename from .kokoro/continuous/node12/lint.cfg rename to .kokoro/continuous/node14/lint.cfg diff --git a/.kokoro/continuous/node12/samples-test.cfg b/.kokoro/continuous/node14/samples-test.cfg similarity index 100% rename from .kokoro/continuous/node12/samples-test.cfg rename to .kokoro/continuous/node14/samples-test.cfg diff --git a/.kokoro/continuous/node12/system-test.cfg b/.kokoro/continuous/node14/system-test.cfg similarity index 100% rename from .kokoro/continuous/node12/system-test.cfg rename to .kokoro/continuous/node14/system-test.cfg diff --git a/.kokoro/continuous/node12/test.cfg b/.kokoro/continuous/node14/test.cfg similarity index 100% rename from .kokoro/continuous/node12/test.cfg rename to .kokoro/continuous/node14/test.cfg diff --git a/.kokoro/presubmit/node12/test.cfg b/.kokoro/presubmit/node12/test.cfg deleted file mode 100644 index e69de29b..00000000 diff --git a/.kokoro/presubmit/node12/common.cfg b/.kokoro/presubmit/node14/common.cfg similarity index 89% rename from .kokoro/presubmit/node12/common.cfg rename to .kokoro/presubmit/node14/common.cfg index e4b4075a..3db21693 100644 --- a/.kokoro/presubmit/node12/common.cfg +++ b/.kokoro/presubmit/node14/common.cfg @@ -16,7 +16,7 @@ build_file: "cloud-profiler-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:12-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/presubmit/node12/samples-test.cfg b/.kokoro/presubmit/node14/samples-test.cfg similarity index 100% rename from .kokoro/presubmit/node12/samples-test.cfg rename to .kokoro/presubmit/node14/samples-test.cfg diff --git a/.kokoro/presubmit/node12/system-test.cfg b/.kokoro/presubmit/node14/system-test.cfg similarity index 100% rename from .kokoro/presubmit/node12/system-test.cfg rename to .kokoro/presubmit/node14/system-test.cfg diff --git a/.kokoro/continuous/node13/test.cfg b/.kokoro/presubmit/node14/test.cfg similarity index 100% rename from .kokoro/continuous/node13/test.cfg rename to .kokoro/presubmit/node14/test.cfg diff --git a/.kokoro/release/docs.cfg b/.kokoro/release/docs.cfg index 87d6e519..a0da41df 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 d6121543..a269edef 100644 --- a/.kokoro/release/publish.cfg +++ b/.kokoro/release/publish.cfg @@ -30,7 +30,7 @@ build_file: "cloud-profiler-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: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 806c0082..8c5d108c 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 0201e9df..0b3043d2 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.bat b/.kokoro/test.bat index ae59e59b..0bb12405 100644 --- a/.kokoro/test.bat +++ b/.kokoro/test.bat @@ -21,7 +21,7 @@ cd .. @rem we upgrade Node.js in the image: SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm -call nvm use v12.14.1 +call nvm use v14.17.3 call which node call npm install || goto :error diff --git a/.kokoro/test.sh b/.kokoro/test.sh index a5c7ac04..862d478d 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 diff --git a/README.md b/README.md index 59ad8ca5..e907b4a0 100644 --- a/README.md +++ b/README.md @@ -349,7 +349,7 @@ also contains samples. ## Supported Node.js Versions -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update diff --git a/package.json b/package.json index ee5ea556..cf02aaec 100644 --- a/package.json +++ b/package.json @@ -27,33 +27,33 @@ }, "license": "Apache-2.0", "dependencies": { - "@google-cloud/common": "^4.0.0", + "@google-cloud/common": "^5.0.0", "@google-cloud/logging-min": "^10.0.0", "@types/console-log-level": "^1.4.0", "@types/semver": "^7.0.0", "console-log-level": "^1.4.0", "delay": "^5.0.0", "extend": "^3.0.2", - "gcp-metadata": "^4.0.0", + "gcp-metadata": "^6.0.0", "parse-duration": "^1.0.0", "pprof": "3.2.1", "pretty-ms": "^7.0.0", "protobufjs": "~7.2.4", "semver": "^7.0.0", - "teeny-request": "^8.0.0" + "teeny-request": "^9.0.0" }, "devDependencies": { "@types/extend": "^3.0.0", "@types/long": "^4.0.0", "@types/mocha": "^9.0.0", "@types/nock": "^10.0.0", - "@types/node": "^18.0.0", + "@types/node": "^20.4.9", "@types/pretty-ms": "^4.0.0", "@types/sinon": "^10.0.0", "@types/tmp": "0.2.3", - "c8": "^8.0.0", + "c8": "^8.0.1", "codecov": "^3.0.0", - "gts": "^3.1.0", + "gts": "^5.0.0", "js-green-licenses": "^4.0.0", "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", @@ -64,7 +64,7 @@ "sinon": "^15.0.0", "source-map": "^0.7.0", "tmp": "0.2.1", - "typescript": "^4.7.2" + "typescript": "^5.1.6" }, "files": [ "build/src", @@ -77,6 +77,6 @@ ] }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } } diff --git a/samples/package.json b/samples/package.json index 801d2723..e64d3cc2 100644 --- a/samples/package.json +++ b/samples/package.json @@ -8,7 +8,7 @@ "test": "echo 'no test yet'" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "repository": { "type": "git", @@ -22,4 +22,4 @@ "files": [ "*.js" ] -} +} \ No newline at end of file diff --git a/src/profiler.ts b/src/profiler.ts index 1931d443..4cbb1f20 100644 --- a/src/profiler.ts +++ b/src/profiler.ts @@ -197,7 +197,10 @@ async function profileBytes(p: perftools.profiles.IProfile): Promise { * Error constructed from HTTP server response which indicates backoff. */ export class BackoffResponseError extends Error { - constructor(message: string | undefined, readonly backoffMillis: number) { + constructor( + message: string | undefined, + readonly backoffMillis: number + ) { super(message); } } diff --git a/system-test/busybench/package.json b/system-test/busybench/package.json index 8c456ec1..08931958 100644 --- a/system-test/busybench/package.json +++ b/system-test/busybench/package.json @@ -8,7 +8,7 @@ "build/src" ], "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "license": "Apache-2.0", "keywords": [], diff --git a/system-test/integration_test.go b/system-test/integration_test.go index 7cfa9fef..946a300f 100644 --- a/system-test/integration_test.go +++ b/system-test/integration_test.go @@ -70,7 +70,7 @@ npm_install() { # Install git retry apt-get update >/dev/null -retry apt-get -y -q install git >/dev/null +retry apt-get -y -q install git build-essential >/dev/null # Install desired version of Node.js retry curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash >/dev/null @@ -265,12 +265,12 @@ func TestAgentIntegration(t *testing.T) { InstanceConfig: proftest.InstanceConfig{ ProjectID: projectID, Zone: zone, - Name: fmt.Sprintf("profiler-test-node12-%s", runID), + Name: fmt.Sprintf("profiler-test-node14-%s", runID), MachineType: "n1-standard-1", }, - name: fmt.Sprintf("profiler-test-node12-%s-gce", runID), + name: fmt.Sprintf("profiler-test-node14-%s-gce", runID), wantProfiles: wantProfiles, - nodeVersion: "12", + nodeVersion: "14", timeout: gceTestTimeout, benchDuration: gceBenchDuration, }, @@ -278,12 +278,25 @@ func TestAgentIntegration(t *testing.T) { InstanceConfig: proftest.InstanceConfig{ ProjectID: projectID, Zone: zone, - Name: fmt.Sprintf("profiler-test-node14-%s", runID), + Name: fmt.Sprintf("profiler-test-node16-%s", runID), MachineType: "n1-standard-1", }, - name: fmt.Sprintf("profiler-test-node14-%s-gce", runID), + name: fmt.Sprintf("profiler-test-node16-%s-gce", runID), wantProfiles: wantProfiles, - nodeVersion: "14", + nodeVersion: "16", + timeout: gceTestTimeout, + benchDuration: gceBenchDuration, + }, + { + InstanceConfig: proftest.InstanceConfig{ + ProjectID: projectID, + Zone: zone, + Name: fmt.Sprintf("profiler-test-node18-%s", runID), + MachineType: "n1-standard-1", + }, + name: fmt.Sprintf("profiler-test-node18-%s-gce", runID), + wantProfiles: wantProfiles, + nodeVersion: "18", timeout: gceTestTimeout, benchDuration: gceBenchDuration, }, @@ -295,16 +308,16 @@ func TestAgentIntegration(t *testing.T) { InstanceConfig: proftest.InstanceConfig{ ProjectID: projectID, Zone: zone, - Name: fmt.Sprintf("profiler-backoff-test-node12-%s", runID), + Name: fmt.Sprintf("profiler-backoff-test-node14-%s", runID), // Running many copies of the benchmark requires more // memory than is available on an n1-standard-1. Use a // machine type with more memory for backoff test. MachineType: "n1-highmem-2", }, - name: fmt.Sprintf("profiler-backoff-test-node12-%s", runID), + name: fmt.Sprintf("profiler-backoff-test-node14-%s", runID), backoffTest: true, - nodeVersion: "12", + nodeVersion: "14", timeout: backoffTestTimeout, benchDuration: backoffBenchDuration, })