Add preboot context to strong_migrations destructive-operation messages
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
- 76/100
Hướng nghiên cứu
Bắt đầu với config/initializers/strong_migrations.rb và danh sách key strong_migrations trong lib/strong_migrations/error_messages.rb, tập trung vào chín key được nêu trong issue. Đọc phần về Heroku preboot trong AGENTS.md, sau đó chạy bundle exec rake db:migrate với một migration rename_column dùng một lần. Được xem là hoàn tất khi ghi chú preboot xuất hiện mà không thay đổi nội dung các message khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up from #2949 (preboot enabled on codebar-production).
With preboot, the release phase (rake db:prepare) runs before old web dynos stop, so old code serves against the new schema for ~3 minutes after each deploy. When strong_migrations raises on a destructive operation, its message ends with "wrap this step in a safety_assured block" — which under preboot only means "the old release tolerates this", not "this is safe to deploy right now". That distinction is documented in AGENTS.md ("Migrations and Heroku preboot") but is invisible at the moment a migration author is staring at the error.
Proposal
Append a short preboot note to the destructive-operation messages via StrongMigrations.error_messages (docs; key list in the gem's lib/strong_migrations/error_messages.rb, confirmed for 2.8.0). Relevant keys: change_column, change_column_with_not_null, change_column_default, change_column_null, rename_column, rename_table, rename_schema, rename_enum_value, execute. One possible shape:
# config/initializers/strong_migrations.rb
note = <<~TXT
Heroku preboot: this runs in the release phase before old web dynos stop,
so old code serves against the new schema for ~3 minutes after the deploy.
See AGENTS.md ("Migrations and Heroku preboot"). If the migration cannot
be made forward-compatible, disable preboot for this deploy.
TXT
%i[change_column change_column_with_not_null change_column_default
change_column_null rename_column rename_table rename_schema
rename_enum_value execute].each do |key|
StrongMigrations.error_messages[key] = StrongMigrations.error_messages[key] + "\n\n" + note
end
Verification
Write a throwaway migration containing a flagged operation (e.g. rename_column), run bundle exec rake db:migrate in development, and check the printed message carries the note. Confirm no other message text changed.
Out of scope
Changing any gem defaults beyond messages; touching start_after or target_postgresql_version.
- Ngôn ngữ chính
- Ruby
- Star
- 104
- Fork
- 205
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 77
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 codebar/planner
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Chapter show pages allocate ~21k+ objects per render for large chapters (18% of app allocations)Đang mởperformance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
codebar/planner#2952 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Workshop show pages allocate ~7.3k objects per request with no caching (28% of app allocations)Đang mởperformance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash successĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codebar/planner
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
jetrockets/jet_ui#47 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
FreeCAD/homebrew-freecad#870 ·
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 78/100
-
Messages with a markdown image that has a relative or malformed URL throw TypeError: Invalid URLĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày