Stop guarding every entry point against missing tables - #21
Merged
Conversation
Follows-up to #14, which had every entry point ask whether the tables were there and go inert when they were not. The premise was a wiki that loads the extension before `update.php` has run on it. Where the extension is deployed, enabling it for a wiki runs its database updates first, in the same request, and the config that loads the extension is not stored when those fail — so it is never live without its tables. What remains are broken wikis: this repository's own schema procedure between the drop and the re-run, a partial restore, a hand-edited `LocalSettings.php`. On those a database error is the better answer. It names what is wrong and where, while an extension that goes quiet leaves the wiki admitting people under rules it has stopped applying, with nothing to say so. The reader-group stand-in goes with it: a second rule for who is refused a password and a single sign-on login, worked out for a state that does not arise, running where nobody is watching, and answerable only against a stub. One guard stays. `MemberLoginHandler` runs for every login the wiki has, so a failure there locks out the administrator who would fix it. `Schema` and `DatabaseSchema` stay for it, and `MissingSchemaTest` collapses into the one case `MemberLoginHandlerTest` now carries. A wiki with its tables behaves exactly as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21 +/- ##
============================================
- Coverage 87.29% 87.03% -0.26%
+ Complexity 604 586 -18
============================================
Files 66 66
Lines 2125 2052 -73
============================================
- Hits 1855 1786 -69
+ Misses 270 266 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Follows-up to #14, which had every entry point ask
whether the tables were there and go inert when they were not.
The premise was a wiki that loads the extension before
update.phphas run on it. Where the extension isdeployed, enabling it for a wiki runs its database updates first, in the same request, and the config that
loads the extension is not stored when those fail — so it is never live without its tables. What remains
are broken wikis: this repository's own schema procedure between the drop and the re-run, a partial
restore, a hand-edited
LocalSettings.php.On those a database error is the better answer. It names what is wrong and where, while an extension that
goes quiet leaves the wiki admitting people under rules it has stopped applying, with nothing to say so.
The reader-group stand-in goes with it: a second rule for who is refused a password and a single sign-on
login, worked out for a state that does not arise, running where nobody is watching, and answerable only
against a stub.
One guard stays.
MemberLoginHandlerruns for every login the wiki has, so a failure there locks out theadministrator who would fix it.
SchemaandDatabaseSchemastay for it, andMissingSchemaTestcollapses into the one case
MemberLoginHandlerTestnow carries.A wiki with its tables behaves exactly as before.
Production notes
Three
CodeScreenTestcases fail in the local dev stack. They fail the same way on unmodifiedmasterthere and CI is green on
master, so they are the environment rather than this branch.