Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(NODE-6622): pin npm version for node 18 to 10 #4358

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/ci_matrix_constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2', '4.0'];
const versions = [
{ codeName: 'gallium', versionNumber: 16, npmVersion: 9 },
{ codeName: 'hydrogen', versionNumber: 18, npmVersion: 'latest' },
{ codeName: 'hydrogen', versionNumber: 18, npmVersion: 10 },
{ codeName: 'iron', versionNumber: 20, npmVersion: 'latest' },
{ codeName: 'jod', versionNumber: 22, npmVersion: 'latest' },
];
Expand Down
6 changes: 3 additions & 3 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3581,7 +3581,7 @@ tasks:
params:
updates:
- {key: NODE_LTS_VERSION, value: '18'}
- {key: NPM_VERSION, value: latest}
- {key: NPM_VERSION, value: '10'}
- func: install dependencies
- func: run unit tests
- name: run-unit-tests-node-20
Expand Down Expand Up @@ -4842,7 +4842,7 @@ buildvariants:
run_on: rhel80-large
expansions:
NODE_LTS_VERSION: 18
NPM_VERSION: latest
NPM_VERSION: 10
CLIENT_ENCRYPTION: true
tasks:
- test-latest-server
Expand Down Expand Up @@ -5123,7 +5123,7 @@ buildvariants:
run_on: windows-vsCurrent-large
expansions:
NODE_LTS_VERSION: 18
NPM_VERSION: latest
NPM_VERSION: 10
tasks:
- test-latest-server
- test-latest-replica_set
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ for (const {
const nodeLtsDisplayName = `Node${NODE_LTS_VERSION}`;
const name = `${osName}-${NODE_LTS_VERSION >= 20 ? nodeLtsDisplayName : nodeLTSCodeName}`;
const display_name = `${osDisplayName} ${nodeLtsDisplayName}`;
const expansions = { NODE_LTS_VERSION, NPM_VERSION: NODE_LTS_VERSION === 16 ? 9 : 'latest' };
const NPM_VERSION = versions.find(({versionNumber}) => versionNumber === NODE_LTS_VERSION).npmVersion;
const expansions = { NODE_LTS_VERSION, NPM_VERSION };
const taskNames = tasks.map(({ name }) => name);

if (clientEncryption) {
Expand Down
5 changes: 4 additions & 1 deletion .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ export NODE_LTS_VERSION=${NODE_LTS_VERSION:-16}
# 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.

# If NODE_LTS_VERSION is numeric and less than 18, default to 9. Do not override if it is already set.
# If NODE_LTS_VERSION is numeric and less than 18, default to 9, if less than 20, default to 10.
# Do not override if it is already set.
if [[ "$NODE_LTS_VERSION" =~ ^[0-9]+$ && "$NODE_LTS_VERSION" -lt 18 ]]; then
export NPM_VERSION=${NPM_VERSION:-9}
elif [[ "$NODE_LTS_VERSION" =~ ^[0-9]+$ && "$NODE_LTS_VERSION" -lt 20 ]]; then
aditi-khare-mongoDB marked this conversation as resolved.
Show resolved Hide resolved
export NPM_VERSION=${NPM_VERSION:-10}
else
export NPM_VERSION=${NPM_VERSION:-latest}
fi
Expand Down
Loading