Repository navigation
fix(check-migration-order): ignore repeatable migrations when finding the newest version [NOJIRA] - #385
Merged
Conversation
… the newest version [NOJIRA]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
check-migration-orderfails every new migration in a repo whose base branch has a repeatable (R__) migration.base_maxruns every.sqlfile name throughversions(), which only strips aB/Vprefix. SoR__monta_service_provider_seed.sqlturns into the versionR, andsort -Vputs that after every numerictimestamp. Every new
V...migration then fails with "does not sort after R".The fix only counts
B/Vfiles followed by a digit when it computesbase_max. Repeatable migrations andcallbacks have no version, so they're left out. The README notes this under "Notes".
Found on
monta-app/service-grid#1184. It adds
V2026.10.13.10.00__grid_asset_asset_type.sql, and main's newest versionedmigration is
V2026.08.13.10.00(failing job). The
R__file has been on service-grid's main since 2022, so every service-grid PR that adds a migration fails until this lands.Test plan
newest migration on origin/main: R, then the error, exit 1.newest migration on origin/main: 2026.08.13.10.00,OK: V2026.10.13.10.00__grid_asset_asset_type.sql sorts after 2026.08.13.10.00, exit 0.V2026.08.01.10.00__stale.sql.It still fails with "does not sort after 2026.08.13.10.00".
bash -npasses. The naming check and the edited-migration check are unchanged.