Skip to content

ci(sentry): add GHCR public build workflow - #1

Merged
dnplkndll merged 3 commits into
26.2.0-kencovefrom
feat/build-push-ghcr
May 18, 2026
Merged

dnplkndll merged 3 commits into
26.2.0-kencovefrom
feat/build-push-ghcr

Conversation

@dnplkndll

@dnplkndll dnplkndll commented May 18, 2026 •

Copy link
Copy Markdown

Summary

Adds .github/workflows/build-push-ghcr.yml — sibling to the existing GCP Cloud Build workflow. Builds self-hosted/Dockerfile.kencove and publishes ghcr.io/ledoent/sentry:26.2.0-kencove (mutable) plus per-commit :26.2.0-kencove-<sha>. Enables self-hosted Sentry+Seer deployments to pull without GCP creds.

Bugbot review applied

  • Added concurrency: block keyed on github.ref with cancel-in-progress — prevents racing pushes from clobbering the mutable tag.
  • Tightened the "Free disk space" step: per-path existence guard instead of blanket || true, so real failures during docker image prune surface.
  • Updated the runner-RAM comment — ubuntu-latest is 16 GB on the free tier now (post-2024 refresh), not 7 GB; our first build completed in ~12 min on it.
  • Disabled 6 upstream-only inherited workflows on this fork (enforce-license-compliance, bump-sentry-in-getsentry, fast-revert, getsentry-dispatcher, meta(deploy), migrations-drift) so PR check noise is signal-only.

Live image

docker pull ghcr.io/ledoent/sentry:26.2.0-kencove — public, anonymous pull works. Currently powering the self-hosted Sentry on sentry-seer-1 at https://sentry.hz.ledoweb.com. See infra MR ledoent/infra!58 for the deploy.

Test plan

  • Workflow completes on push to this branch
  • docker pull ghcr.io/ledoent/sentry:26.2.0-kencove-<sha> succeeds anonymously
  • Image deploys cleanly via getsentry/self-hosted v26.2.0 ./install.sh
  • SEER_URL env override (patched into server.py) reads http://seer:9091 by default

dnplkndll added 3 commits May 18, 2026 11:53
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).
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.
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.
@dnplkndll
dnplkndll merged commit 3de51f1 into 26.2.0-kencove May 18, 2026
36 checks passed
@dnplkndll
dnplkndll deleted the feat/build-push-ghcr branch May 18, 2026 20:36
dnplkndll added a commit that referenced this pull request May 20, 2026
* Add GitLab support for Seer Autofix

Add 'gitlab' and 'integrations:gitlab' to supportedProviders array
to enable GitLab repositories for Seer Autofix feature.

* 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 <noreply@anthropic.com>

* 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.

* fix: Patch Seer URLs in server.py during Docker build

* fix: Use # as sed delimiter to avoid escaping issues

* 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 <noreply@anthropic.com>

* fix(ci): Fix Cloud Build workflow — correct WIF, SA, branch, and use 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>

* fix(build): scope gcloudignore patterns to root directories

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>

* fix(build): remove uwsgi-dogstatsd plugin and upgrade uv to 0.9.28

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>

* fix(seer): Make org_id and integration_id optional in preferences serializer

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 (#1)

* 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.

* fix(build): COPY patches/ before pnpm install for 26.5.0 lockfile

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.

* ci: hourly sync of master from upstream getsentry/sentry

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.

* Revert ci: per-repo sync-upstream — handled at org level

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.

* fix(build): bump node 22 -> 24 and pnpm 9 -> 10 for 26.5.0 lockfile

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.

* fix(build): use upstream getsentry/sentry:26.5.0 as base — drop in-image 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).

* rename: kencove suffix -> ledoent across image tag, branch, Dockerfile

The fork has lived under ledoent/ for some time now; the kencove
branding is legacy. Renames:
  * Image tag suffix: ${VERSION}-kencove -> ${VERSION}-ledoent
  * Branch pattern: *-kencove -> *-ledoent (GHCR workflow trigger)
  * Dockerfile: self-hosted/Dockerfile.kencove -> Dockerfile.ledoent
  * Image labels: 'Sentry (ledoent / kencove fork)' -> 'Sentry (ledoent fork)'

Backwards compat:
  * The ghcr.io/ledoent/sentry:26.2.0-kencove tag remains accessible
    in GHCR (we never delete pushed manifests). Production VM still
    pulls that until we cut over.
  * The legacy build-kencove.yml Cloud Build workflow + kencove-prod
    GAR target keep working — just not the primary path anymore.

Two intentional 'kencove' mentions kept as historical context:
  * Comment in build-push-ghcr.yml about the legacy Cloud Build companion
  * Comment in Dockerfile.ledoent about the obsolete frontend patch

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant