test(database): fail clearly when the events coverage migration replay finds no statements

Đang mở Phù hợp với người mới
#747 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
79/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
sql, supabase, typescript
Lĩnh vực
databases, testing

Hướng nghiên cứu

Đọc supabase/tests/database/48_events_covered_from.test.sql gần dòng 92 và kiểm tra cách tệp chạy lại các câu lệnh từ supabase_migrations.schema_migrations. Thêm thông báo lỗi rõ ràng nếu lần chạy lại không chứa chính xác các câu lệnh alter table, comment on column và update như mong đợi, đồng thời giải thích trong chú thích SQL việc gộp migration có ý nghĩa gì đối với lần chạy lại. Chạy npm run test:db; xác nhận tệp 48 chạy thành công bình thường và thất bại với lỗi chạy lại có tên khi một câu lệnh bị thiếu hoặc thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: ci area: database enhancement priority: P3 size: XS

Context

PR #746 (#724) adds supabase/tests/database/48_events_covered_from.test.sql. To test the migration's update external_accounts set events_history_legacy = true where first_synced_at is not null, it replays the statements the Supabase CLI recorded in supabase_migrations.schema_migrations. If those statements are missing or different (after a migration squash, a migration repair, or a hand-applied migration), the test fails without saying why. Raised as a consider in review round 3, which is the review cap: https://github.com/eddiejaoude/StackDash/pull/746#discussion_r4768183960

Plan

  1. In 48_events_covered_from.test.sql near line 92, count the replayed statements and raise a named error unless they are exactly the expected three: alter table, comment on column, update.
  2. In the comment above the alter table, say that squashing this migration breaks the replay and what to do then.

Acceptance criteria

  • With the recorded statements missing or changed, npm run test:db fails with a message that names the replay
  • With the statements present, file 48 passes as before
  • Playwright e2e: none needed, database test only

Files and areas

supabase/tests/database/48_events_covered_from.test.sql. Non-goals: changing the migration itself.

Verification

npm run test:db: file 48 passes. Removing the update statement makes it fail with the named error.


Branch: <issue-number>-coverage-replay-guard
Closes with a Closes #<issue-number> footer on the commit or pull request.

Model: anthropic/claude-opus-5-5 | Reasoning effort: not reported by the harness

Ngôn ngữ chính
TypeScript
Star
13
Fork
2
Merge trung bình
5 giờ 20 phút
Pull request đã merge (30 ngày)
287

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eddiejaoude/StackDash

Tất cả issue của eddiejaoude/StackDash

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.