feat: detect and gate pending install migrations - #803
Merged
anonymoususer72041 merged 3 commits intoJul 28, 2026
Merged
Conversation
Contributor
Author
|
As this PR currently should not be merged, I will mark it as draft for now. |
anonymoususer72041
marked this pull request as draft
June 23, 2026 15:09
anonymoususer72041
force-pushed
the
feature/detect-pending-migrations
branch
from
July 28, 2026 11:18
4436571 to
28479a7
Compare
Contributor
Author
|
I've reduced this PR to detect and gate pending install migrations only. Authenticated users now see a maintenance notice, and administrators are linked to the existing Installation Wizard instead of a self-service maintenance action. The automatic migration itself will be implemented in a separate follow-up PR. |
anonymoususer72041
marked this pull request as ready for review
July 28, 2026 11:25
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
This PR adds automatic detection for pending install schema migrations and prevents OpenCATS from continuing normal operation while those migrations still need to be finalized.
It introduces a central, read-only migration status check for the install schema (
lib/SchemaMigrationStatus.php). While install migrations are pending, it shows authenticated users a Maintenance Required notice instead of the normal UI, blocks application AJAX requests, and returns a maintenance message for the public Careers Portal.Site administrators are pointed to the existing Installation Wizard (
installwizard.php) to complete the upgrade, while recruiters and other non-admin users are shown a message telling them to contact their administrator.The integration test setup finalizes the install schema version dynamically from
modules/install/Schema.php, so CI test databases represent an already finalized installed snapshot without hard-coding the current install schema version indb/cats_schema.sql.Motivation
Previously, pending install schema migrations could be difficult to notice during normal application usage. This could allow users to continue using OpenCATS while the database schema was not fully aligned with the application code and the Careers Portal could remain publicly available during that state.
Detecting pending migrations centrally makes this state explicit and safer. Blocking the Careers Portal avoids exposing applicants to an application that still requires maintenance, while gating authenticated application requests prevents existing sessions or direct module URLs from bypassing the warning.
Linking administrators to the existing Installation Wizard keeps migration execution on the current, well-tested path and avoids introducing a second migration-execution path in this PR. Automating the migration itself is deliberately left to a separate follow-up PR so this change stays focused on detection and gating.