lhc/web/wiklou.git
5 years agoMerge "MediaWikiTestCase: Fix schema restoration"
jenkins-bot [Tue, 9 Apr 2019 15:17:45 +0000 (15:17 +0000)]
Merge "MediaWikiTestCase: Fix schema restoration"

5 years agoMerge "avoid link cache issues with duplicate title keys for xml dumps"
jenkins-bot [Tue, 9 Apr 2019 14:00:38 +0000 (14:00 +0000)]
Merge "avoid link cache issues with duplicate title keys for xml dumps"

5 years agoSwitch more DatabaseUpdater type hints to using IMaintainableDatabase
Aaron Schulz [Tue, 9 Apr 2019 07:19:34 +0000 (00:19 -0700)]
Switch more DatabaseUpdater type hints to using IMaintainableDatabase

Change-Id: I59b49d00b94c62342e0bf13e127773bbc83f6453

5 years agoMerge "selenium: Add API wait and other pauses in rollback test"
jenkins-bot [Tue, 9 Apr 2019 10:46:05 +0000 (10:46 +0000)]
Merge "selenium: Add API wait and other pauses in rollback test"

5 years agoselenium: Add API wait and other pauses in rollback test
Tim Eulitz [Mon, 8 Apr 2019 09:07:45 +0000 (11:07 +0200)]
selenium: Add API wait and other pauses in rollback test

Bug: T219440
Change-Id: Ifdc0ff72db7f6f176b8a7a0522235e91dfd2aa87

5 years agoMerge "Hard-deprecate MagicWord static methods"
jenkins-bot [Tue, 9 Apr 2019 10:15:05 +0000 (10:15 +0000)]
Merge "Hard-deprecate MagicWord static methods"

5 years agoMerge "Inject LinkRendererFactory into Parser"
jenkins-bot [Tue, 9 Apr 2019 10:14:59 +0000 (10:14 +0000)]
Merge "Inject LinkRendererFactory into Parser"

5 years agoHard-deprecate MagicWord static methods
Aryeh Gregor [Mon, 30 Jul 2018 14:57:53 +0000 (17:57 +0300)]
Hard-deprecate MagicWord static methods

Bug: T200247
Change-Id: Ib36e78274f42ddbeaa7801cc8bad77b991a4a1aa

5 years agoresourceloader: Optimise resolved-check in sortDependencies()
Timo Tijhof [Mon, 8 Apr 2019 00:45:48 +0000 (01:45 +0100)]
resourceloader: Optimise resolved-check in sortDependencies()

Remove the `resolved.indexOf` check from code outside the
for-loop because it's not needed for correctness. The function
is private, and its result is passed to enqueue() and work()
which already do their own de-duplication.

It was here as optimisation to keep the result fairly small
and avoid needless computation, but this isn't useful in practice
because the input never contains duplicates in production.
There are only two ways to call it:

1. From mw.loader.load(), which we never give duplicates.

2. Recursively from within sortDependencies() itself, which
   is already guarded by exactly the same check.

Move the handling of `baseModules` to the caller so that it
does not need to check it N times for every top-level module on
a page and N more times for every dependency of every dependency
of every such module etc. Instead, do it once before we start.

Also update error "Unknown dependency" to say "Unknown module",
because this function deals both with top-level modules and with
dependencies. In fact, most reports of this error in Phabricator
are for top-level modules, not dependencies.
This makes sense given dependency validation via PHPUnit,
which means such error would be unlikely in prod. An unknown
module, on the other hand, is quite normal (and caught) for
cases where a module or gadget is removed but still queued in
cached HTML.

