-
Notifications
You must be signed in to change notification settings - Fork 21
Updated namespace references #130
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
Conversation
Alright, I'm starting to understand why this is failing, but then again, this CI should be testing other versions of MW too, namely, the ones wikimedia actually recommends using. |
Going to try and verify that this works (and it should) in 1.44, then will try to figure out how to implement a polyfill class like this (rough idea, will refine once infrastructure is in place) <?php
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This is not a valid entry point.' );
}
if ( version_compare( MW_VERSION, '1.40.0-alpha', '<' ) ) {
$classAliases = [
[ 'ApiBase', 'MediaWiki\\Api\\ApiBase' ],
[ 'ApiUsageException', 'MediaWiki\\Api\\ApiUsageException' ],
[ 'ApiTestCase', 'MediaWiki\\Tests\\Api\\ApiTestCase' ],
[ 'Config', 'MediaWiki\\Config\\Config' ],
[ 'ConfigException', 'MediaWiki\\Config\\ConfigException' ],
[ 'ConfigFactory', 'MediaWiki\\Config\\ConfigFactory' ],
[ 'Html', 'MediaWiki\\Html\\Html' ],
[ 'File', 'MediaWiki\\FileRepo\\File\\File' ],
[ 'LocalFile', 'MediaWiki\\FileRepo\\File\\LocalFile' ],
[ 'UnregisteredLocalFile', 'MediaWiki\\FileRepo\\File\\UnregisteredLocalFile' ],
[ 'RepoGroup', 'MediaWiki\\FileRepo\\RepoGroup' ],
[ 'Message', 'MediaWiki\\Message\\Message' ],
[ 'Parser', 'MediaWiki\\Parser\\Parser' ],
[ 'ParserOptions', 'MediaWiki\\Parser\\ParserOptions' ],
[ 'PPFrame', 'MediaWiki\\Parser\\PPFrame' ],
[ 'PPCustomFrame_Hash', 'MediaWiki\\Parser\\PPCustomFrame_Hash' ],
[ 'PPFrame_Hash', 'MediaWiki\\Parser\\PPFrame_Hash' ],
[ 'RequestContext', 'MediaWiki\\Context\\RequestContext' ],
[ 'MWException', 'MediaWiki\\Exception\\MWException' ],
[ 'WANObjectCache', 'MediaWiki\\ObjectCache\\WANObjectCache' ],
[ 'OutputPage', 'MediaWiki\\Output\\OutputPage' ],
[ 'WikiPage', 'MediaWiki\\Page\\WikiPage' ],
[ 'Skin', 'MediaWiki\\Skin\\Skin' ],
[ 'FSFile', 'Wikimedia\\FileBackend\\FSFile\\FSFile' ],
[ 'HashBagOStuff', 'Wikimedia\\ObjectCache\\HashBagOStuff' ],
];
foreach ( $classAliases as $classAlias ) {
if ( !class_exists( $classAlias[0] ) && class_exists( $classAlias[1] ) ) {
class_alias( $classAlias[0], $classAlias[1] );
}
}
} |
Thailand for the PR! |
I've tried a few other things on my fork, but I am still getting errors, I'm unclear on why they are occurring, and honestly, the nature of this test suite, is there anything you would recommend for me to try? |
Okay, running tests just for new version support, exposes errors, which is likely why 1.42 was commented out P.S.: Some things I am noticing is that there's a difference in the phpunit version being used, 1.42 uses 9.6 for the first time, trying to understand which ci step procures phpunit. P.P.S.: It's apparently dictated by the MW distribution composer.json, and something in this CI setup is such that the command this project uses to run the tests, doesn't work. P.P.P.S.: This is likely related to this change to the phpunit behavior in MW wikimedia/mediawiki@a69c57b |
Alright, after many tests, I think the issue is that when the phpunit test configuration changed, it went from explicitly bootstrapping through tests/phpunit/phpunit.php, to implicitly bootstrapping through Which means either pulling from the git to get the actual full project, or some other type of approach. |
I made huge progress, and apparently the breakage only occurs in version 1.44, the changes I have are pretty solid and in keeping with the ways in which the star citizen skin is tested. I just need to re-add the namespace changes, and the compatibility layer. |
https://github.com/theMadness/mediawiki-extensions-EmbedVideo/actions/runs/16424438165/job/46411059574 okay, finally working on 1.44 and master, but broken everywhere else, I just need to figure out where to bootstrap a bunch of class_alias rules. |
I'm running out of ideas for how to implement a compatibility layer, at this point I'd recommend adopting a different branching strategy, with a REL1_44 branch that doesn't need to concern itself with backwards compatibility, and a 1.39 branch that supports the legacy versions. I can set up the necessary PRs. |
Thanks for all this work! I also think that different branches make the most sense here, I’ll happily accept your PR. updating the ci is also on my shortlist |
So, closing this PR for now, will work on opening 2 (possibly 3) separate PRs, as described in #131 |
No description provided.