Skip to content
New issue

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

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

Already on GitHub? # to your account

Node 22 upgrade #18478

Merged
merged 1 commit into from
Feb 27, 2025
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
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ executors:
tiny-executor:
resource_class: small
docker:
- image: cimg/node:20.11.1
- image: cimg/node:22.14.0
environment:
HUSKY_SKIP_INSTALL: 1

Expand All @@ -64,7 +64,7 @@ executors:
default: medium+
image:
type: string
default: cimg/node:20.11.1
default: cimg/node:22.14.0
resource_class: << parameters.resource_class >>
docker:
- image: << parameters.image >>
Expand All @@ -82,7 +82,7 @@ executors:
# step, and the saving the initial a workspace state.
build-executor:
docker:
- image: mozilla/fxa-circleci:ci-builder-v4
- image: mozilla/fxa-circleci:ci-builder-v5
environment:
NODE_ENV: development
FIRESTORE_EMULATOR_HOST: localhost:9090
Expand All @@ -98,7 +98,7 @@ executors:
default: medium
resource_class: << parameters.resource_class >>
docker:
- image: mozilla/fxa-circleci:ci-test-runner-v4
- image: mozilla/fxa-circleci:ci-test-runner-v5
environment:
NODE_ENV: development
FIRESTORE_EMULATOR_HOST: localhost:9090
Expand All @@ -114,7 +114,7 @@ executors:
default: large
resource_class: << parameters.resource_class >>
docker:
- image: mozilla/fxa-circleci:ci-test-runner-v4
- image: mozilla/fxa-circleci:ci-test-runner-v5
- image: cimg/mysql:8.0
command: --default-authentication-plugin=mysql_native_password
- image: jdlk7/firestore-emulator
Expand All @@ -137,7 +137,7 @@ executors:
default: xlarge
resource_class: << parameters.resource_class >>
docker:
- image: mozilla/fxa-circleci:ci-functional-test-runner-v4
- image: mozilla/fxa-circleci:ci-functional-test-runner-v5
- image: redis
- image: pafortin/goaws
- image: cimg/mysql:8.0
Expand Down Expand Up @@ -183,7 +183,7 @@ executors:
default: xlarge
resource_class: << parameters.resource_class >>
docker:
- image: mozilla/fxa-circleci:ci-functional-test-runner-v4
- image: mozilla/fxa-circleci:ci-functional-test-runner-v5
environment:
NODE_ENV: development
CUSTOMS_SERVER_URL: none
Expand Down Expand Up @@ -459,7 +459,7 @@ commands:
docker build . \
-f ./project/_dev/docker/ci/Dockerfile \
--target << parameters.target >> \
-t mozilla/fxa-circleci:ci-<< parameters.target >>-v4
-t mozilla/fxa-circleci:ci-<< parameters.target >>-v5

create-fxa-ci-images:
# Build CI images. Images are built on top of each other. Each is optimized for a specific task.
Expand Down Expand Up @@ -488,10 +488,10 @@ commands:
name: Push CI Images and Extract Yarn Cache
command: |
docker login -u $DOCKER_USER_fxa_circleci -p $DOCKER_PASS_fxa_circleci
.circleci/docker-copy-cache.sh mozilla/fxa-circleci:ci-builder-v4
docker push mozilla/fxa-circleci:ci-test-runner-v4
docker push mozilla/fxa-circleci:ci-functional-test-runner-v4
docker push mozilla/fxa-circleci:ci-builder-v4
.circleci/docker-copy-cache.sh mozilla/fxa-circleci:ci-builder-v5
docker push mozilla/fxa-circleci:ci-test-runner-v5
docker push mozilla/fxa-circleci:ci-functional-test-runner-v5
docker push mozilla/fxa-circleci:ci-builder-v5
wait

jobs:
Expand Down Expand Up @@ -908,7 +908,7 @@ workflows:
name: Deploy CI Images
executor:
name: docker-build-executor
image: cimg/node:20.11.1-browsers
image: cimg/node:22.14.0-browsers
filters:
branches:
only:
Expand Down Expand Up @@ -1158,7 +1158,7 @@ workflows:
name: Deploy CI Images (nightly)
executor:
name: docker-build-executor
image: cimg/node:20.11.1-browsers
image: cimg/node:22.14.0-browsers
# Note, setting force-deploy as true will result in rebuilding the images regardless
# of whether or not there are package modifications.
force-deploy: true
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.1
22.14
2 changes: 1 addition & 1 deletion _dev/docker/ci-lockfile-generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# By running a yarn install inside the same base container that we use in our CI, we can
# ensure the same checksums are created correctly.
#
FROM cimg/node:20.11
FROM cimg/node:22.14

COPY . .
RUN sudo yarn cache clear --all
Expand Down
6 changes: 3 additions & 3 deletions _dev/docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Runs tests and common CI operations. Needs minimal install. Assumes
# workspace will be restored into the project folder.
FROM cimg/node:20.11 AS test-runner
FROM cimg/node:22.14 AS test-runner
RUN sudo apt-get update && sudo apt-get install -y \
python3-venv
WORKDIR /home/circleci
Expand All @@ -29,15 +29,15 @@ RUN yarn install --immutable;
# Acts as an intermediate stage for adding the firefox install. Note,
# that a yarn install must happen first to ensure the correct version
# of firefox is installed. Also note that the functional-test-runner
# must based on cimg/node:20.11-browsers, which is why this stage
# must based on cimg/node:22.14-browsers, which is why this stage
# is necessary.
FROM builder AS playwright-install
RUN npx playwright install --with-deps firefox chromium webkit;