Change-Id: I944593994a66f1c65c0732d7d1f2d60ed4226e79

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 9 Apr 2019 06:37:45 +0000 (08:37 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I476ece661f23b3415c2726583a312e48103b8e72

5 years agoMerge "rdbms: Remove weird use of serialize() in MssqlBlob and DatabaseMssql"
jenkins-bot [Tue, 9 Apr 2019 06:11:53 +0000 (06:11 +0000)]
Merge "rdbms: Remove weird use of serialize() in MssqlBlob and DatabaseMssql"

5 years agoMerge "mediawiki.mixins: Remove obsolete `.list-style-image-svg()` mixin"
jenkins-bot [Tue, 9 Apr 2019 00:48:16 +0000 (00:48 +0000)]
Merge "mediawiki.mixins: Remove obsolete `.list-style-image-svg()` mixin"

5 years agoHistoryAction: Visually hide form legend
Volker E [Mon, 8 Apr 2019 06:53:45 +0000 (23:53 -0700)]
HistoryAction: Visually hide form legend

Bug: T220049
Depends-On: Ie3586dd240fac98fd43a0e5c685da6cb781a9b0c
Change-Id: Ie72dee4c0012de22d96a8d40488630c0efa02736

5 years agoHistoryAction: Clarify primary action button label
Volker E [Mon, 8 Apr 2019 06:40:20 +0000 (23:40 -0700)]
HistoryAction: Clarify primary action button label

Bug: T220048
Change-Id: Ie3586dd240fac98fd43a0e5c685da6cb781a9b0c

5 years agomediawiki.mixins: Remove obsolete `.list-style-image-svg()` mixin
Volker E [Mon, 8 Apr 2019 20:35:16 +0000 (13:35 -0700)]
mediawiki.mixins: Remove obsolete `.list-style-image-svg()` mixin

All known uses of this workaround for old browsers like IE 6-8 have
been updated to not rely on mixin any more.
Therefore removing obsolete mixin definition.

Bug: T220327
Change-Id: Ica2d4f86d03249c179c255f905fa9b2deeea841e

5 years agomediawiki.user: Clarify sessionId documentation
T. Bayer [Fri, 5 Oct 2018 21:29:03 +0000 (14:29 -0700)]
mediawiki.user: Clarify sessionId documentation

The existing documentation creates the impression that this ID
remains the same until the browser session ends (like a session
cookie), which has led to misunderstandings about the results of
past data analyses.

See T118063#4547178 ff.

Change-Id: Ia2e156088b9e903836ceb8e2f9e77f9fb46a49fe

5 years agoMerge "build: Add "View history" scenario for Fresnel"
jenkins-bot [Mon, 8 Apr 2019 20:10:42 +0000 (20:10 +0000)]
Merge "build: Add "View history" scenario for Fresnel"

5 years agoMerge "Fix IE conditional comment"
jenkins-bot [Mon, 8 Apr 2019 19:36:51 +0000 (19:36 +0000)]
Merge "Fix IE conditional comment"

5 years agoMerge "redo: don't die producing xml files if rev text export conversion fails"
jenkins-bot [Mon, 8 Apr 2019 18:55:30 +0000 (18:55 +0000)]
Merge "redo: don't die producing xml files if rev text export conversion fails"

5 years agoavoid link cache issues with duplicate title keys for xml dumps
Ariel T. Glenn [Mon, 8 Apr 2019 06:45:55 +0000 (09:45 +0300)]
avoid link cache issues with duplicate title keys for xml dumps

Bug: T220316
Change-Id: If73d6c9b4cac298a7832d65ffa34bc8f69b87752

5 years agoFix IE conditional comment
Fomafix [Mon, 8 Apr 2019 16:41:45 +0000 (18:41 +0200)]
Fix IE conditional comment

47422fabe2813fb12b7663257924fdf4cd7cd0d1 broke the IE conditional
comment. This is change restores them.

Change-Id: I397434e9c23506080fe5507b29c2cc48e2f078c7

5 years agoMerge "Update table header color of `.mw-datatable`"
jenkins-bot [Mon, 8 Apr 2019 18:17:39 +0000 (18:17 +0000)]
Merge "Update table header color of `.mw-datatable`"

5 years agojobqueue: add GenericParameterJob and RunnableJob interface
Aaron Schulz [Sat, 30 Mar 2019 06:07:48 +0000 (23:07 -0700)]
jobqueue: add GenericParameterJob and RunnableJob interface

Simplify the code of jobs that do not care about titles and removes
the direct Title dependency from JobQueue. Remove getTitle() from
IJobSpecification itself. Move all the Job::factory calls into a
single JobQueue::factoryJob() method.

Depends-on: Iee78f4baeca0c0b4d6db073f2fbcc56855114ab0
Change-Id: I9c9d0726d4066bb0aa937665847ad6042ade13ec

5 years agoMediaWikiTestCase: Fix schema restoration
Brad Jorsch [Mon, 8 Apr 2019 17:48:49 +0000 (13:48 -0400)]
MediaWikiTestCase: Fix schema restoration

First, after restoring the old schema it needs to clear the variable so
it doesn't keep "restoring" again and again for every subsequent test
class.

Second, after restoring the old schema it needs to repopulate anything
added by addCoreDBData() that was lost by dropping and recreating the
affected tables, which is easiest done by calling $this->resetDB().

Change-Id: I549d10eb7ceec117d3a0138449ca01f8065707d4

5 years agobuild: Add "View history" scenario for Fresnel
Timo Tijhof [Mon, 8 Apr 2019 17:35:06 +0000 (18:35 +0100)]
build: Add "View history" scenario for Fresnel

Change-Id: I84a9f1f73b948b57215dfc85ca3242ff1346e8a8

5 years agoFix order of @var parameter in PHP
Fomafix [Sat, 2 Feb 2019 13:39:58 +0000 (14:39 +0100)]
Fix order of @var parameter in PHP

Replace

 @var $foo type

by

 @var type $foo

Change-Id: Iec8b90ffea4028a1005daef422b7c4ec38c2715f

5 years agoMerge "Use IMaintainableDatabase type hint for DatabaseUpdater::newForDB()"
jenkins-bot [Mon, 8 Apr 2019 15:21:28 +0000 (15:21 +0000)]
Merge "Use IMaintainableDatabase type hint for DatabaseUpdater::newForDB()"

5 years agordbms: Remove weird use of serialize() in MssqlBlob and DatabaseMssql
Brad Jorsch [Mon, 8 Apr 2019 15:15:54 +0000 (11:15 -0400)]
rdbms: Remove weird use of serialize() in MssqlBlob and DatabaseMssql

The use in MssqlBlob could never be reached, since the test used `&&`
rather than `||`.

The use in DatabaseMssql should never be reached, and all our other
Database subclasses will give PHP warnings or errors when it tries to
stringify an array or object rather than silently serializing. MSSQL
should be consistent there. Further, MSSQL never *un*serializes, so it
seems rather useless anyway.

Change-Id: I7b193c6be28662edb38d416ac02371f7a293ab56

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 8 Apr 2019 06:07:06 +0000 (08:07 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1dcfd8baa72e77a0c43a30270cf3c39810f29760

5 years agoUpdate table header color of `.mw-datatable`
Volker E [Mon, 8 Apr 2019 05:30:01 +0000 (22:30 -0700)]
Update table header color of `.mw-datatable`

Bug: T214208
Change-Id: Id5f14b9a3af40a83385dcb4baf0e2d464c5e07a9

5 years agoMerge "Fix phpdoc for type hint for User::makeUpdateConditions()"
jenkins-bot [Mon, 8 Apr 2019 04:51:21 +0000 (04:51 +0000)]
Merge "Fix phpdoc for type hint for User::makeUpdateConditions()"

5 years agoMerge "resourceloader: Remove unused 'skipped' property from registry"
jenkins-bot [Mon, 8 Apr 2019 03:54:10 +0000 (03:54 +0000)]
Merge "resourceloader: Remove unused 'skipped' property from registry"

5 years agoMerge "resourceloader: Move registration of Resources.php to ServiceWiring"
jenkins-bot [Mon, 8 Apr 2019 03:54:04 +0000 (03:54 +0000)]
Merge "resourceloader: Move registration of Resources.php to ServiceWiring"

5 years agoFix phpdoc for type hint for User::makeUpdateConditions()
Aaron Schulz [Mon, 8 Apr 2019 03:46:22 +0000 (20:46 -0700)]
Fix phpdoc for type hint for User::makeUpdateConditions()

Change-Id: I46b3842495b3b9b8d44d16f434de4b44c65c1d80

5 years agoUse IMaintainableDatabase type hint for DatabaseUpdater::newForDB()
Aaron Schulz [Mon, 8 Apr 2019 03:44:46 +0000 (20:44 -0700)]
Use IMaintainableDatabase type hint for DatabaseUpdater::newForDB()

Change-Id: I56dd9f8d195ad60cf3ec9b81af2b4f25d1ca0a3a

5 years agoresourceloader: Remove unused 'skipped' property from registry
Timo Tijhof [Mon, 8 Apr 2019 00:20:06 +0000 (01:20 +0100)]
resourceloader: Remove unused 'skipped' property from registry

This was added for debugging purposes, but I've never needed it
so far. It also makes the shape of objects in the registry
inconsistent, which can be a de-opt.

Keep it for now, but with a more minimal impact by storing it
in the same property.

Change-Id: I297e3adb4765b83b1e7356b81cd056f99b3de93d

5 years agoMerge "Replace deprecated function wfEscapeShellArg with Shell::escape()"
jenkins-bot [Sun, 7 Apr 2019 22:42:26 +0000 (22:42 +0000)]
Merge "Replace deprecated function wfEscapeShellArg with Shell::escape()"

5 years agoReplace deprecated function wfEscapeShellArg with Shell::escape()
Derick Alangi [Sun, 7 Apr 2019 11:36:22 +0000 (12:36 +0100)]
Replace deprecated function wfEscapeShellArg with Shell::escape()

Change-Id: I4046d593d1450cfffc489ca2abadba1084a540e4

5 years agoMerge "Improve docs for Title::getInternalURL/getCanonicalURL"
jenkins-bot [Sun, 7 Apr 2019 17:25:33 +0000 (17:25 +0000)]
Merge "Improve docs for Title::getInternalURL/getCanonicalURL"

5 years agoRemove redundant closure for all packageFiles with own directory
Fomafix [Sun, 7 Apr 2019 08:15:00 +0000 (10:15 +0200)]
Remove redundant closure for all packageFiles with own directory

The modules loaded with packageFiles, which are always executed in
module scope (with a closure), even in debug mode.

The behaviour of non-packageFiles debug mode is the only reason files
have closures.

Bug: T50886
Change-Id: I38b1b426930763e5ddf61fa29235c2df829310c3

5 years agoMake Special:Version escape extension names that aren't links
Brian Wolff [Sun, 17 Feb 2019 11:09:45 +0000 (11:09 +0000)]
Make Special:Version escape extension names that aren't links

This is to make phan-taint-check happy. Technically this is
a breaking change, but I am unaware of any extensions actually
having their names be arbitrary html, and support for this
is not documented anywhere.

Bug: T216348
Change-Id: I065d7e57f36e079e0b02180379e2df1f8535f3a8

5 years agoMerge "resourceloader: Fix ensureNewline( '' ) support for PHP 7"
jenkins-bot [Sun, 7 Apr 2019 16:52:25 +0000 (16:52 +0000)]
Merge "resourceloader: Fix ensureNewline( '' ) support for PHP 7"

5 years agoMerge "resourceloader: Use self::class instead of 'self'"
jenkins-bot [Sun, 7 Apr 2019 16:52:20 +0000 (16:52 +0000)]
Merge "resourceloader: Use self::class instead of 'self'"

5 years agoMerge "Fix/suppress phan errors related to arrays (#11)"
jenkins-bot [Sun, 7 Apr 2019 16:44:03 +0000 (16:44 +0000)]
Merge "Fix/suppress phan errors related to arrays (#11)"

5 years agoresourceloader: Fix ensureNewline( '' ) support for PHP 7
Fomafix [Sun, 7 Apr 2019 10:08:17 +0000 (12:08 +0200)]
resourceloader: Fix ensureNewline( '' ) support for PHP 7

substr( '', -1 ) returns '', not false, in PHP 7.

Change-Id: Ie48fe064385e70f070e3fbfe0b62198f36cccd6d

5 years agoresourceloader: Use self::class instead of 'self'
Fomafix [Sun, 7 Apr 2019 11:49:26 +0000 (13:49 +0200)]
resourceloader: Use self::class instead of 'self'

Change-Id: I66d9974875d404fb5f7669f3962e694e1d56c350

5 years agoFix/suppress phan errors related to arrays (#11)
Kunal Mehta [Sun, 7 Apr 2019 07:11:39 +0000 (00:11 -0700)]
Fix/suppress phan errors related to arrays (#11)

Change-Id: Ie5c05fbc88c51d493bc1462005d2f8dde5f72101

5 years agoInject LinkRendererFactory into Parser
Aryeh Gregor [Wed, 8 Aug 2018 14:57:31 +0000 (17:57 +0300)]
Inject LinkRendererFactory into Parser

Change-Id: Idaf5a0f897dc3bd2aa9bf03be280281836bfc645

5 years agoMerge "Change Database type hints to use IDatabase"
jenkins-bot [Sun, 7 Apr 2019 09:13:34 +0000 (09:13 +0000)]
Merge "Change Database type hints to use IDatabase"

5 years agoMerge "Fix phan errors by improving documentation (#10)"
jenkins-bot [Sun, 7 Apr 2019 09:13:15 +0000 (09:13 +0000)]
Merge "Fix phan errors by improving documentation (#10)"

5 years agoMerge "Fix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)"
jenkins-bot [Sun, 7 Apr 2019 09:13:09 +0000 (09:13 +0000)]
Merge "Fix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)"

5 years agoMerge "Fix misc phan errors by adjusting documentation (#8)"
jenkins-bot [Sun, 7 Apr 2019 09:13:03 +0000 (09:13 +0000)]
Merge "Fix misc phan errors by adjusting documentation (#8)"

5 years agoMerge "Follow-up 8e1342ed47: Add @since for Title::NEW_CLONE"
jenkins-bot [Sun, 7 Apr 2019 02:32:40 +0000 (02:32 +0000)]
Merge "Follow-up 8e1342ed47: Add @since for Title::NEW_CLONE"

5 years agoChange Database type hints to use IDatabase
Aaron Schulz [Sat, 6 Apr 2019 23:29:36 +0000 (16:29 -0700)]
Change Database type hints to use IDatabase

Change-Id: Ie1e86cd961a619335138402ba22fe2a73a3e62fd

5 years agoMerge "debug: Use __CLASS__ to get the name of the class"
jenkins-bot [Sun, 7 Apr 2019 01:08:04 +0000 (01:08 +0000)]
Merge "debug: Use __CLASS__ to get the name of the class"

5 years agoMerge "resourceloader: Add missing (string) cast to ClientHtml tests"
jenkins-bot [Sun, 7 Apr 2019 01:03:25 +0000 (01:03 +0000)]
Merge "resourceloader: Add missing (string) cast to ClientHtml tests"

5 years agoMerge "phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestLis...
jenkins-bot [Sun, 7 Apr 2019 01:02:12 +0000 (01:02 +0000)]
Merge "phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener"

5 years agodebug: Use __CLASS__ to get the name of the class
Derick Alangi [Wed, 27 Mar 2019 11:35:40 +0000 (12:35 +0100)]
debug: Use __CLASS__ to get the name of the class

self::class would have been better here for consistency across
the code base but seems HHVM handles self::class diferrently from
PHP 7, when used inside a trait. The difference is significant to the
tests and thus we keep the result the same by using __CLASS__ instead.

Change-Id: I58b452341a0567f4d6e6636a7e489531a5569d20

5 years agoFollow-up 8e1342ed47: Add @since for Title::NEW_CLONE
James D. Forrester [Sun, 7 Apr 2019 00:28:43 +0000 (17:28 -0700)]
Follow-up 8e1342ed47: Add @since for Title::NEW_CLONE

Change-Id: I6ad81dad179b2f2f009c8dc43f51eb0083c066f3

5 years agoMerge "mediawiki.Title: Remove redundant closure"
jenkins-bot [Sat, 6 Apr 2019 23:54:02 +0000 (23:54 +0000)]
Merge "mediawiki.Title: Remove redundant closure"

5 years agoresourceloader: Move registration of Resources.php to ServiceWiring
Timo Tijhof [Sat, 6 Apr 2019 20:41:36 +0000 (21:41 +0100)]
resourceloader: Move registration of Resources.php to ServiceWiring

This identified something we hadn't codified before which is that
we expect the 'startup' module to always exist. The code and tests
for ResourceLoaderClientHtml also assume this, which we now
acknowledge explicitly by leaving it in the constructor.

Bug: T32956
Change-Id: Iffc545eb32078aed0d059e5902a5c9382e14c641

5 years agomediawiki.Title: Remove redundant closure
Timo Tijhof [Sat, 6 Apr 2019 20:34:17 +0000 (21:34 +0100)]
mediawiki.Title: Remove redundant closure

This module is loaded with packageFiles, which is always executed
in module scope (with a closure), even in debug mode.

The behaviour of non-packageFiles debug mode is the only reason
files have closures.

Bug: T50886
Change-Id: I6c0e686cb1d6971a6a9c5eeab2d2a093d2dae2d3

5 years agoresourceloader: Add missing (string) cast to ClientHtml tests
Timo Tijhof [Sat, 6 Apr 2019 23:02:28 +0000 (00:02 +0100)]
resourceloader: Add missing (string) cast to ClientHtml tests

One of the assertions already did this, but the others not yet.

The reason we do this is because the return value is a WrappedString
object. The assertEquals() method is able to satisfy the expected
value because of loose comparison casting it to a string for the
case where it matches.

But, when it fails during development, PHPUnit was still printing
the object as "Actual" and the string as "Expected" which makes
it difficult to understand what's going on, and also no diff.

Change-Id: Ice9fe5061fb76867e9bee2f34c88d3ddac3144f9

5 years agophpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener
Timo Tijhof [Sat, 6 Apr 2019 22:53:30 +0000 (23:53 +0100)]
phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener

Follows-up 96657099fc (T217489) adding MediaWikiLoggerPHPUnitTestListener.
It started printing messages from log channels to CLI output when there
is one or more failed assertions. This is useful.

But, it also interacts with MediaWikiPHPUnitTestListener from 2018,
which calls wfDebugLog('PHPUnitCommand', …) for every test and every
assertion. That allows one to later open debug.log and see MediaWiki's
messages interleaved with PHPUnit activity. This provides messages from
a much larger scope (including before test setup, and data providers).

But, this means we get:

 > There were N failures:
 > 1) ExampleTest::testGetThing
 > === Logs generated by test case
 > [PHPUnitCommand] [info] FAILURE in ExampleTest::testGetThing:
 > [PHPUnit\Framework\ExpectationFailedException] Failed asserting …
 > …
 > …
 > …
 > … {"private":false}
 > ===
 > Failed asserting that …
 > --- Expected
 > +++ Actual
 > @@ @@
 > …
 > /var/www/mediawiki/tests/phpunit/includes/…:…

This needlessly repeats the test name and method, and takes up
vertical space to describe the failed assertion in a way that is
less useful than the one that PHPUnit already prints after it.

Exclude these by default from CLI.

Bug: T217489
Change-Id: I0f471f82b16ba869d15389ed470bd73dc6deea78

5 years agoMerge "jobqueue: update claim array in JobQueueMemory::doAck"
jenkins-bot [Sat, 6 Apr 2019 20:15:31 +0000 (20:15 +0000)]
Merge "jobqueue: update claim array in JobQueueMemory::doAck"

5 years agoMerge "rdbms: deprecate unused aggregateValue() method"
jenkins-bot [Sat, 6 Apr 2019 20:03:36 +0000 (20:03 +0000)]
Merge "rdbms: deprecate unused aggregateValue() method"

5 years agoMerge "jobqueue: clean up __construct() signature for some job classes"
jenkins-bot [Sat, 6 Apr 2019 20:02:20 +0000 (20:02 +0000)]
Merge "jobqueue: clean up __construct() signature for some job classes"

5 years agojobqueue: update claim array in JobQueueMemory::doAck
Aaron Schulz [Fri, 5 Apr 2019 00:27:44 +0000 (17:27 -0700)]
jobqueue: update claim array in JobQueueMemory::doAck

Fixes regression from a51ea350bed6f66b.

Change-Id: Id4d703b5537069e785a5c1454b9fc2785494247b

5 years agoMerge "for exports, make sure we compare page titles as strings only"
jenkins-bot [Sat, 6 Apr 2019 18:53:54 +0000 (18:53 +0000)]
Merge "for exports, make sure we compare page titles as strings only"

5 years agojobqueue: clean up __construct() signature for some job classes
Aaron Schulz [Fri, 29 Mar 2019 18:40:59 +0000 (11:40 -0700)]
jobqueue: clean up __construct() signature for some job classes

The $params value should always be an array

Change-Id: If7a0350b64241c7b5bbbdbc7bc90379a93484013

5 years agoMerge "resourceloader: Fix variable spacings where need be"
jenkins-bot [Sat, 6 Apr 2019 15:12:04 +0000 (15:12 +0000)]
Merge "resourceloader: Fix variable spacings where need be"

5 years agoresourceloader: Fix variable spacings where need be
Jack Phoenix [Sat, 6 Apr 2019 12:48:39 +0000 (15:48 +0300)]
resourceloader: Fix variable spacings where need be

This fix is to make sure resource loader code conforms with convension
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Spaces.

Change-Id: I34c0a0addbf7c373fc3a64b644a3098bb485a3f4

5 years agoMove PackedHoverImageGallery from PackedOverlayImageGallery.php
Zoranzoki21 [Sat, 6 Apr 2019 12:12:02 +0000 (14:12 +0200)]
Move PackedHoverImageGallery from PackedOverlayImageGallery.php

Change-Id: I7a764fa89637dc7c3865dbbbbe0d90d5bc268ed2

5 years agofor exports, make sure we compare page titles as strings only
Ariel T. Glenn [Sat, 6 Apr 2019 09:24:30 +0000 (12:24 +0300)]
for exports, make sure we compare page titles as strings only

...and not as numbers!! Also added strict compare for the namespaces
field while we're in here.

Bug: T220257
Change-Id: If68b79334188c2f3be5d254bea3c1e27d52c4a9f

5 years agoMerge "rdbms: add and enforce DB_REPLICA/DB_MASTER roles in DBConnRef"
jenkins-bot [Sat, 6 Apr 2019 09:54:16 +0000 (09:54 +0000)]
Merge "rdbms: add and enforce DB_REPLICA/DB_MASTER roles in DBConnRef"

5 years agoMerge "Add Special:Users as a synonym for Special:ListUsers"
jenkins-bot [Sat, 6 Apr 2019 09:34:10 +0000 (09:34 +0000)]
Merge "Add Special:Users as a synonym for Special:ListUsers"

5 years agoFix phan errors by improving documentation (#10)
Kunal Mehta [Sat, 6 Apr 2019 07:07:54 +0000 (00:07 -0700)]
Fix phan errors by improving documentation (#10)

PhanTypeExpectedObjectPropAccess was flagged by phan in the
DatabaseMysqli and Preprocessor_Hash classes.

In Database, the $conn property might be a standard object, such as
`\mysqli`, which is not a resource.

In Preprocessor, phan was getting confused and thinking
PPDStack::getCurrentPart() was returning bool, and not a PPDPart object.
Adding explicit documentation about the return value fixed that.

Change-Id: I0a3aa219693da5cb46ff9c0936841ed740c6968a

5 years agoFix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)
Kunal Mehta [Sat, 6 Apr 2019 06:40:01 +0000 (23:40 -0700)]
Fix PhanPluginDuplicateExpressionBinaryOp in DjVuImage (#9)

== has a higher precedence operator than &.

So the line `$chunkLength & 1 == 1` is interepreted as:
`$chunkLength & true`. Probably not what was intended, but it actually
works out because true is cast to 1, and the expression will either
result with 0 (falsey) or 1 (truthy), and we were looking for it to
equal 1 anyways. Incredible.

I assume that it was supposed to be `( $chunkLength & 1 ) == 1`, so I've
modified it to use that.

Change-Id: If03823b9286e0d8282519949bf46e2ba4cca0843

5 years agoFix misc phan errors by adjusting documentation (#8)
Kunal Mehta [Sat, 6 Apr 2019 06:31:16 +0000 (23:31 -0700)]
Fix misc phan errors by adjusting documentation (#8)

PhanTypeInvalidRightOperand was triggering on
ApiQueryBase::showHiddenUsersAddBlockInfo() on the line
`$actorQuery['tables'] + $commentQuery['tables']` (and the next one).
For whatever reason, phan was unable to automatically understand that
the right side was an array (though it was able to understand
$actorQuery, which has nearly identical code...), so I added more
specific hinting to CommentStore::getJoin() using phan's union types,
which resolved the issue.

And incorrect documentation on LogEntry::getDeleted() was triggering
PhanTypeMismatchBitwiseBinaryOperands since you can't do bitwise
operations on a string and an integer.

Change-Id: I13b791e4b754ffbc340b55cfb752e2d9226f1949

5 years agoFix PhanUnextractableAnnotation* errors (#7)
Kunal Mehta [Sat, 6 Apr 2019 06:19:29 +0000 (23:19 -0700)]
Fix PhanUnextractableAnnotation* errors (#7)

Change-Id: I8194a7b9c9abce951002590030913706e9bd743e

5 years agoFix phan errors in ChangesListSpecialPage (#6)
Kunal Mehta [Sat, 6 Apr 2019 06:10:08 +0000 (23:10 -0700)]
Fix phan errors in ChangesListSpecialPage (#6)

Specifically in registerFiltersFromDefinitions(), phan was unable to
tell that $groupDefinition['class'] was a string. I think it assumed it
was an integer because the earlier $groupDefinition['priority'] was an
integer.

Use phan's more advanced type documentation system to instruct it that
$className will be a string.

Change-Id: I09f41366b713d6159b57e798cfd1720f42ba30ef

5 years agoResync phan error counts
Kunal Mehta [Sat, 6 Apr 2019 06:00:03 +0000 (23:00 -0700)]
Resync phan error counts

Change-Id: I9d893d5d05ff83c8c8e8c807e35fc2474584a24a

5 years agordbms: deprecate unused aggregateValue() method
Aaron Schulz [Fri, 5 Apr 2019 23:59:29 +0000 (16:59 -0700)]
rdbms: deprecate unused aggregateValue() method

Change-Id: I708a5786657e8d22e4b42230bfadb11ce0d7b9ca

5 years agoMerge "Make WrapOldPasswords pass "refresh" to User::clearSharedCache()"
jenkins-bot [Fri, 5 Apr 2019 23:58:12 +0000 (23:58 +0000)]
Merge "Make WrapOldPasswords pass "refresh" to User::clearSharedCache()"

5 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Fri, 5 Apr 2019 23:46:19 +0000 (23:46 +0000)]
Merge "Localisation updates from https://translatewiki.net."

5 years agoMerge "rdbms: Clean up MssqlBlob constructor"
jenkins-bot [Fri, 5 Apr 2019 23:46:14 +0000 (23:46 +0000)]
Merge "rdbms: Clean up MssqlBlob constructor"

5 years agoMerge "Fix/suppress misc phan errors (#5)"
jenkins-bot [Fri, 5 Apr 2019 23:44:43 +0000 (23:44 +0000)]
Merge "Fix/suppress misc phan errors (#5)"

5 years agoMerge "Fix/suppress misc phan errors (#2)"
jenkins-bot [Fri, 5 Apr 2019 23:44:37 +0000 (23:44 +0000)]
Merge "Fix/suppress misc phan errors (#2)"

5 years agoMerge "rdbms: rename DB server index parameter to LoadBalancer::getMaintenanceConnect...
Krinkle [Fri, 5 Apr 2019 23:38:51 +0000 (23:38 +0000)]
Merge "rdbms: rename DB server index parameter to LoadBalancer::getMaintenanceConnectionRef()"

5 years agoMake WrapOldPasswords pass "refresh" to User::clearSharedCache()
Aaron Schulz [Fri, 5 Apr 2019 23:34:49 +0000 (16:34 -0700)]
Make WrapOldPasswords pass "refresh" to User::clearSharedCache()

Change-Id: I944488abce4ea15c2f4954ffb82b0354424335db

5 years agoMerge "build: Updating mediawiki/mediawiki-codesniffer to 25.0.0"
jenkins-bot [Fri, 5 Apr 2019 23:18:01 +0000 (23:18 +0000)]
Merge "build: Updating mediawiki/mediawiki-codesniffer to 25.0.0"

5 years agoFix/suppress misc phan errors (#2)
Kunal Mehta [Fri, 22 Mar 2019 01:12:50 +0000 (18:12 -0700)]
Fix/suppress misc phan errors (#2)

* Title: phan false positive
* McrUndoAction: fixed improper use of @param
* UploadSourceAdapter: fixed wrong type
* XmlTypeCheck: Use null so phan doesn't think we're trying to call the
function ''
* Database: phan false positive
* SpecialBlock: Use phan's advanced type documentation so phan knows
specifically what's being returned
* ChangesListSpecialPage: phan false positive
* BatchRowUpdate: Have default callback take a parameter so phan doesn't
think too many arguments are being passed
* MimeAnalyzer: left FIXME for relying on PHP 7.1 unpack() signature
* LanguageConverter: Specify types for $mTables since phan couldn't
determine it automatically
* preprocessorFuzzTest: Implement User::load() method signature

Change-Id: I08080ab636c5fe67ea6a4e14b2212d7523606e21

5 years agoMerge "Fixes LocalFile isMissing always returning true"
jenkins-bot [Fri, 5 Apr 2019 23:02:04 +0000 (23:02 +0000)]
Merge "Fixes LocalFile isMissing always returning true"

5 years agordbms: Clean up MssqlBlob constructor
Kunal Mehta [Sun, 24 Mar 2019 00:37:20 +0000 (17:37 -0700)]
rdbms: Clean up MssqlBlob constructor

Returning inside PHP constructors doesn't work, so whatever this code
was previously trying to do didn't work. Now we directly set $this->data
to the existing $data->data. Note that we can't fall through to the
instanceof Blob due to MssqlBlob->fetch() not being idempotent.

Also expand the @param documentation for $data.

h/t to phan for highlighting this and Anomie for explaining that the
behavior was wrong and how to properly fix it.

Change-Id: Ied5ba2f63cbaf7c8e0f951000dbc4aa3089edd80

5 years agoFix/suppress misc phan errors (#5)
Kunal Mehta [Fri, 22 Mar 2019 06:11:04 +0000 (23:11 -0700)]
Fix/suppress misc phan errors (#5)

Add lots of missing return statements, or remove incorrect doc blocks.

Change-Id: I0881e98fbb9d0d4cf79ecc824064d24538055d3f

5 years agobuild: Updating mediawiki/mediawiki-codesniffer to 25.0.0
Kunal Mehta [Fri, 5 Apr 2019 22:32:46 +0000 (15:32 -0700)]
build: Updating mediawiki/mediawiki-codesniffer to 25.0.0

Change-Id: I1132bb024abe9a5f8a5374eb062d1b8efbfc3007

5 years agoMerge "Fix/suppress misc phan errors (#4)"
jenkins-bot [Fri, 5 Apr 2019 22:42:35 +0000 (22:42 +0000)]
Merge "Fix/suppress misc phan errors (#4)"

5 years agoMerge "Fix PhanUndeclaredType* errors (#3)"
jenkins-bot [Fri, 5 Apr 2019 22:41:37 +0000 (22:41 +0000)]
Merge "Fix PhanUndeclaredType* errors (#3)"

5 years agoFix/suppress misc phan errors (#4)
Kunal Mehta [Fri, 22 Mar 2019 03:04:43 +0000 (20:04 -0700)]
Fix/suppress misc phan errors (#4)

* RevisionStore: phan is confused by the array not being the callable
* ApiContinuationManger: phan false positive
* ChronologyProtector: fix doc block
* MssqlBlob: phan doesn't like __construct returning things
* WikiPage: Remove Revision typehint that doesn't match doc block

Change-Id: I0661d97424d0ad6f7a3357542e79aceb6a4f6c64

5 years agoFixes LocalFile isMissing always returning true
Juan Osorio [Fri, 5 Apr 2019 21:47:38 +0000 (14:47 -0700)]
Fixes LocalFile isMissing always returning true

Bug: T220244
Change-Id: I6f4e1371759559a14cb7b2125792fcfbba7e4cf3