-
Notifications
You must be signed in to change notification settings - Fork 109
H-3572, H-4105: Track Node migrations run, skip already-run migrations #8187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PR SummaryTrack completed ontology migrations on the HASH Instance and skip re-running them; seed BP query types; minor utils/frontend/docs updates.
Written by Cursor Bugbot for commit 21b2437. This will update automatically on new commits. Configure here. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8187 +/- ##
==========================================
- Coverage 58.12% 58.09% -0.04%
==========================================
Files 1176 1177 +1
Lines 110784 110859 +75
Branches 4994 5006 +12
==========================================
Hits 64398 64398
- Misses 45634 45709 +75
Partials 752 752
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| `Skipping migration ${migrationFileName} as it has already been processed`, | ||
| ); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Skipped migrations leave migrationState empty, breaking subsequent migrations
When migrations are skipped because they're already completed, the migrationState object is never populated with type version information. The migrationState is only populated when migration functions execute (via utilities like createSystemEntityTypeIfNotExists). Later migrations that use getCurrentHashSystemEntityTypeId or similar functions expect migrationState.entityTypeVersions to contain the current versions, but it will be empty when prior migrations were skipped. This causes failures when deploying new migrations to existing instances where migrations 001-024 are skipped but migration 025 needs to run and look up hashInstance entity type version.
Additional Locations (1)
This ensures migrations are idempotent by populating the cache with existing ontology types before applying migrations. Co-authored-by: c <c@hash.ai>
|
Cursor Agent can help with this pull request. Just |
🌟 What is the purpose of this PR?
Start storing the Node API migrations run as part of the HASH instance entity (they create system types and update entities to updated types), and skip those already run.
Migrations are idempotent – this is designed to speed up start-up time by not bothering to go through the process of checking entities that need upgrading (of which there should be none once a migration has run once).
Drive-bys:
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?