Commit graph

837 commits

Author SHA1 Message Date
Aaron Schulz
390fce6db1 Move user_editcount updates to a mergeable deferred update
This should reduce excess contention and lock timeouts.
Previously, it used a pre-commit hook which ran just before the
end of the DB transaction round.

Also removed unused User::incEditCountImmediate() method.

Bug: T202715
Depends-on: I6d239a5ea286afb10d9e317b2ee1436de60f7e4f
Depends-on: I0ad3d17107efc7b0e59f1dd54d5733cd1572a2b7
Change-Id: I0d6d7ddd91bbb21995142808248d162e05696d47
2018-10-25 15:32:18 -07:00
jenkins-bot
837b96248d Merge "Revert "Introduce Special:RedirectExternal"" 2018-10-18 17:05:10 +00:00
Kosta Harlan
7e81d6f49e Revert "Introduce Special:RedirectExternal"
This reverts commit b83cf88837.

Reason for revert: Security concerns, needs some more nuance.

Change-Id: I5823c3da77accca9839f9632611315223e05351b
2018-10-18 16:18:20 +00:00
jenkins-bot
c75059dacb Merge "Introduce Special:RedirectExternal" 2018-10-17 22:12:52 +00:00
Kosta Harlan
b83cf88837 Introduce Special:RedirectExternal
Special:RedirectExternal is an unlisted special page that accepts a URL as
the first argument, and redirects the user to that page.
Example: Special:RedirectExternal/https://mediawiki.org

At the moment, this is intended to be used by the GrowthExperiments project in
order to track outbound visits to certain external links. But it could be
extended in the future to provide parameters for showing a message to the user
before redirecting, or explicitly requiring a user to click on the link, which
could help improve security when users follow on-wiki links to off-wiki sites.

Bug: T207115
Change-Id: I822af14a84569aab22249e2f16a662a60e60f76a
2018-10-17 14:52:09 -07:00
Brad Jorsch
6ff65e57bb API: Remove long-deprecated methods (and one class)
* ApiBase::profileIn() (deprecated in 1.25)
* ApiBase::profileOut() (deprecated in 1.25)
* ApiBase::safeProfileOut() (deprecated in 1.25)
* ApiBase::profileDBIn() (deprecated in 1.25)
* ApiBase::profileDBOut() (deprecated in 1.25)
* ApiBase::dieUsage() (deprecated in 1.29)
* ApiBase::dieUsageMsg() (deprecated in 1.29)
* ApiBase::dieUsageMsgOrDebug() (deprecated in 1.29)
* ApiBase::getErrorFromStatus() (deprecated in 1.29)
* ApiBase::parseMsg() (deprecated in 1.29)
* ApiBase::setWarning() (deprecated in 1.29)
* ApiPageSet::getInvalidTitles() (deprecated in 1.26)
* ApiQueryLogEvents::addLogParams() (deprecated in 1.25)
* ApiUsageException::getCodeString() (deprecated in 1.29)
* ApiUsageException::getMessageArray() (deprecated in 1.29)
* UsageException (deprecated in 1.29)

Change-Id: Iabb2589a29cc3b46624d31358f3a6bf7b3ccbd57
2018-10-15 16:37:04 -04:00
jenkins-bot
cf6fb41666 Merge "Re-namespace RevisionStore and RevisionRecord classes" 2018-10-10 05:16:45 +00:00
jenkins-bot
95bb2a6f0b Merge "Use job queue for deletion of pages with many revisions" 2018-10-10 04:55:53 +00:00
Brad Jorsch
dff469a408 Re-namespace RevisionStore and RevisionRecord classes
During development a lot of classes were placed in MediaWiki\Storage\.
The precedent set would mean that every class relating to something
stored in a database table, plus all related value classes and such,
would go into that namespace.

Let's put them into MediaWiki\Revision\ instead. Then future classes
related to the 'page' table can go into MediaWiki\Page\, future classes
related to the 'user' table can go into MediaWiki\User\, and so on.

Note I didn't move DerivedPageDataUpdater, PageUpdateException,
PageUpdater, or RevisionSlotsUpdate in this patch. If these are kept
long-term, they probably belong in MediaWiki\Page\ or MediaWiki\Edit\
instead.

Bug: T204158
Change-Id: I16bea8927566a3c73c07e4f4afb3537e05aa04a5
2018-10-09 10:22:48 -04:00
Aaron Schulz
59242afaa7 messagecache: use MergeableUpdate for the deferred replace() update
This combines the load loop for multiple messages for a language code.

