Skip to content

Source maps v1 (phase 2): SourceMapArtifact storage + retention - #120

Merged
unjica merged 3 commits into
developfrom
feature/source-maps-phase2
Jul 2, 2026
Merged

unjica merged 3 commits into
developfrom
feature/source-maps-phase2

Conversation

@unjica

@unjica unjica commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Phase 2 of #98 — storage foundation for source map upload and symbolication.

  • SourceMapArtifact Prisma model keyed by (project_id, app, release, bundle_url)
  • Stores map JSON in content (TEXT), optional storage_key for future object store, sha256, size_bytes
  • source-map-artifact.ts — lookup helpers + MAX_SOURCE_MAP_BYTES for phase 3 upload limits
  • Retention sweep — deletes artifacts where uploaded_at exceeds plan retentionDays

Test plan

  • pnpm exec vitest run src/lib/source-map-artifact.test.ts src/jobs/retention.test.ts
  • prisma validate
  • CI build
  • After merge: pnpm --filter api exec prisma migrate deploy

Next

Phase 3 — POST /api/project/source-maps upload API

Made with Cursor

Introduce schema and migration for per-release map JSON, lookup helpers, and nightly retention aligned with plan retentionDays.

Co-authored-by: Cursor <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6591c59. Configure here.

Comment thread apps/api/src/jobs/retention.ts Resolved
unjica and others added 2 commits July 2, 2026 13:31
Delete SourceMapArtifact only when uploaded_at is past the plan cutoff
and no ErrorGroup for the same app/release still has last_seen in window.

Co-authored-by: Cursor <[email protected]>
@unjica
unjica merged commit 1bb147e into develop Jul 2, 2026
3 checks passed
@unjica
unjica deleted the feature/source-maps-phase2 branch July 2, 2026 11:49
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