Skip to content

Commit d2dffa2

Browse files
authored
Merge branch 'main' into NODE-7043-error-wrapper
2 parents 9bd578d + ff229fa commit d2dffa2

File tree

14 files changed

+1511
-1829
lines changed

14 files changed

+1511
-1829
lines changed

.evergreen/install-mongodb-client-encryption.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ rm -rf mongodb-client-encryption
1212
git clone https://github.com/mongodb-js/mongodb-client-encryption.git
1313
pushd mongodb-client-encryption
1414

15+
# TODO(NODE-7218): test against latest mongodb-client-encryption
16+
git checkout aa61a35f5e174cd1c1e247e036093e18c88268c6
17+
1518
node --version
1619
npm --version
1720

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ updates:
2727
# chai-subset requires @types/chai 4.x.
2828
- dependency-name: "@types/chai"
2929
versions: [">=4.0.0"]
30-
# nyc is Node18+ only starting on [email protected].
31-
- dependency-name: "nyc"
32-
versions: [">=16.0.0"]
3330
# mocha-plugin-eslint breaks our lint configuration
3431
- dependency-name: "mocha-plugin-eslint"
3532
versions: [">=10.0.0"]

etc/notes/releasing.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
# Releasing MongoDB Node.js Packages
22

3+
- [Releasing MongoDB Node.js Packages](#releasing-mongodb-nodejs-packages)
4+
- [Pre-requisites](#pre-requisites)
5+
- [Branching and backport strategy](#branching-and-backport-strategy)
6+
- [Backports](#backports)
7+
- [`release-please`](#release-please)
8+
- [Release Notes](#release-notes)
9+
- [Release Instructions](#release-instructions)
10+
- [Authentication](#authentication)
11+
- [Prebuilds](#prebuilds)
12+
- [Alphas / Prereleases](#alphas--prereleases)
13+
- [Packages](#packages)
14+
315
> [!NOTE]
4-
> _Last updated: Thu Jun 6_
16+
> _Last updated: Oct 1, 2025_
517
618
## Pre-requisites
719

@@ -95,6 +107,52 @@ prebuild uploads archives of the native dependency to the github release.
95107
Uploading binaries should happen automatically after the git tag/github release has been made.
96108
It may take some time for the building and uploading to finish, but no more than a few hours at most.
97109

110+
## Alphas / Prereleases
111+
112+
> [!NOTE]
113+
> This documentation uses `alpha` as the prerelease tag, but if you wish to use a different tag, just
114+
> replace `alpha` with the desired tag.
115+
116+
To configure a repo for a prerelease:
117+
118+
1. Update the release Github action's `npm publish` step to publish an alpha by specifying `--tag alpha`:
119+
120+
```yaml
121+
- run: npm publish --provenance --tag alpha
122+
if: ${{ needs.release_please.outputs.release_created }}
123+
env:
124+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
125+
```
126+
127+
2. Update the release please configuration file with the following parameters:
128+
1. Specify `prerelease-type: alpha`. This tells release-please that we want to use alpha as the pre-release tag.
129+
2. Specify `prerelease: true`. This tells release-please to create the Github release as a pre-release.
130+
3. Specify `versioning: prerelease`. This tells release-please that we wish to release a pre-release.
131+
132+
```json
133+
{
134+
"pull-request-header": "Please run the release_notes action before releasing to generate release highlights",
135+
"packages": {
136+
".": {
137+
"include-component-in-tag": false,
138+
"changelog-path": "HISTORY.md",
139+
"release-type": "node",
140+
"bump-minor-pre-major": false,
141+
"bump-patch-for-minor-pre-major": false,
142+
"draft": false,
143+
"prerelease-type": "alpha",
144+
"prerelease": true,
145+
"versioning": "prerelease"
146+
}
147+
}
148+
}
149+
```
150+
151+
After merging the a PR with the above changes, release-please should re-create the release PR as a PR to release
152+
an alpha.
153+
154+
Example PR: https://github.com/mongodb-js/mongodb-client-encryption/pull/104
155+
98156
## Packages
99157

100158
The following is a list of packages the Node.js team is responsible for and these release instructions apply to.

src/client-side-encryption/auto_encrypter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface AutoEncryptionOptions {
6464
/** If true, autoEncryption will not attempt to spawn a mongocryptd before connecting */
6565
mongocryptdBypassSpawn?: boolean;
6666
/** The path to the mongocryptd executable on the system */
67-
mongocryptdSpawnPath?: string;
67+
mongocryptdSpawnPath?: `${string}mongocryptd${'.exe' | ''}`;
6868
/** Command line arguments to use when auto-spawning a mongocryptd */
6969
mongocryptdSpawnArgs?: string[];
7070
/**
@@ -90,7 +90,7 @@ export interface AutoEncryptionOptions {
9090
*
9191
* Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher.
9292
*/
93-
cryptSharedLibPath?: string;
93+
cryptSharedLibPath?: `${string}mongo_crypt_v${number}.${'so' | 'dll' | 'dylib'}`;
9494
/**
9595
* If specified, never use mongocryptd and instead fail when the MongoDB Crypt
9696
* shared library could not be loaded.

src/cmap/connection.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
import {
2323
MongoCompatibilityError,
2424
MONGODB_ERROR_CODES,
25-
MongoMissingDependencyError,
2625
MongoNetworkError,
2726
MongoNetworkTimeoutError,
2827
MongoOperationTimeoutError,
@@ -868,11 +867,7 @@ export class CryptoConnection extends Connection {
868867
): Promise<Document> {
869868
const { autoEncrypter } = this;
870869
if (!autoEncrypter) {
871-
// TODO(NODE-6065): throw a MongoRuntimeError in Node V7
872-
// @ts-expect-error No cause provided because there is no underlying error.
873-
throw new MongoMissingDependencyError('No AutoEncrypter available for encryption', {
874-
dependencyName: 'n/a'
875-
});
870+
throw new MongoRuntimeError('No AutoEncrypter available for encryption');
876871
}
877872

878873
const serverWireVersion = maxWireVersion(this);

src/cmap/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class PoolClearedError extends MongoNetworkError {
5656
super(errorMessage, pool.serverError ? { cause: pool.serverError } : undefined);
5757
this.address = pool.address;
5858

59-
this.addErrorLabel(MongoErrorLabel.PoolRequstedRetry);
59+
this.addErrorLabel(MongoErrorLabel.PoolRequestedRetry);
6060
}
6161

6262
override get name(): string {

src/error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const MongoErrorLabel = Object.freeze({
9797
ResumableChangeStreamError: 'ResumableChangeStreamError',
9898
HandshakeError: 'HandshakeError',
9999
ResetPool: 'ResetPool',
100-
PoolRequstedRetry: 'PoolRequstedRetry',
100+
PoolRequestedRetry: 'PoolRequestedRetry',
101101
InterruptInUseConnections: 'InterruptInUseConnections',
102102
NoWritesPerformed: 'NoWritesPerformed'
103103
} as const);
@@ -1444,7 +1444,7 @@ export function needsRetryableWriteLabel(
14441444
export function isRetryableWriteError(error: MongoError): boolean {
14451445
return (
14461446
error.hasErrorLabel(MongoErrorLabel.RetryableWriteError) ||
1447-
error.hasErrorLabel(MongoErrorLabel.PoolRequstedRetry)
1447+
error.hasErrorLabel(MongoErrorLabel.PoolRequestedRetry)
14481448
);
14491449
}
14501450

0 commit comments

Comments
 (0)