Bug: T203925
Bug: T193271
Change-Id: Ie5e1e83d6740344b7ca641c99fb3bd4ad5718492
2018-10-05 20:14:41 +00:00
Bill Pirkle
ca9f1dabf3 Use job queue for deletion of pages with many revisions
Pages with many revisions experience transaction size exceptions,
due to archiving revisions.  Use the job queue to split the work
into batches and avoid exceptions.

Bug: T198176
Change-Id: Ie800fb5a46be837ac91b24b9402ee90b0355d6cd
2018-10-03 19:16:14 -05:00
Brad Jorsch
7a422138a7 Migrate image descriptions from image_comment_temp
image_comment_temp was always intended to be temporary, until an
expensive schema change on Wikimedia Commons's image table could be
done. Now that that has been done, stop writing image_comment_temp and
add a migration script to copy existing data into img_description_id.

Ic8efeddc will remove the reads from image_comment_temp and drop the
image_comment_temp table.

Bug: T188132
Change-Id: Iab5f521577a415b2dc213b517ee8a0dca4fdd0aa
2018-10-02 10:30:00 -04:00
Reedy
ed6d53fd38 Add a maintenance script to remove all users from a User Group
Bug: T185989
Change-Id: Ie5cc95b350230bc730c1f1d9f06fc3e95c5f6bd0
2018-09-25 00:57:16 +00:00
jenkins-bot
cf0f32f778 Merge "Provide a way to restore an old revision with multiple slots." 2018-09-24 19:36:32 +00:00
daniel
9da12daf46 Provide a way to restore an old revision with multiple slots.
Bug: T204732
Change-Id: I0ea2711e68c78465a5e5cfaa0181ad5ce983d35a
2018-09-24 19:46:30 +02:00
Reedy
6aaaa070f3 Remove MimeMagic
Deprecated since 1.28

Change-Id: I793deb8669e353525464ccd840801e5015c545c8
2018-09-23 20:13:29 +00:00
Reedy
71badb429e Remove global namespaced LBFactory
Change-Id: Ia87aa5c9426af83627a1bbc9bd914546c89c1e47
2018-09-21 15:42:42 +00:00
jenkins-bot
b7625d63a6 Merge "Introduce ContentHandler::getSecondaryDataUpdates." 2018-09-17 14:06:19 +00:00
daniel
7960d5385f Introduce ContentHandler::getSecondaryDataUpdates.
This adds getSecondaryDataUpdates and getDeletionUpdates
to ContentHandler, and updates WikiPage and DerivedPageDataUpdates
to handle DataUpdates from all slots.

Bug: T194038
Bug: T194037
Change-Id: I75c96318f58a5cdda48484f7040ae41e6f42392a
2018-09-14 16:18:18 +02:00
Pikne
9c46871d60 Remove xx-uca-et collation workaround
Remove workaround introduced in I3e8031b9. No longer needed.

Bug: T202977
Change-Id: I39921ef83cddc33535b99bd9c0b75f8afb52ea9a
2018-09-11 13:33:24 +00:00
Kunal Mehta
e5ded68cf0 Use PSR-4 autoloader for includes/auth/
Change-Id: I63dec06f231a57093086f129b3c1d0ebe1389bab
2018-09-01 20:55:53 +00:00
jenkins-bot
0746755fa9 Merge "Split AuthManagerAuthPluginUser into a separate file" 2018-09-01 20:40:23 +00:00
daniel
e9f71517f7 [MCR] Introduce RevisionRenderer
RevisionRenderer is the MCR replacement for Content::getParserOutput,
as outlined in <https://www.mediawiki.org/wiki/User:Daniel_Kinzler_(WMDE)/MCR-PageUpdater>.

Note: This change also introduces quite a bit of code for
merging ParserOutput objects.

Bug: T194048
Change-Id: I871978bf79f67c9e7954fb3fc8528d6e365f2cc1
2018-08-30 19:15:12 +02:00
Kunal Mehta
d9deecf432 Split AuthManagerAuthPluginUser into a separate file
Change-Id: I22d2bf9514caf717a5d949bed425de1376670d3e
2018-08-28 15:22:49 -07:00
jenkins-bot
d9fb5f0346 Merge "Replace "Bug37714" by "T39714"" 2018-08-27 20:31:34 +00:00
Brad Jorsch
a9033efb28 MCR: Add temporary web UI mcrundo action
Since SDC doesn't actually require the edit form to handle multi-slot
editing, updating EditPage with its normal undo handling is being put
off for later. But in the mean time we still want some sort of "undo" to
work, hence this mcrundo that doesn't allow for editing.