# Runs functional tests in our CI. Needs minimal install. Assumes
# workspace will be restored into the project folder.
FROM cimg/node:20.11-browsers AS functional-test-runner
FROM cimg/node:22.14-browsers AS functional-test-runner
WORKDIR /home/circleci
COPY --chown=circleci:circleci --from=playwright-install /home/circleci/.cache/ms-playwright .cache/ms-playwright/
COPY --chown=circleci:circleci project project
Expand Down
2 changes: 1 addition & 1 deletion _dev/docker/mono/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Multi stage docker build for fxa-mono repo. Note that stages should be cached due to docker layer caching being
# turned on in CI.

FROM node:20.11.1-bullseye-slim AS fxa-base
FROM node:22.14.0-bullseye-slim AS fxa-base
RUN set -x \
&& addgroup --gid 10001 app \
&& adduser --disabled-password \
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"winston": "^3.17.0"
},
"engines": {
"node": "^20.11.1"
"node": "^22.14.0"
},
"husky": {
"hooks": {
Expand Down
6 changes: 3 additions & 3 deletions packages/fxa-auth-server/lib/oauth/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (currentPrivJWK) {
assert.strictEqual(
PRIVATE_KEY_SCHEMA.validate(currentPrivJWK).error,
undefined,
'openid.key must be a valid private key'
new Error('openid.key must be a valid private key')
);
PRIVATE_JWKS_MAP.set(currentPrivJWK.kid, currentPrivJWK);
} else if (!config.get('oauthServer.openid.unsafelyAllowMissingActiveKey')) {
Expand All @@ -62,7 +62,7 @@ if (newPrivJWK) {
assert.strictEqual(
PRIVATE_KEY_SCHEMA.validate(newPrivJWK).error,
undefined,
'openid.newKey must be a valid private key'
new Error('openid.newKey must be a valid private key')
);
assert.notEqual(
currentPrivJWK.kid,
Expand All @@ -79,7 +79,7 @@ if (oldPubJWK) {
assert.strictEqual(
PUBLIC_KEY_SCHEMA.validate(oldPubJWK).error,
undefined,
'openid.oldKey must be a valid public key'
new Error('openid.oldKey must be a valid public key')
);
assert.notEqual(
currentPrivJWK?.kid,
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-auth-server/test/local/email-cloud-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { EmailCloudTaskManager } = proxyquire('../../lib/email-cloud-tasks', {
},
},
});
import { EmailTypes } from '@fxa/shared/cloud-tasks';
const { EmailTypes } = require('@fxa/shared/cloud-tasks');

describe('EmailCloudTaskManager', () => {
const mockConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

const sinon = require('sinon');
const assert = { ...sinon.assert, ...require('chai').assert };
import { ReasonForDeletion } from '@fxa/shared/cloud-tasks';
import proxyquire from 'proxyquire';
const { ReasonForDeletion } = require('@fxa/shared/cloud-tasks');
const proxyquire = require('proxyquire');

describe('CloudSchedulerHandler', function () {
this.timeout(10000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { AccountEventsManager } from '../../../lib/account-events';
const { AccountEventsManager } = require('../../../lib/account-events');

const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
Expand All @@ -12,13 +12,13 @@ const sinon = require('sinon');
const assert = { ...sinon.assert, ...chai.assert };
const mocks = require('../../mocks');
const { recoveryPhoneRoutes } = require('../../../lib/routes/recovery-phone');
import {
const {
RecoveryNumberNotSupportedError,
SmsSendRateLimitExceededError,
RecoveryPhoneService,
RecoveryNumberRemoveMissingBackupCodes,
RecoveryPhoneRegistrationLimitReached,
} from '@fxa/accounts/recovery-phone';
} = require('@fxa/accounts/recovery-phone');

const { getRoute } = require('../../routes_helpers');
const { mockRequest } = require('../../mocks');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { MozillaSubscriptionTypes } from 'fxa-shared/subscriptions/types';
const { MozillaSubscriptionTypes } = require('fxa-shared/subscriptions/types');

import { ERRNO } from '../../../../lib/error';
const { ERRNO } = require('../../../../lib/error');

('use strict');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const { PayPalNotificationHandler } = proxyquire(
const { PayPalHelper } = require('../../../../lib/payments/paypal/helper');
const { CapabilityService } = require('../../../../lib/payments/capability');

import { RefundType } from '@fxa/payments/paypal';
import { SUBSCRIPTIONS_RESOURCE } from '../../../../lib/payments/stripe';
const { RefundType } = require('@fxa/payments/paypal');
const { SUBSCRIPTIONS_RESOURCE } = require('../../../../lib/payments/stripe');

const ACCOUNT_LOCALE = 'en-US';
const TEST_EMAIL = 'test@email.com';
Expand Down
8 changes: 4 additions & 4 deletions packages/fxa-auth-server/test/scripts/db-helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

const {
import {
Device,
Email,
Account,
SessionToken,
SignInCodes,
} = require('fxa-shared/db/models/auth');
const { uuidTransformer } = require('fxa-shared/db/transformers');
const crypto = require('crypto');
} from 'fxa-shared/db/models/auth';
import { uuidTransformer } from 'fxa-shared/db/transformers';
import * as crypto from 'crypto';

export const toZeroBuff = (size) =>
Buffer.from(Array(size).fill(0), 'hex').toString('hex');
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-content-server/server/lib/beta-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function modifyProxyRes(proxyRes, req, res) {
// automatically, and these two headers are incompatible. If this is not
// set any fetch request will fail with:
// - Parse Error: Content-Length can't be present with Transfer-Encoding
res.set('Transfer-Encoding', '');
res.removeHeader('Transfer-Encoding');
res.send(body);
}

Expand Down