Skip to content

Add danger comment when adding new model validations

Abdul Wadood requested to merge 340144-new-validation-danger-comment into master

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

image

How to set up and validate locally

  1. Add a new validation to a model and commit the changes.
  2. 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.
  1. 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.

Related to #340144 (closed)

Edited by Abdul Wadood

Merge request reports