Bug: T200216
Change-Id: I1f11d8ed141cb11576d2df883856d03e8f64bd38
Depends-On: Iedd9bf6c057e8b396a575bab700b15bd38b32cc9
2018-08-23 16:15:14 +00:00
jenkins-bot
b79bc0a274 Merge "OOUIfy CheckMatrix in PHP and JS" 2018-08-22 20:09:12 +00:00
Moriel Schottlender
5a430cdc1c OOUIfy CheckMatrix in PHP and JS
This is to make sure that the design is similar, but also so
that the widget can be read in JS where needed and that we
can toggle the disabled state on/off through the whole widget,
that is made from a series of checkbox widgets.

Bug: T199946
Change-Id: I9943b0aa1746fdfb60c7d4c88d6d4d7ac0589a2c
2018-08-22 21:31:27 +02:00
jenkins-bot
9381d7cbd4 Merge "benchmarks: Minor cleanup for strtr benchmark" 2018-08-22 11:43:13 +00:00
jenkins-bot
1504dea112 Merge "maintenance: Move backup.inc to a regular php class file" 2018-08-22 11:15:03 +00:00
jenkins-bot
b658c71db4 Merge "Add a maintenance script to add a Change Tag" 2018-08-21 20:52:13 +00:00
Reedy
d20f246683 Add a maintenance script to add a Change Tag
Change-Id: I51406b0e9140e5a462d9dd256b1d949fa09b67a0
2018-08-21 18:32:02 +00:00
jenkins-bot
6fb0c3a26d Merge "maintenance: Add maintenance script for managing foreign resources" 2018-08-21 17:53:29 +00:00
Timo Tijhof
dd8cced9ff maintenance: Add maintenance script for managing foreign resources
Something for the short-term, perhaps. But at least an improvement
over 'update-oojs.sh' and 'update-ooui.sh'.

* Does not require any dependencies (no 'node' or 'npm').
* Performs integrity validation.

Change-Id: I0f79b84ef3903756353c66d3c3ee7e492c60e648
2018-08-21 17:18:48 +00:00
Fomafix
90acd0edea Replace "Bug37714" by "T39714"
Change-Id: I7951b24d08fb5257c8e7a52fa5f8f45b6631b979
2018-08-20 23:48:11 +02:00
Gergő Tisza
d31580eeb0
[MCR] Render multi-slot diffs
Move logic for rendering a diff between two content objects out of
DifferenceEngine, into a new SlotDiffRenderer class. Make
DifferenceEngine use multiple SlotDiffRenderers, one per slot.

This separates the class tree for changing high-level diff properties
such as the header or the revision selection method (same as before:
subclass DifferenceEngine and override ContentHandler::getDiffEngineClass
or implement GetDifferenceEngine) and the one for changing the actual
diff rendering for a given content type (subclass SlotDiffRenderer and
override ContentHandler::getSlotDiffRenderer or implement
GetSlotDiffRenderer). To keep B/C, when SlotDiffRenderer is not overridden
for a given content type but DifferenceEngine is, that DifferenceEngine
will be used instead.
The weak point of the scheme is overriding the DifferenceEngine methods
passing control to the SlotDiffRenderers (the ones calling
getDifferenceEngines), without calling the parent. These are:
showDiffStyle, getDiffBody, getDiffBodyCacheKeyParams. Extensions doing
that will probably break in unpredictable ways (most likely, only
showing the main slot diff). Nothing in gerrit does it, at least.

A new GetSlotDiffRenderer hook is added to modify rendering for content
models not owned by the extension, much like how GetDifferenceEngine
works.

Also deprecates public access to mNewRev/mOldRev and creates public
getters instead. DifferenceEngine never supported external changes to
those properties, this just acknowledges it.

Bug: T194731
Change-Id: I2f8a9dbebd2290b7feafb20e2bb2a2693e18ba11
Depends-On: I04e885a33bfce5bccc807b9bcfe1eaa577a9fd47
Depends-On: I203d8895bf436b7fee53fe4718dede8a3b1768bc
2018-08-20 15:39:12 +02:00
addshore
82b19bd96a Create and use PrefixingStatsdDataFactoryProxy in PerDbNameStatsdDataFactory
MediaWiki::emitBufferedStatsdData() is never called for the PerDbName factory,
so stats were being dropped. Instead of having two factories, turn the
PerDbName one into a proxy/wrapper around the main factory that just adds a
prefix in front of all of the keys.

