From c94fbb6321a0f60066d886e8e41595b8ae84a589 Mon Sep 17 00:00:00 2001 From: Tyler Biethman Date: Thu, 21 Jul 2022 13:02:46 -0500 Subject: [PATCH] chore(deps): Updating to electron@19.0.8 (#22775) * Trying out electron 19.0.4 * nvm-for-windows 1.1.7 is busted for node-16.14.2 * Went a bit overboard with the exit I think * Stepping this back * Breaking out yarn install * Print runtime data * log more data points * well i'm confused. seeing what happens after these steps * Lets see if powershell picks up the new PATH * Maybe shell is refreshed between jobs? * Installing nvm-1.1.9 manually * Cleaning up circle.yml and a few other node references. * Yeah that ain't gonna work * Trying bash implementation * Urgh yaml * Bumping to latest patch version * Getting a full build + artifacts * Sourcing node in build step * More node sourcing * Run against updated recipes repo * I'll find all these eventually * Trigger new build after cache busting * Let's slim this down to test recipes for a bit * Good ol' working_directory * Fixing bad syntax * Not quite sure where all this is necessary at this point * Using recipes PR branch * This isn't necessary here * Re-enabling jobs * More node sourcing * Running kitchensink tests against PR branch * Moving nvm-windows update to script * Even more node sourcing * Removing CI config for merged kitchensink/recipes PRs --- .node-version | 2 +- circle.yml | 76 ++++++++++++++----- cli/test/lib/util_spec.js | 4 +- package.json | 4 +- scripts/ensure-node.sh | 9 ++- scripts/run-docker-local.sh | 2 +- .../test-binary/node_versions_spec.ts | 2 +- yarn.lock | 18 ++--- 8 files changed, 83 insertions(+), 34 deletions(-) diff --git a/.node-version b/.node-version index d7cb9ec3a7..a1fe187884 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -16.13.2 \ No newline at end of file +16.14.2 \ No newline at end of file diff --git a/circle.yml b/circle.yml index 9af034d340..8768be00e1 100644 --- a/circle.yml +++ b/circle.yml @@ -27,7 +27,7 @@ mainBuildFilters: &mainBuildFilters branches: only: - develop - - global-mode-issue + - tbiethman/electron-19 # usually we don't build Mac app - it takes a long time # but sometimes we want to really confirm we are doing the right thing @@ -36,7 +36,7 @@ macWorkflowFilters: &darwin-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ 'global-mode-issue', << pipeline.git.branch >> ] + - equal: [ 'tbiethman/electron-19', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -45,6 +45,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ 'tbiethman/electron-19', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -63,6 +64,8 @@ windowsWorkflowFilters: &windows-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ linux-arm64, << pipeline.git.branch >> ] + - equal: [ 'tbiethman/electron-19', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -71,7 +74,7 @@ executors: # the Docker image with Cypress dependencies and Chrome browser cy-doc: docker: - - image: cypress/browsers:node16.13.2-chrome100-ff98 + - image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge # by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed. resource_class: medium environment: @@ -80,7 +83,7 @@ executors: # Docker image with non-root "node" user non-root-docker-user: docker: - - image: cypress/browsers:node16.13.2-chrome100-ff98 + - image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge user: node environment: PLATFORM: linux @@ -126,7 +129,7 @@ commands: - run: name: Check current branch to persist artifacts command: | - if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "global-mode-issue" ]]; then + if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "tbiethman/electron-19" ]]; then echo "Not uploading artifacts or posting install comment for this branch." circleci-agent step halt fi @@ -177,10 +180,14 @@ commands: steps: - run: name: Build all codegen - command: yarn gulp buildProd + command: | + source ./scripts/ensure-node.sh + yarn gulp buildProd - run: name: Build packages - command: yarn build + command: | + source ./scripts/ensure-node.sh + yarn build - prepare-modules-cache # So we don't throw these in the workspace cache - persist_to_workspace: root: ~/ @@ -313,6 +320,7 @@ commands: - run: name: Install Node Modules command: | + source ./scripts/ensure-node.sh # avoid installing Percy's Chromium every time we use @percy/cli # https://docs.percy.io/docs/caching-asset-discovery-browser-in-ci PERCY_POSTINSTALL_BROWSER=true \ @@ -374,7 +382,9 @@ commands: - run: name: Stop .only # this will catch ".only"s in js/coffee as well - command: yarn stop-only-all + command: | + source ./scripts/ensure-node.sh + yarn stop-only-all - run: name: Check terminal variables ## make sure the TERM is set to 'xterm' in node (Linux only) @@ -382,7 +392,9 @@ commands: ## See the following information ## * http://andykdocs.de/development/Docker/Fixing+the+Docker+TERM+variable+issue ## * https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables - command: yarn check-terminal + command: | + source ./scripts/ensure-node.sh + yarn check-terminal install-required-node: # https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/2 @@ -857,9 +869,20 @@ commands: - clone-repo-and-checkout-branch: repo: <> pull_request_id: <> + - run: + # Ensure we're installing the node-version for the cloned repo + command: | + if [[ -f .node-version ]]; then + curl -L https://raw.githubusercontent.com/cypress-io/cypress/<< pipeline.git.branch >>/scripts/ensure-node.sh --output ci-ensure-node.sh + else + # if no .node-version file exists, we no-op the node script and use the global yarn + echo '' > ci-ensure-node.sh + fi + working_directory: /tmp/<> - run: # Install deps + Cypress binary with yarn if yarn.lock present command: | + source ./ci-ensure-node.sh if [[ -f yarn.lock ]]; then yarn --frozen-lockfile CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip yarn add -D ~/cypress/cypress.tgz @@ -888,11 +911,14 @@ commands: - run: name: Print Cypress version working_directory: /tmp/<> - command: npx cypress version + command: | + source ./ci-ensure-node.sh + npx cypress version - run: name: Types check 🧩 (maybe) working_directory: /tmp/<> command: | + source ./ci-ensure-node.sh [[ -f yarn.lock ]] && yarn types || npm run types --if-present - when: condition: <> @@ -901,15 +927,19 @@ commands: name: Build 🏗 (maybe) working_directory: /tmp/<> command: | + source ./ci-ensure-node.sh [[ -f yarn.lock ]] && yarn build || npm run build --if-present - run: working_directory: /tmp/<> - command: <> + command: | + source ./ci-ensure-node.sh + <> background: true - run: condition: <> name: "Waiting on server to boot: <>" - command: "npx wait-on <> --timeout 120000" + command: | + npx wait-on <> --timeout 120000 - windows-install-chrome: browser: <> - when: @@ -939,14 +969,18 @@ commands: - run: name: Run tests using browser "<>" working_directory: /tmp/<> - command: <> -- --browser <> + command: | + source ./ci-ensure-node.sh + <> -- --browser <> - unless: condition: <> steps: - run: name: Run tests using command working_directory: /tmp/<> - command: <> + command: | + source ./ci-ensure-node.sh + <> - store-npm-logs wait-on-circle-jobs: @@ -1003,6 +1037,7 @@ commands: sudo apt-get update sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb fi + source ./scripts/ensure-node.sh node --version yarn binary-build --version $(node ./scripts/get-next-version.js) - run: @@ -1016,6 +1051,7 @@ commands: sudo apt-get update && sudo apt-get install -y zip fi fi + source ./scripts/ensure-node.sh yarn binary-zip - store-npm-logs - persist_to_workspace: @@ -1031,10 +1067,14 @@ commands: steps: - run: name: Bump NPM version - command: yarn get-next-version --npm + command: | + source ./scripts/ensure-node.sh + yarn get-next-version --npm - run: name: Build NPM package - command: yarn build --scope cypress + command: | + source ./scripts/ensure-node.sh + yarn build --scope cypress - run: name: Copy Re-exported NPM Packages command: node ./scripts/post-build.js @@ -1051,7 +1091,9 @@ commands: steps: - run: name: list NPM package contents - command: yarn workspace cypress size + command: | + source ./scripts/ensure-node.sh + yarn workspace cypress size - run: name: pack NPM package working_directory: cli/build diff --git a/cli/test/lib/util_spec.js b/cli/test/lib/util_spec.js index 0e44c4f0f4..7a347e1129 100644 --- a/cli/test/lib/util_spec.js +++ b/cli/test/lib/util_spec.js @@ -267,7 +267,7 @@ describe('util', () => { }) it('copy NODE_OPTIONS to ORIGINAL_NODE_OPTIONS', () => { - sandbox.stub(process.versions, 'node').value('v16.13.2') + sandbox.stub(process.versions, 'node').value('v16.14.2') sandbox.stub(process.versions, 'openssl').value('1.0.0') restoreEnv = mockedEnv({ @@ -322,7 +322,7 @@ describe('util', () => { // https://github.com/cypress-io/cypress/issues/18914 it('does not include --openssl-legacy-provider in Node <=16', () => { - sandbox.stub(process.versions, 'node').value('v16.13.2') + sandbox.stub(process.versions, 'node').value('v16.14.2') sandbox.stub(process.versions, 'openssl').value('1.0.0') restoreEnv = mockedEnv({}) diff --git a/package.json b/package.json index 31a663166d..e740f3250d 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ "dedent": "^0.7.0", "del": "3.0.0", "detect-port": "^1.3.0", - "electron": "18.3.0", + "electron": "19.0.8", "electron-builder": "^22.13.1", "electron-notarize": "^1.1.1", "enzyme-adapter-react-16": "1.12.1", @@ -217,7 +217,7 @@ "yarn-deduplicate": "3.1.0" }, "engines": { - "node": ">=16.13.2", + "node": ">=16.14.2", "yarn": ">=1.17.3" }, "productName": "Cypress", diff --git a/scripts/ensure-node.sh b/scripts/ensure-node.sh index e6663663a9..1e342ce470 100755 --- a/scripts/ensure-node.sh +++ b/scripts/ensure-node.sh @@ -1,9 +1,15 @@ #!/bin/bash # `source ./scripts/ensure-node.sh` to ensure you are running the correct Node version for this repo +# The Windows executor ships with nvm-windows 1.1.7, which has compatibility issues with node 16.14.2. +# When 1.1.7 is detected, we manually update to nvm-windows 1.1.9, which includes a fix for 16.14.2 support. +if [[ $PLATFORM == 'windows' && $(echo `nvm version`) == '1.1.7' ]]; then + curl -L -O https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-noinstall.zip && tar -xvf nvm-noinstall.zip -C C:/ProgramData/nvm +fi + node_version=$(cat .node-version) -# some environments (like Arm on CircleCI) bring their own nvm +# some environments (like Arm/Windows on CircleCI) bring their own nvm if type nvm &>/dev/null; then echo 'nvm found with cache dir' `nvm cache dir` else @@ -16,6 +22,7 @@ else source "${HOME}/.nvm/nvm.sh" fi + echo "Installing Node $node_version" nvm install ${node_version} echo "Using Node $node_version" diff --git a/scripts/run-docker-local.sh b/scripts/run-docker-local.sh index 2b65862079..89f54c62ef 100755 --- a/scripts/run-docker-local.sh +++ b/scripts/run-docker-local.sh @@ -3,7 +3,7 @@ set e+x echo "This script should be run from cypress's root" -name=cypress/browsers:node16.13.2-chrome100-ff98 +name=cypress/browsers:node16.14.2-slim-chrome100-ff99-edge echo "Pulling CI container $name" docker pull $name diff --git a/system-tests/test-binary/node_versions_spec.ts b/system-tests/test-binary/node_versions_spec.ts index 85254c6775..d006b4b273 100644 --- a/system-tests/test-binary/node_versions_spec.ts +++ b/system-tests/test-binary/node_versions_spec.ts @@ -28,7 +28,7 @@ describe('binary node versions', () => { [ 'cypress/base:12', 'cypress/base:14', - 'cypress/base:16.13.2', + 'cypress/base:16.14.2', 'cypress/base:17.3.0', ].forEach(smokeTestDockerImage) }) diff --git a/yarn.lock b/yarn.lock index cf7388950d..a4ba62a72f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3161,10 +3161,10 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== -"@electron/get@^1.13.0", "@electron/get@^1.6.0": - version "1.13.1" - resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.13.1.tgz#42a0aa62fd1189638bd966e23effaebb16108368" - integrity sha512-U5vkXDZ9DwXtkPqlB45tfYnnYBN8PePp1z/XDCupnSpdrxT8/ThCv9WCwPLf9oqiSGZTkH6dx2jDUPuoXpjkcA== +"@electron/get@^1.14.1", "@electron/get@^1.6.0": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.14.1.tgz#16ba75f02dffb74c23965e72d617adc721d27f40" + integrity sha512-BrZYyL/6m0ZXz/lDxy/nlVhQz+WF+iPS6qXolEU8atw7h6v1aYkjwJZ63m+bJMBTxDE66X+r2tPS4a/8C82sZw== dependencies: debug "^4.1.1" env-paths "^2.2.0" @@ -16465,12 +16465,12 @@ electron-to-chromium@^1.3.247, electron-to-chromium@^1.4.84: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.111.tgz#897613f6504f3f17c9381c7499a635b413e4df4e" integrity sha512-/s3+fwhKf1YK4k7btOImOzCQLpUjS6MaPf0ODTNuT4eTM1Bg4itBpLkydhOzJmpmH6Z9eXFyuuK5czsmzRzwtw== -electron@18.3.0: - version "18.3.0" - resolved "https://registry.npmjs.org/electron/-/electron-18.3.0.tgz#43de95979341e63f1b209c569a0ad148d98ae5b7" - integrity sha512-2+pAUIViVvFOGE5mJKKi8F6ruyvQrcqdfsm/AUfz+6P05vbvR5ZsR6WBkr90mlyojHW5w/nAVX9ZSOtz3aHs4A== +electron@19.0.8: + version "19.0.8" + resolved "https://registry.yarnpkg.com/electron/-/electron-19.0.8.tgz#c4d4ba915de554f2926261eb37d3527d2b092d4c" + integrity sha512-OWK3P/NbDFfBUv+wbYv1/OV4jehY5DQPT7n1maQJfN9hsnrWTMktXS/bmS05eSUAjNAzHmKPKfiKH2c1Yr7nGw== dependencies: - "@electron/get" "^1.13.0" + "@electron/get" "^1.14.1" "@types/node" "^16.11.26" extract-zip "^1.0.3"