Add danger check for required migration stop
What does this MR do and why?
There was an incident of finalizing heavy data migration in a release which wasn't originally supposed to be a required stop. To increase awareness of this check and reduce odds of possible future incidents this MR introduces additional Danger check which posts a comment every time someone adds data migration finalization.
Screenshots
See demo
How to set up and validate locally
- Locally commit a migration with data migration finalization.
- run
bin/rake danger_local
- check Markdown output
bin/rake danger_local
Results:
Markdown:
db/migrate/20220331125725_add_title_to_topic.rb#L8
Finalizing data migration might be time consuming and might require [required stop](https://docs.gitlab.com/ee/development/database/required_stops.html).
Please check timings of underlying data migration and postpone finalization to scheduled required stop
if possible and necessary.
db/post_migrate/20220405092619_toggle_vsa_aggregations_enable.rb#L11
Finalizing data migration might be time consuming and might require [required stop](https://docs.gitlab.com/ee/development/database/required_stops.html).
Please check timings of underlying data migration and postpone finalization to scheduled required stop
if possible and necessary.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Pavel Shutsin