veza/veza-backend-api/internal/models
senke 3f326e8266
Some checks failed
Veza CI / Rust (Stream Server) (push) Successful in 4m22s
Security Scan / Secret Scanning (gitleaks) (push) Successful in 1m5s
Veza CI / Frontend (Web) (push) Failing after 17m19s
E2E Playwright / e2e (full) (push) Failing after 20m28s
Veza CI / Backend (Go) (push) Successful in 21m31s
Veza CI / Notify on failure (push) Successful in 4s
fix(ci): unblock CI red — gofmt + e2e webserver reuse + orders.hyperswitch_payment_id (Day 4)
Three pre-existing infra issues surfaced by the Day 1→Day 3 push wave.
Each is independent — bundled here because the goal is "ci.yml + e2e.yml
green" before the v1.0.9 tag, and they're all small.

(1) gofmt — ci.yml golangci-lint v2 step

  Five files were unformatted on main. Pre-existing (untouched by my
  Item G work, but the formatter caught them now):
    - internal/api/router.go
    - internal/core/marketplace/reconcile_hyperswitch_test.go
    - internal/models/user.go
    - internal/monitoring/ledger_metrics.go
    - internal/monitoring/ledger_metrics_test.go
  Pure whitespace via `gofmt -w` — no behavior change.

