diff --git a/.eslintrc.json b/.eslintrc.json index 59b2beaa206..a515ec3b88d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,7 +2,7 @@ "root": true, "parser": "@typescript-eslint/parser", "parserOptions": { - "ecmaVersion": 2020 + "ecmaVersion": 2023 }, "plugins": [ "simple-import-sort", @@ -318,4 +318,4 @@ } } ] -} +} \ No newline at end of file diff --git a/.evergreen/ci_matrix_constants.js b/.evergreen/ci_matrix_constants.js index 2a53ac43360..104de77faf8 100644 --- a/.evergreen/ci_matrix_constants.js +++ b/.evergreen/ci_matrix_constants.js @@ -1,9 +1,7 @@ const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2']; const versions = [ - { codeName: 'gallium', versionNumber: 16, npmVersion: 9 }, - { codeName: 'hydrogen', versionNumber: 18, npmVersion: 10 }, - { codeName: 'iron', versionNumber: 20, npmVersion: 'latest' }, - { codeName: 'jod', versionNumber: 22, npmVersion: 'latest' } + { codeName: 'iron', versionNumber: '20.19.0' }, + { codeName: 'jod', versionNumber: 22 } ]; const NODE_VERSIONS = versions.map(({ versionNumber }) => versionNumber).sort(); const LOWEST_LTS = NODE_VERSIONS[0]; diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index c9eb51a7559..0db7de38320 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -728,7 +728,7 @@ tasks: type: setup params: updates: - - { key: NPM_VERSION, value: "9" } + - { key: NODE_LTS_VERSION, value: "20.19.0" } - func: assume secrets manager role - func: "install dependencies" # Upload node driver to a GCP instance @@ -748,7 +748,7 @@ tasks: type: setup params: updates: - - { key: NPM_VERSION, value: "9" } + - { key: NODE_LTS_VERSION, value: "20.19.0" } - { key: VERSION, value: latest } - { key: TOPOLOGY, value: server } - { key: AUTH, value: noauth } @@ -760,6 +760,7 @@ tasks: binary: bash env: EXPECTED_GCPKMS_OUTCOME: "failure" + NODE_LTS_VERSION: ${NODE_LTS_VERSION} args: - src/.evergreen/run-gcp-kms-tests.sh @@ -769,7 +770,7 @@ tasks: type: setup params: updates: - - { key: NPM_VERSION, value: "9" } + - { key: NODE_LTS_VERSION, value: "20.19.0" } - func: "install dependencies" - func: assume secrets manager role - command: subprocess.exec @@ -786,7 +787,7 @@ tasks: type: setup params: updates: - - { key: NPM_VERSION, value: "9" } + - { key: NODE_LTS_VERSION, value: "20.19.0" } - { key: VERSION, value: latest } - { key: TOPOLOGY, value: server } - { key: AUTH, value: noauth } @@ -798,6 +799,7 @@ tasks: binary: bash env: EXPECTED_AZUREKMS_OUTCOME: "failure" + NODE_LTS_VERSION: ${NODE_LTS_VERSION} args: - src/.evergreen/run-azure-kms-tests.sh @@ -936,7 +938,7 @@ tasks: type: setup params: updates: - - { key: NPM_VERSION, value: "9" } + - { key: NODE_LTS_VERSION, value: "20.19.0" } - func: "install dependencies" - command: ec2.assume_role params: diff --git a/.evergreen/config.yml b/.evergreen/config.yml index c05f3fa7f34..7b9785d0056 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -664,7 +664,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: assume secrets manager role - func: install dependencies - command: subprocess.exec @@ -680,7 +680,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: latest} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} @@ -692,6 +692,7 @@ tasks: binary: bash env: EXPECTED_GCPKMS_OUTCOME: failure + NODE_LTS_VERSION: ${NODE_LTS_VERSION} args: - src/.evergreen/run-gcp-kms-tests.sh - name: test-azurekms-task @@ -700,7 +701,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: assume secrets manager role - command: subprocess.exec @@ -716,7 +717,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: latest} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} @@ -728,6 +729,7 @@ tasks: binary: bash env: EXPECTED_AZUREKMS_OUTCOME: failure + NODE_LTS_VERSION: ${NODE_LTS_VERSION} args: - src/.evergreen/run-azure-kms-tests.sh - name: oidc-auth-test-k8s-latest-eks @@ -865,7 +867,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - command: ec2.assume_role params: @@ -1635,6 +1637,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1649,6 +1652,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1663,6 +1667,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1677,6 +1682,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1691,6 +1697,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1705,6 +1712,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1719,6 +1727,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1733,6 +1742,7 @@ tasks: params: updates: - {key: VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: '22'} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} - {key: TOPOLOGY, value: server} @@ -1835,31 +1845,7 @@ tasks: - func: bootstrap mongo-orchestration - func: run spec driver benchmarks - func: perf send - - name: run-unit-tests-node-16 - tags: - - unit-tests - commands: - - command: expansions.update - type: setup - params: - updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} - - func: install dependencies - - func: run unit tests - - name: run-unit-tests-node-18 - tags: - - unit-tests - commands: - - command: expansions.update - type: setup - params: - updates: - - {key: NODE_LTS_VERSION, value: '18'} - - {key: NPM_VERSION, value: '10'} - - func: install dependencies - - func: run unit tests - - name: run-unit-tests-node-20 + - name: run-unit-tests-node-20.19.0 tags: - unit-tests commands: @@ -1867,8 +1853,7 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '20'} - - {key: NPM_VERSION, value: latest} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: run unit tests - name: run-unit-tests-node-22 @@ -1880,7 +1865,6 @@ tasks: params: updates: - {key: NODE_LTS_VERSION, value: '22'} - - {key: NPM_VERSION, value: latest} - func: install dependencies - func: run unit tests - name: run-lint-checks @@ -1894,18 +1878,6 @@ tasks: - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: run lint checks - - name: run-resource-management-no-async-dispose - tags: - - resource-management - commands: - - command: expansions.update - type: setup - params: - updates: - - {key: NODE_LTS_VERSION, value: v16.20.2} - - {key: NPM_VERSION, value: '9'} - - func: install dependencies - - func: check resource management - name: run-resource-management-async-dispose tags: - resource-management @@ -1915,7 +1887,6 @@ tasks: params: updates: - {key: NODE_LTS_VERSION, value: '22'} - - {key: NPM_VERSION, value: '9'} - func: install dependencies - func: check resource management - name: test-explicit-resource-management-feature-integration @@ -1932,37 +1903,7 @@ tasks: - func: install dependencies - func: bootstrap mongo-orchestration - func: check resource management feature integration - - name: check-types-typescript-next-node-types-22.15.3 - tags: - - check-types-typescript-next - - typescript-compilation - commands: - - command: expansions.update - type: setup - params: - updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} - - {key: TS_VERSION, value: next} - - {key: TYPES_VERSION, value: 22.15.3} - - func: install dependencies - - func: check types - - name: check-types-typescript-current-node-types-22.15.3 - tags: - - check-types-typescript-current - - typescript-compilation - commands: - - command: expansions.update - type: setup - params: - updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} - - {key: TS_VERSION, value: current} - - {key: TYPES_VERSION, value: 22.15.3} - - func: install dependencies - - func: check types - - name: check-types-typescript-next-node-types-16.x + - name: check-types-typescript-next tags: - check-types-typescript-next - typescript-compilation @@ -1971,13 +1912,11 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: TS_VERSION, value: next} - - {key: TYPES_VERSION, value: 16.x} - func: install dependencies - func: check types - - name: check-types-typescript-current-node-types-16.x + - name: check-types-typescript-current tags: - check-types-typescript-current - typescript-compilation @@ -1986,28 +1925,24 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: TS_VERSION, value: current} - - {key: TYPES_VERSION, value: 16.x} - func: install dependencies - func: check types - - name: check-types-typescript-4.4-node-types-18.11.9 + - name: check-types-typescript-5.6 tags: - - check-types-typescript-4.4 + - check-types-typescript-5.6 - typescript-compilation commands: - command: expansions.update type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} - - {key: TS_VERSION, value: '4.4'} - - {key: TYPES_VERSION, value: 18.11.9} + - {key: NODE_LTS_VERSION, value: 20.19.0} + - {key: TS_VERSION, value: '5.6'} - func: install dependencies - func: check types - - name: compile-driver-typescript-current-node-types-22.15.3 + - name: compile-driver-typescript-current tags: - compile-driver-typescript-current - typescript-compilation @@ -2016,10 +1951,8 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: TS_VERSION, value: current} - - {key: TYPES_VERSION, value: 22.15.3} - func: install dependencies - func: compile driver - name: download-and-merge-coverage @@ -2039,8 +1972,7 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: '5.0'} - {key: TOPOLOGY, value: replica_set} - {key: CLIENT_ENCRYPTION, value: 'true'} @@ -2057,8 +1989,7 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: replica_set} - {key: CLIENT_ENCRYPTION, value: 'true'} @@ -2075,8 +2006,7 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: latest} - {key: TOPOLOGY, value: replica_set} - {key: CLIENT_ENCRYPTION, value: 'true'} @@ -2093,8 +2023,7 @@ tasks: type: setup params: updates: - - {key: NODE_LTS_VERSION, value: '16'} - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: replica_set} - {key: CLIENT_ENCRYPTION, value: 'true'} @@ -2112,7 +2041,7 @@ tasks: type: setup params: updates: - - {key: NODE_VERSION, value: 16.20.1} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: latest} - {key: TOPOLOGY, value: replica_set} - {key: CLIENT_ENCRYPTION, value: 'true'} @@ -2135,6 +2064,7 @@ tasks: - {key: VERSION, value: latest} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2151,6 +2081,7 @@ tasks: - {key: VERSION, value: latest} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2167,6 +2098,7 @@ tasks: - {key: VERSION, value: latest} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2183,6 +2115,7 @@ tasks: - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2199,6 +2132,7 @@ tasks: - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2215,6 +2149,7 @@ tasks: - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2231,6 +2166,7 @@ tasks: - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2247,6 +2183,7 @@ tasks: - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2263,6 +2200,7 @@ tasks: - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2279,6 +2217,7 @@ tasks: - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2295,6 +2234,7 @@ tasks: - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2311,6 +2251,7 @@ tasks: - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2327,6 +2268,7 @@ tasks: - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2343,6 +2285,7 @@ tasks: - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2359,6 +2302,7 @@ tasks: - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2375,6 +2319,7 @@ tasks: - {key: VERSION, value: '5.0'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2391,6 +2336,7 @@ tasks: - {key: VERSION, value: '5.0'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2407,6 +2353,7 @@ tasks: - {key: VERSION, value: '5.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2423,6 +2370,7 @@ tasks: - {key: VERSION, value: '4.4'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2439,6 +2387,7 @@ tasks: - {key: VERSION, value: '4.4'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2455,6 +2404,7 @@ tasks: - {key: VERSION, value: '4.4'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2471,6 +2421,7 @@ tasks: - {key: VERSION, value: '4.2'} - {key: TOPOLOGY, value: server} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2487,6 +2438,7 @@ tasks: - {key: VERSION, value: '4.2'} - {key: TOPOLOGY, value: replica_set} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2503,6 +2455,7 @@ tasks: - {key: VERSION, value: '4.2'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: noauth} + - {key: NODE_LTS_VERSION, value: 20.19.0} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2515,7 +2468,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: server} - func: install dependencies @@ -2530,7 +2483,7 @@ tasks: type: setup params: updates: - - {key: NPM_VERSION, value: '9'} + - {key: NODE_LTS_VERSION, value: 20.19.0} - {key: VERSION, value: rapid} - {key: AUTH, value: auth} - {key: ORCHESTRATION_FILE, value: auth-aws.json} @@ -2551,6 +2504,7 @@ tasks: - {key: VERSION, value: latest} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2566,6 +2520,7 @@ tasks: - {key: VERSION, value: rapid} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2581,6 +2536,7 @@ tasks: - {key: VERSION, value: '8.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2596,6 +2552,7 @@ tasks: - {key: VERSION, value: '7.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2611,6 +2568,7 @@ tasks: - {key: VERSION, value: '6.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2626,6 +2584,7 @@ tasks: - {key: VERSION, value: '5.0'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2641,6 +2600,7 @@ tasks: - {key: VERSION, value: '4.4'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2656,6 +2616,7 @@ tasks: - {key: VERSION, value: '4.2'} - {key: TOPOLOGY, value: sharded_cluster} - {key: AUTH, value: auth} + - {key: NODE_LTS_VERSION, value: '22'} - func: install dependencies - func: bootstrap mongo-orchestration - func: run tests @@ -2927,124 +2888,11 @@ buildvariants: run_on: ubuntu2204-small tasks: - .alpine-fle - - name: rhel80-large-gallium - display_name: rhel8 Node16 - run_on: rhel80-large - expansions: - NODE_LTS_VERSION: 16 - NPM_VERSION: 9 - CLIENT_ENCRYPTION: 'true' - TEST_CSFLE: 'true' - tasks: - - test-latest-server - - test-latest-replica_set - - test-latest-sharded_cluster - - test-rapid-server - - test-rapid-replica_set - - test-rapid-sharded_cluster - - test-8.0-server - - test-8.0-replica_set - - test-8.0-sharded_cluster - - test-7.0-server - - test-7.0-replica_set - - test-7.0-sharded_cluster - - test-6.0-server - - test-6.0-replica_set - - test-6.0-sharded_cluster - - test-5.0-server - - test-5.0-replica_set - - test-5.0-sharded_cluster - - test-4.4-server - - test-4.4-replica_set - - test-4.4-sharded_cluster - - test-4.2-server - - test-4.2-replica_set - - test-4.2-sharded_cluster - - test-latest-server-v1-api - - test-x509-authentication - - test-atlas-connectivity - - test-5.0-load-balanced - - test-6.0-load-balanced - - test-7.0-load-balanced - - test-8.0-load-balanced - - test-rapid-load-balanced - - test-latest-load-balanced - - test-auth-ldap - - test-socks5 - - test-socks5-csfle - - test-socks5-tls - - test-snappy-compression - - test-zstd-1.x-compression - - test-zstd-2.x-compression - - test-tls-support-latest - - test-tls-support-8.0 - - test-tls-support-7.0 - - test-tls-support-6.0 - - test-tls-support-5.0 - - test-tls-support-4.4 - - test-tls-support-4.2 - - name: rhel80-large-hydrogen - display_name: rhel8 Node18 - run_on: rhel80-large - expansions: - NODE_LTS_VERSION: 18 - NPM_VERSION: 10 - CLIENT_ENCRYPTION: 'true' - TEST_CSFLE: 'true' - tasks: - - test-latest-server - - test-latest-replica_set - - test-latest-sharded_cluster - - test-rapid-server - - test-rapid-replica_set - - test-rapid-sharded_cluster - - test-8.0-server - - test-8.0-replica_set - - test-8.0-sharded_cluster - - test-7.0-server - - test-7.0-replica_set - - test-7.0-sharded_cluster - - test-6.0-server - - test-6.0-replica_set - - test-6.0-sharded_cluster - - test-5.0-server - - test-5.0-replica_set - - test-5.0-sharded_cluster - - test-4.4-server - - test-4.4-replica_set - - test-4.4-sharded_cluster - - test-4.2-server - - test-4.2-replica_set - - test-4.2-sharded_cluster - - test-latest-server-v1-api - - test-x509-authentication - - test-atlas-connectivity - - test-5.0-load-balanced - - test-6.0-load-balanced - - test-7.0-load-balanced - - test-8.0-load-balanced - - test-rapid-load-balanced - - test-latest-load-balanced - - test-auth-ldap - - test-socks5 - - test-socks5-csfle - - test-socks5-tls - - test-snappy-compression - - test-zstd-1.x-compression - - test-zstd-2.x-compression - - test-tls-support-latest - - test-tls-support-8.0 - - test-tls-support-7.0 - - test-tls-support-6.0 - - test-tls-support-5.0 - - test-tls-support-4.4 - - test-tls-support-4.2 - - name: rhel80-large-Node20 - display_name: rhel8 Node20 + - name: rhel80-large-iron + display_name: rhel8 Node20.19.0 run_on: rhel80-large expansions: - NODE_LTS_VERSION: 20 - NPM_VERSION: latest + NODE_LTS_VERSION: 20.19.0 CLIENT_ENCRYPTION: 'true' TEST_CSFLE: 'true' tasks: @@ -3100,7 +2948,6 @@ buildvariants: run_on: rhel80-large expansions: NODE_LTS_VERSION: 22 - NPM_VERSION: latest CLIENT_ENCRYPTION: 'true' TEST_CSFLE: 'true' tasks: @@ -3204,104 +3051,11 @@ buildvariants: - test-tls-support-5.0 - test-tls-support-4.4 - test-tls-support-4.2 - - name: windows-vsCurrent-large-gallium - display_name: Windows Node16 - run_on: windows-vsCurrent-large - expansions: - NODE_LTS_VERSION: 16 - NPM_VERSION: 9 - CLIENT_ENCRYPTION: 'false' - TEST_CSFLE: 'false' - tasks: - - test-latest-server - - test-latest-replica_set - - test-latest-sharded_cluster - - test-rapid-server - - test-rapid-replica_set - - test-rapid-sharded_cluster - - test-8.0-server - - test-8.0-replica_set - - test-8.0-sharded_cluster - - test-7.0-server - - test-7.0-replica_set - - test-7.0-sharded_cluster - - test-6.0-server - - test-6.0-replica_set - - test-6.0-sharded_cluster - - test-5.0-server - - test-5.0-replica_set - - test-5.0-sharded_cluster - - test-4.4-server - - test-4.4-replica_set - - test-4.4-sharded_cluster - - test-4.2-server - - test-4.2-replica_set - - test-4.2-sharded_cluster - - test-latest-server-v1-api - - test-socks5 - - test-socks5-tls - - test-snappy-compression - - test-zstd-1.x-compression - - test-zstd-2.x-compression - - test-tls-support-latest - - test-tls-support-8.0 - - test-tls-support-7.0 - - test-tls-support-6.0 - - test-tls-support-5.0 - - test-tls-support-4.4 - - test-tls-support-4.2 - - name: windows-vsCurrent-large-hydrogen - display_name: Windows Node18 - run_on: windows-vsCurrent-large - expansions: - NODE_LTS_VERSION: 18 - NPM_VERSION: 10 - CLIENT_ENCRYPTION: 'false' - TEST_CSFLE: 'false' - tasks: - - test-latest-server - - test-latest-replica_set - - test-latest-sharded_cluster - - test-rapid-server - - test-rapid-replica_set - - test-rapid-sharded_cluster - - test-8.0-server - - test-8.0-replica_set - - test-8.0-sharded_cluster - - test-7.0-server - - test-7.0-replica_set - - test-7.0-sharded_cluster - - test-6.0-server - - test-6.0-replica_set - - test-6.0-sharded_cluster - - test-5.0-server - - test-5.0-replica_set - - test-5.0-sharded_cluster - - test-4.4-server - - test-4.4-replica_set - - test-4.4-sharded_cluster - - test-4.2-server - - test-4.2-replica_set - - test-4.2-sharded_cluster - - test-latest-server-v1-api - - test-socks5 - - test-socks5-tls - - test-snappy-compression - - test-zstd-1.x-compression - - test-zstd-2.x-compression - - test-tls-support-latest - - test-tls-support-8.0 - - test-tls-support-7.0 - - test-tls-support-6.0 - - test-tls-support-5.0 - - test-tls-support-4.4 - - test-tls-support-4.2 - - name: windows-vsCurrent-large-Node20 - display_name: Windows Node20 + - name: windows-vsCurrent-large-iron + display_name: Windows Node20.19.0 run_on: windows-vsCurrent-large expansions: - NODE_LTS_VERSION: 20 - NPM_VERSION: latest + NODE_LTS_VERSION: 20.19.0 CLIENT_ENCRYPTION: 'false' TEST_CSFLE: 'false' tasks: @@ -3347,7 +3101,6 @@ buildvariants: run_on: windows-vsCurrent-large expansions: NODE_LTS_VERSION: 22 - NPM_VERSION: latest CLIENT_ENCRYPTION: 'false' TEST_CSFLE: 'false' tasks: @@ -3388,14 +3141,13 @@ buildvariants: - test-tls-support-5.0 - test-tls-support-4.4 - test-tls-support-4.2 - - name: rhel8-node16-test-csfle-mongocryptd - display_name: rhel 8 Node16 test mongocryptd + - name: rhel8-node20.19.0-test-csfle-mongocryptd + display_name: rhel 8 Node20.19.0 test mongocryptd run_on: rhel80-large expansions: CLIENT_ENCRYPTION: true RUN_WITH_MONGOCRYPTD: true - NODE_LTS_VERSION: 16 - NPM_VERSION: 9 + NODE_LTS_VERSION: 20.19.0 tasks: - test-latest-csfle-mongocryptd - test-rapid-csfle-mongocryptd @@ -3411,8 +3163,7 @@ buildvariants: expansions: CLIENT_ENCRYPTION: true RUN_WITH_MONGOCRYPTD: true - NODE_LTS_VERSION: 16 - NPM_VERSION: 9 + NODE_LTS_VERSION: 20.19.0 tasks: - test-latest-csfle-mongocryptd - test-rapid-csfle-mongocryptd diff --git a/.evergreen/docker/Dockerfile.musl b/.evergreen/docker/Dockerfile.musl index 28f32c89ae8..af32e295396 100644 --- a/.evergreen/docker/Dockerfile.musl +++ b/.evergreen/docker/Dockerfile.musl @@ -1,7 +1,7 @@ ARG ARCH=arm64 -ARG NODE_VERSION=16.20.1 +ARG NODE_LTS_VERSION=20.19.0 -FROM ${ARCH}/node:${NODE_VERSION}-alpine AS dependencies +FROM ${ARCH}/node:${NODE_LTS_VERSION}-alpine AS dependencies RUN apk --no-cache add make g++ libc-dev curl bash python3 py3-pip cmake git vim ranger diff --git a/.evergreen/docker/alpine.sh b/.evergreen/docker/alpine.sh index 3fe36479aef..a48822c9f1f 100644 --- a/.evergreen/docker/alpine.sh +++ b/.evergreen/docker/alpine.sh @@ -3,7 +3,7 @@ # script to aid in local testing of linux platforms # requires a running docker instance -if [ -z ${NODE_VERSION+omitted} ]; then echo "NODE_VERSION is unset" && exit 1; fi +if [ -z ${NODE_LTS_VERSION+omitted} ]; then echo "NODE_LTS_VERSION is unset" && exit 1; fi if [ -z ${DRIVERS_TOOLS+omitted} ]; then echo "DRIVERS_TOOLS is unset" && exit 1; fi if [ -z ${MONGODB_URI+omitted} ]; then echo "MONGODB_URI is unset" && exit 1; fi @@ -15,11 +15,11 @@ IMAGE_TAG=${IMAGE_TAG:-alpine-fle-image} build_alpine() { docker buildx create --name builder --bootstrap --use - BASE_TAG=$LINUX_ARCH-alpine-base-node-$NODE_VERSION + BASE_TAG=$LINUX_ARCH-alpine-base-node-$NODE_LTS_VERSION docker --debug buildx build --load --progress=plain \ --platform linux/$LINUX_ARCH \ --build-arg="ARCH=$LINUX_ARCH" \ - --build-arg="NODE_VERSION=$NODE_VERSION" \ + --build-arg="NODE_LTS_VERSION=$NODE_LTS_VERSION" \ --build-arg="DRIVERS_TOOLS=$DRIVERS_TOOLS" \ -f ./.evergreen/docker/Dockerfile.musl -t $IMAGE_TAG \ . diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 9896ea86079..33434d27a47 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -15,7 +15,6 @@ const { DEFAULT_OS, WINDOWS_OS, MACOS_OS, - UBUNTU_OS, UBUNTU_20_OS, DEBIAN_OS, UBUNTU_22_OS @@ -65,12 +64,20 @@ function updateExpansions(expansions) { }; } -function makeTask({ mongoVersion, topology, tags = [], auth = 'auth' }) { +function makeTask({ mongoVersion, topology, tags = [], auth = 'auth', nodeLtsVersion }) { + const expansions = nodeLtsVersion + ? updateExpansions({ + VERSION: mongoVersion, + TOPOLOGY: topology, + AUTH: auth, + NODE_LTS_VERSION: nodeLtsVersion + }) + : updateExpansions({ VERSION: mongoVersion, TOPOLOGY: topology, AUTH: auth }); return { name: `test-${mongoVersion}-${topology}${auth === 'noauth' ? '-noauth' : ''}`, tags: [mongoVersion, topology, ...tags], commands: [ - updateExpansions({ VERSION: mongoVersion, TOPOLOGY: topology, AUTH: auth }), + expansions, { func: 'install dependencies' }, { func: 'bootstrap mongo-orchestration' }, { func: 'run tests' } @@ -92,7 +99,7 @@ function generateVersionTopologyMatrix() { const BASE_TASKS = generateVersionTopologyMatrix().map(makeTask); const AUTH_DISABLED_TASKS = generateVersionTopologyMatrix().map(test => - makeTask({ ...test, auth: 'noauth', tags: ['noauth'] }) + makeTask({ ...test, auth: 'noauth', tags: ['noauth'], nodeLtsVersion: LOWEST_LTS }) ); BASE_TASKS.push({ @@ -285,7 +292,7 @@ AWS_LAMBDA_HANDLER_TASKS.push({ tags: ['latest', 'lambda'], commands: [ updateExpansions({ - NPM_VERSION: 9, + NODE_LTS_VERSION: LOWEST_LTS, VERSION: 'rapid', TOPOLOGY: 'server' }), @@ -301,7 +308,7 @@ AWS_LAMBDA_HANDLER_TASKS.push({ tags: ['latest', 'lambda'], commands: [ updateExpansions({ - NPM_VERSION: 9, + NODE_LTS_VERSION: LOWEST_LTS, VERSION: 'rapid', AUTH: 'auth', ORCHESTRATION_FILE: 'auth-aws.json', @@ -352,6 +359,7 @@ for (const VERSION of AWS_AUTH_VERSIONS) { commands: [ updateExpansions({ VERSION, + NODE_LTS_VERSION: LATEST_LTS, AUTH: 'auth', ORCHESTRATION_FILE: 'auth-aws.json', TOPOLOGY: 'server' @@ -395,10 +403,7 @@ for (const { const nodeLtsDisplayName = `Node${NODE_LTS_VERSION}`; const name = `${osName}-${NODE_LTS_VERSION >= 20 ? nodeLtsDisplayName : nodeLTSCodeName}`; const display_name = `${osDisplayName} ${nodeLtsDisplayName}`; - const NPM_VERSION = versions.find( - ({ versionNumber }) => versionNumber === NODE_LTS_VERSION - ).npmVersion; - const expansions = { NODE_LTS_VERSION, NPM_VERSION }; + const expansions = { NODE_LTS_VERSION }; const taskNames = tasks.map(({ name }) => name); expansions.CLIENT_ENCRYPTION = String(!!clientEncryption); @@ -435,7 +440,8 @@ const MONGOCRYPTD_CSFLE_TASKS = MONGODB_VERSIONS.filter( updateExpansions({ VERSION: mongoVersion, TOPOLOGY: 'sharded_cluster', - AUTH: 'auth' + AUTH: 'auth', + NODE_LTS_VERSION: LATEST_LTS }), { func: 'install dependencies' }, { func: 'bootstrap mongo-orchestration' }, @@ -454,8 +460,7 @@ for (const nodeVersion of [LOWEST_LTS, LATEST_LTS]) { expansions: { CLIENT_ENCRYPTION: true, RUN_WITH_MONGOCRYPTD: true, - NODE_LTS_VERSION: LOWEST_LTS, - NPM_VERSION: 9 + NODE_LTS_VERSION: LOWEST_LTS }, tasks: MONGOCRYPTD_CSFLE_TASKS.map(task => task.name) }); @@ -474,14 +479,13 @@ BUILD_VARIANTS.push({ const unitTestTasks = Array.from( (function* () { - for (const { versionNumber: NODE_LTS_VERSION, npmVersion: NPM_VERSION } of versions) { + for (const { versionNumber: NODE_LTS_VERSION } of versions) { yield { name: `run-unit-tests-node-${NODE_LTS_VERSION}`, tags: ['unit-tests'], commands: [ updateExpansions({ - NODE_LTS_VERSION, - NPM_VERSION + NODE_LTS_VERSION }), { func: 'install dependencies' }, { func: 'run unit tests' } @@ -506,25 +510,12 @@ SINGLETON_TASKS.push( { func: 'run lint checks' } ] }, - { - name: 'run-resource-management-no-async-dispose', - tags: ['resource-management'], - commands: [ - updateExpansions({ - NODE_LTS_VERSION: 'v16.20.2', - NPM_VERSION: 9 - }), - { func: 'install dependencies' }, - { func: 'check resource management' } - ] - }, { name: 'run-resource-management-async-dispose', tags: ['resource-management'], commands: [ updateExpansions({ - NODE_LTS_VERSION: LATEST_LTS, - NPM_VERSION: 9 + NODE_LTS_VERSION: LATEST_LTS }), { func: 'install dependencies' }, { func: 'check resource management' } @@ -551,30 +542,26 @@ SINGLETON_TASKS.push( function* makeTypescriptTasks() { function makeCompileTask(TS_VERSION, TYPES_VERSION) { return { - name: `compile-driver-typescript-${TS_VERSION}-node-types-${TYPES_VERSION}`, + name: `compile-driver-typescript-${TS_VERSION}`, tags: [`compile-driver-typescript-${TS_VERSION}`, 'typescript-compilation'], commands: [ updateExpansions({ NODE_LTS_VERSION: LOWEST_LTS, - NPM_VERSION: 9, - TS_VERSION, - TYPES_VERSION + TS_VERSION }), { func: 'install dependencies' }, { func: 'compile driver' } ] }; } - function makeCheckTypesTask(TS_VERSION, TYPES_VERSION) { + function makeCheckTypesTask(TS_VERSION) { return { - name: `check-types-typescript-${TS_VERSION}-node-types-${TYPES_VERSION}`, + name: `check-types-typescript-${TS_VERSION}`, tags: [`check-types-typescript-${TS_VERSION}`, 'typescript-compilation'], commands: [ updateExpansions({ NODE_LTS_VERSION: LOWEST_LTS, - NPM_VERSION: 9, - TS_VERSION, - TYPES_VERSION + TS_VERSION }), { func: 'install dependencies' }, { func: 'check types' } @@ -582,17 +569,11 @@ function* makeTypescriptTasks() { }; } - const typesVersion = require('../package.json').devDependencies['@types/node'].slice(1); - yield makeCheckTypesTask('next', typesVersion); - yield makeCheckTypesTask('current', typesVersion); - - yield makeCheckTypesTask('next', '16.x'); - yield makeCheckTypesTask('current', '16.x'); + yield makeCheckTypesTask('next'); + yield makeCheckTypesTask('current'); + yield makeCheckTypesTask('5.6'); - // typescript 4.4 only compiles our types with this particular version - yield makeCheckTypesTask('4.4', '18.11.9'); - - yield makeCompileTask('current', typesVersion); + yield makeCompileTask('current'); } BUILD_VARIANTS.push({ @@ -639,7 +620,6 @@ for (const serverVersion of ['5.0', 'rapid', 'latest']) { commands: [ updateExpansions({ NODE_LTS_VERSION: LOWEST_LTS, - NPM_VERSION: 9, VERSION: serverVersion, TOPOLOGY: 'replica_set', CLIENT_ENCRYPTION: true @@ -659,7 +639,6 @@ customDependencyTests.push({ commands: [ updateExpansions({ NODE_LTS_VERSION: LOWEST_LTS, - NPM_VERSION: 9, VERSION: '7.0', TOPOLOGY: 'replica_set', CLIENT_ENCRYPTION: true @@ -702,7 +681,7 @@ SINGLETON_TASKS.push({ tags: ['alpine-fle'], commands: [ updateExpansions({ - NODE_VERSION: '16.20.1', + NODE_LTS_VERSION: LOWEST_LTS, VERSION: 'latest', TOPOLOGY: 'replica_set', CLIENT_ENCRYPTION: true, diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 6715b1397df..70cfa98487b 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -5,7 +5,8 @@ set -o errexit # Exit the script with error if any of the commands fail ## a nodejs major version (i.e., 16) ## 'latest' ## a full nodejs version, in the format v..patch -export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16} +if [ -z ${NODE_LTS_VERSION+omitted} ]; then echo "NODE_LTS_VERSION is unset" && exit 1; fi + # npm version can be defined in the environment for cases where we need to install # a version lower than latest to support EOL Node versions. When not provided will # be handled by this script in drivers tools. diff --git a/.evergreen/run-deployed-azure-kms-tests.sh b/.evergreen/run-deployed-azure-kms-tests.sh index 5244f665fb5..318e069c3af 100644 --- a/.evergreen/run-deployed-azure-kms-tests.sh +++ b/.evergreen/run-deployed-azure-kms-tests.sh @@ -6,6 +6,7 @@ source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh if [ -z ${AZUREKMS_RESOURCEGROUP+omitted} ]; then echo "AZUREKMS_RESOURCEGROUP is unset" && exit 1; fi if [ -z ${AZUREKMS_VMNAME+omitted} ]; then echo "AZUREKMS_VMNAME is unset" && exit 1; fi +if [ -z ${NODE_LTS_VERSION:+omitted}]; then echo "NODE_LTS_VERSION is unset" && exit 1; fi export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey @@ -26,6 +27,6 @@ export AZUREKMS_CMD="tar xf node-driver-source.tgz" echo "decompressing node driver tar on azure ... end" echo "Running test ... begin" -export AZUREKMS_CMD="env EXPECTED_AZUREKMS_OUTCOME=success bash src/.evergreen/run-azure-kms-tests.sh" +export AZUREKMS_CMD="env EXPECTED_AZUREKMS_OUTCOME=success NODE_LTS_VERSION=$NODE_LTS_VERSION bash src/.evergreen/run-azure-kms-tests.sh" ${DRIVERS_TOOLS}/.evergreen/csfle/azurekms/run-command.sh echo "Running test ... end" diff --git a/.evergreen/run-deployed-gcp-kms-tests.sh b/.evergreen/run-deployed-gcp-kms-tests.sh index 3db1571beee..a456a89bd52 100644 --- a/.evergreen/run-deployed-gcp-kms-tests.sh +++ b/.evergreen/run-deployed-gcp-kms-tests.sh @@ -8,6 +8,7 @@ if [ -z ${GCPKMS_GCLOUD+omitted} ]; then echo "GCPKMS_GCLOUD is unset" && exit 1 if [ -z ${GCPKMS_PROJECT+omitted} ]; then echo "GCPKMS_PROJECT is unset" && exit 1; fi if [ -z ${GCPKMS_ZONE+omitted} ]; then echo "GCPKMS_ZONE is unset" && exit 1; fi if [ -z ${GCPKMS_INSTANCENAME+omitted} ]; then echo "GCPKMS_INSTANCENAME is unset" && exit 1; fi +if [ -z ${NODE_LTS_VERSION:+omitted}]; then echo "NODE_LTS_VERSION is unset" && exit 1; fi set -o errexit @@ -28,5 +29,5 @@ export GCPKMS_CMD="tar -xzf $GCPKMS_SRC" "${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh" echo "decompressing node driver tar on gcp ... end" -export GCPKMS_CMD="env EXPECTED_GCPKMS_OUTCOME=success bash src/.evergreen/run-gcp-kms-tests.sh" +export GCPKMS_CMD="env EXPECTED_GCPKMS_OUTCOME=success NODE_LTS_VERSION=$NODE_LTS_VERSION bash src/.evergreen/run-gcp-kms-tests.sh" bash ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh \ No newline at end of file diff --git a/.evergreen/run-typescript.sh b/.evergreen/run-typescript.sh index 0d952980166..c760eb9491a 100755 --- a/.evergreen/run-typescript.sh +++ b/.evergreen/run-typescript.sh @@ -12,7 +12,6 @@ case $TS_CHECK in esac if [ -z "$TS_VERSION" ]; then echo "TS_VERSION must be set"; exit 1; fi -if [ -z "$TYPES_VERSION" ]; then echo "TYPES_VERSION must be set"; exit 1; fi if [ ! -f "mongodb.d.ts" ]; then echo "mongodb.d.ts should always exist because of the installation in prior steps but in case it doesn't, build it" @@ -30,7 +29,7 @@ function get_ts_version() { export TSC="./node_modules/typescript/bin/tsc" export TS_VERSION=$(get_ts_version) -npm install --no-save --force "typescript@$TS_VERSION" "@types/node@$TYPES_VERSION" +npm install --no-save --force "typescript@$TS_VERSION" echo "Typescript $($TSC -v)" echo "Types: $(cat node_modules/@types/node/package.json | jq -r .version)" @@ -44,12 +43,7 @@ if [ "$TS_CHECK" == "COMPILE_DRIVER" ]; then npm run build:ts elif [ "$TS_CHECK" == "CHECK_TYPES" ]; then echo "checking driver types" - if [ "$TS_VERSION" == "4.4" ]; then - # check compilation - node $TSC mongodb.d.ts --module commonjs --target es2021 - else - node $TSC mongodb.d.ts --module node16 --target es2021 - fi + node $TSC mongodb.d.ts --module node16 --target es2023 else "Invalid value $TS_CHECK for TS_CHECK environment variable." exit 1 diff --git a/README.md b/README.md index 7c1ba76e76e..7ec0b5fc646 100644 --- a/README.md +++ b/README.md @@ -95,16 +95,16 @@ The following table describes add-on component version compatibility for the Nod #### Typescript Version -We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@4.4.0`. +We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@5.6.0`. This is the lowest typescript version guaranteed to work with our driver: older versions may or may not work - use at your own risk. Since typescript [does not restrict breaking changes to major versions](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes), we consider this support best effort. If you run into any unexpected compiler failures against our supported TypeScript versions, please let us know by filing an issue on our [JIRA](https://jira.mongodb.org/browse/NODE). -Additionally, our Typescript types are compatible with the ECMAScript standard for our minimum supported Node version. Currently, our Typescript targets es2021. +Additionally, our Typescript types are compatible with the ECMAScript standard for our minimum supported Node version. Currently, our Typescript targets es2023. ## Installation -The recommended way to get started using the Node.js 5.x driver is by using the `npm` (Node Package Manager) to install the dependency in your project. +The recommended way to get started using the Node.js driver is by using the `npm` (Node Package Manager) to install the dependency in your project. After you've created your own project using `npm init`, you can run: diff --git a/package-lock.json b/package-lock.json index 00d285e620d..4db68a81d74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,7 @@ "yargs": "^18.0.0" }, "engines": { - "node": ">=16.20.1" + "node": ">=20.19.0" }, "peerDependencies": { "@aws-sdk/credential-providers": "^3.188.0", @@ -3102,19 +3102,6 @@ "@types/node": "*" } }, - "node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", diff --git a/package.json b/package.json index 700b0a349fb..c14dfcfe590 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=16.20.1" + "node": ">=20.19.0" }, "bugs": { "url": "https://jira.mongodb.org/projects/NODE/issues/" @@ -175,4 +175,4 @@ "moduleResolution": "node" } } -} +} \ No newline at end of file diff --git a/src/cmap/wire_protocol/on_data.ts b/src/cmap/wire_protocol/on_data.ts index 53ab41aebda..408c4a51492 100644 --- a/src/cmap/wire_protocol/on_data.ts +++ b/src/cmap/wire_protocol/on_data.ts @@ -49,7 +49,7 @@ export function onData( /** Set to true only after event listeners have been removed. */ let finished = false; - const iterator: AsyncGenerator = { + const iterator: AsyncGenerator & AsyncDisposable = { next() { // First, we consume all unread events const value = unconsumedEvents.shift(); @@ -89,7 +89,6 @@ export function onData( return this; }, - // Note this should currently not be used, but is required by the AsyncGenerator interface. async [Symbol.asyncDispose]() { await closeHandler(); } diff --git a/test/integration/connection-monitoring-and-pooling/connection.test.ts b/test/integration/connection-monitoring-and-pooling/connection.test.ts index eb6a8b39821..584f1ee67fc 100644 --- a/test/integration/connection-monitoring-and-pooling/connection.test.ts +++ b/test/integration/connection-monitoring-and-pooling/connection.test.ts @@ -372,7 +372,11 @@ describe('Connection', function () { // Ensure that we used the drain event for this write expect(addedListeners).to.deep.equal(['drain', 'error']); - expect(removedListeners).to.deep.equal(['drain', 'error']); + + // https://github.com/nodejs/node/issues/59977: Node 20.11.0 + // does not emit a `removeListeners` event for `drain`. + expect(removedListeners).to.deep.equal(['error']); + expect(socket.listenerCount('drain')).to.equal(0); }); } ); diff --git a/tsconfig.json b/tsconfig.json index 9915a1303f1..74fb09c6ff8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,15 +4,12 @@ "checkJs": false, "strict": true, "alwaysStrict": true, - "target": "ES2021", + "target": "ES2023", "module": "commonJS", "moduleResolution": "node", "skipLibCheck": true, "lib": [ - "es2021", - "ES2022.Error", - "ES2022.Object", - "esnext.disposable" + "es2023" ], // We don't make use of tslib helpers, all syntax used is supported by target engine "importHelpers": false, @@ -36,7 +33,8 @@ "noImplicitOverride": true, "noImplicitReturns": true, // TODO(NODE-3659): Enable useUnknownInCatchVariables and add type assertions or remove unnecessary catch blocks - "useUnknownInCatchVariables": false + "useUnknownInCatchVariables": false, + "useDefineForClassFields": false }, "ts-node": { "transpileOnly": true, @@ -45,4 +43,4 @@ "include": [ "src/**/*" ] -} +} \ No newline at end of file