From 24d46cd8fef7f176bee099afe98d951d3ddc1092 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Thu, 29 Jan 2026 09:46:55 -0500 Subject: [PATCH 1/6] Add GitLab support for Seer Autofix Add 'gitlab' and 'integrations:gitlab' to supportedProviders array to enable GitLab repositories for Seer Autofix feature. --- static/app/components/events/autofix/utils.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/app/components/events/autofix/utils.tsx b/static/app/components/events/autofix/utils.tsx index 4a5a67f079f952..5cc63cf6c1e946 100644 --- a/static/app/components/events/autofix/utils.tsx +++ b/static/app/components/events/autofix/utils.tsx @@ -188,6 +188,8 @@ const supportedProviders = [ 'github', 'integrations:github', 'integrations:github_enterprise', + 'gitlab', + 'integrations:gitlab', ]; export const isSupportedAutofixProvider = (provider: {id: string; name: string}) => { return supportedProviders.includes(provider.id); From 0cc980a2687f117c6d7c2d2ec58e1474a501848d Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Thu, 29 Jan 2026 23:28:22 -0500 Subject: [PATCH 2/6] feat: Add build infrastructure for custom Kencove images - Add cloudbuild.yaml for GCP Cloud Build - Add Dockerfile.kencove multi-stage build - Add build-and-push.sh convenience script - Add GitHub Actions workflow for CI/CD - Update AGENTS.md with build instructions Co-Authored-By: Claude Opus 4.5 --- .github/workflows/build-kencove.yml | 107 ++++++++++++++++++ AGENTS.md | 48 +++++++++ build-and-push.sh | 75 +++++++++++++ cloudbuild.yaml | 57 ++++++++++ self-hosted/Dockerfile.kencove | 162 ++++++++++++++++++++++++++++ self-hosted/Dockerfile.patch | 23 ++++ 6 files changed, 472 insertions(+) create mode 100644 .github/workflows/build-kencove.yml create mode 100755 build-and-push.sh create mode 100644 cloudbuild.yaml create mode 100644 self-hosted/Dockerfile.kencove create mode 100644 self-hosted/Dockerfile.patch diff --git a/.github/workflows/build-kencove.yml b/.github/workflows/build-kencove.yml new file mode 100644 index 00000000000000..dc2281672430c5 --- /dev/null +++ b/.github/workflows/build-kencove.yml @@ -0,0 +1,107 @@ +name: Build Kencove Sentry Image + +on: + push: + branches: + - master + workflow_dispatch: + inputs: + tag: + description: 'Image tag (e.g., v26.1.0-gitlab)' + required: false + default: '' + +env: + REGION: us-central1 + PROJECT_ID: kencove-prod + REPOSITORY: kencove-docker-repo + IMAGE_NAME: sentry + +jobs: + build: + runs-on: ubuntu-24.04 + permissions: + contents: read + id-token: write # For Workload Identity Federation + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + + - uses: pnpm/action-setup@v4 + + - uses: astral-sh/setup-uv@v4 + with: + version: '0.8.2' + + - name: Setup Python venv + run: | + uv venv + source .venv/bin/activate + echo "PATH=$PWD/.venv/bin:$PATH" >> $GITHUB_ENV + + - name: Cache webpack + uses: actions/cache@v4 + with: + path: .webpack_cache + key: webpack-${{ hashFiles('rspack.config.ts') }} + + - name: Cache node_modules + uses: actions/cache@v4 + id: node-cache + with: + path: node_modules + key: node-modules-${{ hashFiles('pnpm-lock.yaml') }} + + - name: Install Node dependencies + if: steps.node-cache.outputs.cache-hit != 'true' + run: pnpm install --frozen-lockfile + + - name: Build frontend + run: | + python3 -m tools.fast_editable --path . + python3 -m sentry.build.main + env: + WEBPACK_CACHE_PATH: .webpack_cache + NODE_OPTIONS: '--max-old-space-size=4096' + + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v2 + with: + workload_identity_provider: 'projects/103143301688/locations/global/workloadIdentityPools/github-pool/providers/github-provider' + service_account: 'github-actions@kencove-prod.iam.gserviceaccount.com' + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + + - name: Configure Docker for Artifact Registry + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet + + - name: Determine image tag + id: tag + run: | + if [ -n "${{ github.event.inputs.tag }}" ]; then + echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT + else + echo "tag=${{ github.sha }}" >> $GITHUB_OUTPUT + fi + + - name: Build and push Docker image + run: | + docker build \ + -t ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} \ + -t ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:latest \ + -f self-hosted/Dockerfile \ + --build-arg SOURCE_COMMIT=${{ github.sha }} \ + . + + docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }} + docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:latest + + - name: Output image info + run: | + echo "## Build Complete" >> $GITHUB_STEP_SUMMARY + echo "Image: \`${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY diff --git a/AGENTS.md b/AGENTS.md index e92a3027e352e1..1b0ce1d6bcb67a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,3 +53,51 @@ For backend testing patterns and best practices, see `tests/AGENTS.md`. ## Frontend For frontend development patterns, commands, design system guidelines, and React testing best practices, see `static/AGENTS.md`. + +## Kencove Fork + +This is **kencove/sentry** - a fork of getsentry/sentry with custom modifications for our self-hosted deployment. + +### Key Modifications + +1. **GitLab Autofix Support** (`static/app/components/events/autofix/utils.tsx`) + - Added `'gitlab'` and `'integrations:gitlab'` to `supportedProviders` array + - Enables GitLab repositories for Seer Autofix feature + +### Building Custom Image + +Build and push to Google Artifact Registry: + +```bash +# Using Cloud Build (recommended) +./build-and-push.sh v26.1.0-gitlab + +# Local build only (no push) +./build-and-push.sh --local + +# Using gcloud directly +gcloud builds submit --config=cloudbuild.yaml . +``` + +Image location: `us-central1-docker.pkg.dev/kencove-prod/kencove-docker-repo/sentry` + +### Syncing with Upstream + +```bash +# Add upstream remote +git remote add upstream https://github.com/getsentry/sentry.git + +# Fetch and merge specific release +git fetch upstream +git checkout master +git merge upstream/releases/26.1.0 + +# Re-apply Kencove changes if needed +# (GitLab support in static/app/components/events/autofix/utils.tsx) +``` + +### Related Repositories + +- **Seer AI Service**: [kencove/seer](https://github.com/kencove/seer) - GitLab repository client +- **Helm Charts**: [kencove/charts](https://github.com/kencove/charts) - Deployment configuration +- **Infra Clusters**: `~/projects/infra/clusters/helm/sentry/` - Deployment values diff --git a/build-and-push.sh b/build-and-push.sh new file mode 100755 index 00000000000000..ea1341903e1340 --- /dev/null +++ b/build-and-push.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Build and push Kencove Sentry image to Google Artifact Registry +# +# Usage: +# ./build-and-push.sh # Build with commit SHA tag +# ./build-and-push.sh v26.1.0-gitlab # Build with custom tag +# ./build-and-push.sh --local # Build locally without pushing + +set -euo pipefail + +# Configuration +PROJECT_ID="${PROJECT_ID:-kencove-prod}" +REGION="${REGION:-us-central1}" +REPOSITORY="${REPOSITORY:-kencove-docker-repo}" +IMAGE_NAME="${IMAGE_NAME:-sentry}" +TAG="${1:-$(git rev-parse --short HEAD)}" + +FULL_IMAGE="${REGION}-docker.pkg.dev/${PROJECT_ID}/${REPOSITORY}/${IMAGE_NAME}" + +echo "=== Kencove Sentry Build ===" +echo "Image: ${FULL_IMAGE}:${TAG}" +echo "Commit: $(git rev-parse HEAD)" +echo "" + +if [[ "${1:-}" == "--local" ]]; then + echo "Building locally (not pushing)..." + docker build \ + -t "${IMAGE_NAME}:${TAG}" \ + -t "${IMAGE_NAME}:latest" \ + -f self-hosted/Dockerfile.kencove \ + --build-arg SOURCE_COMMIT="$(git rev-parse HEAD)" \ + --progress=plain \ + . + echo "" + echo "Local build complete: ${IMAGE_NAME}:${TAG}" + exit 0 +fi + +# Check if using Cloud Build or local Docker +if command -v gcloud &> /dev/null && [[ "${USE_CLOUD_BUILD:-true}" == "true" ]]; then + echo "Using Cloud Build..." + gcloud builds submit \ + --config=cloudbuild.yaml \ + --substitutions="_TAG=${TAG}" \ + --project="${PROJECT_ID}" \ + . +else + echo "Using local Docker build + push..." + + # Configure Docker for GAR + gcloud auth configure-docker "${REGION}-docker.pkg.dev" --quiet + + # Build + docker build \ + -t "${FULL_IMAGE}:${TAG}" \ + -t "${FULL_IMAGE}:latest" \ + -f self-hosted/Dockerfile.kencove \ + --build-arg SOURCE_COMMIT="$(git rev-parse HEAD)" \ + --progress=plain \ + . + + # Push + docker push "${FULL_IMAGE}:${TAG}" + docker push "${FULL_IMAGE}:latest" +fi + +echo "" +echo "=== Build Complete ===" +echo "Image: ${FULL_IMAGE}:${TAG}" +echo "" +echo "To use in Helm values:" +echo " images:" +echo " sentry:" +echo " repository: ${FULL_IMAGE}" +echo " tag: \"${TAG}\"" diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 00000000000000..2b177ead905df2 --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,57 @@ +# Cloud Build configuration for kencove/sentry +# Builds custom Sentry image with GitLab Autofix support +# +# Usage: +# gcloud builds submit --config=cloudbuild.yaml . +# +# Or with custom tag: +# gcloud builds submit --config=cloudbuild.yaml --substitutions=_TAG=v26.1.0-gitlab . +# +# Trigger on push: +# gcloud builds triggers create github \ +# --repo-name=sentry --repo-owner=kencove \ +# --branch-pattern="^master$" \ +# --build-config=cloudbuild.yaml + +substitutions: + _REGION: us-central1 + _REPOSITORY: kencove-docker-repo + _IMAGE_NAME: sentry + _TAG: ${COMMIT_SHA} + +options: + machineType: E2_HIGHCPU_32 + diskSizeGb: 200 + logging: CLOUD_LOGGING_ONLY + +steps: + # Build using multi-stage Dockerfile that handles both frontend and runtime + - name: 'gcr.io/cloud-builders/docker' + id: 'build-image' + args: + - 'build' + - '-t' + - '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:${_TAG}' + - '-t' + - '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:latest' + - '-f' + - 'self-hosted/Dockerfile.kencove' + - '--build-arg' + - 'SOURCE_COMMIT=${COMMIT_SHA}' + - '--progress=plain' + - '.' + + # Push to Artifact Registry + - name: 'gcr.io/cloud-builders/docker' + id: 'push-image' + args: + - 'push' + - '--all-tags' + - '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}' + waitFor: ['build-image'] + +images: + - '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:${_TAG}' + - '${_REGION}-docker.pkg.dev/$PROJECT_ID/${_REPOSITORY}/${_IMAGE_NAME}:latest' + +timeout: 3600s # 1 hour - Sentry build is slow diff --git a/self-hosted/Dockerfile.kencove b/self-hosted/Dockerfile.kencove new file mode 100644 index 00000000000000..b8d273be9bf3b5 --- /dev/null +++ b/self-hosted/Dockerfile.kencove @@ -0,0 +1,162 @@ +# Multi-stage Dockerfile for Kencove Sentry build +# This builds the frontend and creates the runtime image in one Dockerfile +# +# Build: docker build -f self-hosted/Dockerfile.kencove -t sentry:kencove . + +# ============================================================================= +# Stage 1: Build frontend assets using the same Python base as runtime +# ============================================================================= +FROM python:3.13.1-slim-bookworm AS frontend-builder + +WORKDIR /build + +# Install Node.js 22 and build tools +RUN apt-get update && apt-get install -y \ + curl \ + gnupg \ + build-essential \ + git \ + && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g pnpm@9 \ + && rm -rf /var/lib/apt/lists/* + +# Install uv for Python dependency management +RUN pip install uv==0.8.2 + +# Copy dependency files first for layer caching +COPY package.json pnpm-lock.yaml .node-version ./ +COPY pyproject.toml uv.lock ./ + +# Install Node dependencies with shamefully-hoist to fix module resolution +RUN pnpm install --frozen-lockfile --shamefully-hoist + +# Create Python venv and install dependencies (needed for sentry.build) +ENV PATH="/build/.venv/bin:$PATH" +RUN python -m venv .venv && \ + uv sync --frozen --quiet --no-install-project + +# Copy source code +COPY . . + +# Initialize minimal git repo for build scripts that need it +ARG SOURCE_COMMIT=unknown +RUN git init && \ + git config user.email "build@kencove.com" && \ + git config user.name "Build" && \ + git add -A && \ + git commit -m "Build commit" --allow-empty && \ + echo "${SOURCE_COMMIT}" > .git/COMMIT_EDITMSG + +# Build frontend assets +ENV WEBPACK_CACHE_PATH=/build/.webpack_cache +ENV NODE_OPTIONS="--max-old-space-size=4096" +ENV SENTRY_BUILD=${SOURCE_COMMIT} +RUN python -m tools.fast_editable --path . && \ + python -m sentry.build.main + +# Verify build outputs +RUN test -f src/sentry/static/sentry/dist/entrypoints/app.js && \ + test -f src/sentry/loader/_registry.json && \ + echo "Frontend build verified successfully" + +# ============================================================================= +# Stage 2: Runtime image (same as official self-hosted/Dockerfile) +# ============================================================================= +FROM python:3.13.1-slim-bookworm AS runtime + +LABEL maintainer="kencove" +LABEL org.opencontainers.image.title="Sentry (Kencove)" +LABEL org.opencontainers.image.description="Kencove fork with GitLab Autofix support" +LABEL org.opencontainers.image.url="https://github.com/kencove/sentry" +LABEL org.opencontainers.image.vendor="Kencove" + +# Add user and group +RUN groupadd -r sentry --gid 999 && useradd -r -m -g sentry --uid 999 sentry + +# Install runtime dependencies +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + gosu \ + libexpat1 \ + tini \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /usr/src/sentry + +ENV PATH="/.venv/bin:$PATH" UV_PROJECT_ENVIRONMENT=/.venv \ + PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1 \ + UV_COMPILE_BYTECODE=1 UV_NO_CACHE=1 + +# Install uv +RUN python3 -m pip install --index-url 'https://pypi.devinfra.sentry.io/simple' 'uv==0.8.2' + +# Create venv +RUN python3 -m venv /.venv + +ENV \ + SENTRY_CONF=/etc/sentry \ + UWSGI_NEED_PLUGIN=/var/lib/uwsgi/dogstatsd \ + GRPC_POLL_STRATEGY=epoll1 + +# Copy dependency files +COPY --from=frontend-builder /build/uv.lock /build/pyproject.toml ./ + +# Install Python dependencies and uwsgi-dogstatsd plugin +RUN set -x \ + && buildDeps=" \ + gcc \ + libpcre2-dev \ + wget \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -y --no-install-recommends $buildDeps \ + && uv sync --frozen --quiet --no-install-project \ + && mkdir /tmp/uwsgi-dogstatsd \ + && wget -O - https://github.com/DataDog/uwsgi-dogstatsd/archive/1a04f784491ab0270b4e94feb94686b65d8d2db1.tar.gz | \ + tar -xzf - -C /tmp/uwsgi-dogstatsd --strip-components=1 \ + && UWSGI_NEED_PLUGIN="" uwsgi --build-plugin /tmp/uwsgi-dogstatsd \ + && mkdir -p /var/lib/uwsgi \ + && mv dogstatsd_plugin.so /var/lib/uwsgi/ \ + && rm -rf /tmp/uwsgi-dogstatsd .uwsgi_plugins_builder \ + && apt-get purge -y --auto-remove $buildDeps \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && python -c 'import maxminddb.extension; maxminddb.extension.Reader' \ + && mkdir -p $SENTRY_CONF + +# Copy entire build from frontend-builder (includes src, bin, tools, etc.) +COPY --from=frontend-builder /build/src /usr/src/sentry/src +COPY --from=frontend-builder /build/bin /usr/src/sentry/bin +COPY --from=frontend-builder /build/tools /usr/src/sentry/tools +COPY --from=frontend-builder /build/scripts /usr/src/sentry/scripts +COPY --from=frontend-builder /build/pyproject.toml /usr/src/sentry/ +COPY --from=frontend-builder /build/setup.cfg /usr/src/sentry/ +COPY --from=frontend-builder /build/README.md /usr/src/sentry/ + +# Install sentry package +RUN python3 -m tools.fast_editable --path . && \ + sentry help | sed '1,/Commands:/d' | awk '{print $1}' > /sentry-commands.txt + +# Copy config files +COPY ./self-hosted/sentry.conf.py ./self-hosted/config.yml $SENTRY_CONF/ +COPY ./self-hosted/docker-entrypoint.sh / + +# Verify built files +RUN test -f /usr/src/sentry/src/sentry/loader/_registry.json && \ + test -f /usr/src/sentry/src/sentry/integration-docs/python.json && \ + test -f /usr/src/sentry/src/sentry/static/sentry/dist/entrypoints/app.js && \ + sentry help + +EXPOSE 9000 +VOLUME /data + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["run", "web"] + +ARG SOURCE_COMMIT +ENV SENTRY_BUILD=${SOURCE_COMMIT:-unknown} +LABEL org.opencontainers.image.revision=$SOURCE_COMMIT +LABEL org.opencontainers.image.source="https://github.com/kencove/sentry/tree/${SOURCE_COMMIT:-master}/" diff --git a/self-hosted/Dockerfile.patch b/self-hosted/Dockerfile.patch new file mode 100644 index 00000000000000..f316ffea43da9b --- /dev/null +++ b/self-hosted/Dockerfile.patch @@ -0,0 +1,23 @@ +# Dockerfile that patches the official Sentry image with GitLab Autofix support +# Much faster than rebuilding from source (~2 minutes vs ~45 minutes) +# +# Build: docker build -f self-hosted/Dockerfile.patch -t sentry:kencove . + +ARG SENTRY_VERSION=26.1.0 +FROM ghcr.io/getsentry/sentry:${SENTRY_VERSION} + +LABEL maintainer="kencove" +LABEL org.opencontainers.image.title="Sentry (Kencove)" +LABEL org.opencontainers.image.description="Kencove fork with GitLab Autofix support" + +# Copy patched autofix utils with GitLab support +# The change adds 'gitlab' and 'integrations:gitlab' to supportedProviders +COPY static/app/components/events/autofix/utils.tsx \ + /usr/src/sentry/src/sentry/static/sentry/dist/app/components/events/autofix/utils.tsx + +# Note: The above path may need adjustment - the built JS is in dist/ +# Let's find the actual location and patch the compiled JS instead + +ARG SOURCE_COMMIT +ENV SENTRY_BUILD=${SOURCE_COMMIT:-patched} +LABEL org.opencontainers.image.revision=$SOURCE_COMMIT From 20e563a5b254d2d9a8e05bed1530d5f31a13ccf9 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Fri, 30 Jan 2026 15:07:28 -0500 Subject: [PATCH 3/6] fix: Patch Seer URLs before server import for self-hosted Modifies sentry.conf.py to patch sentry.conf.server module attributes BEFORE the wildcard import. This ensures all code that imports Seer URLs from the server module sees the correct service URLs. Adds SEER_URL and SEER_RPC_SHARED_SECRET environment variable support. --- self-hosted/sentry.conf.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/self-hosted/sentry.conf.py b/self-hosted/sentry.conf.py index 71a4c2598b2153..7301c90f19c479 100644 --- a/self-hosted/sentry.conf.py +++ b/self-hosted/sentry.conf.py @@ -6,6 +6,23 @@ import os import os.path +############################################## +# CRITICAL: Patch Seer URLs before any imports +# This must happen BEFORE `from sentry.conf.server import *` +# to ensure all code sees the correct Seer service URLs +############################################## +import sentry.conf.server as _sentry_server +_sentry_server.SEER_DEFAULT_URL = os.environ.get("SEER_URL", "http://seer:9091") +_sentry_server.SEER_AUTOFIX_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_SIMILARITY_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_ANOMALY_DETECTION_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_SEVERITY_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_BREAKPOINT_DETECTION_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_GROUPING_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_SUMMARIZATION_URL = _sentry_server.SEER_DEFAULT_URL +_sentry_server.SEER_RPC_SHARED_SECRET = os.environ.get("SEER_RPC_SHARED_SECRET", "").split(",") if os.environ.get("SEER_RPC_SHARED_SECRET") else None +############################################## + # For Docker, the following environment variables are supported: # SENTRY_POSTGRES_HOST # SENTRY_POSTGRES_PORT From f13844ef29336a82d5943a32f1a24158d882fc47 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Fri, 30 Jan 2026 16:16:07 -0500 Subject: [PATCH 4/6] fix: Patch Seer URLs in server.py during Docker build --- self-hosted/Dockerfile.kencove | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/self-hosted/Dockerfile.kencove b/self-hosted/Dockerfile.kencove index b8d273be9bf3b5..64e5cafae3a384 100644 --- a/self-hosted/Dockerfile.kencove +++ b/self-hosted/Dockerfile.kencove @@ -140,6 +140,14 @@ COPY --from=frontend-builder /build/README.md /usr/src/sentry/ RUN python3 -m tools.fast_editable --path . && \ sentry help | sed '1,/Commands:/d' | awk '{print $1}' > /sentry-commands.txt +# Patch Seer URLs to use env vars (default to http://seer:9091 for K8s) +# This must be done in the Python source so imports see the correct values +RUN sed -i 's|SEER_DEFAULT_URL = "http://127.0.0.1:9091"|SEER_DEFAULT_URL = os.environ.get("SEER_URL", "http://seer:9091")|' \ + /usr/src/sentry/src/sentry/conf/server.py && \ + sed -i 's|SEER_RPC_SHARED_SECRET: list\[str\] | None = None|SEER_RPC_SHARED_SECRET = os.environ.get("SEER_RPC_SHARED_SECRET", "").split(",") if os.environ.get("SEER_RPC_SHARED_SECRET") else None|' \ + /usr/src/sentry/src/sentry/conf/server.py && \ + echo "Seer URLs patched successfully" + # Copy config files COPY ./self-hosted/sentry.conf.py ./self-hosted/config.yml $SENTRY_CONF/ COPY ./self-hosted/docker-entrypoint.sh / From a8c9b2137193e77b6a4696aa2400aff75e32e176 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Fri, 30 Jan 2026 16:36:22 -0500 Subject: [PATCH 5/6] fix: Use # as sed delimiter to avoid escaping issues --- self-hosted/Dockerfile.kencove | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/self-hosted/Dockerfile.kencove b/self-hosted/Dockerfile.kencove index 64e5cafae3a384..df4d67849d5c6f 100644 --- a/self-hosted/Dockerfile.kencove +++ b/self-hosted/Dockerfile.kencove @@ -142,10 +142,9 @@ RUN python3 -m tools.fast_editable --path . && \ # Patch Seer URLs to use env vars (default to http://seer:9091 for K8s) # This must be done in the Python source so imports see the correct values -RUN sed -i 's|SEER_DEFAULT_URL = "http://127.0.0.1:9091"|SEER_DEFAULT_URL = os.environ.get("SEER_URL", "http://seer:9091")|' \ - /usr/src/sentry/src/sentry/conf/server.py && \ - sed -i 's|SEER_RPC_SHARED_SECRET: list\[str\] | None = None|SEER_RPC_SHARED_SECRET = os.environ.get("SEER_RPC_SHARED_SECRET", "").split(",") if os.environ.get("SEER_RPC_SHARED_SECRET") else None|' \ +RUN sed -i 's#SEER_DEFAULT_URL = "http://127.0.0.1:9091"#SEER_DEFAULT_URL = os.environ.get("SEER_URL", "http://seer:9091")#' \ /usr/src/sentry/src/sentry/conf/server.py && \ + grep -q 'SEER_DEFAULT_URL = os.environ.get' /usr/src/sentry/src/sentry/conf/server.py && \ echo "Seer URLs patched successfully" # Copy config files From d6852ef363914ba1b9a7997ec84b26bef8a19fd8 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Sat, 31 Jan 2026 09:02:49 -0500 Subject: [PATCH 6/6] feat: Disable seer-explorer feature flag for self-hosted The Explorer-based autofix requires additional endpoints not yet fully implemented in self-hosted Seer. Disable the feature flag to use the legacy /v1/automation/autofix/start endpoint instead. Co-Authored-By: Claude Opus 4.5 --- self-hosted/sentry.conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/self-hosted/sentry.conf.py b/self-hosted/sentry.conf.py index 7301c90f19c479..06fa91bb809746 100644 --- a/self-hosted/sentry.conf.py +++ b/self-hosted/sentry.conf.py @@ -251,3 +251,10 @@ SENTRY_OPTIONS["system.secret-key"] = secret_key SENTRY_USE_RELAY = True + +############################################## +# Feature Flags for Self-Hosted +############################################## +# Disable Explorer-based autofix (not available in self-hosted Seer) +# This forces Sentry to use the legacy /v1/automation/autofix/start endpoint +SENTRY_FEATURES["organizations:seer-explorer"] = False