Add preboot context to strong_migrations destructive-operation messages
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Comienza con config/initializers/strong_migrations.rb y la lista de claves de strong_migrations en lib/strong_migrations/error_messages.rb, centrándote en las nueve claves mencionadas en el issue. Lee la sección de AGENTS.md sobre Heroku preboot y después ejecuta bundle exec rake db:migrate con una migración rename_column desechable. Se considera terminado cuando aparece la nota de preboot sin cambiar el texto de los demás mensajes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Ruby
- Estrellas
- 104
- Forks
- 205
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 77
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codebar/planner
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
Los mantenedores suelen responder en 1 día
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash successAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
refactoring tech debt
Dificultad 4/5 3-5 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
refactoring tech debt
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de codebar/planner
Issues similares
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
IBM/aspera-cli#265 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 3 días
-
[Bug]: QR Code do Evolution Go não aparece no CRM com Evolution Go 0.7.2 (campos em minúsculo)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
evolution-foundation/evo-ai-crm-community#423 ·
Los mantenedores suelen responder en 1 día