Make error reporting work for multiple current migrations
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- postgresql, typescript
Hướng nghiên cứu
Bắt đầu bằng cách lần theo luồng thực thi migration và báo cáo lỗi kết hợp nhiều tệp migration hiện tại, tập trung vào cách vị trí "current.sql" được báo cáo và các độ lệch dòng được tạo ra. Tái hiện sự cố với nhiều migration hiện tại và một lỗi nằm ngoài tệp đầu tiên, sau đó xác minh rằng tên tệp và dòng được báo cáo xác định đúng tệp gây ra lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When I have multiple files in my current migration, and I make an error, I get something like:
:octagonal_sign: Error occurred at line 67, column 1 of "current.sql":
|
|
| )
| ^
| 42601: syntax error at or near ")"
error: syntax error at or near ")"
at Parser.parseErrorMessage (/Users/mgoldfield/Rewired/assemble/node_modules/pg-protocol/dist/parser.js:287:98)
at Parser.handlePacket (/Users/mgoldfield/Rewired/assemble/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/mgoldfield/Rewired/assemble/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/mgoldfield/Rewired/assemble/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Severity: ERROR
Code: 42601
However, this was actually on line 21 of my third current migration file.
It'd be nice if
Steps to reproduce
Create multiple current migrations, and then make an error in one other than the first. The line numbers of the errors will not match up.
Expected results
Something like "Error occurred at line 21 of <your-sql-file.sql>".
Actual results
Error occurred at line 67, column 1 of "current.sql"
Additional context
Graphile-migrate 0.12.0
Possible Solution
I think we'll have to build a little source map in memory, storing file offsets?
Happy to take this one! Will approach it by storing file offsets unless you'd like a different approach.
- Ngôn ngữ chính
- TypeScript
- Star
- 836
- Fork
- 71
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của graphile/migrate
-
Partition migrations folderĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
🐛 bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Tất cả issue của graphile/migrate
Issue tương tự
-
foreground-up-signals-live: delivery-repair cell expects a spawn suggestion status no longer printsĐang mởbug triage:owned
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
redhat-developer/rhdh-plugin-export-overlays#4905 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
directus/directus#28558 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
review: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
1lck/Lithe-IDEA#2432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
cloudflare/workers-sdk#17189 ·
Maintainer thường phản hồi trong vòng 1 ngày