mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-04 14:00:22 -05:00
chore(dependency): Upgrade Electron 27 (#28792)
* dependency: upgrades electron from 25 to 26 * bump cache run ci * fix docker img names * ref electron upgrade branch * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * debug * debug * debug * update search string for resize observer error swallow * debug * update integrity check * update electron readme with upgrade troubleshooting section * point to new publish binary workflow branch for electron 27 * update electron readme with locations of chromium & node versions for a given electron version * update node versions and docker image refs * update electron version to 27.1.3 * fix db nativeBinding arg * chore: updating v8 snapshot cache * install setuptools on mac when updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * run workflows on this branch run ci * require addon directly and pass to better-sqlite3 init; debug * rm debug * try loading better-sqlite with a more dynamic filename * bump electron version * bump electron version * bump electron version -- run ci * bump electron version -- run ci * bump electron version -- run ci * bump electron version -- run ci * bump electron version -- run ci * add a step to update workflows.yml to electron upgrade process * reduce retry limit on issue 1244 test to prevent circle from thinking tests have hanged * target main branch of binary publish workflow? run ci * Update .node-version -- run ci * Update CHANGELOG.md * Update module_api_spec.ts * point publish binary back to electron upgrade branch * Adds some logging re: cachedDataVersion * use precise electron version for better-sqlite3 for centos7 * Update CHANGELOG.md * chore: fix issue with bytenode (#28568) * fix jsc for 27 -- run ci * Update smoke.js * fix build * update electron upgrade steps * Update packages/electron/README.md Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * Update cli/CHANGELOG.md Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * fix DebugEmptyStates component test * try to fix downstream build -- run ci (#28649) Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com> * point to consolidated binary publish branch * revert webpack-preprocessor-awesome-typescript-loader update * revert certain system tests * increase padding for module api system test duration window * account for differing screenshot sizes * screenshot size differs locally vs ci * update protocol snapshots * Update after-pack-hook.js * fix flaky slideshow * correct the chromium version in changelog * use 18.17.1 internal images * workflow filters * fix trailing checkbox in electron readme * add solution to crashing better-sqlite3 in electron readme * Update packages/electron/README.md Co-authored-by: Bill Glesias <bglesias@gmail.com> * Update scripts/after-pack-hook.js Co-authored-by: Ryan Manuel <ryanm@cypress.io> * Update scripts/after-pack-hook.js Co-authored-by: Ryan Manuel <ryanm@cypress.io> * Update scripts/after-pack-hook.js Co-authored-by: Ryan Manuel <ryanm@cypress.io> * add branch to setup_should_persist_artifacts * debug app e2e test * bump cache * upgrade browsers-internal to chrome 121 * revert to chrome 118 images * bump cache * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * bump cache --------- Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: Ryan Manuel <ryanm@cypress.io> Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Co-authored-by: Bill Glesias <bglesias@gmail.com>
This commit is contained in:
@@ -4,6 +4,8 @@ const path = require('path')
|
||||
const esbuild = require('esbuild')
|
||||
|
||||
const escapeString = (string) => string.replaceAll(`\``, `\\\``).replaceAll(`$`, `\\$`)
|
||||
const secret = require('crypto').randomBytes(48).toString('hex')
|
||||
const DUMMY_INDEX_JSC_HASH = 'abcddcbaabcddcbaabcddcbaabcddcba'
|
||||
|
||||
function read (file) {
|
||||
const pathToFile = require.resolve(`./${file}`)
|
||||
@@ -24,22 +26,37 @@ const getBinaryEntryPointSource = async () => {
|
||||
return esbuildResult.outputFiles[0].text
|
||||
}
|
||||
|
||||
const getBinaryByteNodeEntryPointSource = async () => {
|
||||
const esbuildResult = await esbuild.build({
|
||||
entryPoints: [require.resolve('./binary-byte-node-entry-point-source.js')],
|
||||
bundle: true,
|
||||
platform: 'node',
|
||||
write: false,
|
||||
minify: true,
|
||||
treeShaking: true,
|
||||
})
|
||||
|
||||
return esbuildResult.outputFiles[0].text
|
||||
}
|
||||
|
||||
const getIntegrityCheckSource = (baseDirectory) => {
|
||||
const fileSource = read('binary-integrity-check-source.js')
|
||||
const secret = require('crypto').randomBytes(48).toString('hex')
|
||||
|
||||
const mainIndexHash = crypto.createHmac('md5', secret).update(fs.readFileSync(path.join(baseDirectory, './index.js'), 'utf8')).digest('hex')
|
||||
const indexJscHash = crypto.createHmac('md5', secret).update(fs.readFileSync(path.join(baseDirectory, './packages/server/index.jsc'), 'utf8')).digest('hex')
|
||||
|
||||
return fileSource.split('\n').join(`\n `)
|
||||
.replaceAll('MAIN_INDEX_HASH', mainIndexHash)
|
||||
.replaceAll('INDEX_JSC_HASH', indexJscHash)
|
||||
.replaceAll('INDEX_JSC_HASH', DUMMY_INDEX_JSC_HASH)
|
||||
.replaceAll('HMAC_SECRET', secret)
|
||||
.replaceAll('CRYPTO_CREATE_HMAC_TO_STRING', escapeString(crypto.createHmac.toString()))
|
||||
.replaceAll('CRYPTO_HMAC_UPDATE_TO_STRING', escapeString(crypto.Hmac.prototype.update.toString()))
|
||||
.replaceAll('CRYPTO_HMAC_DIGEST_TO_STRING', escapeString(crypto.Hmac.prototype.digest.toString()))
|
||||
}
|
||||
|
||||
const getIndexJscHash = (baseDirectory) => {
|
||||
return crypto.createHmac('md5', secret).update(fs.readFileSync(path.join(baseDirectory, './packages/server/index.jsc'), 'utf8')).digest('hex')
|
||||
}
|
||||
|
||||
const getEncryptionFileSource = async (encryptionFilePath) => {
|
||||
const fileContents = await fs.readFile(encryptionFilePath, 'utf8')
|
||||
|
||||
@@ -102,6 +119,7 @@ const validateProtocolFile = async (protocolFilePath) => {
|
||||
|
||||
module.exports = {
|
||||
getBinaryEntryPointSource,
|
||||
getBinaryByteNodeEntryPointSource,
|
||||
getIntegrityCheckSource,
|
||||
getEncryptionFileSource,
|
||||
validateEncryptionFile,
|
||||
@@ -109,4 +127,6 @@ module.exports = {
|
||||
validateCloudEnvironmentFile,
|
||||
getProtocolFileSource,
|
||||
validateProtocolFile,
|
||||
getIndexJscHash,
|
||||
DUMMY_INDEX_JSC_HASH,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user