Skip to content

feat(sentry): rebase ledoent fork onto 26.5.0 + drop kencove suffix - #2

Closed
dnplkndll wants to merge 16 commits into
masterfrom
26.5.0-kencove
Closed

dnplkndll wants to merge 16 commits into
masterfrom
26.5.0-kencove

Conversation

@dnplkndll

Copy link
Copy Markdown

What changed

Rebases the ledoent (kencove) Sentry fork from upstream 26.2.0 to 26.5.0 (released 2026-05-18). Produces ghcr.io/ledoent/sentry:26.5.0-kencove.

Patches carried over (11 of 12)

Patch Notes
Add GitLab support for Seer Autofix (utils.tsx) Frontend supportedProviders
Add build infrastructure for custom Kencove images self-hosted/Dockerfile.kencove + scripts
Patch Seer URLs before server import for self-hosted Dockerfile.patch
Patch Seer URLs in server.py during Docker build Dockerfile.patch refinement
Use # as sed delimiter to avoid escaping issues Dockerfile.patch refinement
Disable seer-explorer feature flag for self-hosted sentry.conf.py
fix(ci): Fix Cloud Build workflow cloudbuild.yaml
fix(build): scope gcloudignore patterns to root .gcloudignore
fix(build): remove uwsgi-dogstatsd plugin + uv 0.9.28 self-hosted/Dockerfile.kencove
fix(seer): Make org_id and integration_id optional in preferences serializer Conflict resolved — see below
ci(sentry): add GHCR public build workflow This file builds the image

Conflicts resolved

  1. AGENTS.md — upstream 26.5.0 appended new sections (Feature Flags, Customer Information, Pull Requests). Resolution: keep upstream's additions + append the kencove fork section after them. Updated the fork section to point at ledoent/seer and the new GHCR workflow (was Cloud Build only).
  2. src/sentry/seer/endpoints/project_seer_preferences.py — upstream introduced BaseRepositorySerializer (organization_id + integration_id REQUIRED) and rewrote the POST endpoint with the new ProjectRepository table. The kencove patch defined a from-scratch RepositorySerializer with optional fields + a GitLab-external_id fallback. Resolution: subclass upstream's BaseRepositorySerializer and override only the two fields to be optional (smaller diff, takes advantage of upstream's improvements). Carried forward the GitLab external_id fallback in the POST endpoint logic.

Patches skipped (1 of 12)

Patch Why skipped
feat(cursor): Add GitLab support to Cursor coding agent integration (38e8a76) Upstream 26.5.0 added native GitLab support behind the organizations:seer-gitlab-support feature flag (commit 7a56f7479). The hand-rolled kencove version conflicts heavily with upstream's refactored cursor/client.py (+197 lines: model fallback, verify_api_key split). Follow-up: enable the upstream feature flag in self-hosted/sentry.conf.py instead.

Build

GHCR workflow auto-triggers on push to *-kencove branches. Image: ghcr.io/ledoent/sentry:26.5.0-kencove.

Verification (pre-merge)

docker pull ghcr.io/ledoent/sentry:26.5.0-kencove
docker run --rm --entrypoint sentry ghcr.io/ledoent/sentry:26.5.0-kencove --version
# expect: "sentry, version 26.5.0+<sha>"

Companion PRs:

  • ledoent/seer add stub endpoints for 26.5.0 new API surface (separate)
  • VM-side /opt/sentry/ upgrade (manual, no MR)

Rollback

Keep 26.2.0-kencove branch + image immutable; revert by changing SENTRY_IMAGE env on the VM back to :26.2.0-kencove.

dnplkndll and others added 11 commits May 20, 2026 13:53
Add 'gitlab' and 'integrations:gitlab' to supportedProviders array
to enable GitLab repositories for Seer Autofix feature.
- 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 <noreply@anthropic.com>
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.
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 <noreply@anthropic.com>
…gcloud builds submit

- WIF provider: github-wlif/providers/github-oidc (was nonexistent github-pool/providers/github-provider)
- Service account: github-actions-seer@ (was nonexistent github-actions@)
- Branch trigger: 26.1.0-* (was master, which never has the workflow file)
- Use gcloud builds submit instead of local docker build (Sentry needs E2_HIGHCPU_32 + 200GB)
- Dockerfile: self-hosted/Dockerfile.kencove via cloudbuild.yaml
- Add .gcloudignore to exclude .git, node_modules, tests from source upload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fixtures/ and tests/ glob matched ALL directories named fixtures/tests
throughout the tree, excluding frontend fixture files needed by rspack.
Prefix with / to only match root-level directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Upstream 26.2.0 removed uwsgi from dependencies. Also align uv version
with upstream (0.8.2 → 0.9.28).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ializer

Seer returns repositories without organization_id and integration_id,
but the DRF serializer required them. This caused 400 errors when the
frontend sent back Seer's repo data in preference updates (e.g. setting
Cursor handoff).

Also adds external_id fallback for repo validation since GitLab repos
in Seer have simplified owner/name that differs from the DB format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci(sentry): add GHCR public build workflow

Publishes ledoent fork to ghcr.io/ledoent/sentry (public) so self-hosted
Sentry+Seer deployments can pull without GCP credentials. Builds
self-hosted/Dockerfile.kencove for amd64. Free disk on runner before build
because Sentry's frontend+backend build is large.

Sibling to build-kencove.yml (kept for kencove-prod Cloud Build).

* ci(sentry): concurrency + safer disk-cleanup in GHCR workflow

Address bugbot findings on the GHCR build workflow:

