Enforce db:check-migrations job
What does this MR do and why?
There's been a lot of cases lately where changes merged to db/strcuture.sql
do not match the actual changes generated from migrations.
These are some of the recent cases (from the last two months):
- Update structure.sql (!160663 - merged)
- Update structure.sql (!159825 - merged)
- Update structure.sql after https://gitlab.com/g... (!159025 - merged)
- Update structure.sql (!157864 - merged)
- Fix column order in structure.sql (!156987 - merged)
- Fix column order in structure.sql (!156368 - merged)
- Update trigger order in structure.sql (!156092 - merged)
- Update structure.sql after !154560 (!155163 - merged)
Most, if not all, were caught by the db:check-migrations
job, but as this job is allowed to fail, it was ignored.
This MR updates job to no longer be allowed to fail. For the very few valid cases when it fails with false positive, the checks can be skipped if pipeline:skip-check-migrations label is present on the MR.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Examples
- Failing job - https://gitlab.com/gitlab-org/gitlab/-/jobs/7447058178#L131
- Same job passing on retry after pipeline:skip-check-migrations is applied - https://gitlab.com/gitlab-org/gitlab/-/jobs/7447080825#L110
Edited by Krasimir Angelov