Deluan Quintão 74dc7678f1
ci: add migration timestamp validation to pipeline (#4732)
* ci: add migration timestamp validation to pipeline

Added a new migrations-lint job to the CI pipeline that validates new migrations
in PRs have timestamps greater than the latest migration on master. This prevents
migration ordering conflicts when multiple PRs add migrations concurrently.

The validation script compares timestamps using git ls-tree for master and
git diff for changed files, outputting GitHub Actions error annotations for
inline PR feedback. The job runs in parallel with other lint/test jobs and
only executes on pull requests.

* fix: only fail on new migrations, warn on modified ones

Updated the migration validation script to distinguish between new migrations
(which must have timestamps after master's latest) and modified existing
migrations (which only produce warnings). This allows fixing typos or issues
in existing migrations without breaking the pipeline.

* feat: post PR comment when migrations are modified

When modified migration files are detected, the script now posts a comment
on the PR to alert reviewers. This makes the warning more visible than just
the workflow annotation. The comment lists all modified migration files and
warns about potential issues for users who have already applied them.

* fix: deduplicate PR comments for modified migrations

Check if a warning comment already exists before posting a new one.
This prevents duplicate comments when multiple commits are pushed to the PR.
2025-11-26 20:47:28 -05:00
..
2023-03-08 14:14:42 -05:00
2020-10-12 22:31:01 -04:00