GeezerVison is showing github.com — desktop: sentry integration (#15300) · huer0625/opencode@163290b
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 36 | 36 | PLANETSCALE_SERVICE_TOKEN_NAME: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_NAME }} | 37 | 37 | PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} | 38 | 38 | STRIPE_SECRET_KEY: ${{ github.ref_name == 'production' && secrets.STRIPE_SECRET_KEY_PROD || secrets.STRIPE_SECRET_KEY_DEV }} | | 39 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | | 40 | + SENTRY_ORG: ${{ vars.SENTRY_ORG }} | | 41 | + SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }} | | 42 | + SENTRY_RELEASE: web@${{ github.sha }} | | 43 | + VITE_SENTRY_DSN: ${{ vars.WEB_SENTRY_DSN }} | | 44 | + VITE_SENTRY_RELEASE: web@${{ github.sha }} |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/publish.yml +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -494,6 +494,13 @@ jobs: | 494 | 494 | working-directory: packages/desktop-electron | 495 | 495 | env: | 496 | 496 | OPENCODE_CHANNEL: ${{ (github.ref_name == 'beta' && 'beta') || 'prod' }} | | 497 | + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | | 498 | + SENTRY_ORG: ${{ vars.SENTRY_ORG }} | | 499 | + SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }} | | 500 | + SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }} | | 501 | + VITE_SENTRY_DSN: ${{ vars.WEB_SENTRY_DSN }} | | 502 | + VITE_SENTRY_ENVIRONMENT: ${{ (github.ref_name == 'beta' && 'beta') || 'production' }} | | 503 | + VITE_SENTRY_RELEASE: desktop@${{ needs.version.outputs.version }} | 497 | 504 |
| 498 | 505 | - name: Package and publish | 499 | 506 | if: needs.version.outputs.release | |
Collapse file Copy file name to clipboardExpand all lines: bun.lock +105-9Lines changed: 105 additions & 9 deletions Collapse file Copy file name to clipboardExpand all lines: package.json +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 77 | 77 | "@solidjs/meta": "0.29.4", | 78 | 78 | "@solidjs/router": "0.15.4", | 79 | 79 | "@solidjs/start": "https://pkg.pr.new/@solidjs/start@dfb2020", | | 80 | + "@sentry/solid": "10.36.0", | | 81 | + "@sentry/vite-plugin": "4.6.0", | 80 | 82 | "solid-js": "1.9.10", | 81 | 83 | "vite-plugin-solid": "2.11.10", | 82 | 84 | "@lydell/node-pty": "1.2.0-beta.10" | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/package.json +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 27 | 27 | "devDependencies": { | 28 | 28 | "@happy-dom/global-registrator": "20.0.11", | 29 | 29 | "@playwright/test": "catalog:", | | 30 | + "@sentry/vite-plugin": "catalog:", | 30 | 31 | "@tailwindcss/vite": "catalog:", | 31 | 32 | "@tsconfig/bun": "1.0.9", | 32 | 33 | "@types/bun": "catalog:", | | 40 | 41 | }, | 41 | 42 | "dependencies": { | 42 | 43 | "@kobalte/core": "catalog:", | | 44 | + "@sentry/solid": "catalog:", | 43 | 45 | "@opencode-ai/sdk": "workspace:*", | 44 | 46 | "@opencode-ai/ui": "workspace:*", | 45 | 47 | "@opencode-ai/core": "workspace:*", | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/app.tsx +14-6Lines changed: 14 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import "@/index.css" | | 2 | +import * as Sentry from "@sentry/solid" | 2 | 3 | import { I18nProvider } from "@opencode-ai/ui/context" | 3 | 4 | import { DialogProvider } from "@opencode-ai/ui/context/dialog" | 4 | 5 | import { FileComponentProvider } from "@opencode-ai/ui/context/file" | @@ -148,12 +149,19 @@ export function AppBaseProviders(props: ParentProps<{ locale?: Locale }>) { | 148 | 149 | > | 149 | 150 | <LanguageProvider locale={props.locale}> | 150 | 151 | <UiI18nBridge> | 151 | | - <ErrorBoundary fallback={(error) => <ErrorPage error={error} />}> | 152 | | - <DialogProvider> | 153 | | - <MarkedProvider> | 154 | | - <FileComponentProvider component={File}>{props.children}</FileComponentProvider> | 155 | | - </MarkedProvider> | 156 | | - </DialogProvider> | | 152 | + <ErrorBoundary | | 153 | + fallback={(error) => { | | 154 | + Sentry.captureException(error) | | 155 | + return <ErrorPage error={error} /> | | 156 | + }} | | 157 | + > | | 158 | + <QueryProvider> | | 159 | + <DialogProvider> | | 160 | + <MarkedProvider> | | 161 | + <FileComponentProvider component={File}>{props.children}</FileComponentProvider> | | 162 | + </MarkedProvider> | | 163 | + </DialogProvider> | | 164 | + </QueryProvider> | 157 | 165 | </ErrorBoundary> | 158 | 166 | </UiI18nBridge> | 159 | 167 | </LanguageProvider> | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/entry.tsx +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | // @refresh reload | 2 | 2 |
| | 3 | +import * as Sentry from "@sentry/solid" | 3 | 4 | import { render } from "solid-js/web" | 4 | 5 | import { AppBaseProviders, AppInterface } from "@/app" | 5 | 6 | import { type Platform, PlatformProvider } from "@/context/platform" | @@ -125,6 +126,25 @@ const platform: Platform = { | 125 | 126 | setDefaultServer: writeDefaultServerUrl, | 126 | 127 | } | 127 | 128 |
| | 129 | +if (import.meta.env.VITE_SENTRY_DSN) { | | 130 | + Sentry.init({ | | 131 | + dsn: import.meta.env.VITE_SENTRY_DSN, | | 132 | + environment: import.meta.env.VITE_SENTRY_ENVIRONMENT ?? import.meta.env.MODE, | | 133 | + release: import.meta.env.VITE_SENTRY_RELEASE ?? `web@${pkg.version}`, | | 134 | + initialScope: { | | 135 | + tags: { | | 136 | + platform: "web", | | 137 | + }, | | 138 | + }, | | 139 | + integrations: (integrations) => { | | 140 | + return integrations.filter( | | 141 | + (i) => | | 142 | + i.name !== "Breadcrumbs" && !(import.meta.env.OPENCODE_CHANNEL === "prod" && i.name === "GlobalHandlers"), | | 143 | + ) | | 144 | + }, | | 145 | + }) | | 146 | +} | | 147 | + | 128 | 148 | if (root instanceof HTMLElement) { | 129 | 149 | const server: ServerConnection.Http = { type: "http", http: { url: getCurrentUrl() } } | 130 | 150 | render( | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/env.d.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,10 @@ interface ImportMetaEnv { | 2 | 2 | readonly VITE_OPENCODE_SERVER_HOST: string | 3 | 3 | readonly VITE_OPENCODE_SERVER_PORT: string | 4 | 4 | readonly VITE_OPENCODE_CHANNEL?: "dev" | "beta" | "prod" | | 5 | + | | 6 | + readonly VITE_SENTRY_DSN?: string | | 7 | + readonly VITE_SENTRY_ENVIRONMENT?: string | | 8 | + readonly VITE_SENTRY_RELEASE?: string | 5 | 9 | } | 6 | 10 |
| 7 | 11 | interface ImportMeta { | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/i18n/ar.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -402,6 +402,8 @@ export const dict = { | 402 | 402 | "error.page.description": "حدث خطأ أثناء تحميل التطبيق.", | 403 | 403 | "error.page.details.label": "تفاصيل الخطأ", | 404 | 404 | "error.page.action.restart": "إعادة تشغيل", | | 405 | + "error.page.action.report": "الإبلاغ عن الخطأ", | | 406 | + "error.page.action.reported": "تم الإبلاغ عن الخطأ", | 405 | 407 | "error.page.action.checking": "جارٍ التحقق...", | 406 | 408 | "error.page.action.checkUpdates": "التحقق من وجود تحديثات", | 407 | 409 | "error.page.action.updateTo": "تحديث إلى {{version}}", | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/i18n/br.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -403,6 +403,8 @@ export const dict = { | 403 | 403 | "error.page.description": "Ocorreu um erro ao carregar a aplicação.", | 404 | 404 | "error.page.details.label": "Detalhes do Erro", | 405 | 405 | "error.page.action.restart": "Reiniciar", | | 406 | + "error.page.action.report": "Reportar erro", | | 407 | + "error.page.action.reported": "Erro reportado", | 406 | 408 | "error.page.action.checking": "Verificando...", | 407 | 409 | "error.page.action.checkUpdates": "Verificar atualizações", | 408 | 410 | "error.page.action.updateTo": "Atualizar para {{version}}", | |
|