From acb98ce01e7e3759b0d2bd9ed81b3cd198c755a4 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Tue, 8 Aug 2023 11:44:55 -0600 Subject: [PATCH 1/6] add new package --- .evergreen/config.in.yml | 7 +++++ .evergreen/config.yml | 25 +++++++++++++++++ .evergreen/generate_evergreen_tasks.js | 38 +++++++++++++++++++++----- package-lock.json | 6 ++-- package.json | 3 ++ 5 files changed, 69 insertions(+), 10 deletions(-) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index df9df455f78..a34f710b8ef 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -352,6 +352,13 @@ functions: SKIP_DEPS=${SKIP_DEPS|1} \ bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh + "install package": + - command: shell.exec + params: + working_dir: src + script: | + npm install --force ${PACKAGE} + "run lint checks": - command: subprocess.exec type: test diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 55d2fef4b00..56240675902 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -316,6 +316,12 @@ functions: COMPRESSOR="${COMPRESSOR}" \ SKIP_DEPS=${SKIP_DEPS|1} \ bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh + install package: + - command: shell.exec + params: + working_dir: src + script: | + npm install --force ${PACKAGE} run lint checks: - command: subprocess.exec type: test @@ -2745,6 +2751,22 @@ tasks: - func: run custom csfle tests vars: CSFLE_GIT_REF: master + - name: test-latest-driver-mongodb-client-encryption-6.0.0 + tags: + - run-custom-dependency-tests + commands: + - func: install dependencies + vars: + NODE_LTS_VERSION: 16 + - func: bootstrap mongo-orchestration + vars: + VERSION: '7.0' + TOPOLOGY: replica_set + - func: bootstrap kms servers + - func: install package + vars: + PACKAGE: mongodb-client-encryption@6.0.0-alpha.1 + - func: run tests - name: test-latest-server-noauth tags: - latest @@ -3676,6 +3698,7 @@ buildvariants: - test-auth-ldap - test-auth-oidc - test-socks5 + - test-socks5-csfle - test-socks5-tls - test-tls-support-latest - test-tls-support-6.0 @@ -3726,6 +3749,7 @@ buildvariants: - test-auth-ldap - test-auth-oidc - test-socks5 + - test-socks5-csfle - test-socks5-tls - test-tls-support-latest - test-tls-support-6.0 @@ -4015,6 +4039,7 @@ buildvariants: - run-custom-csfle-tests-rapid-master - run-custom-csfle-tests-latest-pinned-commit - run-custom-csfle-tests-latest-master + - test-latest-driver-mongodb-client-encryption-6.0.0 - name: rhel8-test-serverless display_name: Serverless Test run_on: rhel80-large diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 46224a08117..f1419123722 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -677,6 +677,37 @@ for (const version of ['5.0', 'rapid', 'latest']) { } } +oneOffFuncAsTasks.push({ + name: `test-latest-driver-mongodb-client-encryption-6.0.0`, + tags: ['run-custom-dependency-tests'], + commands: [ + { + func: 'install dependencies', + vars: { + NODE_LTS_VERSION: LOWEST_LTS + } + }, + { + func: 'bootstrap mongo-orchestration', + vars: { + VERSION: '7.0', + TOPOLOGY: 'replica_set' + } + }, + { func: 'bootstrap kms servers' }, + { + func: 'install package', + vars: { + // TODO: update the package version here + PACKAGE: 'mongodb-client-encryption@6.0.0-alpha.1' + } + }, + { + func: 'run tests' + } + ] +}); + const coverageTask = { name: 'download and merge coverage'.split(' ').join('-'), tags: [], @@ -781,13 +812,6 @@ for (const variant of BUILD_VARIANTS.filter( variant.tasks = variant.tasks.filter(name => !['test-socks5'].includes(name)); } -// TODO(NODE-5283): fix socks5 fle tests on node 20+ -for (const variant of BUILD_VARIANTS.filter( - variant => variant.expansions && [20].includes(variant.expansions.NODE_LTS_VERSION) -) ) { - variant.tasks = variant.tasks.filter(name => !['test-socks5-csfle'].includes(name)); -} - const fileData = yaml.load(fs.readFileSync(`${__dirname}/config.in.yml`, 'utf8')); fileData.tasks = (fileData.tasks || []) .concat(BASE_TASKS) diff --git a/package-lock.json b/package-lock.json index 56f25df94f6..2991d437ea2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6629,9 +6629,9 @@ } }, "node_modules/mongodb-client-encryption": { - "version": "6.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0-alpha.1.tgz", - "integrity": "sha512-SaYli844l5TN8oog4nJW8KKWpSPwSx2auojv30JtDQv8hgWV979Bnc4bwF2pf+R9fquqgoLr27CWxganGY0Zfg==", + "version": "6.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0-alpha.2.tgz", + "integrity": "sha512-MTIKpTN7MIbsPqXr2wWUs91yFIXMpXSvosnEi2qvsquD3OVtue/zMCiKCqSZH4ulBLiKnEESOsOPyqzfwgS1ow==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/package.json b/package.json index ed97baf16b2..5ee8c63d91f 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,9 @@ "snappy": "^7.2.2", "socks": "^2.7.1" }, + "overrides": { + "node-gyp": "9.4.0" + }, "peerDependenciesMeta": { "@aws-sdk/credential-providers": { "optional": true From a4b6e55479032b7f075d8c852387e6a639690f04 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Tue, 8 Aug 2023 12:53:08 -0600 Subject: [PATCH 2/6] fix CI and add logging for FLE version --- .evergreen/config.yml | 2 ++ .evergreen/generate_evergreen_tasks.js | 5 ++++- test/tools/runner/filters/client_encryption_filter.js | 11 ++++++++++- test/tools/runner/hooks/configuration.js | 5 ++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 56240675902..8976487bcfc 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2767,6 +2767,8 @@ tasks: vars: PACKAGE: mongodb-client-encryption@6.0.0-alpha.1 - func: run tests + vars: + CLIENT_ENCRYPTION: true - name: test-latest-server-noauth tags: - latest diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index f1419123722..6627bf8d684 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -703,7 +703,10 @@ oneOffFuncAsTasks.push({ } }, { - func: 'run tests' + func: 'run tests', + vars: { + CLIENT_ENCRYPTION: true + } } ] }); diff --git a/test/tools/runner/filters/client_encryption_filter.js b/test/tools/runner/filters/client_encryption_filter.js index d811c574b19..2cc20262e6e 100644 --- a/test/tools/runner/filters/client_encryption_filter.js +++ b/test/tools/runner/filters/client_encryption_filter.js @@ -1,5 +1,7 @@ 'use strict'; +const { readFileSync } = require('fs'); +const { resolve } = require('path'); const process = require('process'); /** @@ -25,13 +27,20 @@ class ClientSideEncryptionFilter { } } + const { version } = JSON.parse( + readFileSync( + resolve(__dirname, '../../../../node_modules/mongodb-client-encryption', 'package.json') + ) + ); + this.enabled = !!(CSFLE_KMS_PROVIDERS && mongodbClientEncryption); // Adds these fields onto the context so that they can be reused by tests context.clientSideEncryption = { enabled: this.enabled, mongodbClientEncryption, - CSFLE_KMS_PROVIDERS + CSFLE_KMS_PROVIDERS, + version }; callback(); diff --git a/test/tools/runner/hooks/configuration.js b/test/tools/runner/hooks/configuration.js index f07da9e2943..0aeb0966d25 100644 --- a/test/tools/runner/hooks/configuration.js +++ b/test/tools/runner/hooks/configuration.js @@ -156,7 +156,10 @@ const testConfigBeforeHook = async function () { serverless: process.env.SERVERLESS === '1', auth: process.env.AUTH === 'auth', tls: process.env.SSL === 'ssl', - csfle: this.configuration.clientSideEncryption.enabled, + csfle: { + enabled: this.configuration.clientSideEncryption.enabled, + version: this.configuration.clientSideEncryption.version + }, serverApi: MONGODB_API_VERSION, atlas: process.env.ATLAS_CONNECTIVITY != null, aws: MONGODB_URI.includes('authMechanism=MONGODB-AWS'), From 1d89af73e498906c16b80ce40eb2c4d89cccc028 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Tue, 8 Aug 2023 13:51:28 -0600 Subject: [PATCH 3/6] fix package lock issue --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2991d437ea2..56f25df94f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6629,9 +6629,9 @@ } }, "node_modules/mongodb-client-encryption": { - "version": "6.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0-alpha.2.tgz", - "integrity": "sha512-MTIKpTN7MIbsPqXr2wWUs91yFIXMpXSvosnEi2qvsquD3OVtue/zMCiKCqSZH4ulBLiKnEESOsOPyqzfwgS1ow==", + "version": "6.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0-alpha.1.tgz", + "integrity": "sha512-SaYli844l5TN8oog4nJW8KKWpSPwSx2auojv30JtDQv8hgWV979Bnc4bwF2pf+R9fquqgoLr27CWxganGY0Zfg==", "dev": true, "hasInstallScript": true, "dependencies": { From 9ddfab7eb1058822589916c0f006331f8466471e Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 9 Aug 2023 09:18:30 -0600 Subject: [PATCH 4/6] pull in alpha.3 --- package-lock.json | 10 +++++----- package.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56f25df94f6..890a0902930 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "js-yaml": "^4.1.0", "mocha": "^10.2.0", "mocha-sinon": "^2.1.2", - "mongodb-client-encryption": "6.0.0-alpha.1", + "mongodb-client-encryption": "6.0.0-alpha.3", "mongodb-legacy": "^5.0.0", "nyc": "^15.1.0", "prettier": "^2.8.8", @@ -75,7 +75,7 @@ "@mongodb-js/zstd": "^1.1.0", "gcp-metadata": "^5.2.0", "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0-alpha.1 <7", + "mongodb-client-encryption": ">=6.0.0-alpha.3 <7", "snappy": "^7.2.2", "socks": "^2.7.1" }, @@ -6629,9 +6629,9 @@ } }, "node_modules/mongodb-client-encryption": { - "version": "6.0.0-alpha.1", - "resolved": "https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0-alpha.1.tgz", - "integrity": "sha512-SaYli844l5TN8oog4nJW8KKWpSPwSx2auojv30JtDQv8hgWV979Bnc4bwF2pf+R9fquqgoLr27CWxganGY0Zfg==", + "version": "6.0.0-alpha.3", + "resolved": "https://registry.npmjs.org/mongodb-client-encryption/-/mongodb-client-encryption-6.0.0-alpha.3.tgz", + "integrity": "sha512-4mMs1SHfeE7c69xzqzXEC8psx8mh1o+6DOuXgft83RkBAIaI/YwfnHAHKxYH1KtwEmq60CK3tE3fai+JZjh8BA==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/package.json b/package.json index 5ee8c63d91f..7c7602eb553 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@mongodb-js/zstd": "^1.1.0", "gcp-metadata": "^5.2.0", "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0-alpha.1 <7", + "mongodb-client-encryption": ">=6.0.0-alpha.3 <7", "snappy": "^7.2.2", "socks": "^2.7.1" }, @@ -101,7 +101,7 @@ "js-yaml": "^4.1.0", "mocha": "^10.2.0", "mocha-sinon": "^2.1.2", - "mongodb-client-encryption": "6.0.0-alpha.1", + "mongodb-client-encryption": "6.0.0-alpha.3", "mongodb-legacy": "^5.0.0", "nyc": "^15.1.0", "prettier": "^2.8.8", From fb1656c23f3753bc0ed68a93d1860711d3fb976b Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 9 Aug 2023 09:21:30 -0600 Subject: [PATCH 5/6] bump to alpha3 for driver latest ce 6.0 tests --- .evergreen/config.yml | 2 +- .evergreen/generate_evergreen_tasks.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 8976487bcfc..058475c86df 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2765,7 +2765,7 @@ tasks: - func: bootstrap kms servers - func: install package vars: - PACKAGE: mongodb-client-encryption@6.0.0-alpha.1 + PACKAGE: mongodb-client-encryption@6.0.0-alpha.3 - func: run tests vars: CLIENT_ENCRYPTION: true diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index 6627bf8d684..236ee2cb8d6 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -698,8 +698,7 @@ oneOffFuncAsTasks.push({ { func: 'install package', vars: { - // TODO: update the package version here - PACKAGE: 'mongodb-client-encryption@6.0.0-alpha.1' + PACKAGE: 'mongodb-client-encryption@6.0.0-alpha.3' } }, { From 47f4be408beaaf3d4050a5e8ef090883cca9b99c Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 9 Aug 2023 14:30:45 -0600 Subject: [PATCH 6/6] remove override fields --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 7c7602eb553..3ba59eff044 100644 --- a/package.json +++ b/package.json @@ -40,9 +40,6 @@ "snappy": "^7.2.2", "socks": "^2.7.1" }, - "overrides": { - "node-gyp": "9.4.0" - }, "peerDependenciesMeta": { "@aws-sdk/credential-providers": { "optional": true