Commit f5a96dcf authored by Stan Hu's avatar Stan Hu

Fix qa-frontend-node:latest CI build

Due to changes in node v17+ to work with OpenSSL v3.0, MD4/MD5 hash
algorithms no longer can be used out-of-the-box with Webpack
(https://github.com/webpack/webpack/issues/14532).

We can't switch to another hash algorithm like SHA256 until we upgrade
to Webpack v5 (https://gitlab.com/gitlab-org/gitlab/-/issues/350120),
but we can make the latest node version work by specifying
`--openssl-legacy-provider` in `NODE_OPTIONS`.

We use a separate build script (`webpack-prod-node-latest`) because
older versions of node will fail if `--openssl-legacy-provider` is used.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/346110
parent a933ce46
......@@ -306,6 +306,11 @@ qa-frontend-node:latest:
- .qa-frontend-node
- .frontend:rules:qa-frontend-node-latest
image: ${GITLAB_DEPENDENCY_PROXY}node:latest
# This is a workaround for https://github.com/webpack/webpack/issues/14532 until
# we can upgrade to Webpack 5 and switch to SHA256: https://gitlab.com/gitlab-org/gitlab/-/issues/350120
script:
- *yarn-install
- run_timed_command "retry yarn run webpack-prod-node-latest"
webpack-dev-server:
extends:
......
......@@ -44,7 +44,8 @@
"stylelint-create-utility-map": "node scripts/frontend/stylelint/stylelint-utility-map.js",
"webpack": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.config.js",
"webpack-vendor": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.vendor.config.js",
"webpack-prod": "NODE_OPTIONS=\"--max-old-space-size=3584\" NODE_ENV=production webpack --config config/webpack.config.js"
"webpack-prod": "NODE_OPTIONS=\"--max-old-space-size=3584\" NODE_ENV=production webpack --config config/webpack.config.js",
"webpack-prod-node-latest": "NODE_OPTIONS=\"--max-old-space-size=3584 --openssl-legacy-provider\" NODE_ENV=production webpack --config config/webpack.config.js"
},
"dependencies": {
"@babel/core": "^7.10.1",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment