Merge pull request #51 from trails-cool/sentry-ci-environment
This commit is contained in:
commit
f7288c88d1
5 changed files with 26 additions and 14 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -177,6 +177,8 @@ jobs:
|
||||||
|
|
||||||
- name: Build for production
|
- name: Build for production
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
env:
|
||||||
|
VITE_SENTRY_ENVIRONMENT: ci
|
||||||
|
|
||||||
- name: Run E2E tests
|
- name: Run E2E tests
|
||||||
run: pnpm test:e2e
|
run: pnpm test:e2e
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,17 @@ import { startTransition, StrictMode } from "react";
|
||||||
import { hydrateRoot } from "react-dom/client";
|
import { hydrateRoot } from "react-dom/client";
|
||||||
import { HydratedRouter } from "react-router/dom";
|
import { HydratedRouter } from "react-router/dom";
|
||||||
|
|
||||||
|
const sentryEnvironment = import.meta.env.VITE_SENTRY_ENVIRONMENT ??
|
||||||
|
(import.meta.env.PROD ? "production" : "development");
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
||||||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
||||||
environment: import.meta.env.PROD ? "production" : "development",
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: 0.1,
|
tracesSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
||||||
replaysSessionSampleRate: 0,
|
replaysSessionSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
||||||
replaysOnErrorSampleRate: 1.0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
enabled: import.meta.env.PROD,
|
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
||||||
});
|
});
|
||||||
|
|
||||||
startTransition(() => {
|
startTransition(() => {
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,14 @@ import { isbot } from "isbot";
|
||||||
import type { RenderToPipeableStreamOptions } from "react-dom/server";
|
import type { RenderToPipeableStreamOptions } from "react-dom/server";
|
||||||
import { renderToPipeableStream } from "react-dom/server";
|
import { renderToPipeableStream } from "react-dom/server";
|
||||||
|
|
||||||
|
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
||||||
release: process.env.SENTRY_RELEASE,
|
release: process.env.SENTRY_RELEASE,
|
||||||
environment: process.env.NODE_ENV ?? "development",
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: 0.1,
|
tracesSampleRate: 1.0,
|
||||||
enabled: process.env.NODE_ENV === "production",
|
enabled: process.env.NODE_ENV === "production" && !process.env.CI,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const streamTimeout = 5_000;
|
export const streamTimeout = 5_000;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,17 @@ import { startTransition, StrictMode } from "react";
|
||||||
import { hydrateRoot } from "react-dom/client";
|
import { hydrateRoot } from "react-dom/client";
|
||||||
import { HydratedRouter } from "react-router/dom";
|
import { HydratedRouter } from "react-router/dom";
|
||||||
|
|
||||||
|
const sentryEnvironment = import.meta.env.VITE_SENTRY_ENVIRONMENT ??
|
||||||
|
(import.meta.env.PROD ? "production" : "development");
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
||||||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
||||||
environment: import.meta.env.PROD ? "production" : "development",
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: 0.1,
|
tracesSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
||||||
replaysSessionSampleRate: 0,
|
replaysSessionSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
||||||
replaysOnErrorSampleRate: 1.0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
enabled: import.meta.env.PROD,
|
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
||||||
});
|
});
|
||||||
|
|
||||||
startTransition(() => {
|
startTransition(() => {
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,14 @@ import { createReadStream, statSync } from "node:fs";
|
||||||
import { join, extname, resolve } from "node:path";
|
import { join, extname, resolve } from "node:path";
|
||||||
import { setupYjsWebSocket } from "./app/lib/yjs-server.ts";
|
import { setupYjsWebSocket } from "./app/lib/yjs-server.ts";
|
||||||
|
|
||||||
|
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
||||||
release: process.env.SENTRY_RELEASE,
|
release: process.env.SENTRY_RELEASE,
|
||||||
environment: process.env.NODE_ENV ?? "development",
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: 0.1,
|
tracesSampleRate: 1.0,
|
||||||
enabled: process.env.NODE_ENV === "production",
|
enabled: process.env.NODE_ENV === "production" && !process.env.CI,
|
||||||
});
|
});
|
||||||
|
|
||||||
const port = Number(process.env.PORT ?? 3001);
|
const port = Number(process.env.PORT ?? 3001);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue