Repository navigation
Remove inline MIME runtime compatibility - #854
Conversation
π WalkthroughWalkthroughEmail raw-MIME handling now stores and reads content through deterministic R2 keys, updates deletion and retention cleanup to delete those keys before D1 rows, excludes transitional cleanup-queue data from runtime account coverage, and removes the offload maintenance endpoint and deployment sweep. ChangesRaw-MIME storage contract
Deletion and retention cleanup
Offload maintenance removal
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant InboundEmail
participant insertEmailMessage
participant EMAIL_BLOBS
participant APP_DB
participant loadRawMime
InboundEmail->>insertEmailMessage: parse and store raw MIME
insertEmailMessage->>EMAIL_BLOBS: write deterministic object
insertEmailMessage->>APP_DB: store raw_mime_key
loadRawMime->>EMAIL_BLOBS: read by raw_mime_key
EMAIL_BLOBS-->>loadRawMime: return raw MIME
Possibly related PRs
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b75dcac to
0eb3a8b
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and canβt be posted inline due to platform limitations.
β οΈ Outside diff range comments (1)
.github/workflows/deploy.yml (1)
269-269: ποΈ Data Integrity & Integration | π Major | ποΈ Heavy liftGate deployment on the required raw-MIME transition verification.
The PR requires production confirmation that
remainingInline=0,remainingBlockedInline=0, andremainingBlobCleanup=0, but this workflow removes the maintenance step without adding any equivalent pre-deploy check. Deploying first can leave legacy MIME unreadable and cleanup-queue rows outside deletion/export coverage. Add a pre-deploy D1 verification gate or an auditable required release step before this removal ships.π€ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/deploy.yml at line 269, Update the production deployment workflow around βπ§ͺ Execute smoke check (production)β to add an auditable pre-deploy D1 verification gate before deployment proceeds. The gate must confirm remainingInline=0, remainingBlockedInline=0, and remainingBlobCleanup=0, and fail or block the deployment when any value is nonzero; preserve the existing smoke-check flow after successful verification.
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/deploy.yml:
- Line 269: Update the production deployment workflow around βπ§ͺ Execute smoke
check (production)β to add an auditable pre-deploy D1 verification gate before
deployment proceeds. The gate must confirm remainingInline=0,
remainingBlockedInline=0, and remainingBlobCleanup=0, and fail or block the
deployment when any value is nonzero; preserve the existing smoke-check flow
after successful verification.
βΉοΈ Review info
βοΈ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b22cc030-d27a-454b-99ed-0a401ba932bc
π Files selected for processing (26)
.github/workflows/deploy.ymldocs/contributing/architecture/data-storage.mdpackages/worker/src/app/account-data-targets.tspackages/worker/src/app/account-deletion.node.test.tspackages/worker/src/app/account-deletion.tspackages/worker/src/app/account-export.node.test.tspackages/worker/src/app/admin-system-email-data.tspackages/worker/src/app/retention.node.test.tspackages/worker/src/app/retention.tspackages/worker/src/email-raw-mime-offload-maintenance.node.test.tspackages/worker/src/email-raw-mime-offload-maintenance.tspackages/worker/src/email-raw-mime-offload-races.node.test.tspackages/worker/src/email/inbound.tspackages/worker/src/email/inbound.workers.test.tspackages/worker/src/email/outbound.workers.test.tspackages/worker/src/email/parser.tspackages/worker/src/email/raw-mime-key.node.test.tspackages/worker/src/email/repo.tspackages/worker/src/email/system-email.tspackages/worker/src/email/test-schema.tspackages/worker/src/email/types.tspackages/worker/src/index.tspackages/worker/src/mcp/capabilities/admin/admin-capabilities.node.test.tspackages/worker/src/security/public-route-hardening.workers.test.tspackages/worker/src/storage-runner.workers.test.tspackages/worker/src/test-support/email-raw-mime-offload-fixtures.ts
π€ Files with no reviewable changes (9)
- packages/worker/src/email-raw-mime-offload-maintenance.node.test.ts
- packages/worker/src/email-raw-mime-offload-races.node.test.ts
- packages/worker/src/index.ts
- packages/worker/src/email/types.ts
- packages/worker/src/email-raw-mime-offload-maintenance.ts
- packages/worker/src/app/admin-system-email-data.ts
- packages/worker/src/security/public-route-hardening.workers.test.ts
- packages/worker/src/test-support/email-raw-mime-offload-fixtures.ts
- packages/worker/src/app/account-data-targets.ts
|
π Preview deployed: https://kody-pr-854.kody-a99.workers.dev Worker: Mocks:
|
Summary
raw_mime_keyonlyRollout
Production after required-R2 writes reported
remainingInline=0,remainingBlockedInline=0, andremainingBlobCleanup=0. This is the code-first half of expand/contract; no schema migration is included.Validation
System recap β extends existing primitives (medium risk)
Mode: recap Β· Base:
main@a25adea9Β· Head:b75dcac5Classification: extends β removes runtime dependence on transitional MIME schema while retaining physical compatibility for one release.
Invariants
Summary by CodeRabbit
New Features
Bug Fixes
Chores