Skip to content

Commit 2013159

Browse files
mabaasitnbbeekenaddaleax
authored
feat: update libmongocrypt and fix tests (#2076)
- Migrate mongosh to new mongodb-client-encryption repository - Update mongodb-client-encryption to 6.1.0 - Enable QE Range as GA and disable the RangePreview version of the algorithm - Use the 8.0 server crypt_shared library everywhere and consequentially break out-of-the-box automatic encryption on platforms with lower glibc requirements Co-authored-by: Neal Beeken <[email protected]> Co-authored-by: Anna Henningsen <[email protected]>
1 parent 246d135 commit 2013159

File tree

16 files changed

+413
-307
lines changed

16 files changed

+413
-307
lines changed

.evergreen.yml

Lines changed: 84 additions & 76 deletions
Large diffs are not rendered by default.

.evergreen/evergreen.yml.in

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const MONGODB_VERSIONS = [
1515
{ shortName: '60xe', versionSpec: '6.0.x-enterprise' },
1616
{ shortName: '70xc', versionSpec: '7.0.x' },
1717
{ shortName: '70xe', versionSpec: '7.0.x-enterprise' },
18-
{ shortName: '80xc', versionSpec: '>= 8.0.0-rc15' },
19-
{ shortName: '80xe', versionSpec: '>= 8.0.0-rc15-enterprise' },
18+
{ shortName: '80xc', versionSpec: '8.0.0-rc17' },
19+
{ shortName: '80xe', versionSpec: '8.0.0-rc17-enterprise' },
2020
{ shortName: 'latest', versionSpec: 'latest-alpha-enterprise' }
2121
];
2222
const NODE_VERSIONS = [
@@ -743,6 +743,8 @@ functions:
743743
params:
744744
working_dir: src
745745
shell: bash
746+
env:
747+
MONGOSH_NO_AUTOMATIC_ENCRYPTION_SUPPORT: ${no_automatic_encryption_support|}
746748
script: |
747749
set -e
748750
set -x
@@ -769,6 +771,8 @@ functions:
769771
params:
770772
working_dir: src
771773
shell: bash
774+
env:
775+
MONGOSH_NO_AUTOMATIC_ENCRYPTION_SUPPORT: ${no_automatic_encryption_support|}
772776
script: |
773777
set -e
774778
set -x
@@ -794,6 +798,8 @@ functions:
794798
params:
795799
working_dir: src
796800
shell: bash
801+
env:
802+
MONGOSH_NO_AUTOMATIC_ENCRYPTION_SUPPORT: ${no_automatic_encryption_support|}
797803
script: |
798804
set -e
799805
set -x
@@ -1192,7 +1198,7 @@ tasks:
11921198
# E2E TESTS
11931199
###
11941200
<% for (const { executableOsId, compileBuildVariant } of RELEASE_PACKAGE_MATRIX) {
1195-
for (const mVersion of ['stable', '8.0.0-rc15', '6.0.x']) {
1201+
for (const mVersion of ['stable', '8.0.0-rc17', '6.0.x']) {
11961202
for (const fipsVariant of ['fips', 'nofips']) {
11971203
%>
11981204
- name: e2e_tests_<% out(executableOsId.replace(/-/g, '_')) %><% out(mVersion === 'stable' ? '' : '_' + mVersion.replace(/[^a-zA-Z0-9]/g, '')) %><% out(fipsVariant === 'fips' ? '_fips' : '') %>
@@ -1732,8 +1738,8 @@ buildvariants:
17321738
run_on: ubuntu2404-small
17331739
tags: ["nightly-driver"]
17341740
tasks:
1735-
- name: e2e_tests_linux_x64_800rc15
1736-
- name: e2e_tests_linux_x64_openssl3_800rc15
1741+
- name: e2e_tests_linux_x64_800rc17
1742+
- name: e2e_tests_linux_x64_openssl3_800rc17
17371743
- name: e2e_debian10_x64
17381744
display_name: "Debian 10 x64 (E2E Tests)"
17391745
run_on: debian10-small
@@ -1795,8 +1801,8 @@ buildvariants:
17951801
display_name: "Ubuntu 24.04 arm64 (E2E Tests)"
17961802
run_on: ubuntu2404-arm64-small
17971803
tasks:
1798-
- name: e2e_tests_linux_arm64_800rc15
1799-
- name: e2e_tests_linux_arm64_openssl3_800rc15
1804+
- name: e2e_tests_linux_arm64_800rc17
1805+
- name: e2e_tests_linux_arm64_openssl3_800rc17
18001806
- name: e2e_amazon2_arm64
18011807
display_name: "Amazon Linux 2 arm64 (E2E Tests)"
18021808
run_on: amazon2-arm64-large
@@ -1965,6 +1971,8 @@ buildvariants:
19651971
- name: pkg_smoke_tests_rhel72_s390x
19661972
display_name: "package smoke tests (RHEL 7.2 s390x)"
19671973
run_on: rhel72-zseries-small
1974+
expansions:
1975+
no_automatic_encryption_support: 1
19681976
tasks:
19691977
- name: pkg_test_rpmextract_rpm_s390x
19701978
- name: pkg_smoke_tests_rhel83_s390x

package-lock.json

Lines changed: 62 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"generate-error-overview": "npm run generate-error-overview --workspace @mongosh/errors",
4848
"update-authors": "ts-node -P configs/tsconfig-mongosh/tsconfig.common.json scripts/generate-authors.ts",
4949
"create-dependency-sbom-lists": "npm run webpack-build -w packages/cli-repl && npm run write-node-js-dep && npm run create-purls-file && npm run create-first-party-dependency-lists",
50-
"create-first-party-dependency-lists": "mongodb-sbom-tools fetch-codeql-results --first-party-deps-list-dest=.sbom/first-party-deps.json --dependencies=.sbom/dependencies.json --exclude-repos=mongodb-js/kerberos",
50+
"create-first-party-dependency-lists": "mongodb-sbom-tools fetch-codeql-results --first-party-deps-list-dest=.sbom/first-party-deps.json --dependencies=.sbom/dependencies.json --exclude-repos=mongodb-js/kerberos,mongodb-client-encryption",
5151
"create-purls-file": "node scripts/create-purls.js .sbom/dependencies.json .sbom/node-js-dep.json > .sbom/purls.txt",
5252
"preupdate-third-party-notices": "npm run create-dependency-sbom-lists",
5353
"update-third-party-notices": "mongodb-sbom-tools generate-3rd-party-notices --product='mongosh' --dependencies=.sbom/dependencies.json > THIRD_PARTY_NOTICES.md",

packages/build/src/compile/signable-compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function preCompileHook(nodeSourceTree: string) {
3232
env: {
3333
...process.env,
3434
FLE_NODE_SOURCE_PATH: nodeSourceTree,
35-
LIBMONGOCRYPT_VERSION: `node-v${fleAddonVersion}`,
35+
MONGODB_CLIENT_ENCRYPTION_VERSION: `v${fleAddonVersion}`,
3636
},
3737
stdio: 'inherit',
3838
}

packages/build/src/packaging/download-crypt-library.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ export async function downloadCryptLibrary(
3434
);
3535
// Download mongodb for latest server version, including rapid releases
3636
// (for the platforms that they exist for, i.e. for ppc64le/s390x only pick stable releases).
37-
let versionSpec = 'continuous';
38-
if (/ppc64/.test(opts.arch || process.arch)) {
39-
versionSpec = 'stable';
40-
}
41-
if (/s390x/.test(opts.arch || process.arch)) {
42-
versionSpec = '6.0.x'; // The 7.x+ server releases don't have RHEL7-compatible crypt_shared libraries
43-
}
37+
// TODO(MONGOSH-1833): The current 'continuous' release is not compatible with 8.x rc server releases. So we are using
38+
// 8.0.0-rc17 (current latest) for now and once 8.0 is released we should switch back to continuous.
39+
const versionSpec = '8.0.0-rc17';
40+
//if (/ppc64|s390x/.test(opts.arch || process.arch)) {
41+
// versionSpec = 'stable';
42+
//}
4443
const { downloadedBinDir: libdir, version } =
4544
await downloadMongoDbWithVersionInfo(cryptTmpTargetDir, versionSpec, opts);
4645
const cryptLibrary = path.join(
@@ -73,11 +72,10 @@ function lookupReleaseDistro(packageVariant: PackageVariant): {
7372
case 'ppc64le':
7473
return { platform: 'linux', distro: 'rhel81' };
7574
case 's390x':
76-
return { platform: 'linux', distro: 'rhel72' };
75+
return { platform: 'linux', distro: 'rhel83' };
7776
case 'arm64':
78-
return { platform: 'linux', distro: 'amazon2' };
7977
case 'x64':
80-
return { platform: 'linux', distro: 'rhel70' };
78+
return { platform: 'linux', distro: 'rhel8' };
8179
default:
8280
break;
8381
}

packages/cli-repl/src/smoke-tests-fle.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const assert = function(value, message) {
1313
}
1414
};
1515
if (db.version().startsWith('4.0.') ||
16-
!db.runCommand({buildInfo:1}).modules.includes('enterprise')) {
16+
!db.runCommand({buildInfo:1}).modules.includes('enterprise') ||
17+
!!process.env.MONGOSH_NO_AUTOMATIC_ENCRYPTION_SUPPORT) {
1718
// No FLE on mongod < 4.2 or community
1819
print('Test skipped')
1920
process.exit(0)

packages/cli-repl/src/smoke-tests.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ export async function runSmokeTests({
7373
const expectFipsSupport =
7474
!!process.env.MONGOSH_SMOKE_TEST_OS_HAS_FIPS_SUPPORT &&
7575
(await buildInfo()).sharedOpenssl;
76+
const expectAutomaticEncryptionSupport =
77+
!process.env.MONGOSH_NO_AUTOMATIC_ENCRYPTION_SUPPORT;
7678
if (!wantPerformanceTesting) {
77-
console.log('FIPS support required to pass?', { expectFipsSupport });
79+
console.log('FIPS/FLE support required to pass?', {
80+
expectFipsSupport,
81+
expectAutomaticEncryptionSupport,
82+
});
7883
}
7984
const perfResults: PerfTestResult[] = [];
8085

0 commit comments

Comments
 (0)