fix(observability): switch source map upload to glitchtip-cli
Some checks failed
Release / Test backend (push) Successful in 18s
CI / Test backend (pull_request) Successful in 18s
Release / Check ui (push) Successful in 47s
Release / Docker / caddy (push) Successful in 55s
CI / Check ui (pull_request) Successful in 21s
Release / Docker / backend (push) Failing after 1m13s
CI / Docker / backend (pull_request) Failing after 20s
Release / Docker / runner (push) Successful in 1m46s
CI / Docker / runner (pull_request) Failing after 1m17s
Release / Docker / ui (push) Failing after 39s
CI / Docker / ui (pull_request) Successful in 1m11s
CI / Docker / caddy (pull_request) Successful in 7m6s
Release / Upload source maps (push) Failing after 41s
Release / Gitea Release (push) Has been skipped
Some checks failed
Release / Test backend (push) Successful in 18s
CI / Test backend (pull_request) Successful in 18s
Release / Check ui (push) Successful in 47s
Release / Docker / caddy (push) Successful in 55s
CI / Check ui (pull_request) Successful in 21s
Release / Docker / backend (push) Failing after 1m13s
CI / Docker / backend (pull_request) Failing after 20s
Release / Docker / runner (push) Successful in 1m46s
CI / Docker / runner (pull_request) Failing after 1m17s
Release / Docker / ui (push) Failing after 39s
CI / Docker / ui (pull_request) Successful in 1m11s
CI / Docker / caddy (pull_request) Successful in 7m6s
Release / Upload source maps (push) Failing after 41s
Release / Gitea Release (push) Has been skipped
@sentry/vite-plugin uses sentry-cli which creates release entries but doesn't upload files to GlitchTip's API correctly. Switch to the native glitchtip-cli which uses the debug ID inject+upload approach that GlitchTip actually supports.
This commit is contained in:
@@ -158,12 +158,31 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build with source maps and upload to GlitchTip
|
- name: Build with source maps
|
||||||
env:
|
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.GLITCHTIP_AUTH_TOKEN }}
|
|
||||||
BUILD_VERSION: ${{ gitea.ref_name }}
|
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Download glitchtip-cli
|
||||||
|
run: |
|
||||||
|
curl -L https://gitlab.com/glitchtip/glitchtip-cli/-/releases/permalink/latest/downloads/glitchtip-cli-x86_64-unknown-linux-musl \
|
||||||
|
-o /usr/local/bin/glitchtip-cli
|
||||||
|
chmod +x /usr/local/bin/glitchtip-cli
|
||||||
|
|
||||||
|
- name: Inject debug IDs into build artifacts
|
||||||
|
run: glitchtip-cli sourcemaps inject ./build
|
||||||
|
env:
|
||||||
|
SENTRY_URL: https://errors.libnovel.cc/
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.GLITCHTIP_AUTH_TOKEN }}
|
||||||
|
SENTRY_ORG: libnovel
|
||||||
|
SENTRY_PROJECT: libnovel-ui
|
||||||
|
|
||||||
|
- name: Upload source maps to GlitchTip
|
||||||
|
run: glitchtip-cli sourcemaps upload ./build --release ${{ gitea.ref_name }}
|
||||||
|
env:
|
||||||
|
SENTRY_URL: https://errors.libnovel.cc/
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.GLITCHTIP_AUTH_TOKEN }}
|
||||||
|
SENTRY_ORG: libnovel
|
||||||
|
SENTRY_PROJECT: libnovel-ui
|
||||||
|
|
||||||
# ── docker: ui ────────────────────────────────────────────────────────────────
|
# ── docker: ui ────────────────────────────────────────────────────────────────
|
||||||
docker-ui:
|
docker-ui:
|
||||||
name: Docker / ui
|
name: Docker / ui
|
||||||
|
|||||||
@@ -1,36 +1,14 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
import tailwindcss from '@tailwindcss/vite';
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
|
||||||
|
|
||||||
// Source maps are always generated so that the CI pipeline can upload them to
|
// Source maps are always generated so that the CI pipeline can upload them to
|
||||||
// GlitchTip after a release build. The sentryVitePlugin upload step is only
|
// GlitchTip via glitchtip-cli after a release build.
|
||||||
// active when SENTRY_AUTH_TOKEN is present (i.e. in the release CI job).
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [tailwindcss(), sveltekit()],
|
||||||
tailwindcss(),
|
|
||||||
sveltekit(),
|
|
||||||
sentryVitePlugin({
|
|
||||||
org: 'libnovel',
|
|
||||||
project: 'libnovel-ui',
|
|
||||||
url: 'https://errors.libnovel.cc/',
|
|
||||||
// Auth token injected by CI via SENTRY_AUTH_TOKEN env var.
|
|
||||||
// When the env var is absent the plugin is a no-op.
|
|
||||||
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
||||||
// Release name matches the Docker image tag (e.g. "1.2.3").
|
|
||||||
release: { name: process.env.BUILD_VERSION },
|
|
||||||
// Don't upload source maps in local dev or CI type-check jobs.
|
|
||||||
disable: !process.env.SENTRY_AUTH_TOKEN,
|
|
||||||
// Source maps are uploaded to GlitchTip; do not ship them in the
|
|
||||||
// production bundle served to browsers.
|
|
||||||
sourcemaps: {
|
|
||||||
filesToDeleteAfterUpload: ['./build/**/*.map']
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
|
||||||
ssr: {
|
ssr: {
|
||||||
// Force these packages to be bundled into the server output rather than
|
// Force these packages to be bundled into the server output rather than
|
||||||
// treated as external requires. The production Docker image has no
|
// treated as external requires. The production Docker image has no
|
||||||
|
|||||||
Reference in New Issue
Block a user