Add preboot context to strong_migrations destructive-operation messages
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
config/initializers/strong_migrations.rb と lib/strong_migrations/error_messages.rb の strong_migrations キー一覧から始め、Issue で名前が挙げられている 9 つのキーに焦点を当てます。AGENTS.md の Heroku preboot に関するセクションを読み、その後、使い捨ての rename_column マイグレーションを使って bundle exec rake db:migrate を実行します。他のメッセージのテキストを変更せずに preboot に関する注記が表示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Ruby
- スター
- 104
- フォーク
- 205
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 81
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codebar/planner のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
メンテナーはふだん 1 日以内に返信
-
Chapter show pages allocate ~21k+ objects per render for large chapters (18% of app allocations)オープンperformance
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
codebar/planner#2952 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Workshop show pages allocate ~7.3k objects per request with no caching (28% of app allocations)オープンperformance
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash successオープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
codebar/planner の issue をすべて見る
似ている issue
-
security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
OSCON 2016オープンcontent
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rubyevents/rubyevents#2148 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
we-promise/sure#3838 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Mend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ManageIQ/manageiq-ui-classic#10341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
rubocop/ruby-style-guide#984 ·