Skip to content

fix(rees): upload Sentry source maps for Railway deploys - #1726

Merged
JSONbored merged 1 commit into
mainfrom
codex/rees-sentry-sourcemaps
Jun 29, 2026
Merged

fix(rees): upload Sentry source maps for Railway deploys#1726
JSONbored merged 1 commit into
mainfrom
codex/rees-sentry-sourcemaps

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • adds optional REES Sentry SDK wiring and Railway-safe release/source-map upload
  • validates REES source maps in build/test paths and removes map files from the running container before serving
  • documents the required Railway variables, Sentry code mapping, release id behavior, and troubleshooting path

What changed

  • REES now resolves releases as gittensory-rees@<RAILWAY_GIT_COMMIT_SHA> unless SENTRY_RELEASE is explicitly set.
  • Startup uploads source maps with the local @sentry/cli, associates commits when Railway commit metadata is present, records a deploy, finalizes the release, then starts dist/server.js.
  • tsconfig emits inline source contents, and validate:sourcemaps checks dist/server.js, dist/server.js.map, sourceMappingURL, original sources, and sourcesContent.
  • CI gets a path-filtered rees job and the root gate gets a self-preparing rees:test script.
  • The focus manifest now includes review-enrichment/ so REES changes are inside the repo's allowed contribution scope.

Why

REES deploys automatically from Railway after merges to main, so release/source-map upload needs to happen against the exact bundle Railway built, without asking contributors to run Sentry commands and without passing Sentry auth through Docker build args.

Validation

  • npm --prefix review-enrichment test
  • node review-enrichment/dist/upload-sourcemaps.js
  • npm run actionlint
  • npm run rees:test
  • npm run typecheck
  • npx vitest run test/unit/gittensory-focus-manifest.test.ts
  • npm run test:ci
  • docker build -f review-enrichment/Dockerfile review-enrichment -t gittensory-rees:sentry-smoke
  • Docker smoke: REES /health returned ok, Sentry upload skipped cleanly without Sentry env, and the running container had no dist/*.map files after startup cleanup.

Notes

  • Required Railway variables for upload are SENTRY_AUTH_TOKEN, SENTRY_ORG, and SENTRY_PROJECT; SENTRY_DSN enables SDK error capture.
  • Sentry code mapping should be Stack Trace Root /app, Source Code Root review-enrichment, Branch main.
  • SENTRY_RELEASE should only be set for custom deployments when that exact release/source-map bundle has been uploaded.

@dosubot dosubot Bot added the size:L label Jun 29, 2026
@loopover-orb

loopover-orb Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review — held for maintainer review

17 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

⏸️ Held for maintainer review — Touches a guarded path — held for manual review

Review summary
This PR adds REES Sentry initialization, runtime source-map injection/upload, source-map validation, Docker startup cleanup, and CI coverage for the standalone service. The main runtime flow is coherent: builds emit inline sources, the container uploads from the built dist directory, then removes map files before serving. I do not see a must-fix correctness break in the provided files, but the uploader test leaves part of the Sentry command sequence weakly covered.

Nits — 6 non-blocking
  • review-enrichment/test/sentry-upload.test.ts:65 only asserts selected CLI calls; it should also assert the set-commits, deploy creation, and finalize calls so the release lifecycle cannot regress silently.
  • review-enrichment/src/upload-sourcemaps.ts:34 duplicates nearly the same source-map validation logic as review-enrichment/scripts/validate-sourcemaps.mjs:14; keeping two validators in sync will be easy to miss.
  • .github/workflows/ci.yml:66 does not include root package.json in the rees path filter even though the rees job executes the root rees:test script, so a future edit to that script could skip the REES-specific CI job.
  • In review-enrichment/test/sentry-upload.test.ts, assert the complete ordered call list rather than only indices 0, 2, and 3.
  • Move the shared source-map validation into a small reusable module or keep one implementation and have the other entry point call it.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels; size label size:L.
Validation evidence ✅ 25/25 PR body includes validation/test evidence.
Open PR queue ❌ 3/10 19 open PR(s), 8 likely reviewable, 11 unlinked.
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 80 PR(s), 280 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 80 PR(s), 280 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Expect slower review.
  • No action.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 29, 2026
@JSONbored
JSONbored force-pushed the codex/rees-sentry-sourcemaps branch from 8c9231d to 34be5f1 Compare June 29, 2026 08:29
@JSONbored
JSONbored force-pushed the codex/rees-sentry-sourcemaps branch from 34be5f1 to f00a079 Compare June 29, 2026 08:35
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.58%. Comparing base (73c021e) to head (f00a079).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1726   +/-   ##
=======================================
  Coverage   95.58%   95.58%           
=======================================
  Files         204      204           
  Lines       22316    22316           
  Branches     8067     8067           
=======================================
  Hits        21331    21331           
  Misses        408      408           
  Partials      577      577           
Files with missing lines Coverage Δ
src/config/gittensory-repo-focus-manifest.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 6cbfd56 into main Jun 29, 2026
20 checks passed
@JSONbored
JSONbored deleted the codex/rees-sentry-sourcemaps branch June 29, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant