Skip to content

Prepare refactor backend promotion to production with verified data preservation - #343

Merged
bepes-code merged 49 commits into
mainfrom
release/production-preparation
Sep 23, 2026
Merged

bepes-code merged 49 commits into
mainfrom
release/production-preparation

Conversation

@bepes-code

@bepes-code bepes-code commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Promotes the refactor backend to main with an explicit, data-preserving Docker release procedure. Merging validates code; the manual deployment workflow builds an immutable candidate without restarting production or running migrations.

Includes private backend/mail configuration preparation, transactional insertion of the missing ticket template, exact preservation checks for existing rows and sequences, and a cutover/recovery runbook. Resolves inherited Python lint/format failures with pinned Ruff, preserves legacy datetime behavior, and tests trusted proxy address handling. OpenAPI is identical before and after the quality cleanup.

Validated candidate: 0442cc91e3dd341089f7f062e7b1fac927b9cfdd, built on the VPS. All hosted checks pass: backend tests, quality, repository security and CodeQL. Locally, 118 tests pass. Fresh September 23 backups of both production databases were copied off-host, checksum-verified and restored into isolated PostgreSQL 15. The candidate migrations preserved all 5,349 existing rows across 28 tables and all 10 sequences. The final image passed isolated OpenAPI/CORS smoke checks and read all required production mail templates without sending email.

Production preparation completed: healthy private Redis, immutable backend image and private configuration, pinned existing mail image with corrected email URLs, and ticket template 9 added after restore rehearsal while preserving all eight existing templates. Existing production backend image and schema remain unchanged; no merge or cutover has occurred.

Activation still requires the documented write freeze and fresh final backups, explicit migration with fingerprint comparison, application/mail restart, coordinated JWT/service-key rotation and signed-link reissuance, then backend verification before reopening writes. Frontend/Vercel work is explicitly outside scope at the owner's request. See docs/production-release-2026-09-20.md. Keep draft until scheduling the production cutover.

bepes-code and others added 30 commits September 16, 2026 15:56
Add GET /v1/event/{id}/registration/{hacker_id} so the admin panel can review a
participant's application data (CV, experience description, links) when deciding
acceptances. Organizer-only, read-only schema without the shirt-size validator so
stored data is always readable.
feat(hacker): visor de CV en PDF (GET /hacker/{id}/cv)
bepes-code and others added 19 commits September 17, 2026 23:07
Sota càrrega alta, un handler intensiu en CPU pot bloquejar el heartbeat del
worker async i el timeout per defecte de 30s el mata a mitja petició (vist als
logs com a WORKER TIMEOUT i, al client, 'unexpected EOF'). S'apuja el timeout a
60s, s'afegeix graceful_timeout, keepalive i reciclatge de workers
(max_requests) i es fan tots configurables per variables d'entorn
(WEB_CONCURRENCY, GUNICORN_TIMEOUT, ...) per poder-ho ajustar a producció sense
reconstruir la imatge.
- POST /event/{id}/tickets/send mails the QR ticket (event_hacker_ticket
  template) to accepted and confirmed hackers in background, tracked with
  hacker_event_registration.ticket_sent_at; GET /tickets/status for progress
- public GET /event/{id}/ticket/{code}/qr.png renders the QR embedded in the
  mail (segno); GET /event/{id}/ticket/{hacker_id} exposes ticket state
- event_voucher table: bulk generate, list, summary, CSV export, QR per code
- PUT /event/{id}/vouchers/{voucher}/assign/{hacker} checks the hacker in
  and binds the badge atomically; DELETE releases a lost badge
- hacker/user lookups by code also resolve an assigned voucher, so meals and
  participation scans work with the badge
feat: tiquets de check-in per correu i vouchers físics per esdeveniment
perf: gunicorn — evitar WORKER TIMEOUT sota càrrega i fer-lo configurable
feat: GET /event/{id}/checkin-summary (comptadors en viu)
fix: exposa l'id dels hackers a HackerGet
EventSponsorUpdate.validate_tier només acceptava [0,1,2,3], però el tier 4
(Col·laboradors/patrocini inferior) és un tier vàlid al model d'empresa i al
frontend d'HackEPS. Amb la validació anterior, els sponsors de tier 4 no es
podien editar ni reordenar des del panell d'admin (PATCH /event/{id}/sponsors/
{company_id} retornava 422 'Unknown sponsor tier').
fix: permetre tier 4 (Col·laboradors) en editar sponsors
fix: validate participant uploads and correct account creation dates
@bepes-code
bepes-code marked this pull request as ready for review September 23, 2026 15:13
@bepes-code
bepes-code merged commit a00963b into main Sep 23, 2026
6 checks passed
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