diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b26b4cdc..98476b00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,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 b5a151ff..bb5c896c 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 df373fd5..a881f667 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,3 @@ generate-devel-token.json .idea/ generate-devel-token-* -# Sentry Config File -.sentryclirc diff --git a/Dockerfile b/Dockerfile index 17b652d8..09cfea50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ FROM node:18-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 @@ -11,7 +10,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 a9c252a7..cd129504 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,6 @@ "@craco/craco": "^6.4.3", "@craftjs/core": "^0.2.0-beta.5", "@reduxjs/toolkit": "^1.8.3", - "@sentry/cli": "^2.23.0", - "@sentry/react": "^7.84.0", "@silevis/reactgrid": "^4.0.4", "@zendeskgarden/react-dropdowns": "^8.75.0", "@zendeskgarden/react-theming": "^8.75.0", @@ -78,8 +76,7 @@ "prettier": "npx prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'", "translate": "i18next-scanner", "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-backoffice ./build && sentry-cli sourcemaps upload --org appquality-srl --project tryber-backoffice ./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'" }, "browserslist": { "production": [ diff --git a/src/App.tsx b/src/App.tsx index 6cfed2f6..1434e2bf 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,5 @@ import "./App.css"; -import * as Sentry from "@sentry/react"; import { createBrowserHistory } from "history"; import { Provider } from "react-redux"; import { BrowserRouter, Route, Router, Switch } from "react-router-dom"; @@ -13,7 +12,6 @@ import EditPreselectionForm from "src/pages/preselectionForms/edit"; import NewPreselectionForm from "src/pages/preselectionForms/new"; import { setupStore } from "src/store"; import { PageTemplate } from "./features/PageTemplate"; -import SentryWrapper from "./features/SentryWrapper"; import AgreementsList from "./pages/agreements/list"; import SingleAgreementNew from "./pages/agreements/new"; import SingleAgreementEdit from "./pages/agreements/view-edit"; @@ -27,91 +25,79 @@ import CampaignPreselectionList from "./pages/preselectionForms"; import Prospect from "./pages/Prospect"; import UxDashboard from "./pages/UxDashboard"; -const SentryRoute = Sentry.withSentryRouting(Route); const history = createBrowserHistory(); function App() { return ( - - - - - - - - - - - - - - - - - - - - - - - ( - TestUnguess - )} - /> - - - - - - - + + + + + + + + + + + + + + + + + + + + + + ( + TestUnguess + )} + /> + + + + + + ); } diff --git a/src/features/PageTemplate.tsx b/src/features/PageTemplate.tsx index d21b9061..8782174c 100644 --- a/src/features/PageTemplate.tsx +++ b/src/features/PageTemplate.tsx @@ -6,7 +6,6 @@ import { ToastProvider, GlobalStyle as UnguessGlobalStyle, } from "@appquality/unguess-design-system"; -import * as Sentry from "@sentry/react"; import { ThemeProvider as UnguessThemeProvider } from "@zendeskgarden/react-theming"; import React from "react"; import TagManager from "react-gtm-module"; @@ -37,13 +36,6 @@ export const PageTemplate = ({ 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) { return ( diff --git a/src/features/SentryWrapper.tsx b/src/features/SentryWrapper.tsx deleted file mode 100644 index 7220587a..00000000 --- a/src/features/SentryWrapper.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import * as Sentry from "@sentry/react"; -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://4ab6d9977b0cc2ac430e8bf49522e512@o1087982.ingest.sentry.io/4506320026664960", - 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, - }); - } - - return <>{children}; -}; - -export default SentryWrapper; diff --git a/src/features/isStagingEnvironment.tsx b/src/features/isStagingEnvironment.tsx deleted file mode 100644 index db6658a2..00000000 --- a/src/features/isStagingEnvironment.tsx +++ /dev/null @@ -1,5 +0,0 @@ -const isStagingEnvironment = () => { - return react_env.REACT_APP_ENVIRONMENT !== "production"; -}; - -export default isStagingEnvironment; diff --git a/yarn.lock b/yarn.lock index d2d740cb..f371a08b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3332,120 +3332,6 @@ swagger2openapi "^7.0.7" typescript "^4.1.2" -"@sentry-internal/tracing@7.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.84.0.tgz#430da253ee5b075be4ef57f20ea842c0208bc6b0" - integrity sha512-y9bGYA0OM6PEREfd+nk4UURZy29tpIw+7vQwpxWfEVs2fqq0/5TBFX/tKFb8AKUI9lVM8v0bcF0bNSCnuPQZHQ== - dependencies: - "@sentry/core" "7.84.0" - "@sentry/types" "7.84.0" - "@sentry/utils" "7.84.0" - -"@sentry/browser@7.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.84.0.tgz#7c82470f0afbb6178f26127894e40e9ce2b1e6d6" - integrity sha512-X50TlTKY9WzAnHsYc4FYrCWgm+CdVo0h02ggmodVBUpRLUBjj+cs5Q1plov/v/XeorSwmorNEMUu/n+XZNSsrA== - dependencies: - "@sentry-internal/tracing" "7.84.0" - "@sentry/core" "7.84.0" - "@sentry/replay" "7.84.0" - "@sentry/types" "7.84.0" - "@sentry/utils" "7.84.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.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.84.0.tgz#01d33fc452044ffd8ea57b20f60304b9cfa2b9e1" - integrity sha512-tbuwunbBx2kSex15IHCqHDnrMfIlqPc6w/76fwkGqokz3oh9GSEGlLICwmBWL8AypWimUg13IDtFpD0TJTriWA== - dependencies: - "@sentry/types" "7.84.0" - "@sentry/utils" "7.84.0" - -"@sentry/react@^7.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.84.0.tgz#2cb3192f7fb67b7696e8ece08d67229b193ddaa4" - integrity sha512-VQZrEHwPKCYTSbRYXD2ohXcQg99G1Hgs8eevRUuRpdChmA2e3z/RvT00NlaSNNZrS86wPyKpAK6kickB/eSYrw== - dependencies: - "@sentry/browser" "7.84.0" - "@sentry/types" "7.84.0" - "@sentry/utils" "7.84.0" - hoist-non-react-statics "^3.3.2" - -"@sentry/replay@7.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.84.0.tgz#7e17876d9a1802ee33800e2b2cbda4e026c0a2af" - integrity sha512-c4PxT0ZpvkR9zXNfmAk3ojkm6eZ9+NlDze09RFBOCNo69QwIN90hnvbjXFC1+vRIJsfgo78Zr0ya/Wzb3Rog7Q== - dependencies: - "@sentry-internal/tracing" "7.84.0" - "@sentry/core" "7.84.0" - "@sentry/types" "7.84.0" - "@sentry/utils" "7.84.0" - -"@sentry/types@7.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.84.0.tgz#e8db86c36c61659c3b2558f0aa8b6a073a756117" - integrity sha512-VqGLIF3JOUrk7yIXjLXJvAORkZL1e3dDX0Q1okRehwyt/5CRE+mdUTeJZkBo9P9mBwgMyvtwklzOGGrzjb4eMA== - -"@sentry/utils@7.84.0": - version "7.84.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.84.0.tgz#32861d922fa31e86dd2863a1d9dfc5a369e98952" - integrity sha512-qdUVuxnRBvaf05AU+28R+xYtZmi/Ymf8os3Njq9g4XuA+QEkZLbzmIpRK5W9Ja7vUtjOeg29Xgg43A8znde9LQ== - dependencies: - "@sentry/types" "7.84.0" - "@silevis/reactgrid@^4.0.4": version "4.0.4" resolved "https://registry.yarnpkg.com/@silevis/reactgrid/-/reactgrid-4.0.4.tgz#20092d8a8f27e5b48d9683beebb1b5921a4bbac7" @@ -13528,7 +13414,7 @@ process@^0.11.10: resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz" 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.npmjs.org/progress/-/progress-2.0.3.tgz" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==