Bug: T202144
Change-Id: I31e376446abb58e41353b4ca3814120d2e914104
2018-08-19 00:19:57 -07:00
Kunal Mehta
3b1e8a5cef Move wfMakeStaticArrayFile() into a class
And include tests :)

This code is independent of MediaWiki, but not really large enough to be
worth librarizing right now.

Bug: T200626
Change-Id: I022c074e8a708fb5219bc4ff4b53e7e31f60dc4b
2018-08-17 22:48:19 -07:00
Timo Tijhof
1031825f3b benchmarks: Minor cleanup for strtr benchmark
Only bench with variable input ("indirect"). The static string is
too unrealistic and not worth testing for imho, if it even makes
a difference at all.

Also bump the default count from 100 to 10,000 given it's so tiny.

Change-Id: Iccc35af4bd3c5b0967983ddfacd1d4ead235e4a4
2018-08-18 03:57:45 +00:00
Aryeh Gregor
d4045035b0 Make SpecialPageFactory a service
Calling SpecialPageFactory methods statically is now soft-deprecated.

SpecialPageFactory::resetList() is a no-op, and I changed tests
in core to use overrideMwServices() instead.

Methods that fell back to $wgUser now require a User object being passed.

Depends-On: Ie1f80315871085b9fd4763a265b588849d94414d
Change-Id: Id8a92d57743f790b7d8c377c033cef38d1bb24de
2018-08-17 11:12:23 -07:00
Timo Tijhof
2960be7f1d benchmarks: Add benchmark for JavaScriptMinifier
Bug: T201606
Change-Id: I40fe0b2799b210e552b96f9fadc2b394928ec729
2018-08-13 18:12:21 +00:00
Kunal Mehta
7c5a5fe93c Add benchmark script demonstrating TitleValue is slower than Title
Change-Id: I9fe5b35f0f5196830cf75eae33195d14d0a66238
2018-08-12 19:17:04 -07:00
Aryeh Gregor
62515f7b15 Introduce ParserFactory service
Bug: T200881
Change-Id: I257e78200983cb10afb76de1f07dd1b9d531c52a
2018-08-11 00:15:52 -06:00
jhsoby
3469713f4e Remove special collation for Northern Sami
This removes the special collation for Northern Sami
that was added in 396007, when UCA support for Northern
Sami was not yet in MediaWiki. Now it is, so this
is no longer needed.

Bug: T182431
Change-Id: I760eb7ae8bf92f0ac93b5fca5cb69148a28d8f6f
2018-08-07 01:21:21 +02:00
Timo Tijhof
55875bcd2d maintenance: Move backup.inc to a regular php class file
Move the class to maintenance/includes/, following the precedent
set by d788692076.

Bug: T184782
Change-Id: I0ba86e4401e2c97db4cf2ad9f0e78c04b5565ee8
2018-08-02 17:20:30 +01:00
Gergő Tisza
d788692076 Add maintenance script for deleting local passwords
This is mainly for the benefit of authentication extensions which
all need similar functionality for removing local passwords on a
wiki where local authentication was used for a while but has been
disabled, but can be used directly to just indiscriminately remove
the passwords of all users.

To test the change without irreversibly locking out users, an
option is provided to make the password invalid in an
easy-to-reverse way.

The immediate use case is I974184899c33.

This patch also introduces the maintenance/includes directory
to hold PHP files which are not executable scripts themselves.
(Previously such files had a .inc extension, but that is so PHP4.)

Bug: T57420
Change-Id: If7207b80a2c8374e90182e0b09d8f76ee94264b0
2018-08-02 13:47:33 +00:00
Aryeh Gregor
5189333c39 MagicWordFactory to replace MagicWord static members/methods
Static members of MagicWord have been removed.

Static methods are soft-deprecated and forward to the factory.  They
will be hard-deprecated when all callers are removed from core.

MagicWord::clearCache() has been removed.  Instead, call
resetServiceForTesting( 'MagicWordFactory' ) on your MediaWikiServices
object.

Change-Id: Ie061fe90f9b9eca0cbf7e8199d9ca325c464867a
Bug: T200247
2018-07-30 21:20:43 +03:00
jenkins-bot
f506a05aaa Merge "Upstream EasyDeflate library from VisualEditor" 2018-07-26 15:06:41 +00:00
jenkins-bot
9f32a4dc89 Merge "Add helper trait for deprecating properties" 2018-07-25 22:49:39 +00:00
Gergő Tisza
43e4cd5b43 Add maintenance script for resetting login/signup throttle
Bug: T194506
Change-Id: I6dda5f516ba47a452e438946379fcb696c8c87f9
2018-07-20 13:15:06 +00:00