Skip to content

Commit bda0451

Browse files
Merge branch 'main' into uri-validate-less
2 parents 15dc8ee + 65e0e15 commit bda0451

File tree

202 files changed

+6113
-5429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+6113
-5429
lines changed

Diff for: .eslintignore

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
lib
33
test/disabled
44
!etc/docs
5-
6-
test/explicit-resource-management

Diff for: .eslintrc.json

+45-15
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
},
77
"plugins": [
88
"simple-import-sort",
9-
"import",
109
"@typescript-eslint",
1110
"prettier",
1211
"unused-imports",
1312
"tsdoc",
14-
"mocha",
15-
"github"
13+
"mocha"
1614
],
1715
"extends": [
1816
"eslint:recommended",
@@ -67,15 +65,17 @@
6765
],
6866
"simple-import-sort/imports": "error",
6967
"simple-import-sort/exports": "error",
70-
"import/first": "error",
71-
"import/newline-after-import": "error",
72-
"import/no-duplicates": "error",
7368
"strict": [
7469
"error",
7570
"global"
7671
],
7772
"@typescript-eslint/no-explicit-any": "off",
73+
"@typescript-eslint/no-non-null-assertion": "error",
74+
// We use redundant type constituents for documentation purposes.
75+
"@typescript-eslint/no-redundant-type-constituents": "off",
76+
"@typescript-eslint/no-empty-function": "error",
7877
"@typescript-eslint/require-await": "off",
78+
"@typescript-eslint/no-unused-expressions": "off",
7979
"@typescript-eslint/consistent-type-imports": [
8080
"error",
8181
{
@@ -121,12 +121,8 @@
121121
"message": "Do not strictly check typeof undefined (NOTE: currently this rule only detects the usage of 'undefined' string literal so this could be a misfire)"
122122
}
123123
],
124-
"@typescript-eslint/no-unused-vars": [
125-
"error",
126-
{
127-
"argsIgnorePattern": "^_"
128-
}
129-
]
124+
"@typescript-eslint/no-unused-vars": "error",
125+
"no-duplicate-imports": "error"
130126
},
131127
"overrides": [
132128
{
@@ -168,6 +164,9 @@
168164
"@typescript-eslint/no-empty-function": "off",
169165
"@typescript-eslint/no-this-alias": "off",
170166
"@typescript-eslint/no-unused-vars": "off",
167+
"@typescript-eslint/consistent-type-imports": "off",
168+
// JS test files use require
169+
"@typescript-eslint/no-require-imports": "off",
171170
// Since we use ts-node we should always require the TS code
172171
// Also we have patches to apply to the mock server, so we should always import from there
173172
"no-restricted-modules": [
@@ -200,6 +199,15 @@
200199
"no-restricted-syntax": "off",
201200
"typescript-eslint/ban-ts-comment": "off",
202201
"no-restricted-imports": "off",
202+
"@typescript-eslint/no-unused-vars": [
203+
"error",
204+
{
205+
"argsIgnorePattern": "^_",
206+
"caughtErrorsIgnorePattern": "^_",
207+
"destructuredArrayIgnorePattern": "^_",
208+
"varsIgnorePattern": "^_"
209+
}
210+
],
203211
"@typescript-eslint/no-restricted-imports": [
204212
"error",
205213
{
@@ -235,12 +243,23 @@
235243
"@typescript-eslint/restrict-plus-operands": "off",
236244
"@typescript-eslint/restrict-template-expressions": "off",
237245
"@typescript-eslint/require-await": "off",
246+
"@typescript-eslint/no-redundant-type-constituents": "off",
247+
"@typescript-eslint/no-unused-expressions": "off",
248+
"@typescript-eslint/no-explicit-any": "off",
238249
"no-return-await": "off",
239250
"@typescript-eslint/return-await": [
240251
"error",
241252
"always"
242253
],
243-
"github/no-then": "error",
254+
"@typescript-eslint/no-unused-vars": [
255+
"error",
256+
{
257+
"argsIgnorePattern": "^_",
258+
"caughtErrorsIgnorePattern": "^_",
259+
"destructuredArrayIgnorePattern": "^_",
260+
"varsIgnorePattern": "^_"
261+
}
262+
],
244263
"no-restricted-imports": [
245264
"error",
246265
{
@@ -263,7 +282,7 @@
263282
"tsdoc/syntax": "warn",
264283
"no-console": "off",
265284
"@typescript-eslint/no-explicit-any": "off",
266-
"@typescript-eslint/no-unused-vars": "error",
285+
"@typescript-eslint/no-unused-vars": "off",
267286
"@typescript-eslint/ban-ts-comment": "off",
268287
"@typescript-eslint/no-empty-function": "off"
269288
}
@@ -276,7 +295,18 @@
276295
],
277296
"parser": "@typescript-eslint/parser",
278297
"rules": {
279-
"unused-imports/no-unused-imports": "error"
298+
"unused-imports/no-unused-imports": "error",
299+
"@typescript-eslint/no-empty-object-type": "off",
300+
"@typescript-eslint/no-unsafe-declaration-merging": "off",
301+
"no-duplicate-imports": "off",
302+
"@typescript-eslint/consistent-type-imports": [
303+
"error",
304+
{
305+
"prefer": "type-imports",
306+
"disallowTypeAnnotations": false,
307+
"fixStyle": "separate-type-imports"
308+
}
309+
]
280310
}
281311
}
282312
]

Diff for: .evergreen/config.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3522,7 +3522,7 @@ tasks:
35223522
- func: install dependencies
35233523
- func: bootstrap mongo-orchestration
35243524
- func: check resource management feature integration
3525-
- name: check-types-typescript-next-node-types-20.14.10
3525+
- name: check-types-typescript-next-node-types-22.4.1
35263526
tags:
35273527
- check-types-typescript-next
35283528
- typescript-compilation
@@ -3534,10 +3534,10 @@ tasks:
35343534
- {key: NODE_LTS_VERSION, value: '16'}
35353535
- {key: NPM_VERSION, value: '9'}
35363536
- {key: TS_VERSION, value: next}
3537-
- {key: TYPES_VERSION, value: 20.14.10}
3537+
- {key: TYPES_VERSION, value: 22.4.1}
35383538
- func: install dependencies
35393539
- func: check types
3540-
- name: check-types-typescript-current-node-types-20.14.10
3540+
- name: check-types-typescript-current-node-types-22.4.1
35413541
tags:
35423542
- check-types-typescript-current
35433543
- typescript-compilation
@@ -3549,7 +3549,7 @@ tasks:
35493549
- {key: NODE_LTS_VERSION, value: '16'}
35503550
- {key: NPM_VERSION, value: '9'}
35513551
- {key: TS_VERSION, value: current}
3552-
- {key: TYPES_VERSION, value: 20.14.10}
3552+
- {key: TYPES_VERSION, value: 22.4.1}
35533553
- func: install dependencies
35543554
- func: check types
35553555
- name: check-types-typescript-next-node-types-16.x
@@ -3597,7 +3597,7 @@ tasks:
35973597
- {key: TYPES_VERSION, value: 18.11.9}
35983598
- func: install dependencies
35993599
- func: check types
3600-
- name: compile-driver-typescript-current-node-types-20.14.10
3600+
- name: compile-driver-typescript-current-node-types-22.4.1
36013601
tags:
36023602
- compile-driver-typescript-current
36033603
- typescript-compilation
@@ -3609,7 +3609,7 @@ tasks:
36093609
- {key: NODE_LTS_VERSION, value: '16'}
36103610
- {key: NPM_VERSION, value: '9'}
36113611
- {key: TS_VERSION, value: current}
3612-
- {key: TYPES_VERSION, value: 20.14.10}
3612+
- {key: TYPES_VERSION, value: 22.4.1}
36133613
- func: install dependencies
36143614
- func: compile driver
36153615
- name: download-and-merge-coverage

Diff for: .evergreen/install-mongodb-client-encryption.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env bash
2-
set +o xtrace # Do not write AWS credentials to stderr
2+
set +o xtrace
33

44
# Initial checks for running these tests
55
if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi
@@ -9,20 +9,19 @@ source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"
99
set -o xtrace # Write all commands first to stderr
1010
set -o errexit # Exit the script with error if any of the commands fail
1111

12-
rm -rf $INSTALL_DIR
12+
rm -rf mongodb-client-encryption
1313
git clone https://github.com/mongodb-js/mongodb-client-encryption.git
1414
pushd mongodb-client-encryption
1515

1616
if [ -n "${LIBMONGOCRYPT_VERSION}" ]; then
1717
# nightly tests test with `latest` to test against the laster FLE build.
18-
npm run install:libmongocrypt -- --libVersion $LIBMONGOCRYPT_VERSION
18+
npm run install:libmongocrypt -- --build --libVersion $LIBMONGOCRYPT_VERSION
1919
else
2020
# otherwise use whatever is specified in the package.json.
2121
npm run install:libmongocrypt
2222
fi
2323

2424
echo "finished installing libmongocrypt"
25-
BINDINGS_DIR=$(pwd)
2625

2726
popd
2827

Diff for: .github/dependabot.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "monthly"
12+
ignore:
13+
# chai is esmodule only.
14+
- dependency-name: "chai"
15+
versions: [">=5.0.0"]
16+
# sinon-chai 4.x+ supports chai 5.x+.
17+
- dependency-name: "sinon-chai"
18+
versions: [">=4.0.0"]
19+
# nyc is Node18+ only starting on [email protected].
20+
- dependency-name: "nyc"
21+
versions: [">=16.0.0"]
22+
# we ignore TS as a part of quarterly dependency updates.
23+
- dependency-name: "typescript"
24+
# stay on the supported major version of gcp-metadata
25+
- dependency-name: "gcp-metadata"
26+
versions: [">=6.0.0"]
27+
28+
versioning-strategy: increase
29+
allow:
30+
- dependency-type: "development"
31+
32+
groups:
33+
development-dependencies:
34+
dependency-type: "development"
35+
applies-to: version-updates
36+
update-types:
37+
- "minor"
38+
- "patch"

Diff for: .github/workflows/release-6.8.yml

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
on:
2+
push:
3+
branches: [6.8]
4+
workflow_dispatch: {}
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
id-token: write
10+
11+
name: release-68
12+
13+
jobs:
14+
release_please:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
steps:
19+
- id: release
20+
uses: googleapis/release-please-action@v4
21+
with:
22+
target-branch: 6.8
23+
24+
build:
25+
needs: [release_please]
26+
name: "Perform any build or bundling steps, as necessary."
27+
uses: ./.github/workflows/build.yml
28+
29+
ssdlc:
30+
needs: [release_please, build]
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
id-token: write
35+
contents: write
36+
environment: release
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Install Node and dependencies
42+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
43+
with:
44+
ignore_install_scripts: false
45+
46+
- name: Load version and package info
47+
uses: mongodb-labs/drivers-github-tools/node/get_version_info@v2
48+
with:
49+
npm_package_name: mongodb
50+
51+
- name: actions/compress_sign_and_upload
52+
uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
53+
with:
54+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
55+
aws_region_name: us-east-1
56+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
57+
npm_package_name: mongodb
58+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
59+
60+
- name: Copy sbom file to release assets
61+
shell: bash
62+
if: ${{ '' == '' }}
63+
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
64+
65+
# only used for mongodb-client-encryption
66+
- name: Augment SBOM and copy to release assets
67+
if: ${{ '' != '' }}
68+
uses: mongodb-labs/drivers-github-tools/sbom@v2
69+
with:
70+
silk_asset_group: ''
71+
sbom_file_name: sbom.json
72+
73+
- name: Generate authorized pub report
74+
uses: mongodb-labs/drivers-github-tools/full-report@v2
75+
with:
76+
release_version: ${{ env.package_version }}
77+
product_name: mongodb
78+
sarif_report_target_ref: 6.8
79+
third_party_dependency_tool: n/a
80+
dist_filenames: artifacts/*
81+
token: ${{ github.token }}
82+
sbom_file_name: sbom.json
83+
evergreen_project: mongo-node-driver-next
84+
evergreen_commit: ${{ env.commit }}
85+
86+
- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
87+
with:
88+
version: ${{ env.package_version }}
89+
product_name: mongodb
90+
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
91+
92+
publish:
93+
needs: [release_please, ssdlc, build]
94+
environment: release
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Install Node and dependencies
100+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
101+
102+
# Just picking a string to put here so that releases from this branch are not marked "latest",
103+
# we should go and rm-dist-tag after this is published, no reason to keep it tagged.
104+
- run: |
105+
npm publish --provenance --tag=tag-for-publishing-older-releases
106+
npm dist-tag rm mongodb tag-for-publishing-older-releases
107+
if: ${{ needs.release_please.outputs.release_created }}
108+
env:
109+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)