From 2e475071b8d53c9c16a216e71a0d92c616196887 Mon Sep 17 00:00:00 2001 From: Gianpaolo Date: Thu, 26 Feb 2026 15:51:43 +0100 Subject: [PATCH 1/2] chore: remove Sentry integration --- Dockerfile | 4 +- package.json | 5 +- src/Page.tsx | 308 +++++++++++++++------------------ src/features/LoggedOnly.tsx | 9 - src/features/NotLoggedOnly.tsx | 8 - src/features/SentryWrapper.tsx | 44 ----- yarn.lock | 118 +------------ 7 files changed, 146 insertions(+), 350 deletions(-) delete mode 100644 src/features/SentryWrapper.tsx diff --git a/Dockerfile b/Dockerfile index f1ee294d6..c1f1a6c18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,7 @@ FROM node:16.19-alpine3.17 as base COPY package.json ./ COPY yarn.lock ./ -ARG SENTRY_AUTH_TOKEN -ARG NPM_TOKEN +ARG NPM_TOKEN RUN echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc RUN ["yarn", "install", "--frozen-lockfile", "--ignore-scripts"] RUN rm -f .npmrc @@ -12,7 +11,6 @@ RUN rm -f .npmrc COPY . . RUN ["yarn", "build"] -RUN ["yarn", "sentry:sourcemaps"] FROM alpine:3.14 as web diff --git a/package.json b/package.json index f80536fb3..4d9e7f7c3 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "@datadog/browser-logs": "^3.4.1", "@mui/material": "^7.3.2", "@reduxjs/toolkit": "^1.8.2", - "@sentry/react": "^7.83.0", "date-fns": "^2.30.0", "formik": "^2.2.6", "i18n-iso-countries": "7.12.0", @@ -61,8 +60,7 @@ "translate": "i18next-scanner", "generate-schema": ". ./.env.development; npx openapi-typescript $REACT_APP_API_URL/reference/ --output src/utils/schema.ts ", "generate-api": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/ npx @rtk-query/codegen-openapi src/services/tryberApi/config.ts", - "generate-fixtures": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/; npx @appquality/fixture-generator -u $API_URL && npx prettier --write 'tests/api/**/*.json'", - "sentry:sourcemaps": "sentry-cli sourcemaps inject --org appquality-srl --project tryber-react ./build && sentry-cli sourcemaps upload --org appquality-srl --project tryber-react ./build" + "generate-fixtures": ". ./.env.development; API_URL=$REACT_APP_API_URL/reference/; npx @appquality/fixture-generator -u $API_URL && npx prettier --write 'tests/api/**/*.json'" }, "eslintConfig": { "extends": [ @@ -101,7 +99,6 @@ "@playwright/test": "^1.39.0", "@redux-devtools/core": "^3.11.0", "@rtk-query/codegen-openapi": "^1.0.0-alpha.1", - "@sentry/cli": "^2.23.0", "@types/node": "^14.14.41", "@types/qs": "^6.14.0", "@types/react": "17.0.9", diff --git a/src/Page.tsx b/src/Page.tsx index 01c08b2a3..41b738f59 100644 --- a/src/Page.tsx +++ b/src/Page.tsx @@ -5,9 +5,7 @@ import { useEffect } from "react"; import { Redirect, Route, Router, Switch, useLocation } from "react-router-dom"; import "./i18n"; -import * as Sentry from "@sentry/react"; import GenericModal from "./features/GenericModal"; -import SentryWrapper from "./features/SentryWrapper"; import SiteWideMessages from "./features/SiteWideMessages"; import { Dashboard, @@ -32,8 +30,6 @@ import ThankYouPage from "./pages/ThankYou"; import VdpPage from "./pages/VDP"; import referralStore from "./redux/referral"; -// Create Custom Sentry Route component -const SentryRoute = Sentry.withSentryRouting(Route); const history = createBrowserHistory(); if (process.env.REACT_APP_DATADOG_CLIENT_TOKEN) { @@ -58,176 +54,156 @@ function Page() { }, []); return ( - -
- - - - - - - - - - +
+ + + + + + + + + + - + - ( - - )} - /> + ( + + )} + /> - + - - ( - - )} - /> - ( - - )} - /> + + ( + + )} + /> + ( + + )} + /> - - - - - - + + + + + + - - - - ( - - )} - /> - ( - - )} - /> + + + + ( + + )} + /> + ( + + )} + /> - ( - - )} - /> - ( - - )} - /> + ( + + )} + /> + ( + + )} + /> - - - - - - {/* TODO Temporary route */} - - - - - - - - - - - - - - - - - - - -
- + + + + + + {/* TODO Temporary route */} + + + + + + + + + + + + + + + + + +
+
+
); } diff --git a/src/features/LoggedOnly.tsx b/src/features/LoggedOnly.tsx index 368a76c09..a69667ac2 100644 --- a/src/features/LoggedOnly.tsx +++ b/src/features/LoggedOnly.tsx @@ -1,5 +1,4 @@ import { Container, Title } from "@appquality/appquality-design-system"; -import * as Sentry from "@sentry/react"; import TagManager from "react-gtm-module"; import { useTranslation } from "react-i18next"; import { useGetUsersMeQuery } from "src/services/tryberApi"; @@ -35,14 +34,6 @@ const LoggedOnly = ({ event: "ApiLoaded", }, }); - Sentry.setUser({ - id: user?.id ?? 0, - email: user?.email ?? "unknown", - username: user?.username ?? "unknown", - wp_user_id: user?.wp_user_id ?? 0, - role: user?.role ?? "unknown", - }); - if (error) { if ("status" in error && error.status === 403) { const unlocalizedUrl = getUnlocalizedUrl(window.location.pathname); diff --git a/src/features/NotLoggedOnly.tsx b/src/features/NotLoggedOnly.tsx index 2a9744dda..71c34a5ae 100644 --- a/src/features/NotLoggedOnly.tsx +++ b/src/features/NotLoggedOnly.tsx @@ -1,7 +1,6 @@ import TagManager from "react-gtm-module"; import { useHistory } from "react-router-dom"; -import * as Sentry from "@sentry/react"; import { useGetUsersMeQuery } from "src/services/tryberApi"; import { useAppSelector } from "src/store"; import Loading from "./Loading"; @@ -32,13 +31,6 @@ const NotLoggedOnly = ({ return ; } if (user && redirect && !isPublicUser) { - Sentry.setUser({ - id: user?.id ?? 0, - email: user?.email ?? "unknown", - username: user?.username ?? "unknown", - wp_user_id: user?.wp_user_id ?? 0, - role: user?.role ?? "unknown", - }); history.push(redirect.url); } TagManager.dataLayer({ diff --git a/src/features/SentryWrapper.tsx b/src/features/SentryWrapper.tsx deleted file mode 100644 index 1eff90479..000000000 --- a/src/features/SentryWrapper.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import * as Sentry from "@sentry/react"; -import i18n from "src/i18n"; -import isStagingEnvironment from "./isStagingEnvironment"; -import { RouterHistory } from "@sentry/react/types/reactrouter"; - -const SentryWrapper = ({ - children, - history, -}: { - children: React.ReactNode; - history: RouterHistory; -}) => { - if (process.env.NODE_ENV !== "test") { - Sentry.init({ - dsn: "https://84fe7a6107da4c0058197b52ce74743d@o1087982.ingest.sentry.io/4506337899511808", - integrations: [ - new Sentry.BrowserTracing({ - routingInstrumentation: Sentry.reactRouterV5Instrumentation(history), - }), - ], - environment: react_env.REACT_APP_ENVIRONMENT, - // trace all staging and locale traces and 70% of production traces - tracesSampleRate: isStagingEnvironment() ? 1.0 : 0.7, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: [ - "localhost", - /^https:\/\/dev\.tryber\.me\/api/, - /^https:\/\/tryber\.me\/api/, - ], - release: react_env.REACT_APP_VERSION, - // Capture Replay for 10% of all sessions, - // plus for 100% of sessions with an error - // do not capture for staging and locale - replaysSessionSampleRate: isStagingEnvironment() ? 0.0 : 0.1, - replaysOnErrorSampleRate: isStagingEnvironment() ? 0.0 : 1.0, - }); - } - - Sentry.setTag("page_locale", i18n.language); - - return <>{children}; -}; - -export default SentryWrapper; diff --git a/yarn.lock b/yarn.lock index 20c6cf3d2..8dc62c758 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2899,120 +2899,6 @@ swagger2openapi "^7.0.4" typescript "^5.0.0" -"@sentry-internal/tracing@7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.83.0.tgz#8f69d339569b020c495f8350a8ea527c369586e8" - integrity sha512-fY1ZyOiQaaUTuoq5rO+G4/5Ov3n8BnfNK7ck97yAGxy3w+E1CwhVZkXHEvTngNfdYV3ArxvlrtPRb9STFRqXvQ== - dependencies: - "@sentry/core" "7.83.0" - "@sentry/types" "7.83.0" - "@sentry/utils" "7.83.0" - -"@sentry/browser@7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.83.0.tgz#01e8ba0d3f4d4652e67c8b0d955d2f3903a19ab0" - integrity sha512-8v7QEaC/fVAHn8pi59ZlJznr7ZdOQIgtz8DAOJeJsC2vHTAxQ9nVkoMkJWjTp/qaDHUjSe5ob6eqaChuhi6t2g== - dependencies: - "@sentry-internal/tracing" "7.83.0" - "@sentry/core" "7.83.0" - "@sentry/replay" "7.83.0" - "@sentry/types" "7.83.0" - "@sentry/utils" "7.83.0" - -"@sentry/cli-darwin@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.23.0.tgz#1a4f149071a77f2e767a9cd7997b0b9257eae59f" - integrity sha512-tWuTxvb6P5pA0E+O1/7jKQ6AP45DOOW+BAd7mwBMHZ+5xG3nsvvrRS9hOIzBNPTeB2RyIEXgpQ2Mb6NdD21DBQ== - -"@sentry/cli-linux-arm64@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.23.0.tgz#f3f154dc9ee68b4c3e6386ececb7c4b7dbe6cdbe" - integrity sha512-KsOckP+b0xAzrRuoP4eiqJ6ASD6SqIplL8BCHOAODQfvWn9rgNwsJWOgKlWwfrJnkJYkpWVYvYeyx0oeUx3N0g== - -"@sentry/cli-linux-arm@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.23.0.tgz#93afbf73c21b69c0e7b605d7508ee8002f90bba0" - integrity sha512-1R8ngBDKtPw++Km6VnVTx76ndrBL9BuBBNpF9TUCGftK3ArdaifqoIx8cZ8aKu8sWXLAKO7lHzxL4BNPZvlDiw== - -"@sentry/cli-linux-i686@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.23.0.tgz#4a2db236f94474aea127abcb73402c5aa5a48f89" - integrity sha512-KRqB98KstBkKh33ZqUq+q8O0U4c01aTWCNPpVrqAX7zikSk0AAJTG8eAtqwDSx949IkKUl8xa6PFLfz+Nb2EMQ== - -"@sentry/cli-linux-x64@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.23.0.tgz#fd0a1ac2fe4841247dcf89e43f3df9a416719259" - integrity sha512-USHZ0zzg9qujGYAyRjLeUfLDZOMgNjCr82m0BSBMmlFs4oKwHmO6bSvdi9UzNNcpmkOavNAdUM4jnZWk11i46Q== - -"@sentry/cli-win32-i686@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.23.0.tgz#0201030d2128a2fba79e3fd7e644052151bb21ed" - integrity sha512-lS/B3pONDl18IEu/I//3vcMnosThobyXpqfAm4WYUtFTiw/wwDHgwGgaIjZWm5wMRkPFzYoRFpZfPlUrJd/4cQ== - -"@sentry/cli-win32-x64@2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.23.0.tgz#648b99be78af130dbb0a53506d5c55bbe0d46472" - integrity sha512-7LP6wA3w93ViYKQR8tMN2i/SfpQzaXqM2SAHI3yfJ3bdREHOV3+/N0mNiWVRvgL0TKNQJS42v2IILLhiDxufHQ== - -"@sentry/cli@^2.23.0": - version "2.23.0" - resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.23.0.tgz#d8fa6a514aedfe316a8afc046435b96746e7099f" - integrity sha512-xFTv7YOaKWMCSPgN8A1jZpxJQhwdES89pqMTWjJOgjmkwFvziuaTM7O7kazps/cACDhJp2lK2j6AT6imhr4t9w== - dependencies: - https-proxy-agent "^5.0.0" - node-fetch "^2.6.7" - progress "^2.0.3" - proxy-from-env "^1.1.0" - which "^2.0.2" - optionalDependencies: - "@sentry/cli-darwin" "2.23.0" - "@sentry/cli-linux-arm" "2.23.0" - "@sentry/cli-linux-arm64" "2.23.0" - "@sentry/cli-linux-i686" "2.23.0" - "@sentry/cli-linux-x64" "2.23.0" - "@sentry/cli-win32-i686" "2.23.0" - "@sentry/cli-win32-x64" "2.23.0" - -"@sentry/core@7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.83.0.tgz#29bdd5aba40a6f25c01c68387b6a9aa13e27f20a" - integrity sha512-fglvpw8aWM6nWXzCjAVXIMTiTEAQ9G9b85IpDd/7L8fuwaFTPQAUSJXupF2PfbpQ3FUYbJt80dxshbERVJG8vQ== - dependencies: - "@sentry/types" "7.83.0" - "@sentry/utils" "7.83.0" - -"@sentry/react@^7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.83.0.tgz#e3d5e4480d613e8c5b2e927f6f72a7b91896f721" - integrity sha512-8GjKRXkZH+FkmO0LaGEVOrTC9g6Csn7VnTVIqtnfX2hVxbdHnqyjhHDgnCbmW7JRb0X6//QK4CuLCWu8uApLBw== - dependencies: - "@sentry/browser" "7.83.0" - "@sentry/types" "7.83.0" - "@sentry/utils" "7.83.0" - hoist-non-react-statics "^3.3.2" - -"@sentry/replay@7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.83.0.tgz#14fd39a638911f60b780d232d2056f0d19ed478e" - integrity sha512-B/rzmjmQ3ZWE68m4Z9rHIN3Fa/wkfVVTK+iSQtqErFflyMETMNwtWRNd6P9FhXnphEINZEbcn/UZF5w5xu/DfA== - dependencies: - "@sentry-internal/tracing" "7.83.0" - "@sentry/core" "7.83.0" - "@sentry/types" "7.83.0" - "@sentry/utils" "7.83.0" - -"@sentry/types@7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.83.0.tgz#117e45900603190c547e52bba35e1b3d539d47fb" - integrity sha512-Bd+zJcy8p1VgCfQqUprmUaw0QPWUV+GmCt6zJRHrHTb2pwLahXv6sHJvQ8F8Va6S7Keuy088U+kHzUFGQLMZMQ== - -"@sentry/utils@7.83.0": - version "7.83.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.83.0.tgz#ec0fc0a468ec35ab9623603f1ba218dd58233eda" - integrity sha512-7SrZtgAn3pHFBqSSvV/VL0CWTBQ7VenJjok4+WGWd6/FhP3fKrEEd9rjVTUb2Pzq9WLJJYzdvxAG8RlggG+H4g== - dependencies: - "@sentry/types" "7.83.0" - "@sinonjs/commons@^1.7.0": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -10475,7 +10361,7 @@ node-fetch-h2@^2.3.0: dependencies: http2-client "^1.2.5" -node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7: +node-fetch@^2.6.1, node-fetch@^2.6.12: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -12063,7 +11949,7 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -progress@^2.0.0, progress@^2.0.3: +progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== From 51685ed3862e2ba80600e94dfe2cceb020062fb0 Mon Sep 17 00:00:00 2001 From: Gianpaolo Date: Fri, 27 Feb 2026 10:04:15 +0100 Subject: [PATCH 2/2] chore: remove residual Sentry references from CI workflows and gitignore --- .github/workflows/main.yml | 1 - .github/workflows/release.yml | 1 - .gitignore | 2 -- 3 files changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f09abc4b6..88be4d3b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,6 @@ jobs: # be deployed to ECS. docker build \ --build-arg NPM_TOKEN=${{ secrets.NPM_TOKEN }} \ - --build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \ -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98d6cf5c6..cfd82b165 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,6 @@ jobs: run: | DOCKER_BUILDKIT=1 docker build \ --build-arg NPM_TOKEN=$NPM_TOKEN \ - --build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \ -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG diff --git a/.gitignore b/.gitignore index 45d207db3..b16a8b2b5 100644 --- a/.gitignore +++ b/.gitignore @@ -36,8 +36,6 @@ cypress/screenshots cypress/reports cypress/downloads -# Sentry Config File -.sentryclirc /test-results/ /playwright-report/ /blob-report/