Add danger comment when adding new model validations
What does this MR do and why?
This is a corrective action from a recent production incident that happened because new validations were added that prevented saving of existing records. This comment by danger will nudge developers to think about the impact that the new validations will have on existing data.
Screenshots or screen recordings
How to set up and validate locally
- Add a new validation to a model and commit the changes.
- Run
bin/rake danger_local
which should give:
bin/rake danger_local
Results:
Markdown:
app/models/user.rb#L302
Did you consider new validations can break existing records?
Please follow the [code quality guidelines](https://docs.gitlab.com/ee/development/code_review.html#quality) when adding a new model validation.
If you're adding the validations to a model with no records you can ignore this warning.
- Check this MR for the comment by the danger bot !126306 (comment 1468276849)
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.
Related to #340144 (closed)
Edited by Abdul Wadood