Repository navigation
[O2B-1635] Improve start sequence of server to help with big migrations and data integrity - #2278
Merged
graduta merged 6 commits intoOct 22, 2026
Conversation
…ns and data integrity
There was a problem hiding this comment.
🟡 Changes recommended
The new regression suite is not registered in the parallel unit-test entry point used by CI.
1 open issue
What changed in this PR
This PR delays application startup until database preparation and migrations finish, preventing servers and background services from accessing data during migrations.
Changes:
- Adds a
start()method that awaits database preparation before running the application. - Updates the entry point to use
start()and exit if database preparation fails. - Adds regression tests for delayed startup and database preparation failure.
| File | Description |
|---|---|
test/lib/application.test.js |
Adds tests for migration-gated startup. |
test/index.js |
Registers the application startup suite. |
lib/main.js |
Uses ordered startup and exits on preparation failure. |
lib/application.js |
Adds the database-first startup method. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2278 +/- ##
==========================================
+ Coverage 46.45% 46.46% +0.01%
==========================================
Files 1054 1054
Lines 17379 17384 +5
Branches 3165 3166 +1
==========================================
+ Hits 8073 8078 +5
Misses 9306 9306 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…rver' of github.com:AliceO2Group/Bookkeeping into improv/O2B-1635/wait-for-migration-to-end-on-startup-server
… for migrations Add useApplication test helper calling application.start() (migrations before anything else) and use it in every test script instead of run() followed by connectDatabase(). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
graduta
deleted the
improv/O2B-1635/wait-for-migration-to-end-on-startup-server
branch
October 22, 2026 13:00
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.

I have a JIRA ticket
Notable changes for users:
Notable changes for developers:
Changes made to the database: