Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e981048
feat(commands): register wizard error-tracking in the pickers
ablaszkiewicz Sep 1, 2026
45f0f25
feat(apps): seed error-tracking fixtures (node-raw, next-no-posthog)
ablaszkiewicz Sep 1, 2026
ddaa413
feat(apps): add next error-tracking fixture
ablaszkiewicz Sep 1, 2026
247d667
feat(apps): add react-vite error-tracking fixture
ablaszkiewicz Sep 1, 2026
4ebdd3c
feat(apps): add nuxt-3-6 error-tracking fixture
ablaszkiewicz Sep 1, 2026
b9f087b
feat(apps): add nuxt-4-3 error-tracking fixture
ablaszkiewicz Sep 1, 2026
ab3d47e
feat(apps): add python-flask error-tracking fixture
ablaszkiewicz Sep 1, 2026
bfd61fa
feat(apps): add node-webpack error-tracking fixture
ablaszkiewicz Sep 1, 2026
79f1ae5
feat(apps): add node-rollup error-tracking fixture
ablaszkiewicz Sep 1, 2026
60e5feb
feat(apps): add node-rollup-typescript-plugin error-tracking fixture
ablaszkiewicz Sep 1, 2026
6950638
feat(apps): add cicd-github-actions-node-raw error-tracking fixture
ablaszkiewicz Sep 1, 2026
179f6e6
feat(apps): add cicd-docker-node-raw error-tracking fixture
ablaszkiewicz Sep 2, 2026
15999c2
feat(apps): add cicd-gitlab-node-raw error-tracking fixture
ablaszkiewicz Sep 2, 2026
0d6d672
feat(apps): add cicd-ssh-vps-node-raw error-tracking fixture
ablaszkiewicz Sep 2, 2026
6e77a01
feat(apps): add cicd-monorepo-pnpm-node-react error-tracking fixture
ablaszkiewicz Sep 2, 2026
9d75b84
feat(apps): add cicd-monorepo-raw-node-react error-tracking fixture
ablaszkiewicz Sep 2, 2026
2072c6d
feat(apps): add cicd-github-actions-docker-node-raw error-tracking fi…
ablaszkiewicz Sep 2, 2026
77582ba
feat(apps): add cicd-github-actions-nested-docker-node-raw error-trac…
ablaszkiewicz Sep 2, 2026
1ed607f
feat(apps): add cicd-github-actions-single-stage-docker-node-raw erro…
ablaszkiewicz Sep 2, 2026
2139c92
fix(apps): stop ignoring .env in the error-tracking fixtures
ablaszkiewicz Sep 2, 2026
e5771df
feat(apps): add next-js error-tracking fixture
ablaszkiewicz Sep 2, 2026
fff2308
feat(apps): add react-router error-tracking fixture
ablaszkiewicz Sep 2, 2026
089f3fc
feat(apps): add vue error-tracking fixture
ablaszkiewicz Sep 2, 2026
b0ff218
feat(apps): add angular error-tracking fixture
ablaszkiewicz Sep 2, 2026
da792aa
feat(apps): add nuxt error-tracking fixture
ablaszkiewicz Sep 2, 2026
6a3a392
feat(apps): add sveltekit error-tracking fixture
ablaszkiewicz Sep 2, 2026
9ee709e
feat(apps): add astro error-tracking fixture
ablaszkiewicz Sep 2, 2026
487d790
feat(apps): add javascript-web error-tracking fixture
ablaszkiewicz Sep 2, 2026
744cba9
feat(apps): add javascript-node error-tracking fixture
ablaszkiewicz Sep 2, 2026
94a953d
feat(apps): add django error-tracking fixture
ablaszkiewicz Sep 2, 2026
cfcbef3
refactor(apps): prefix the PostHog-less error-tracking fixtures with …
ablaszkiewicz Sep 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions apps/error-tracking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Error tracking test apps

Fixtures for `wizard error-tracking`. On every supported app the run is expected to:

- install and initialize the PostHog SDK first when the app doesn't have it (the flow's seed queues install/init like `wizard replay-vision` does)
- wire up exception capture through the SDK's own mechanism (autocapture at init, the framework's error handler, or an error boundary at the app entry) — in one place, never sprinkled manual capture calls
- on platforms that ship minified bundles or stripped binaries, wire source-map / debug-symbol upload into the production build, credentials and CI included
- write the run report to `./posthog-error-tracking-report.md`

Each app's README lists only what is specific to it.
7 changes: 7 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
*.log
.DS_Store
.env
.git
.github
4 changes: 4 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
*.log
.DS_Store
30 changes: 30 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# syntax=docker/dockerfile:1

# ---- Build stage ----
# Compiles the TypeScript app into dist/. The image is built and run by hand
# (`docker build` / `docker run`) — this project has no CI pipeline.
FROM node:22-slim AS build
WORKDIR /app

# Install all dependencies (including dev deps such as typescript) using the lockfile.
COPY package.json package-lock.json ./
RUN npm ci

# Compile src/ -> dist/
COPY tsconfig.json ./
COPY src ./src
RUN npm run build

# ---- Runtime stage ----
# Ships only production dependencies and the compiled output.
FROM node:22-slim AS runtime
ENV NODE_ENV=production
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci --omit=dev

COPY --from=build /app/dist ./dist

# POSTHOG_KEY / POSTHOG_HOST are provided at runtime (e.g. `docker run -e ...`).
CMD ["node", "dist/index.js"]
85 changes: 85 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "cicd-docker-node-raw",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "tsc",
"start": "node --env-file=.env dist/index.js"
},
"dependencies": {
"posthog-node": "^5.35.4"
},
"devDependencies": {
"@types/node": "^26.0.0",
"typescript": "^5.7.2"
}
}
10 changes: 10 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PostHog } from 'posthog-node'

const client = new PostHog(process.env.POSTHOG_KEY ?? '', {
host: process.env.POSTHOG_HOST,
})

client.capture({ distinctId: 'node-raw', event: 'hello' })


await client.shutdown()
12 changes: 12 additions & 0 deletions apps/error-tracking/cicd-docker-node-raw/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"skipLibCheck": true
},
"include": ["src"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
*.log
.DS_Store
.env
.git
.github
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Deploy

# Deploy pipeline: build a Docker image, push it to GHCR, then SSH into the
# target server and run the freshly built image.

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
image: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
name: Deploy to server over SSH
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment: production
steps:
- name: SSH into server and run the new image
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
envs: REGISTRY,IMAGE_NAME,GITHUB_SHA
script: |
set -euo pipefail
IMAGE="${REGISTRY}/${IMAGE_NAME}:sha-${GITHUB_SHA}"

echo "${{ secrets.GHCR_TOKEN }}" | docker login "${REGISTRY}" -u "${{ secrets.GHCR_USER }}" --password-stdin
docker pull "${IMAGE}"

# Replace the running container with the freshly built image.
docker rm -f node-raw-app 2>/dev/null || true
docker run -d \
--name node-raw-app \
--restart unless-stopped \
-e POSTHOG_KEY="${{ secrets.POSTHOG_KEY }}" \
-e POSTHOG_HOST="${{ secrets.POSTHOG_HOST }}" \
"${IMAGE}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
*.log
.DS_Store
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# syntax=docker/dockerfile:1

# ---- Build stage ----
# Compiles the TypeScript app into dist/.
FROM node:22-slim AS build
WORKDIR /app

# Install all dependencies (including dev deps such as typescript) using the lockfile.
COPY package.json package-lock.json ./
RUN npm ci

# Compile src/ -> dist/
COPY tsconfig.json ./
COPY src ./src
RUN npm run build

# ---- Runtime stage ----
# Ships only production dependencies and the compiled output.
FROM node:22-slim AS runtime
ENV NODE_ENV=production
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci --omit=dev

COPY --from=build /app/dist ./dist

# POSTHOG_KEY / POSTHOG_HOST are provided at runtime (e.g. `docker run -e ...`).
CMD ["node", "dist/index.js"]
Loading
Loading