Skip to content

feat: detect and gate pending install migrations - #803

Merged
anonymoususer72041 merged 3 commits into
opencats:masterfrom
anonymoususer72041:feature/detect-pending-migrations
Jul 28, 2026
Merged

feat: detect and gate pending install migrations#803
anonymoususer72041 merged 3 commits into
opencats:masterfrom
anonymoususer72041:feature/detect-pending-migrations

Conversation

@anonymoususer72041

@anonymoususer72041 anonymoususer72041 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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 in db/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.

@anonymoususer72041

Copy link
Copy Markdown
Contributor Author

As this PR currently should not be merged, I will mark it as draft for now.

@anonymoususer72041
anonymoususer72041 marked this pull request as draft June 23, 2026 15:09
@anonymoususer72041
anonymoususer72041 force-pushed the feature/detect-pending-migrations branch from 4436571 to 28479a7 Compare July 28, 2026 11:18
@anonymoususer72041

Copy link
Copy Markdown
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.
This PR no longer introduces a second migration-execution path.

The automatic migration itself will be implemented in a separate follow-up PR.

@anonymoususer72041 anonymoususer72041 modified the milestones: 1.0.0, 0.11.0 Jul 28, 2026
@anonymoususer72041
anonymoususer72041 marked this pull request as ready for review July 28, 2026 11:25
@anonymoususer72041
anonymoususer72041 merged commit 78cc21e into opencats:master Jul 28, 2026
6 of 7 checks passed
@anonymoususer72041
anonymoususer72041 deleted the feature/detect-pending-migrations branch July 28, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant