Add postcard sending - #8107
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
87a0f5a to
63c1a23
Compare
|
Claude finished @aapeliv's task in 2m 19s —— View job Migration Safety Review
Result: The single migration ( |
Migration ReviewOne of our most common issues is migrations that don't work with existing data in production. This is very hard to catch with CI, so we have this bot to check for potential problems. Overall Risk: SAFE Files Reviewed
FindingsNo issues found.
SummaryThis migration is safe to run against production. Both operations are metadata-only with no data loss risk, correct ordering, and a complete downgrade path. |
|
Claude finished @aapeliv's task in 1m 5s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 2m 21s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 44s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 1m 56s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 2m 50s —— View job Migration Safety Review
Result: The single migration ( |
f72ce96 to
f159b8c
Compare
|
Claude finished @aapeliv's task in 2m 34s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 58s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 2m 57s —— View job Migration Safety Review
Result: Found 1 critical issue. Migration |
| sa.Column("state", sa.String(), nullable=True), | ||
| sa.Column("postal_code", sa.String(), nullable=True), | ||
| sa.Column("country", sa.String(), nullable=False), | ||
| sa.Column("country_code", sa.String(), nullable=False), |
There was a problem hiding this comment.
This migration (0118) has already been applied to production — the postal_verification_attempts table exists with a column named country (confirmed in the current production schema). Changing country → country_code in this file has no effect on production since Alembic won't re-run an already-applied migration.
This means:
- Production will still have the column named
country - The new code referencing
country_codewill break against the production database - The model and migration are now out of sync with the actual production schema
Fix: Create a new migration (e.g., 0142) that renames the column:
op.alter_column("postal_verification_attempts", "country", new_column_name="country_code")And revert this change to 0118 so it matches what was actually applied.
|
Claude finished @aapeliv's task in 2m 49s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 3m 12s —— View job Migration Safety Review
Result: The single migration ( |
|
Claude finished @aapeliv's task in 1m 51s —— View job Migration Safety Review
Result: The single migration ( |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add types-qrcode stubs, fix type annotations for font fallbacks, return types, and QR image handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace programmatic image generation with a static postcard-front.png, remove pillow/qrcode deps, inline API URLs, and let exceptions propagate instead of catching them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix mypy: Image.NEAREST → Image.Resampling.NEAREST - Fix postal verification tests: mock send_postcard to return job_id string - Rewrite postcard service tests: remove classes, use context managers, test through public API instead of internal functions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…line dates - Add couchers/sentry.py with report_error/report_message wrappers - Change mypostcard_job_id from String to Integer throughout - Move get_orders inline import to top-level, accept date objects - Filter known_job_ids to last 2 weeks in orphan check - Remove stale if True block in handler - Report orphaned jobs to Sentry instead of logger.error Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The field stores an ISO 3166-1 alpha-2 code, not a country name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The column rename should be in the latest migration on this PR branch, not in the original table creation migration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Test generates sample front/back postcard images to test_artifacts/ - CI collects and uploads them to the preview S3 bucket - Clean up QR code rendering: use named bounds, extend outward, no white bg - Fix postal verification URL query param Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ache resources - Compute QR box coordinates inline (227+312=539, 419+312=731) - Hardcode font size to 58 instead of iterating from 100 - Move QR URL generation into _generate_back_left_side - Remove qr_code_url parameter from send_postcard and _generate_back_left_side - Add @functools.cache to postcard resource functions - Remove unused get_postcard_logo - Inline front_page, back_left_side, auth_token variables Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ser instead of LiteUser - Rename PostalAddress.country to country_code in proto definition - Update all Python references to use the new field name - Switch ListPostcards query from LiteUser to User join Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bdc5959 to
1abcc8d
Compare
|
Claude finished @aapeliv's task in 1m 39s —— View job Migration Safety Review
Result: The single migration ( |
📝 Release NotesThis PR should be included in the release notes. Suggested release note: 🤖 Bot Debug InformationModel: |
Describe briefly what this PR is doing and why.
Testing
Explain how you tested this PR and give clear steps so the reviewer can replicate.
Backend checklist
developif necessary for linear migration historyWeb frontend checklist
For maintainers