- Add concurrency group keyed on github.ref with cancel-in-progress so
  rapid pushes (or a force-push) don't race two builds into publishing
  the same mutable tag. Saves GHA minutes too.
- Tighten the 'Free disk space' step: per-path existence check via
  [ -e "$path" ] && rm -rf, plus drop the blanket '|| true' so a real
  failure during docker image prune surfaces instead of masking.
- Update the runner-RAM comment: GitHub free ubuntu-latest is 16 GB now
  (post-2024 Larger Hosted Runners refresh), not 7 GB; our first build
  completed in ~12 min on it. Bump to ubuntu-latest-large only if
  webpack starts OOMing.

* style(ci): prettier — single space before inline comment

Sentry's pre-commit prettier hook collapsed a double-space to a single
space before the 'full history' comment on fetch-depth. No semantic
change.
@github-actions

Copy link
Copy Markdown

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Upstream 26.5.0's pnpm-lock.yaml uses pnpm's patchedDependencies for
zod@4.3.5 (the patch file lives at patches/zod@4.3.5.patch). pnpm
install reads the patch contents at lockfile-resolve time, so the
directory has to be on disk before that step.

Was failing in CI with:
  ENOENT: no such file or directory, open '/build/patches/zod@4.3.5.patch'

The 26.2.0 lockfile didn't have patchedDependencies so the old COPY . .
on line 40 (AFTER pnpm install) was sufficient. Adding an explicit
COPY patches/ ./patches/ before the install fixes it cleanly without
breaking layer caching.
@dnplkndll
dnplkndll changed the base branch from 26.2.0-kencove to master May 20, 2026 18:17
dnplkndll added 2 commits May 20, 2026 14:18
Without this workflow ledoent/sentry@master sits frozen at whatever
commit the fork was created from. Every PR from a *-kencove rebase
branch then shows GitHub's 'this branch has conflicts' against master
— even though the kencove patches themselves don't conflict.

The workflow:
  * Runs hourly + on-demand
  * Fast-forwards master to upstream/master when possible (the normal
    case — kencove patches live on *-kencove branches, never on master)
  * Never force-pushes
  * If upstream/master can't be FF'd (means master has diverged),
    writes a warning to the job summary and exits non-zero so a human
    sees it in the Actions tab

Drop-in deployment — no secrets required (GITHUB_TOKEN with
contents:write is auto-provided by the workflow run).

Verified at fork creation time: ledoent/sentry@master is 166 commits
behind getsentry/sentry@master. First run will catch us up.
The ledoent/.github repo has fork-sync-and-digest.yml that already
syncs all forks listed in .github/forks.yml via the merge-upstream
API. Adding ledoent/sentry to that inventory is the right path —
keeps the sync logic in one place and gets the daily digest email
alongside the OCA forks.
@github-actions

github-actions Bot commented May 20, 2026 •

Copy link
Copy Markdown

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.57%

dnplkndll added 2 commits May 20, 2026 14:30
Upstream 26.5.0 pins .node-version=24.14.0 and
packageManager=pnpm@10.30.2. Our Dockerfile was still installing
node@22 + pnpm@9 from the 26.2.0 era. pnpm@9 doesn't recognize the
new lockfile patchedDependencies format and bails out with
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH at frozen install time.

Drop-in version bumps; no other Dockerfile changes needed.
…age frontend build

Three iterations failing on the in-Dockerfile rspack frontend build
(typescript loader resolution after upstream's type-loader.ts work
in 26.5.0). Backing off to a much simpler strategy: layer our small
backend patches on top of the pre-built getsentry/sentry:26.5.0
image that upstream's own CI publishes.

This trades a (now-redundant) frontend customization for build
reliability. The kencove fork's only frontend patch was adding
'gitlab' + 'integrations:gitlab' to supportedProviders — and
upstream 26.5.0 already has both in BASE_SUPPORTED_PROVIDERS
natively, with a feature-flag-gated provider mechanism added on
top. So we lose nothing.

What this image still contains:
  * Patched src/sentry/seer/endpoints/project_seer_preferences.py
    (optional org_id/integration_id + GitLab fallback)
  * SEER_URL sed patch on src/sentry/conf/server.py
  * self-hosted/sentry.conf.py overlay (seer-explorer flag off)

What's dropped:
  * The two-stage frontend-builder + python-runtime build
  * uwsgi-dogstatsd remove (upstream image already handles this)
  * Node + pnpm install (upstream's image has the frontend bundle)
  * sentry.build.main invocation (upstream's image already has dist/)

Dockerfile shrunk from ~170 lines to ~60. Build time goes from
~12 min cold to <30s (just an apt overlay on a pre-built base).
@dnplkndll dnplkndll changed the title feat(sentry): rebase ledoent fork onto upstream 26.5.0 feat(sentry): rebase ledoent fork onto 26.5.0 + drop kencove suffix May 20, 2026
@dnplkndll

Copy link
Copy Markdown
Author

Closed in favor of #3 — same content, but head branch renamed from 26.5.0-kencove → 26.5.0-ledoent to drop the legacy fork branding.

@github-actions

Copy link
Copy Markdown

Backend Test Failures

Failures on 5178b4b in this run:

tests/sentry/seer/endpoints/test_project_seer_preferences.py::ProjectSeerPreferencesEndpointTest::test_post_rejects_mismatched_repo_name_or_owner — log
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/endpoints/test_project_seer_preferences.py:474: in test_post_rejects_mismatched_repo_name_or_owner
    assert response.status_code == 400
E   assert 204 == 400
E    +  where 204 = <Response status_code=204>.status_code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant