Nicer error messages for linting migrations (#43667)
* Nicer error messages for linting migrations In general, just throw exceptions instead of using clojure spec here. You'll only get one error per run, but that seems fine. I did keep some specs around, but run them slightly differently. Rather than validating the whole collection of changeSets at once with `s/+`, just `doseq` through the changeSets and validate each one separately. That way, the value that's presented as erroneous is much smaller (a single changeSet) and it's easier to see what went wrong. * Update bin/lint-migrations-file/test/lint_migrations_file_test.clj Co-authored-by:Noah Moss <32746338+noahmoss@users.noreply.github.com> * Update bin/lint-migrations-file/src/lint_migrations_file.clj Co-authored-by:
Noah Moss <32746338+noahmoss@users.noreply.github.com> * Require preConditions for certain liquibase change types to encourage idempotence (#44578) Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com> * remove `!`s from non-side-effecty fns * add preConditions to a few v51 migrations --------- Co-authored-by:
Noah Moss <32746338+noahmoss@users.noreply.github.com> Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com>
Showing
- bin/lint-migrations-file/src/change_set/strict.clj 26 additions, 1 deletionbin/lint-migrations-file/src/change_set/strict.clj
- bin/lint-migrations-file/src/lint_migrations_file.clj 92 additions, 44 deletionsbin/lint-migrations-file/src/lint_migrations_file.clj
- bin/lint-migrations-file/test/lint_migrations_file_test.clj 157 additions, 84 deletionsbin/lint-migrations-file/test/lint_migrations_file_test.clj
- resources/migrations/001_update_migrations.yaml 4 additions, 0 deletionsresources/migrations/001_update_migrations.yaml
Loading
Please register or sign in to comment