Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add preboot context to strong_migrations destructive-operation messages

オープン 初心者向け
#2,963 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ruby
領域
databases, devops

調査の方向性

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 の本文から書いたものです。

説明

enhancement

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codebar/planner のほかの issue

codebar/planner の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。