Skip to content

Warn if migration time stamp is earlier than three weeks in the past

Jon Jenkins requested to merge 407459-warn-if-older-3-weeks into master

What does this MR do and why?

If any migrations are being added in a given MR, we want to warn the user if the migration's timestamp is older than three weeks - this keeps migrations in rough chronological order corresponding to the date they were added to GitLab.

How to set up and validate locally

A sample outcome of this testing procedure can be seen here

It is tough to run Danger locally, so I end-to-end tested this code this way:

  1. Check out branch 407459-warn-if-older-3-weeks.
  2. Make a new branch based on it - git checkout -b 407359-test-danger.
  3. Generate a test migration using bin/rails generate migration ...
  4. Rename the migration file such that the timestamp is greater than three weeks in the past.
  5. Commit the change.
  6. Push the change and open an MR against master.
  7. As soon as the danger-review job is done, review the comment left on the MR.

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 #407459 (closed)

Edited by Jon Jenkins

Merge request reports