diff --git a/ghost/admin/app/routes/application.js b/ghost/admin/app/routes/application.js index 628fe2af4c..cd23fd0284 100644 --- a/ghost/admin/app/routes/application.js +++ b/ghost/admin/app/routes/application.js @@ -7,6 +7,7 @@ import ShortcutsRoute from 'ghost-admin/mixins/shortcuts-route'; import ctrlOrCmd from 'ghost-admin/utils/ctrl-or-cmd'; import windowProxy from 'ghost-admin/utils/window-proxy'; import {Debug} from '@sentry/integrations'; +import {RewriteFrames} from '@sentry/integrations'; import {importSettings} from '../components/admin-x/settings'; import {inject} from 'ghost-admin/decorators/inject'; import { @@ -210,10 +211,26 @@ export default Route.extend(ShortcutsRoute, { }, // TransitionAborted errors surface from normal application behaviour // - https://github.com/emberjs/ember.js/issues/12505 - ignoreErrors: [/^TransitionAborted$/] + ignoreErrors: [/^TransitionAborted$/], + integrations: [ + // Stack frames in production are rewritten to remove the version identifier + // from the path. This makes grouping by stack trace not work. + // Before: /admin/1633/assets/path/to/file.js + // After: /admin/assets/path/to/file.js + new RewriteFrames({ + iteratee: (frame) => { + if (frame.filename) { + // Check if the frame.filename matches /admin/1633/assets + // and rewrite it to /admin/assets + frame.filename = frame.filename.replace(/\/admin\/\d+\/assets/, '/admin/assets'); + } + return frame; + } + }) + ] }; if (this.config.sentry_env === 'development') { - sentryConfig.integrations = [new Debug()]; + sentryConfig.integrations.push(new Debug()); } Sentry.init(sentryConfig); } diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 0b77487962..30a34f9a89 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -40,6 +40,7 @@ "@glimmer/component": "1.1.2", "@html-next/vertical-collection": "3.0.0", "@sentry/ember": "7.78.0", + "@sentry/integrations": "7.80.0", "@tryghost/color-utils": "0.2.0", "@tryghost/ember-promise-modals": "2.0.1", "@tryghost/helpers": "1.1.88", @@ -168,7 +169,6 @@ "*.js": "eslint" }, "dependencies": { - "@sentry/integrations": "^7.75.1", "jose": "4.15.4", "path-browserify": "1.0.1", "webpack": "5.89.0" @@ -199,4 +199,4 @@ } } } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index de0a4888e3..6430a78937 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4884,6 +4884,14 @@ "@sentry/types" "7.78.0" "@sentry/utils" "7.78.0" +"@sentry/core@7.80.0": + version "7.80.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.80.0.tgz#7b8a460c19160b81ade20080333189f1a80c1410" + integrity sha512-nJiiymdTSEyI035/rdD3VOq6FlOZ2wWLR5bit9LK8a3rzHU3UXkwScvEo6zYgs0Xp1sC0yu1S9+0BEiYkmi29A== + dependencies: + "@sentry/types" "7.80.0" + "@sentry/utils" "7.80.0" + "@sentry/ember@7.78.0": version "7.78.0" resolved "https://registry.yarnpkg.com/@sentry/ember/-/ember-7.78.0.tgz#4c17d9e719611f681abce3f091aa6fa45508d0e1" @@ -4898,14 +4906,14 @@ ember-cli-htmlbars "^6.1.1" ember-cli-typescript "^5.1.1" -"@sentry/integrations@^7.75.1": - version "7.78.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.78.0.tgz#9dc149c0ff92535c412a6f6eeaa6f8613fa0c83a" - integrity sha512-h5D2CqM3KPD5hcDFBSsaVGUz95QDuEaKU9juhb96os5zpg5c3VfSWE+u9CuABXu+cXS5+TVfffVrZ+A+YFo+Rg== +"@sentry/integrations@7.80.0": + version "7.80.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.80.0.tgz#d81dc3b357d4efd4368471b39496494ab221a64a" + integrity sha512-9xI+jtqSBrAG/Y2f4OyeJhl6WZR3i0qCXRwqCZoCFCDgN4ZQORc4VBwaC3nW2s9jgfb13FC2FQToGOVrRnsetg== dependencies: - "@sentry/core" "7.78.0" - "@sentry/types" "7.78.0" - "@sentry/utils" "7.78.0" + "@sentry/core" "7.80.0" + "@sentry/types" "7.80.0" + "@sentry/utils" "7.80.0" localforage "^1.8.1" "@sentry/node@7.78.0", "@sentry/node@^7.73.0": @@ -4951,6 +4959,11 @@ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.78.0.tgz#1ed40b43dbf7b92d4e7117d66be312a927cb48e4" integrity sha512-XNyu6EFTrXmKlVgKHOxGdBJ6Aw7BnMBWtptr5TPOQJ4kh+rP+4DB3I6nafcSSUbIsO+hBVgBpj0J8R3Ps86CMQ== +"@sentry/types@7.80.0": + version "7.80.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.80.0.tgz#f6896de2d231a7f8d814cf1c981c474240e96d8a" + integrity sha512-4bpMO+2jWiWLDa8zbTASWWNLWe6yhjfPsa7/6VH5y9x1NGtL8oRbqUsTgsvjF3nmeHEMkHQsC8NHPaQ/ibFmZQ== + "@sentry/utils@7.78.0": version "7.78.0" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.78.0.tgz#a3dd459f2347e20af81bfe92b6f75bae95918fb8" @@ -4958,6 +4971,13 @@ dependencies: "@sentry/types" "7.78.0" +"@sentry/utils@7.80.0": + version "7.80.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.80.0.tgz#5bd682fa9a382eea952d4fa3628f0f33e4240ff3" + integrity sha512-XbBCEl6uLvE50ftKwrEo6XWdDaZXHXu+kkHXTPWQEcnbvfZKLuG9V0Hxtxxq3xQgyWmuF05OH1GcqYqiO+v5Yg== + dependencies: + "@sentry/types" "7.80.0" + "@sidvind/better-ajv-errors@^2.0.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@sidvind/better-ajv-errors/-/better-ajv-errors-2.1.0.tgz#54f4216d2200d60e90ec25c6a27c1ea3afdc6cdf"