From 374656a3d15e43f25f73874bacb85ce679532f8d Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 21 Jul 2023 16:33:25 -0230 Subject: [PATCH] Fix sentry sourcemaps (#20122) * Update sentry/cli to 2.19.4 * Ensure sentry files are loaded and referenced with a valid url * Temp to eliminate errors in sentry (should be split into other PRs) --- app/scripts/lib/setupSentry.js | 2 +- development/build/index.js | 2 ++ development/sentry-upload-artifacts.sh | 2 +- lavamoat/build-system/policy.json | 16 ++++++++-------- package.json | 2 +- yarn.lock | 16 ++++++++-------- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index a383f8221..bac3c79ce 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -352,6 +352,6 @@ function toMetamaskUrl(origUrl) { if (!filePath) { return origUrl; } - const metamaskUrl = `metamask${filePath}`; + const metamaskUrl = `/metamask${filePath}`; return metamaskUrl; } diff --git a/development/build/index.js b/development/build/index.js index 84ee91040..92a6ea678 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -99,6 +99,8 @@ async function defineAndRunBuildTasks() { 'navigator', 'harden', 'console', + 'WeakSet', + 'Event', 'Image', // Used by browser to generate notifications // globals chromedriver needs to function /cdc_[a-zA-Z0-9]+_[a-zA-Z]+/iu, diff --git a/development/sentry-upload-artifacts.sh b/development/sentry-upload-artifacts.sh index 9d2fd32b4..e70989123 100755 --- a/development/sentry-upload-artifacts.sh +++ b/development/sentry-upload-artifacts.sh @@ -31,7 +31,7 @@ function upload_sourcemaps { local release="${1}"; shift local dist_directory="${1}"; shift - sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/*.js "${dist_directory}"/sourcemaps/ --rewrite --url-prefix 'metamask' + sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/*.js "${dist_directory}"/sourcemaps/ --rewrite --url-prefix '/metamask' } function main { diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index a615563a8..98fd8942c 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1124,13 +1124,6 @@ "@metamask/jazzicon>color>color-convert>color-name": true } }, - "@sentry/cli>mkdirp": { - "builtin": { - "fs": true, - "path.dirname": true, - "path.resolve": true - } - }, "@storybook/addon-knobs>qs": { "packages": { "string.prototype.matchall>side-channel": true @@ -8153,7 +8146,14 @@ "path.dirname": true }, "packages": { - "@sentry/cli>mkdirp": true + "stylelint>file-entry-cache>flat-cache>write>mkdirp": true + } + }, + "stylelint>file-entry-cache>flat-cache>write>mkdirp": { + "builtin": { + "fs": true, + "path.dirname": true, + "path.resolve": true } }, "stylelint>global-modules": { diff --git a/package.json b/package.json index e80cdb33a..ac81c669a 100644 --- a/package.json +++ b/package.json @@ -382,7 +382,7 @@ "@metamask/forwarder": "^1.1.0", "@metamask/phishing-warning": "^2.1.0", "@metamask/test-dapp": "^7.0.1", - "@sentry/cli": "^1.58.0", + "@sentry/cli": "^2.19.4", "@storybook/addon-a11y": "^7.0.11", "@storybook/addon-actions": "^7.0.11", "@storybook/addon-essentials": "^7.0.11", diff --git a/yarn.lock b/yarn.lock index da39e1257..4b43e388f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5597,18 +5597,18 @@ __metadata: languageName: node linkType: hard -"@sentry/cli@npm:^1.58.0": - version: 1.58.0 - resolution: "@sentry/cli@npm:1.58.0" +"@sentry/cli@npm:^2.19.4": + version: 2.19.4 + resolution: "@sentry/cli@npm:2.19.4" dependencies: https-proxy-agent: ^5.0.0 - mkdirp: ^0.5.5 - node-fetch: ^2.6.0 + node-fetch: ^2.6.7 progress: ^2.0.3 proxy-from-env: ^1.1.0 + which: ^2.0.2 bin: sentry-cli: bin/sentry-cli - checksum: fc781bbffcf5cd970bb023168421ad89bca4184c2ddfbfddde92f4f5333c8b9075e9e16a8a4b192ecc3b197ac97062715e7b350c306ccc538fc01b955b06c3bb + checksum: 1f2442857a5eec2bc6f872a633d88fc2f11ed7f434db36627a034d904390f4cbbb4dccc33c571a8815e423cd36b863c72621298d49a1541b28370c7f7308f0dc languageName: node linkType: hard @@ -24530,7 +24530,7 @@ __metadata: "@reduxjs/toolkit": ^1.6.2 "@segment/loosely-validate-event": ^2.0.0 "@sentry/browser": ^7.53.0 - "@sentry/cli": ^1.58.0 + "@sentry/cli": ^2.19.4 "@sentry/integrations": ^7.53.0 "@sentry/types": ^7.53.0 "@sentry/utils": ^7.53.0 @@ -26117,7 +26117,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2, node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.11, node-fetch@npm:^2.6.7, node-fetch@npm:~2.6.1": +"node-fetch@npm:^2, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.11, node-fetch@npm:^2.6.7, node-fetch@npm:~2.6.1": version: 2.6.11 resolution: "node-fetch@npm:2.6.11" dependencies: