From 1833cca8709165f5339f311a3ce1eb70ae0830b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 17:26:30 +0100 Subject: [PATCH 01/27] chore: test sentry conf --- .kontinuous/env/dev/values.yaml | 7 +++++++ .kontinuous/env/preprod/values.yaml | 7 +++++++ .kontinuous/env/prod/values.yaml | 2 +- .kontinuous/values.yaml | 4 +++- .talismanrc | 2 ++ next.config.js | 2 +- sentry.client.config.js | 16 ++-------------- sentry.edge.config.js | 16 ++-------------- sentry.server.config.js | 16 ++-------------- src/pages/api/report.ts | 1 + src/pages/index.tsx | 8 ++++++++ 11 files changed, 36 insertions(+), 45 deletions(-) diff --git a/.kontinuous/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml index 07c9d5838..637a6d929 100644 --- a/.kontinuous/env/dev/values.yaml +++ b/.kontinuous/env/dev/values.yaml @@ -1,3 +1,10 @@ app: vars: ENV: review + +jobs: + runs: + build-app: + with: + buildArgs: + NEXT_PUBLIC_ENVIRONMENT: review diff --git a/.kontinuous/env/preprod/values.yaml b/.kontinuous/env/preprod/values.yaml index 681d1d02b..c7d569040 100644 --- a/.kontinuous/env/preprod/values.yaml +++ b/.kontinuous/env/preprod/values.yaml @@ -1,3 +1,10 @@ app: vars: ENV: preprod + +jobs: + runs: + build-app: + with: + buildArgs: + NEXT_PUBLIC_ENVIRONMENT: preprod diff --git a/.kontinuous/env/prod/values.yaml b/.kontinuous/env/prod/values.yaml index 5fc4e244b..cecbf000b 100644 --- a/.kontinuous/env/prod/values.yaml +++ b/.kontinuous/env/prod/values.yaml @@ -31,6 +31,6 @@ jobs: with: imagePackage: app buildArgs: - NEXT_PUBLIC_HASURA_URL: "https://hasura-{{ .Values.global.host }}/v1/graphql" NEXT_PUBLIC_MATOMO_SITE_ID: "82" NEXT_PUBLIC_MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" + NEXT_PUBLIC_ENVIRONMENT: prod diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index b5c3a2481..82a541e86 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -28,7 +28,9 @@ jobs: with: imagePackage: app buildArgs: - NEXT_PUBLIC_HASURA_URL: "https://hasura-{{ .Values.global.host }}/v1/graphql" + NEXT_PUBLIC_HASURA_URL: + "https://hasura-{{ .Values.global.host }}/v1/graphql" + NEXT_PUBLIC_SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" build-hasura: use: build diff --git a/.talismanrc b/.talismanrc index 45991464d..9a6115c0c 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,4 +1,6 @@ fileignoreconfig: +- filename: .kontinuous/values.yaml + checksum: 5cbf30ed8e834175378bf4ddc82bec820875bd0fc960ac80025ca5027d61fda5 - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/down.sql checksum: cac3e070c06c7c7fbd6821009fef546e452a38184ac6539ccca609be4a82bd8b - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/up.sql diff --git a/next.config.js b/next.config.js index adad9547e..66c1ead1b 100644 --- a/next.config.js +++ b/next.config.js @@ -82,4 +82,4 @@ module.exports = { }, } -module.exports = withSentryConfig(module.exports, { silent: true }) +module.exports = withSentryConfig(module.exports) diff --git a/sentry.client.config.js b/sentry.client.config.js index 47af13bb7..366b4649c 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -1,19 +1,7 @@ -// This file configures the initialization of Sentry on the browser. -// The config you add here will be used whenever a page is visited. -// https://docs.sentry.io/platforms/javascript/guides/nextjs/ - import * as Sentry from "@sentry/nextjs" -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN - Sentry.init({ - dsn: - SENTRY_DSN || - "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85", - // Adjust this value in production, or use tracesSampler for greater control + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, - // ... - // Note: if you want to override the automatic release value, do not set a - // `release` value here - use the environment variable `SENTRY_RELEASE`, so - // that it will also get attached to your source maps }) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index fe5a25bc2..366b4649c 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -1,19 +1,7 @@ -// This file configures the initialization of Sentry on the server. -// The config you add here will be used whenever middleware or an Edge route handles a request. -// https://docs.sentry.io/platforms/javascript/guides/nextjs/ - import * as Sentry from "@sentry/nextjs" -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN - Sentry.init({ - dsn: - SENTRY_DSN || - "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85", - // Adjust this value in production, or use tracesSampler for greater control + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, - // ... - // Note: if you want to override the automatic release value, do not set a - // `release` value here - use the environment variable `SENTRY_RELEASE`, so - // that it will also get attached to your source maps }) diff --git a/sentry.server.config.js b/sentry.server.config.js index 5984c306f..366b4649c 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -1,19 +1,7 @@ -// This file configures the initialization of Sentry on the server. -// The config you add here will be used whenever the server handles a request. -// https://docs.sentry.io/platforms/javascript/guides/nextjs/ - import * as Sentry from "@sentry/nextjs" -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN - Sentry.init({ - dsn: - SENTRY_DSN || - "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85", - // Adjust this value in production, or use tracesSampler for greater control + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, - // ... - // Note: if you want to override the automatic release value, do not set a - // `release` value here - use the environment variable `SENTRY_RELEASE`, so - // that it will also get attached to your source maps }) diff --git a/src/pages/api/report.ts b/src/pages/api/report.ts index 53e04466a..a5619fe39 100644 --- a/src/pages/api/report.ts +++ b/src/pages/api/report.ts @@ -3,6 +3,7 @@ import { NextApiRequest, NextApiResponse } from "next" const Report = (req: NextApiRequest, res: NextApiResponse) => { httpLogger(req, res) + throw new Error("api error") res.status(200).end() } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a26e42678..f786366a9 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -8,6 +8,14 @@ const Index = () => ( Secrétariat + ) From 583523c203947d73e75feea9f96a8508293f726c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 17:32:50 +0100 Subject: [PATCH 02/27] test --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 020dd58fe..f0a7f940b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,21 +4,26 @@ WORKDIR /app # Rebuild the source code only when needed FROM base AS builder + +# install deps +COPY yarn.lock .yarnrc.yml ./ +COPY .yarn .yarn +RUN yarn fetch --immutable + +COPY . . + +# build time args ARG NEXT_PUBLIC_HASURA_URL ENV NEXT_PUBLIC_HASURA_URL $NEXT_PUBLIC_HASURA_URL ARG NEXT_PUBLIC_MATOMO_URL ENV NEXT_PUBLIC_MATOMO_URL $NEXT_PUBLIC_MATOMO_URL ARG NEXT_PUBLIC_MATOMO_SITE_ID ENV NEXT_PUBLIC_MATOMO_SITE_ID $NEXT_PUBLIC_MATOMO_SITE_ID +ARG NEXT_PUBLIC_ENVIRONMENT +ENV NEXT_PUBLIC_ENVIRONMENT $NEXT_PUBLIC_ENVIRONMENT ENV NEXT_TELEMETRY_DISABLED 1 -# install deps -COPY yarn.lock .yarnrc.yml ./ -COPY .yarn .yarn -RUN yarn fetch --immutable - # build -COPY . . RUN yarn build # Production image, copy all the files and run next From 32a9ada62b4fa6d54533a381144c64ca3dbb00ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 17:48:15 +0100 Subject: [PATCH 03/27] dsn build --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index f0a7f940b..b42c118da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,8 @@ ARG NEXT_PUBLIC_MATOMO_SITE_ID ENV NEXT_PUBLIC_MATOMO_SITE_ID $NEXT_PUBLIC_MATOMO_SITE_ID ARG NEXT_PUBLIC_ENVIRONMENT ENV NEXT_PUBLIC_ENVIRONMENT $NEXT_PUBLIC_ENVIRONMENT +ARG NEXT_PUBLIC_SENTRY_DSN +ENV NEXT_PUBLIC_SENTRY_DSN $NEXT_PUBLIC_SENTRY_DSN ENV NEXT_TELEMETRY_DISABLED 1 # build From 5d43b5e5a06387406140a2d029c42c2e97e07a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 18:16:50 +0100 Subject: [PATCH 04/27] use ks value --- .kontinuous/env/dev/values.yaml | 13 ++++++------- .kontinuous/env/preprod/values.yaml | 13 ++++++------- .kontinuous/env/prod/values.yaml | 2 +- .kontinuous/values.yaml | 1 + Dockerfile | 2 -- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.kontinuous/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml index 637a6d929..1701bf073 100644 --- a/.kontinuous/env/dev/values.yaml +++ b/.kontinuous/env/dev/values.yaml @@ -1,10 +1,9 @@ app: vars: ENV: review - -jobs: - runs: - build-app: - with: - buildArgs: - NEXT_PUBLIC_ENVIRONMENT: review +# jobs: +# runs: +# build-app: +# with: +# buildArgs: +# NEXT_PUBLIC_ENVIRONMENT: review diff --git a/.kontinuous/env/preprod/values.yaml b/.kontinuous/env/preprod/values.yaml index c7d569040..05ac1b241 100644 --- a/.kontinuous/env/preprod/values.yaml +++ b/.kontinuous/env/preprod/values.yaml @@ -1,10 +1,9 @@ app: vars: ENV: preprod - -jobs: - runs: - build-app: - with: - buildArgs: - NEXT_PUBLIC_ENVIRONMENT: preprod +# jobs: +# runs: +# build-app: +# with: +# buildArgs: +# NEXT_PUBLIC_ENVIRONMENT: preprod diff --git a/.kontinuous/env/prod/values.yaml b/.kontinuous/env/prod/values.yaml index cecbf000b..72be89310 100644 --- a/.kontinuous/env/prod/values.yaml +++ b/.kontinuous/env/prod/values.yaml @@ -33,4 +33,4 @@ jobs: buildArgs: NEXT_PUBLIC_MATOMO_SITE_ID: "82" NEXT_PUBLIC_MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" - NEXT_PUBLIC_ENVIRONMENT: prod + # NEXT_PUBLIC_ENVIRONMENT: prod diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 82a541e86..832c635e5 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -31,6 +31,7 @@ jobs: NEXT_PUBLIC_HASURA_URL: "https://hasura-{{ .Values.global.host }}/v1/graphql" NEXT_PUBLIC_SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" + NEXT_PUBLIC_ENVIRONMENT: "{{ .Values.global.env }}" build-hasura: use: build diff --git a/Dockerfile b/Dockerfile index b42c118da..5d2f26f8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,11 +37,9 @@ ENV NEXT_TELEMETRY_DISABLED 1 RUN addgroup --system --gid 1001 nodejs && \ adduser --system --uid 1001 nextjs -# You only need to copy next.config.js if you are NOT using the default configuration COPY --from=builder /app/next.config.js ./ COPY --from=builder /app/public ./public -# Automatically leverage output traces to reduce image size COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static From c77f17f752c944a27049619df01b58ad85a29e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 18:27:50 +0100 Subject: [PATCH 05/27] cleanup --- .kontinuous/env/dev/values.yaml | 6 ------ .kontinuous/env/preprod/values.yaml | 6 ------ .kontinuous/env/prod/values.yaml | 1 - 3 files changed, 13 deletions(-) diff --git a/.kontinuous/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml index 1701bf073..07c9d5838 100644 --- a/.kontinuous/env/dev/values.yaml +++ b/.kontinuous/env/dev/values.yaml @@ -1,9 +1,3 @@ app: vars: ENV: review -# jobs: -# runs: -# build-app: -# with: -# buildArgs: -# NEXT_PUBLIC_ENVIRONMENT: review diff --git a/.kontinuous/env/preprod/values.yaml b/.kontinuous/env/preprod/values.yaml index 05ac1b241..681d1d02b 100644 --- a/.kontinuous/env/preprod/values.yaml +++ b/.kontinuous/env/preprod/values.yaml @@ -1,9 +1,3 @@ app: vars: ENV: preprod -# jobs: -# runs: -# build-app: -# with: -# buildArgs: -# NEXT_PUBLIC_ENVIRONMENT: preprod diff --git a/.kontinuous/env/prod/values.yaml b/.kontinuous/env/prod/values.yaml index 72be89310..5a96a8865 100644 --- a/.kontinuous/env/prod/values.yaml +++ b/.kontinuous/env/prod/values.yaml @@ -33,4 +33,3 @@ jobs: buildArgs: NEXT_PUBLIC_MATOMO_SITE_ID: "82" NEXT_PUBLIC_MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" - # NEXT_PUBLIC_ENVIRONMENT: prod From 2219e95bcb78adabebde82cbf98ecce43056ba1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 18:29:37 +0100 Subject: [PATCH 06/27] clear test funcs --- src/pages/api/report.ts | 1 - src/pages/index.tsx | 8 -------- 2 files changed, 9 deletions(-) diff --git a/src/pages/api/report.ts b/src/pages/api/report.ts index a5619fe39..53e04466a 100644 --- a/src/pages/api/report.ts +++ b/src/pages/api/report.ts @@ -3,7 +3,6 @@ import { NextApiRequest, NextApiResponse } from "next" const Report = (req: NextApiRequest, res: NextApiResponse) => { httpLogger(req, res) - throw new Error("api error") res.status(200).end() } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f786366a9..a26e42678 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -8,14 +8,6 @@ const Index = () => ( Secrétariat - ) From 9cb5a43367d89bcc44ac1a4bdb36f3f4d9f9d937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 18:41:14 +0100 Subject: [PATCH 07/27] release --- .kontinuous/values.yaml | 1 + Dockerfile | 2 ++ sentry.client.config.js | 1 + sentry.edge.config.js | 1 + sentry.server.config.js | 1 + 5 files changed, 6 insertions(+) diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 832c635e5..80d3a0942 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -32,6 +32,7 @@ jobs: "https://hasura-{{ .Values.global.host }}/v1/graphql" NEXT_PUBLIC_SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" NEXT_PUBLIC_ENVIRONMENT: "{{ .Values.global.env }}" + NEXT_PUBLIC_RELEASE: "{{ .Values.global.imageTag }}" build-hasura: use: build diff --git a/Dockerfile b/Dockerfile index 5d2f26f8d..ff5612f43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,8 @@ ARG NEXT_PUBLIC_MATOMO_SITE_ID ENV NEXT_PUBLIC_MATOMO_SITE_ID $NEXT_PUBLIC_MATOMO_SITE_ID ARG NEXT_PUBLIC_ENVIRONMENT ENV NEXT_PUBLIC_ENVIRONMENT $NEXT_PUBLIC_ENVIRONMENT +ARG NEXT_PUBLIC_RELEASE +ENV NEXT_PUBLIC_RELEASE $NEXT_PUBLIC_RELEASE ARG NEXT_PUBLIC_SENTRY_DSN ENV NEXT_PUBLIC_SENTRY_DSN $NEXT_PUBLIC_SENTRY_DSN ENV NEXT_TELEMETRY_DISABLED 1 diff --git a/sentry.client.config.js b/sentry.client.config.js index 366b4649c..a41d1e4d9 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -4,4 +4,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, + release: process.env.NEXT_PUBLIC_RELEASE, }) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index 366b4649c..a41d1e4d9 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -4,4 +4,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, + release: process.env.NEXT_PUBLIC_RELEASE, }) diff --git a/sentry.server.config.js b/sentry.server.config.js index 366b4649c..a41d1e4d9 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -4,4 +4,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, + release: process.env.NEXT_PUBLIC_RELEASE, }) From 785d5734ba19b4203d9588bd2cbe47e89a90febb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 18:46:24 +0100 Subject: [PATCH 08/27] test func --- src/pages/api/report.ts | 1 + src/pages/index.tsx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/pages/api/report.ts b/src/pages/api/report.ts index 53e04466a..a5619fe39 100644 --- a/src/pages/api/report.ts +++ b/src/pages/api/report.ts @@ -3,6 +3,7 @@ import { NextApiRequest, NextApiResponse } from "next" const Report = (req: NextApiRequest, res: NextApiResponse) => { httpLogger(req, res) + throw new Error("api error") res.status(200).end() } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a26e42678..5a6854900 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -8,6 +8,13 @@ const Index = () => ( Secrétariat + ) From 7f6fb47adddc0f526e6d1afc6b9ea3414bce8baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 22 Nov 2023 18:50:35 +0100 Subject: [PATCH 09/27] typo --- src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 5a6854900..171a42365 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -10,7 +10,7 @@ const Index = () => ( ) From 9ddff4a32e5028a2e24fc8d966b37da654703b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 09:36:06 +0100 Subject: [PATCH 11/27] wip webpack --- next.config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/next.config.js b/next.config.js index 66c1ead1b..eb89f744e 100644 --- a/next.config.js +++ b/next.config.js @@ -61,8 +61,6 @@ module.exports = { }, sentry: { hideSourceMaps: true, - disableClientWebpackPlugin: true, - disableServerWebpackPlugin: true, }, output: "standalone", env: { From e2c8d0f3e057fbabfc6306a9838cdeefd01bbec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 09:57:05 +0100 Subject: [PATCH 12/27] test sentry source maps --- .gitignore | 3 + .../dev/templates/sentry.sealed-secret.yaml | 15 ++ .../templates/sentry.sealed-secret.yaml | 15 ++ .../prod/templates/sentry.sealed-secret.yaml | 16 ++ .kontinuous/values.yaml | 4 + .talismanrc | 10 +- Dockerfile | 3 +- next.config.js | 25 +- package.json | 2 +- yarn.lock | 222 +++++++++--------- 10 files changed, 201 insertions(+), 114 deletions(-) create mode 100644 .kontinuous/env/dev/templates/sentry.sealed-secret.yaml create mode 100644 .kontinuous/env/preprod/templates/sentry.sealed-secret.yaml create mode 100644 .kontinuous/env/prod/templates/sentry.sealed-secret.yaml diff --git a/.gitignore b/.gitignore index bb8740498..ac00e599d 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ coverage !.yarn/releases !.yarn/sdks !.yarn/versions + +# Sentry Config File +.sentryclirc diff --git a/.kontinuous/env/dev/templates/sentry.sealed-secret.yaml b/.kontinuous/env/dev/templates/sentry.sealed-secret.yaml new file mode 100644 index 000000000..d5c5cabbd --- /dev/null +++ b/.kontinuous/env/dev/templates/sentry.sealed-secret.yaml @@ -0,0 +1,15 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: 'true' + name: sentry +spec: + encryptedData: + SENTRY_AUTH_TOKEN: AgB0+vei/m71QPjqmuo6v9pfgHRy8U9LCuVK2PHzkH5ul8tmgs04r2afwRs877iu+EP4NB6OtjXKG6AFCFmPusi6p35xl/IpqjdA/GlBC9Vwx914YDd46Hn+QoVqqDMmtvNxfuMxuxs5Zwro/5tMJMb6sU31Qyl/8p4Rne18EA2gje/WVK1a91HCb75o2sB0t/M5HgP+oP8Fj1yw1sqbIbnxHaIn4arf7NTEB3DSGrL4NpLtNN1ToQfL8UXH9vCmbLUjinHVSDm5Fkd67hPBqen0HkIdBIheU+LU7ygiiA5Bb470IuKxV9BuCey2CxSKDVNZBDfLuQAZ3uqF8plBoEtPLCeZ4Tda6KOvTnQ72Maj1YE3CLdOaLMtKQTi/Lt3ZcoBJvUEbGck+hmpEQq3QjwZMhmba8ZZX4Y8ymVpQd/LoJYhBM0ftel4kpK4oBlYEC612phPa+d+LywVkv+Vb3QQX4VOynAWhiuS+larg27H3dZ95kHZlzEgKdnUJ0WxfupoZEnyE7EXQ9aA1b+6Jg8GvCFoSCRuBG3WM7VmTCCzI7n/yjbKHTaPRqcLKA0pgvYNqyKiBemuKCRb+i/gzK8LqsdO8bJb3ZYl/H7ysqdWTvz0JLblg6lIMd/dDDjTJ5CWjF1q/RZWKiWigarirlNgnYdkK2iRaQ666KBRb3DoiexpAiBxx2iAsUDLWiVdHsZ8g9HB5xIbZTbyEuJZ56cKywwZvoTZNHXCKY2Ki74ArsKu9H9NiOwf9shgoDghXQc5AZskxzL7wkOyqhSvpjKC + template: + metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: 'true' + name: sentry + type: Opaque diff --git a/.kontinuous/env/preprod/templates/sentry.sealed-secret.yaml b/.kontinuous/env/preprod/templates/sentry.sealed-secret.yaml new file mode 100644 index 000000000..d5c5cabbd --- /dev/null +++ b/.kontinuous/env/preprod/templates/sentry.sealed-secret.yaml @@ -0,0 +1,15 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: 'true' + name: sentry +spec: + encryptedData: + SENTRY_AUTH_TOKEN: AgB0+vei/m71QPjqmuo6v9pfgHRy8U9LCuVK2PHzkH5ul8tmgs04r2afwRs877iu+EP4NB6OtjXKG6AFCFmPusi6p35xl/IpqjdA/GlBC9Vwx914YDd46Hn+QoVqqDMmtvNxfuMxuxs5Zwro/5tMJMb6sU31Qyl/8p4Rne18EA2gje/WVK1a91HCb75o2sB0t/M5HgP+oP8Fj1yw1sqbIbnxHaIn4arf7NTEB3DSGrL4NpLtNN1ToQfL8UXH9vCmbLUjinHVSDm5Fkd67hPBqen0HkIdBIheU+LU7ygiiA5Bb470IuKxV9BuCey2CxSKDVNZBDfLuQAZ3uqF8plBoEtPLCeZ4Tda6KOvTnQ72Maj1YE3CLdOaLMtKQTi/Lt3ZcoBJvUEbGck+hmpEQq3QjwZMhmba8ZZX4Y8ymVpQd/LoJYhBM0ftel4kpK4oBlYEC612phPa+d+LywVkv+Vb3QQX4VOynAWhiuS+larg27H3dZ95kHZlzEgKdnUJ0WxfupoZEnyE7EXQ9aA1b+6Jg8GvCFoSCRuBG3WM7VmTCCzI7n/yjbKHTaPRqcLKA0pgvYNqyKiBemuKCRb+i/gzK8LqsdO8bJb3ZYl/H7ysqdWTvz0JLblg6lIMd/dDDjTJ5CWjF1q/RZWKiWigarirlNgnYdkK2iRaQ666KBRb3DoiexpAiBxx2iAsUDLWiVdHsZ8g9HB5xIbZTbyEuJZ56cKywwZvoTZNHXCKY2Ki74ArsKu9H9NiOwf9shgoDghXQc5AZskxzL7wkOyqhSvpjKC + template: + metadata: + annotations: + sealedsecrets.bitnami.com/cluster-wide: 'true' + name: sentry + type: Opaque diff --git a/.kontinuous/env/prod/templates/sentry.sealed-secret.yaml b/.kontinuous/env/prod/templates/sentry.sealed-secret.yaml new file mode 100644 index 000000000..c3a7ce207 --- /dev/null +++ b/.kontinuous/env/prod/templates/sentry.sealed-secret.yaml @@ -0,0 +1,16 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + annotations: + sealedsecrets.bitnami.com/namespace-wide: 'true' + name: sentry + namespace: secretariat +spec: + encryptedData: + SENTRY_AUTH_TOKEN: AgCg6EpuN96oZQ1zbCfciq9w63htn3GtqMwQB5COwLocovcJTk42Z3c1aDp7zkZpDS0rVgUt5zcQuEVoWoZExQOyfmQPxRbFGQnXqbFGYTcekc9mZ1qRTr9Vzl26YQ7OsVegEv+tCX5Njzgm/vrGPHQCQBZQKtVNSzH5ihhu79UNS1G5U6gXhlYzOFEAjQAzKP9UfHcd1lkXfVx9bm0dpnJPyWPjMyJvC7RfAd9SGNJwDuGsGeUH/zbn5XuLHblqV6XvUD4YX/9cBxMvCzcHAwQCrruTxeogoLRXAzWXZye/RqSV/AQ4fPRP0fK+rxzF6sOumP3T7Zmb31/Rb0zv0kozbavdhcsX71nZbMUXJVFNuTqpT24JoMSJnsc/U9vNyya65IDjs18BVsJl2+x01Oc143W/irLzilh7lNriP+YqUcpjoZK9RHtNfyNTJ8ffFd/M3wlvE55WAmTvSzcTivV8oubvM3nREUDihaMGwRSsW24d84Gr3VBM8KlZlm7XEIazmeS7Xt62w/Xgj88b7UWP0+YLH5PlIZnMnoQPVDhnyAOIMAGmp97VVw4AogfuaqZqgQkn+LCTC/DTz68u7vpWSsNRxw835CxaEKB55GT4WpgtGbAvttufeDfvMMrPNswFv8uoI4Ae0a/lb5kKjZOlZIF/dYxu4vJScUFkic6df78NBMLIoX9aB5U/PQPOBLl92vlGDrPzckq+oQMDZmdT5rHPeogjFHHi3AQQOd3gqacq1TV8RGPGryK5vZu4c4Ddop2FK2roqqRabIwlzSI/ + template: + metadata: + annotations: + sealedsecrets.bitnami.com/namespace-wide: 'true' + name: sentry + type: Opaque diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 80d3a0942..8faa44272 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -41,3 +41,7 @@ jobs: context: ./packages/hasura buildArgs: APP_URL: "https://{{ .Values.global.host }}" + secrets: + sentry_auth_token: + secretName: sentry + secretKey: SENTRY_AUTH_TOKEN diff --git a/.talismanrc b/.talismanrc index 9a6115c0c..a1cfffa5c 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,6 +1,14 @@ fileignoreconfig: +- filename: .kontinuous/env/dev/templates/sentry.sealed-secret.yaml + checksum: 6b3eb493305a8c3d24402c99d7a20b01b6650e7fedb2782648c539a70adc4088 +- filename: .kontinuous/env/preprod/templates/sentry.sealed-secret.yaml + checksum: fae95a0f658c5920845516eb04659cac883418d135a4bce54615236e47da8df1 +- filename: .kontinuous/env/prod/templates/sentry.sealed-secret.yaml + checksum: ef7c23320a02ca66f8a10755bccabc2a487973e9581a4408ed3f4c8685f921f7 - filename: .kontinuous/values.yaml - checksum: 5cbf30ed8e834175378bf4ddc82bec820875bd0fc960ac80025ca5027d61fda5 + checksum: ac5d9706a33f1a17ce439ae53449d71a33eac2c21f36ffc19130212e972ed2ca +- filename: Dockerfile + checksum: 14c30aedc55e0f61364c26cf84c28596973f6951f4e0322f2f2693ec84ff513c - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/down.sql checksum: cac3e070c06c7c7fbd6821009fef546e452a38184ac6539ccca609be4a82bd8b - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/up.sql diff --git a/Dockerfile b/Dockerfile index ff5612f43..8c4820585 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,8 @@ ENV NEXT_PUBLIC_SENTRY_DSN $NEXT_PUBLIC_SENTRY_DSN ENV NEXT_TELEMETRY_DISABLED 1 # build -RUN yarn build +RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)"; \ + yarn build # Production image, copy all the files and run next FROM base AS runner diff --git a/next.config.js b/next.config.js index eb89f744e..01d95a1c9 100644 --- a/next.config.js +++ b/next.config.js @@ -50,7 +50,7 @@ const headers = [ { key: "Reporting-Endpoints", value: "endpoint='/api/report'" }, ] -module.exports = { +const nextConfig = { swcMinify: true, optimizeFonts: false, reactStrictMode: true, @@ -59,9 +59,6 @@ module.exports = { domains: ["avatars.githubusercontent.com", "secure.gravatar.com"], contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;", }, - sentry: { - hideSourceMaps: true, - }, output: "standalone", env: { NEXT_PUBLIC_APP_VERSION: version, @@ -80,4 +77,22 @@ module.exports = { }, } -module.exports = withSentryConfig(module.exports) +const sentryWebpackPluginOptions = { + org: "incubateur", + project: "secretariat", + url: "https://sentry.fabrique.social.gouv.fr/", +} + +const sentryOptions = { + // Upload additional client files (increases upload size) + widenClientFileUpload: true, + + // Hides source maps from generated client bundles + hideSourceMaps: true, +} + +module.exports = withSentryConfig( + nextConfig, + sentryWebpackPluginOptions, + sentryOptions +) diff --git a/package.json b/package.json index 6e4a6f421..0ffe11793 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "@octokit/rest": "19.0.5", "@octokit/types": "8.0.0", - "@sentry/nextjs": "7.32.1", + "@sentry/nextjs": "^7.84.0", "@socialgouv/matomo-next": "1.5.0", "date-fns": "2.28.0", "debounce-fn": "4.0.0", diff --git a/yarn.lock b/yarn.lock index 63f6eae27..df8a8ba65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1637,20 +1637,31 @@ __metadata: languageName: node linkType: hard -"@sentry/browser@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/browser@npm:7.32.1" +"@sentry-internal/tracing@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry-internal/tracing@npm:7.84.0" dependencies: - "@sentry/core": "npm:7.32.1" - "@sentry/replay": "npm:7.32.1" - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" - tslib: "npm:^1.9.3" - checksum: 65104a4e5e48cb838fc759f28b0f2b43781b957ea20e81aad276d4f1cc0bf0d5006dca3cdb1b761c96eabf2423a9491fb60a0b5f3e382e54d98c7334ae1349b6 + "@sentry/core": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" + checksum: bdf79b9b5a9c4d6247c1492b69974c52c7f31e804dfce61e94c3ba04cf00525df68491a1f84285aebd606c97cbdac42789e9d03fe86c7c76179b7b8de06a833e languageName: node linkType: hard -"@sentry/cli@npm:^1.74.6": +"@sentry/browser@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/browser@npm:7.84.0" + dependencies: + "@sentry-internal/tracing": "npm:7.84.0" + "@sentry/core": "npm:7.84.0" + "@sentry/replay": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" + checksum: 43adcc605968a0230c27988365b703edc7ee145dce70b50e5797cdaecfd57955151dc5d26af1dd2dd38ae3b968114e682a1d42a5e143837643a911622e5cb151 + languageName: node + linkType: hard + +"@sentry/cli@npm:^1.77.1": version: 1.77.1 resolution: "@sentry/cli@npm:1.77.1" dependencies: @@ -1666,133 +1677,130 @@ __metadata: languageName: node linkType: hard -"@sentry/core@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/core@npm:7.32.1" +"@sentry/core@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/core@npm:7.84.0" dependencies: - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" - tslib: "npm:^1.9.3" - checksum: 81fef62d275c468275bbc6fec92ed24bd877c9d59d70ff4bd71c8410e9568d23a911095a4d1283bc350e915c5286614547003de4e2dabd4f422d2d288ece23ad + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" + checksum: c305d988c65b3e0ae5dfcd257d65b6da67e0cc0a1395e2b2c8bcb314d0649020d72641424a34db463fec7fa9905d42f4f021df8cec3aaaeedb52101df8c40f75 languageName: node linkType: hard -"@sentry/integrations@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/integrations@npm:7.32.1" +"@sentry/integrations@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/integrations@npm:7.84.0" dependencies: - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" + "@sentry/core": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" localforage: "npm:^1.8.1" - tslib: "npm:^1.9.3" - checksum: 658e4bdc0c0f39f5bec5d38ce1c43df1a2b6e58f4e183d4de268b783e1fc3d2a97212b4d790860b07d449da69e03cd20ab4e6c80ccc01c0fcfd4632117da7a25 + checksum: d2967539c10c7c78955bf2a2fc7abaf0943a46445b75d74c377f35ccb4d114ab68591a476f5c4c9f5874c8c886ddccb7b23e528181c8200771816afe1ed67c65 languageName: node linkType: hard -"@sentry/nextjs@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/nextjs@npm:7.32.1" +"@sentry/nextjs@npm:^7.84.0": + version: 7.84.0 + resolution: "@sentry/nextjs@npm:7.84.0" dependencies: "@rollup/plugin-commonjs": "npm:24.0.0" - "@sentry/core": "npm:7.32.1" - "@sentry/integrations": "npm:7.32.1" - "@sentry/node": "npm:7.32.1" - "@sentry/react": "npm:7.32.1" - "@sentry/tracing": "npm:7.32.1" - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" - "@sentry/webpack-plugin": "npm:1.20.0" + "@sentry/core": "npm:7.84.0" + "@sentry/integrations": "npm:7.84.0" + "@sentry/node": "npm:7.84.0" + "@sentry/react": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" + "@sentry/vercel-edge": "npm:7.84.0" + "@sentry/webpack-plugin": "npm:1.21.0" chalk: "npm:3.0.0" + resolve: "npm:1.22.8" rollup: "npm:2.78.0" - tslib: "npm:^1.9.3" + stacktrace-parser: "npm:^0.1.10" peerDependencies: - next: ^10.0.8 || ^11.0 || ^12.0 || ^13.0 - react: 15.x || 16.x || 17.x || 18.x + next: ^10.0.8 || ^11.0 || ^12.0 || ^13.0 || ^14.0 + react: 16.x || 17.x || 18.x webpack: ">= 4.0.0" peerDependenciesMeta: webpack: optional: true - checksum: d3636135324a6504b869c994cd5f0eec3666798c8b628d549b5d9d62392913a61a856ae1f9585b4baeb5c3009472cbf3e2237284a63bcf08c38f71e37a6333f5 + checksum: 737f236fb9bf2d6ec13e3f8353176480ccd644b1e8e1b1b7e6200b1f3e7b24d4d87612b3d6fcf1c5b3d9c4f153dc723c1b488305b3ed657a8cfd5e56926c90d9 languageName: node linkType: hard -"@sentry/node@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/node@npm:7.32.1" +"@sentry/node@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/node@npm:7.84.0" dependencies: - "@sentry/core": "npm:7.32.1" - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" - cookie: "npm:^0.4.1" + "@sentry-internal/tracing": "npm:7.84.0" + "@sentry/core": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" https-proxy-agent: "npm:^5.0.0" - lru_map: "npm:^0.3.3" - tslib: "npm:^1.9.3" - checksum: ee366a3ebeab32b33005af6a7ee05f7ac4b67d25467c440e178a8a9d7504ed580b980214916f6523ff83f129a8b4efab94d0bc2a271e05b3a74b122d4327a551 + checksum: 9d14a1270b037a448d7096f9386432a9f8ba057cd1e48894ea7d45ca006088954ca52b9e27373becc11315a2b1bcd466532358d04ca1ff06433db805228dd725 languageName: node linkType: hard -"@sentry/react@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/react@npm:7.32.1" +"@sentry/react@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/react@npm:7.84.0" dependencies: - "@sentry/browser": "npm:7.32.1" - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" + "@sentry/browser": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" hoist-non-react-statics: "npm:^3.3.2" - tslib: "npm:^1.9.3" peerDependencies: react: 15.x || 16.x || 17.x || 18.x - checksum: 448301398dc4b9a8f438e54867af27746fc038a5da02cccd2736dfb629969e708864b367be3de90178ca5e30525fe4298e35137dd52eabb9fe20b6424555269e + checksum: d867855e899c32596a1db4a9ac696b09663e8004d610d2f2c7b507c8e717fbccc49b858b43030a1c54a410f3fb06ac496780fdd5addb4f06c484829f84436b3f languageName: node linkType: hard -"@sentry/replay@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/replay@npm:7.32.1" +"@sentry/replay@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/replay@npm:7.84.0" dependencies: - "@sentry/core": "npm:7.32.1" - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" - checksum: 3b2da82d8959f07bba8c0d05ec21a7092ac0f09dcc5ec8ba9096b29a8ec162aba4d32929a1ee0508aa93e6c13f02d523150d147f3f04f7ba31d8474025ad1bc0 + "@sentry-internal/tracing": "npm:7.84.0" + "@sentry/core": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" + checksum: 80a3a97c463de0a6d8ed5d0302e9db2e42c6e155685827d57f90f172666846812d33b7b65890106131124f4168f48c11e279ff91c99ba1fc1fe274848ed67c01 languageName: node linkType: hard -"@sentry/tracing@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/tracing@npm:7.32.1" - dependencies: - "@sentry/core": "npm:7.32.1" - "@sentry/types": "npm:7.32.1" - "@sentry/utils": "npm:7.32.1" - tslib: "npm:^1.9.3" - checksum: 7268f6a45dd0472add7049ca560f09a8babdd04255a86f3634e194c08f0f3e3fc04f368c1dfd9f1774cd164eb869994018fa465d46052bfc2dbbe25b582f9d78 +"@sentry/types@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/types@npm:7.84.0" + checksum: 45d979a914d9a3bed98146e0595ae0d80416b7a25d43a814569071d177e89c10847f1b3dde790ca5023fe7cac977d99780eb4c09df97f2da0a83f844b5a9a5ed languageName: node linkType: hard -"@sentry/types@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/types@npm:7.32.1" - checksum: 4fd0126bc92786039627cb1dde5fbfd264d6e5b68f0fe731384f762eaadc104cb36669931307a15f87d3481e136a62e664590e4faaf783366271dc2de5cd60b5 +"@sentry/utils@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/utils@npm:7.84.0" + dependencies: + "@sentry/types": "npm:7.84.0" + checksum: 1ee88dcd8ac2eb81bf4549796e8721a107b724e5dcbfc6f2d208f1864cca49ae0cdb4f055b0ff2084f6c21d051a87f97213d4d90e2211311678b3012c5a34fdb languageName: node linkType: hard -"@sentry/utils@npm:7.32.1": - version: 7.32.1 - resolution: "@sentry/utils@npm:7.32.1" +"@sentry/vercel-edge@npm:7.84.0": + version: 7.84.0 + resolution: "@sentry/vercel-edge@npm:7.84.0" dependencies: - "@sentry/types": "npm:7.32.1" - tslib: "npm:^1.9.3" - checksum: 53d3566c89dc6199134ae6e3b10fe805f34b53e82c857ef2e587604a787a9dd084151fb27f3c9f591f50229f75ad035ee6df6ccbef57ab7603e75424d8d8b0ad + "@sentry-internal/tracing": "npm:7.84.0" + "@sentry/core": "npm:7.84.0" + "@sentry/types": "npm:7.84.0" + "@sentry/utils": "npm:7.84.0" + checksum: 2ef19d1447dbff7efc9532ec6559926af45bfbce80563b1596b07b25fd20068f228327ac551bfda1b221b9781b38e62b7c689b81723489a64c6e0d168d31071e languageName: node linkType: hard -"@sentry/webpack-plugin@npm:1.20.0": - version: 1.20.0 - resolution: "@sentry/webpack-plugin@npm:1.20.0" +"@sentry/webpack-plugin@npm:1.21.0": + version: 1.21.0 + resolution: "@sentry/webpack-plugin@npm:1.21.0" dependencies: - "@sentry/cli": "npm:^1.74.6" + "@sentry/cli": "npm:^1.77.1" webpack-sources: "npm:^2.0.0 || ^3.0.0" - checksum: 257bf2bb9bf03a3e63a85659b01cc7ce95811333103263d35711586908e33a8c1e6033672158bcdef4afe9777df565e52deba78ebc8ce6ee920f8b2cdf94d376 + checksum: fc28506d72ae6eeddd9b2e1eb3e79fc7d186d902c0193cdab3367c8f10bd29ff23a50c6117d34652eb6bd35812469f2a5a2ba5180c62a4ea9b9e36f3075b3ee1 languageName: node linkType: hard @@ -3558,13 +3566,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.4.1": - version: 0.4.2 - resolution: "cookie@npm:0.4.2" - checksum: 2e1de9fdedca54881eab3c0477aeb067f281f3155d9cfee9d28dfb252210d09e85e9d175c0a60689661feb9e35e588515352f2456bc1f8e8db4267e05fd70137 - languageName: node - linkType: hard - "cookie@npm:^0.5.0": version: 0.5.0 resolution: "cookie@npm:0.5.0" @@ -7176,13 +7177,6 @@ __metadata: languageName: node linkType: hard -"lru_map@npm:^0.3.3": - version: 0.3.3 - resolution: "lru_map@npm:0.3.3" - checksum: 50f6597924a7763ab0b31192e5e9965f08ca64a0044254138e74a65aecab95047d540f73739cff489866f4310e0202c11c10fdf18b10b236472160baaa68bbb1 - languageName: node - linkType: hard - "lz-string@npm:^1.5.0": version: 1.5.0 resolution: "lz-string@npm:1.5.0" @@ -9148,7 +9142,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.1.7, resolve@npm:^1.10.0, resolve@npm:^1.20.0, resolve@npm:^1.22.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4": +"resolve@npm:1.22.8, resolve@npm:^1.1.7, resolve@npm:^1.10.0, resolve@npm:^1.20.0, resolve@npm:^1.22.0, resolve@npm:^1.22.1, resolve@npm:^1.22.4": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -9174,7 +9168,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@npm%3A^1.1.7#optional!builtin, resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin": +"resolve@patch:resolve@npm%3A1.22.8#optional!builtin, resolve@patch:resolve@npm%3A^1.1.7#optional!builtin, resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.20.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.0#optional!builtin, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -9407,7 +9401,7 @@ __metadata: "@octokit/rest": "npm:19.0.5" "@octokit/types": "npm:8.0.0" "@react-spring/types": "npm:9.6.1" - "@sentry/nextjs": "npm:7.32.1" + "@sentry/nextjs": "npm:^7.84.0" "@socialgouv/matomo-next": "npm:1.5.0" "@testing-library/jest-dom": "npm:5.16.5" "@testing-library/react": "npm:12.1.5" @@ -9814,6 +9808,15 @@ __metadata: languageName: node linkType: hard +"stacktrace-parser@npm:^0.1.10": + version: 0.1.10 + resolution: "stacktrace-parser@npm:0.1.10" + dependencies: + type-fest: "npm:^0.7.1" + checksum: f4fbddfc09121d91e587b60de4beb4941108e967d71ad3a171812dc839b010ca374d064ad0a296295fed13acd103609d99a4224a25b4e67de13cae131f1901ee + languageName: node + linkType: hard + "statuses@npm:^2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" @@ -10476,7 +10479,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.8.1, tslib@npm:^1.9.3": +"tslib@npm:^1.8.1": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 7dbf34e6f55c6492637adb81b555af5e3b4f9cc6b998fb440dac82d3b42bdc91560a35a5fb75e20e24a076c651438234da6743d139e4feabf0783f3cdfe1dddb @@ -10561,6 +10564,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^0.7.1": + version: 0.7.1 + resolution: "type-fest@npm:0.7.1" + checksum: 0699b6011bb3f7fac5fd5385e2e09432cde08fa89283f24084f29db00ec69a5445cd3aa976438ec74fc552a9a96f4a04ed390b5cb62eb7483aa4b6e5b935e059 + languageName: node + linkType: hard + "type-fest@npm:^0.8.1": version: 0.8.1 resolution: "type-fest@npm:0.8.1" From 38577542eb5bf616b22853ea0c903e1d4c2cb48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 10:06:23 +0100 Subject: [PATCH 13/27] fix --- .kontinuous/values.yaml | 8 ++++---- .talismanrc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 8faa44272..44b427996 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -33,6 +33,10 @@ jobs: NEXT_PUBLIC_SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" NEXT_PUBLIC_ENVIRONMENT: "{{ .Values.global.env }}" NEXT_PUBLIC_RELEASE: "{{ .Values.global.imageTag }}" + secrets: + sentry_auth_token: + secretName: sentry + secretKey: SENTRY_AUTH_TOKEN build-hasura: use: build @@ -41,7 +45,3 @@ jobs: context: ./packages/hasura buildArgs: APP_URL: "https://{{ .Values.global.host }}" - secrets: - sentry_auth_token: - secretName: sentry - secretKey: SENTRY_AUTH_TOKEN diff --git a/.talismanrc b/.talismanrc index a1cfffa5c..2d1dad6b7 100644 --- a/.talismanrc +++ b/.talismanrc @@ -6,7 +6,7 @@ fileignoreconfig: - filename: .kontinuous/env/prod/templates/sentry.sealed-secret.yaml checksum: ef7c23320a02ca66f8a10755bccabc2a487973e9581a4408ed3f4c8685f921f7 - filename: .kontinuous/values.yaml - checksum: ac5d9706a33f1a17ce439ae53449d71a33eac2c21f36ffc19130212e972ed2ca + checksum: 01e719187c7031e191581bd6f0e7c6e0b956c71d91a29d5c4c15e86672693c50 - filename: Dockerfile checksum: 14c30aedc55e0f61364c26cf84c28596973f6951f4e0322f2f2693ec84ff513c - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/down.sql From ee32c2d80f446d6173d9ab002fdecb2c0283fbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 10:32:17 +0100 Subject: [PATCH 14/27] without release --- sentry.client.config.js | 2 +- sentry.edge.config.js | 2 +- sentry.server.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sentry.client.config.js b/sentry.client.config.js index a41d1e4d9..0b3d233d3 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -4,5 +4,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, - release: process.env.NEXT_PUBLIC_RELEASE, + // release: process.env.NEXT_PUBLIC_RELEASE, }) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index a41d1e4d9..0b3d233d3 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -4,5 +4,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, - release: process.env.NEXT_PUBLIC_RELEASE, + // release: process.env.NEXT_PUBLIC_RELEASE, }) diff --git a/sentry.server.config.js b/sentry.server.config.js index a41d1e4d9..0b3d233d3 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -4,5 +4,5 @@ Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_ENVIRONMENT, tracesSampleRate: 1.0, - release: process.env.NEXT_PUBLIC_RELEASE, + // release: process.env.NEXT_PUBLIC_RELEASE, }) From 7df32a57c2d67706e73d2522ce863d8b59818d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 10:42:09 +0100 Subject: [PATCH 15/27] test env var --- .kontinuous/values.yaml | 6 +++--- .talismanrc | 2 +- sentry.client.config.js | 6 +++--- sentry.edge.config.js | 6 +++--- sentry.server.config.js | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 44b427996..1b487f2d2 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -30,9 +30,9 @@ jobs: buildArgs: NEXT_PUBLIC_HASURA_URL: "https://hasura-{{ .Values.global.host }}/v1/graphql" - NEXT_PUBLIC_SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" - NEXT_PUBLIC_ENVIRONMENT: "{{ .Values.global.env }}" - NEXT_PUBLIC_RELEASE: "{{ .Values.global.imageTag }}" + SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" + SENTRY_ENVIRONMENT: "{{ .Values.global.env }}" + SENTRY_RELEASE: "{{ .Values.global.imageTag }}" secrets: sentry_auth_token: secretName: sentry diff --git a/.talismanrc b/.talismanrc index 2d1dad6b7..0956e2ed8 100644 --- a/.talismanrc +++ b/.talismanrc @@ -6,7 +6,7 @@ fileignoreconfig: - filename: .kontinuous/env/prod/templates/sentry.sealed-secret.yaml checksum: ef7c23320a02ca66f8a10755bccabc2a487973e9581a4408ed3f4c8685f921f7 - filename: .kontinuous/values.yaml - checksum: 01e719187c7031e191581bd6f0e7c6e0b956c71d91a29d5c4c15e86672693c50 + checksum: 80576ff559e478771cc231b7bb71875c5e2cf1f474910132bb6b9433717ec8bf - filename: Dockerfile checksum: 14c30aedc55e0f61364c26cf84c28596973f6951f4e0322f2f2693ec84ff513c - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/down.sql diff --git a/sentry.client.config.js b/sentry.client.config.js index 0b3d233d3..b4f652d91 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -1,8 +1,8 @@ import * as Sentry from "@sentry/nextjs" Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - environment: process.env.NEXT_PUBLIC_ENVIRONMENT, - tracesSampleRate: 1.0, + // dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + // environment: process.env.NEXT_PUBLIC_ENVIRONMENT, + // tracesSampleRate: 1.0, // release: process.env.NEXT_PUBLIC_RELEASE, }) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index 0b3d233d3..b4f652d91 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -1,8 +1,8 @@ import * as Sentry from "@sentry/nextjs" Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - environment: process.env.NEXT_PUBLIC_ENVIRONMENT, - tracesSampleRate: 1.0, + // dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + // environment: process.env.NEXT_PUBLIC_ENVIRONMENT, + // tracesSampleRate: 1.0, // release: process.env.NEXT_PUBLIC_RELEASE, }) diff --git a/sentry.server.config.js b/sentry.server.config.js index 0b3d233d3..b4f652d91 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -1,8 +1,8 @@ import * as Sentry from "@sentry/nextjs" Sentry.init({ - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - environment: process.env.NEXT_PUBLIC_ENVIRONMENT, - tracesSampleRate: 1.0, + // dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + // environment: process.env.NEXT_PUBLIC_ENVIRONMENT, + // tracesSampleRate: 1.0, // release: process.env.NEXT_PUBLIC_RELEASE, }) From fae7c2db11b6601dc49a2338a9021ddfec9cc840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 10:53:29 +0100 Subject: [PATCH 16/27] test --- Dockerfile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c4820585..9a4aff041 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,12 +19,12 @@ ARG NEXT_PUBLIC_MATOMO_URL ENV NEXT_PUBLIC_MATOMO_URL $NEXT_PUBLIC_MATOMO_URL ARG NEXT_PUBLIC_MATOMO_SITE_ID ENV NEXT_PUBLIC_MATOMO_SITE_ID $NEXT_PUBLIC_MATOMO_SITE_ID -ARG NEXT_PUBLIC_ENVIRONMENT -ENV NEXT_PUBLIC_ENVIRONMENT $NEXT_PUBLIC_ENVIRONMENT -ARG NEXT_PUBLIC_RELEASE -ENV NEXT_PUBLIC_RELEASE $NEXT_PUBLIC_RELEASE -ARG NEXT_PUBLIC_SENTRY_DSN -ENV NEXT_PUBLIC_SENTRY_DSN $NEXT_PUBLIC_SENTRY_DSN +ARG SENTRY_ENVIRONMENT +ENV SENTRY_ENVIRONMENT $SENTRY_ENVIRONMENT +ARG SENTRY_RELEASE +ENV SENTRY_RELEASE $SENTRY_RELEASE +ARG SENTRY_DSN +ENV SENTRY_DSN $SENTRY_DSN ENV NEXT_TELEMETRY_DISABLED 1 # build @@ -34,6 +34,13 @@ RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /ru # Production image, copy all the files and run next FROM base AS runner +ARG SENTRY_ENVIRONMENT +ENV SENTRY_ENVIRONMENT $SENTRY_ENVIRONMENT +ARG SENTRY_RELEASE +ENV SENTRY_RELEASE $SENTRY_RELEASE +ARG SENTRY_DSN +ENV SENTRY_DSN $SENTRY_DSN + ENV NODE_ENV production ENV NEXT_TELEMETRY_DISABLED 1 From ff13464cbfa20ed86c973328038222b44feb73d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 10:58:53 +0100 Subject: [PATCH 17/27] test --- Dockerfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a4aff041..43d1f840e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,13 +34,6 @@ RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /ru # Production image, copy all the files and run next FROM base AS runner -ARG SENTRY_ENVIRONMENT -ENV SENTRY_ENVIRONMENT $SENTRY_ENVIRONMENT -ARG SENTRY_RELEASE -ENV SENTRY_RELEASE $SENTRY_RELEASE -ARG SENTRY_DSN -ENV SENTRY_DSN $SENTRY_DSN - ENV NODE_ENV production ENV NEXT_TELEMETRY_DISABLED 1 From 88b8d9bf4ac568bbb158b9763a228aae2c896943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:00:06 +0100 Subject: [PATCH 18/27] test --- sentry.client.config.js | 7 +------ sentry.edge.config.js | 7 +------ sentry.server.config.js | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/sentry.client.config.js b/sentry.client.config.js index b4f652d91..110c7b72d 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -1,8 +1,3 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({ - // dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - // environment: process.env.NEXT_PUBLIC_ENVIRONMENT, - // tracesSampleRate: 1.0, - // release: process.env.NEXT_PUBLIC_RELEASE, -}) +Sentry.init({}) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index b4f652d91..110c7b72d 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -1,8 +1,3 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({ - // dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - // environment: process.env.NEXT_PUBLIC_ENVIRONMENT, - // tracesSampleRate: 1.0, - // release: process.env.NEXT_PUBLIC_RELEASE, -}) +Sentry.init({}) diff --git a/sentry.server.config.js b/sentry.server.config.js index b4f652d91..110c7b72d 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -1,8 +1,3 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({ - // dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - // environment: process.env.NEXT_PUBLIC_ENVIRONMENT, - // tracesSampleRate: 1.0, - // release: process.env.NEXT_PUBLIC_RELEASE, -}) +Sentry.init({}) From f468b4f29006e16849579b0bc5c866d87918cdd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:05:49 +0100 Subject: [PATCH 19/27] test errors --- src/pages/api/error.ts | 8 ++++++++ src/pages/index.tsx | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 src/pages/api/error.ts diff --git a/src/pages/api/error.ts b/src/pages/api/error.ts new file mode 100644 index 000000000..e03ec4608 --- /dev/null +++ b/src/pages/api/error.ts @@ -0,0 +1,8 @@ +import { NextApiRequest, NextApiResponse } from "next" + +const Report = (req: NextApiRequest, res: NextApiResponse) => { + throw new Error("serve error") + res.status(200).end() +} + +export default Report diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a26e42678..e3941aba0 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -7,6 +7,13 @@ const Index = () => ( Secrétariat + ) From 78b70d94025f66a0344a6391e7038f6b0454b32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:18:02 +0100 Subject: [PATCH 20/27] test env --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 43d1f840e..9a4aff041 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,13 @@ RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /ru # Production image, copy all the files and run next FROM base AS runner +ARG SENTRY_ENVIRONMENT +ENV SENTRY_ENVIRONMENT $SENTRY_ENVIRONMENT +ARG SENTRY_RELEASE +ENV SENTRY_RELEASE $SENTRY_RELEASE +ARG SENTRY_DSN +ENV SENTRY_DSN $SENTRY_DSN + ENV NODE_ENV production ENV NEXT_TELEMETRY_DISABLED 1 From 629e66c4c9d5a42c06ad1e503182af52fa310525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:32:33 +0100 Subject: [PATCH 21/27] test --- .kontinuous/values.yaml | 6 +++--- .talismanrc | 2 +- Dockerfile | 7 ------- next.config.js | 3 +++ 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index 1b487f2d2..99b391bc6 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -30,9 +30,9 @@ jobs: buildArgs: NEXT_PUBLIC_HASURA_URL: "https://hasura-{{ .Values.global.host }}/v1/graphql" - SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" - SENTRY_ENVIRONMENT: "{{ .Values.global.env }}" - SENTRY_RELEASE: "{{ .Values.global.imageTag }}" + NEXT_PUBLIC_SENTRY_DSN: "https://1fc6ed945722444583d4238af34346a9@sentry.fabrique.social.gouv.fr/85" + NEXT_PUBLIC_SENTRY_ENVIRONMENT: "{{ .Values.global.env }}" + NEXT_PUBLIC_SENTRY_RELEASE: "{{ .Values.global.imageTag }}" secrets: sentry_auth_token: secretName: sentry diff --git a/.talismanrc b/.talismanrc index 0956e2ed8..1b237a7fa 100644 --- a/.talismanrc +++ b/.talismanrc @@ -6,7 +6,7 @@ fileignoreconfig: - filename: .kontinuous/env/prod/templates/sentry.sealed-secret.yaml checksum: ef7c23320a02ca66f8a10755bccabc2a487973e9581a4408ed3f4c8685f921f7 - filename: .kontinuous/values.yaml - checksum: 80576ff559e478771cc231b7bb71875c5e2cf1f474910132bb6b9433717ec8bf + checksum: 1d67b52046f6e850ff38f806000aa8bb1329cb1f7e6314fbec89bea2009709e3 - filename: Dockerfile checksum: 14c30aedc55e0f61364c26cf84c28596973f6951f4e0322f2f2693ec84ff513c - filename: packages/hasura/migrations/default/1691156416829_alter_table_public_users_add_column_disabled/down.sql diff --git a/Dockerfile b/Dockerfile index 9a4aff041..43d1f840e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,13 +34,6 @@ RUN --mount=type=secret,id=sentry_auth_token export SENTRY_AUTH_TOKEN="$(cat /ru # Production image, copy all the files and run next FROM base AS runner -ARG SENTRY_ENVIRONMENT -ENV SENTRY_ENVIRONMENT $SENTRY_ENVIRONMENT -ARG SENTRY_RELEASE -ENV SENTRY_RELEASE $SENTRY_RELEASE -ARG SENTRY_DSN -ENV SENTRY_DSN $SENTRY_DSN - ENV NODE_ENV production ENV NEXT_TELEMETRY_DISABLED 1 diff --git a/next.config.js b/next.config.js index 01d95a1c9..bb7e939b0 100644 --- a/next.config.js +++ b/next.config.js @@ -81,6 +81,9 @@ const sentryWebpackPluginOptions = { org: "incubateur", project: "secretariat", url: "https://sentry.fabrique.social.gouv.fr/", + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, } const sentryOptions = { From 2428c090389f8d16e1d6c96e5c235ced072d1ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:36:33 +0100 Subject: [PATCH 22/27] test --- sentry.client.config.js | 6 +++++- sentry.edge.config.js | 6 +++++- sentry.server.config.js | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sentry.client.config.js b/sentry.client.config.js index 110c7b72d..95764b9d1 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -1,3 +1,7 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({}) +Sentry.init({ + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, +}) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index 110c7b72d..95764b9d1 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -1,3 +1,7 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({}) +Sentry.init({ + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, +}) diff --git a/sentry.server.config.js b/sentry.server.config.js index 110c7b72d..95764b9d1 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -1,3 +1,7 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({}) +Sentry.init({ + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, +}) From 7eb2308dd3b53a06ac612393f1478139b47b95ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:40:44 +0100 Subject: [PATCH 23/27] test --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 43d1f840e..eec38d401 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,12 +19,12 @@ ARG NEXT_PUBLIC_MATOMO_URL ENV NEXT_PUBLIC_MATOMO_URL $NEXT_PUBLIC_MATOMO_URL ARG NEXT_PUBLIC_MATOMO_SITE_ID ENV NEXT_PUBLIC_MATOMO_SITE_ID $NEXT_PUBLIC_MATOMO_SITE_ID -ARG SENTRY_ENVIRONMENT -ENV SENTRY_ENVIRONMENT $SENTRY_ENVIRONMENT -ARG SENTRY_RELEASE -ENV SENTRY_RELEASE $SENTRY_RELEASE -ARG SENTRY_DSN -ENV SENTRY_DSN $SENTRY_DSN +ARG NEXT_PUBLIC_SENTRY_ENVIRONMENT +ENV NEXT_PUBLIC_SENTRY_ENVIRONMENT $NEXT_PUBLIC_SENTRY_ENVIRONMENT +ARG NEXT_PUBLIC_SENTRY_RELEASE +ENV NEXT_PUBLIC_SENTRY_RELEASE $NEXT_PUBLIC_SENTRY_RELEASE +ARG NEXT_PUBLIC_SENTRY_DSN +ENV NEXT_PUBLIC_SENTRY_DSN $NEXT_PUBLIC_SENTRY_DSN ENV NEXT_TELEMETRY_DISABLED 1 # build From 5e28ace77c6ed74392b74e9ad88a79bdeb52fd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:45:46 +0100 Subject: [PATCH 24/27] test --- sentry.client.config.js | 6 +----- sentry.edge.config.js | 6 +----- sentry.server.config.js | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/sentry.client.config.js b/sentry.client.config.js index 95764b9d1..110c7b72d 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -1,7 +1,3 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({ - release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, - environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, -}) +Sentry.init({}) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index 95764b9d1..110c7b72d 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -1,7 +1,3 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({ - release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, - environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, -}) +Sentry.init({}) diff --git a/sentry.server.config.js b/sentry.server.config.js index 95764b9d1..110c7b72d 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -1,7 +1,3 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({ - release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, - environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, -}) +Sentry.init({}) From e1959460949bbe3a2de8c2ea7e19fb12ba0712fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:49:53 +0100 Subject: [PATCH 25/27] test --- next.config.js | 3 --- sentry.client.config.js | 6 +++++- sentry.edge.config.js | 6 +++++- sentry.server.config.js | 6 +++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/next.config.js b/next.config.js index bb7e939b0..01d95a1c9 100644 --- a/next.config.js +++ b/next.config.js @@ -81,9 +81,6 @@ const sentryWebpackPluginOptions = { org: "incubateur", project: "secretariat", url: "https://sentry.fabrique.social.gouv.fr/", - release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, - environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, - dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, } const sentryOptions = { diff --git a/sentry.client.config.js b/sentry.client.config.js index 110c7b72d..95764b9d1 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -1,3 +1,7 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({}) +Sentry.init({ + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, +}) diff --git a/sentry.edge.config.js b/sentry.edge.config.js index 110c7b72d..95764b9d1 100644 --- a/sentry.edge.config.js +++ b/sentry.edge.config.js @@ -1,3 +1,7 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({}) +Sentry.init({ + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, +}) diff --git a/sentry.server.config.js b/sentry.server.config.js index 110c7b72d..95764b9d1 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -1,3 +1,7 @@ import * as Sentry from "@sentry/nextjs" -Sentry.init({}) +Sentry.init({ + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, +}) From 24f8c6834e3c7fe500a059b2cb1c55865f67c33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 11:58:35 +0100 Subject: [PATCH 26/27] test --- next.config.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/next.config.js b/next.config.js index 01d95a1c9..3c2e6590a 100644 --- a/next.config.js +++ b/next.config.js @@ -81,13 +81,11 @@ const sentryWebpackPluginOptions = { org: "incubateur", project: "secretariat", url: "https://sentry.fabrique.social.gouv.fr/", + release: process.env.NEXT_PUBLIC_SENTRY_RELEASE, } const sentryOptions = { - // Upload additional client files (increases upload size) widenClientFileUpload: true, - - // Hides source maps from generated client bundles hideSourceMaps: true, } From 089942c057ce8f8ff5a0456058b57a64c12fc059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Mon, 4 Dec 2023 12:10:55 +0100 Subject: [PATCH 27/27] remove test errors --- src/pages/api/error.ts | 8 -------- src/pages/index.tsx | 7 ------- 2 files changed, 15 deletions(-) delete mode 100644 src/pages/api/error.ts diff --git a/src/pages/api/error.ts b/src/pages/api/error.ts deleted file mode 100644 index e03ec4608..000000000 --- a/src/pages/api/error.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NextApiRequest, NextApiResponse } from "next" - -const Report = (req: NextApiRequest, res: NextApiResponse) => { - throw new Error("serve error") - res.status(200).end() -} - -export default Report diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e3941aba0..a26e42678 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -7,13 +7,6 @@ const Index = () => ( Secrétariat - )