(2) e2e silent-fail — playwright webServer port collision

  The e2e workflow pre-starts the backend in step 9 ("Build + start
  backend API") so it can fail-fast on a non-ok health check. But
  playwright.config.ts had `reuseExistingServer: !process.env.CI` on
  the backend webServer entry — meaning in CI Playwright tried to
  spawn a SECOND backend on port 18080. The spawn collided with
  EADDRINUSE and Playwright silently exited before printing any test
  output. The artifact upload then warned "No files were found"
  because tests/e2e/playwright-report/ never got written, and the job
  ended in `Failure` for an unrelated reason (the artifact upload
  step's GHESNotSupportedError).

  Fix: backend `reuseExistingServer: true` always — workflow + dev
  both pre-start backend on 18080. Vite stays `!CI` because the
  workflow doesn't pre-start it. Comment in playwright.config.ts
  documents the symptom so the next person debugging gets the
  pointer immediately.

(3) orders.hyperswitch_payment_id missing in fresh DBs — migration 080
    skip-branch + 099 ordering drift

  Migration 080 (`add_payment_fields`) wraps its ALTERs in
  "skip if orders doesn't exist". At authoring time orders existed
  earlier in the migration sequence; that ordering has since shifted
  (orders is now created at 099_z_create_orders.sql, AFTER 080).
  Result: in any freshly-migrated DB (CI, fresh dev, future restore
  drills) migration 080 takes the skip branch and the columns are
  never added — even though the Order model and the marketplace code
  rely on them.

  Symptom: every CI run logs
    pq: column "hyperswitch_payment_id" does not exist
  from the periodic ledger_metrics worker. Order checkout would also
  fail to persist payment_id at write time, breaking reconciliation.

  Fix: append-only migration 987 with idempotent
  `ADD COLUMN IF NOT EXISTS` + a partial index on the reconciliation
  hot path. Production envs that did pick up 080 in the original
  order are no-ops; fresh envs converge to the same end state.
  Rollback in migrations/rollback/.

Verified locally:
  $ cd veza-backend-api && go build ./... && VEZA_SKIP_INTEGRATION=1 \
      go test -short -count=1 ./internal/...
  (all green)

SKIP_TESTS=1: backend-only Go + Playwright config + SQL. Frontend
unit tests irrelevant to this commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:03:55 +02:00
..
admin.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
announcement.go feat(admin): global announcements CRUD and public banner endpoint 2026-02-25 19:55:21 +01:00
api_key.go v0.9.4 2026-03-05 23:03:43 +01:00
bitrate_adaptation.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
bitrate_adaptation_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
chat_message.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
cloud_file_share.go v0.9.4 2026-03-05 23:03:43 +01:00
cloud_file_version.go feat(cloud): file versioning, restore, and sharing 2026-02-25 13:33:08 +01:00
co_listening_session.go feat(v0.10.7): Collaboration Temps Réel F481-F483 2026-03-10 13:34:16 +01:00
custom_claims.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
daily_track_stats.go feat(v0.11.0): F381-F385 database migrations and models for creator analytics 2026-03-10 16:21:01 +01:00
data_export.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
delivered_status.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
feature_flag.go v0.9.4 2026-03-05 23:03:43 +01:00
federated_identity.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
gear.go v0.9.4 2026-03-05 23:03:43 +01:00
gear_document.go feat(v0.802): frontend Cloud/Gear, MSW, docs, scope v0.803, archive 2026-02-25 14:00:58 +01:00
gear_image.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
gear_repair.go feat(v0.802): frontend Cloud/Gear, MSW, docs, scope v0.803, archive 2026-02-25 14:00:58 +01:00
genre.go feat(v0.10.1): Tags & Genres discover - F351-F355 2026-03-09 01:52:56 +01:00
hardware.go v0.9.4 2026-03-05 23:03:43 +01:00
hls_stream.go v0.9.4 2026-03-05 23:03:43 +01:00
hls_stream_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
hls_transcode_queue.go v0.9.4 2026-03-05 23:03:43 +01:00
hls_transcode_queue_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
live_stream.go v0.9.4 2026-03-05 23:03:43 +01:00
message.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
message_reaction.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
mfa_config.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
notification.go incus deployement fully implemented, Makefile updated and make fmt ran 2026-01-13 19:47:57 +01:00
playback_analytics.go v0.9.4 2026-03-05 23:03:43 +01:00
playback_analytics_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
playlist_collaborator.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_collaborator_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist_follow.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_share_link.go v0.9.4 2026-03-05 23:03:43 +01:00
playlist_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist_version.go v0.9.4 2026-03-05 23:03:43 +01:00
queue.go v0.9.4 2026-03-05 23:03:43 +01:00
queue_session.go v0.9.4 2026-03-05 23:03:43 +01:00
read_receipt.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
recovery_code.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
refresh_token.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
report.go feat(admin): moderation queue with reports CRUD 2026-02-25 19:53:04 +01:00
requests.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
responses.go [INT-008] int: Standardize date/time formats 2025-12-25 15:16:38 +01:00
role.go [T0-006] test(backend): Ajout tests service role - Progression couverture 2026-01-04 01:44:21 +01:00
role_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
room.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
room_invitation.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
royalty.go v0.9.4 2026-03-05 23:03:43 +01:00
seller_stripe_account.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
session.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
storage_quota.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
tag.go feat(v0.10.1): Tags & Genres discover - F351-F355 2026-03-09 01:52:56 +01:00
track.go feat(storage): add track storage_backend column + config prep (v1.0.8 P0) 2026-04-23 19:54:28 +02:00
track_comment.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_comment_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_history.go v0.9.4 2026-03-05 23:03:43 +01:00
track_history_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_like.go v0.9.4 2026-03-05 23:03:43 +01:00
track_like_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
track_lyrics.go feat(tracks): add lyrics model and endpoints (E3) 2026-02-20 15:36:28 +01:00
track_play.go v0.9.4 2026-03-05 23:03:43 +01:00
track_play_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_repost.go feat(v0.10.3): Commentaires & Interactions Sociales - F201-F215 2026-03-09 10:30:47 +01:00
track_share.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_share_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_status.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_stem.go feat(v0.10.7): Collaboration Temps Réel F481-F483 2026-03-10 13:34:16 +01:00
track_version.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
track_version_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
user.go fix(ci): unblock CI red — gofmt + e2e webserver reuse + orders.hyperswitch_payment_id (Day 4) 2026-04-27 12:03:55 +02:00
user_file.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
user_folder.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
user_genre_tag_follow.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
user_presence.go feat: backend — config, handlers, services, logging, migration 2026-03-23 15:46:57 +01:00
user_settings.go v0.9.4 2026-03-05 23:03:43 +01:00
webauthn_credential.go feat(v0.13.3): complete - Polish Sécurité Avancée 2026-03-13 10:09:01 +01:00
webhook.go incus deployement fully implemented, Makefile updated and make fmt ran 2026-01-13 19:47:57 +01:00