lhc/web/wiklou.git
5 years agoregistration: Short-circuit if dependency constraint is '*'
Kunal Mehta [Tue, 28 Aug 2018 19:29:04 +0000 (12:29 -0700)]
registration: Short-circuit if dependency constraint is '*'

Most extensions depend upon any version of other extensions/skins since
versioning is pretty inconsistent. Since '*' is so commonly used, explicitly
short-circuit that constraint since we only need to check whether the
dependency is loaded.

Bug: T198044
Change-Id: I5526c8068d3b9a6ee5ca71ea6bdbcd693f1ffb7a

5 years agoUpdate $wgTranscludeCacheExpiry comment
Aaron Schulz [Tue, 28 Aug 2018 17:28:45 +0000 (10:28 -0700)]
Update $wgTranscludeCacheExpiry comment

Change-Id: Ic1f20c072174732f7fd8ecab9d366125d6f0c2d2

5 years agoMerge "Improve logging in MediaWikiTestCase"
jenkins-bot [Tue, 28 Aug 2018 09:47:04 +0000 (09:47 +0000)]
Merge "Improve logging in MediaWikiTestCase"

5 years agoMerge "Set migration stages in RevisionStoreDbTestBase"
jenkins-bot [Tue, 28 Aug 2018 09:39:15 +0000 (09:39 +0000)]
Merge "Set migration stages in RevisionStoreDbTestBase"

5 years agoMerge "Replace underscores with spaces in DeletedContribs form"
jenkins-bot [Tue, 28 Aug 2018 07:22:19 +0000 (07:22 +0000)]
Merge "Replace underscores with spaces in DeletedContribs form"

5 years agoMerge "Remove PhanUndeclaredStaticMethod from blacklist"
jenkins-bot [Tue, 28 Aug 2018 06:03:08 +0000 (06:03 +0000)]
Merge "Remove PhanUndeclaredStaticMethod from blacklist"

5 years agoMerge "resourceloader: Optimise several map-like objects with Object.create(null)"
jenkins-bot [Tue, 28 Aug 2018 05:47:28 +0000 (05:47 +0000)]
Merge "resourceloader: Optimise several map-like objects with Object.create(null)"

5 years agoImprove logging in MediaWikiTestCase
Tim Starling [Tue, 28 Aug 2018 02:39:33 +0000 (12:39 +1000)]
Improve logging in MediaWikiTestCase

Log test setup, start and end to the tests-phpunit log channel. This
helps when interpreting debug logs. The channel name was chosen by
analogy with the existing tests-parser log channel.

Change-Id: I2bc87564247f2f136b2244d426fa127d21663f92

5 years agoSet migration stages in RevisionStoreDbTestBase
Tim Starling [Mon, 27 Aug 2018 23:39:18 +0000 (09:39 +1000)]
Set migration stages in RevisionStoreDbTestBase

I confirmed that wgCommentTableSchemaMigrationStage needs to be set, and
getActorQueryFields() implies that the actor table migration stage needs
to be set as well.

Change-Id: I153ff985c8753b291d2201ebeed10515acb0cd36

5 years agoRemove PhanUndeclaredStaticMethod from blacklist
Erik Bernhardson [Fri, 8 Jun 2018 20:51:44 +0000 (13:51 -0700)]
Remove PhanUndeclaredStaticMethod from blacklist

There was a single instance of this issue which was reasonably simple
to solve. The code that triggered the issue was not wrong, but calling
the grandparent constructor directly is not the cleanest code so it
seems right to fix it. Switch revision initialization into an
overridable function to remove the need to even have a constructor in
the class.

Change-Id: Ic2af0d93e8d55e93061e3f4b5c7a4122509543f0

5 years agoMerge "resourceloader: Simplify addEmbeddedCSS by using object refs"
jenkins-bot [Tue, 28 Aug 2018 04:51:27 +0000 (04:51 +0000)]
Merge "resourceloader: Simplify addEmbeddedCSS by using object refs"

5 years agoresourceloader: Simplify addEmbeddedCSS by using object refs
Timo Tijhof [Sun, 26 Aug 2018 03:09:02 +0000 (04:09 +0100)]
resourceloader: Simplify addEmbeddedCSS by using object refs

* Previously, the same function was used both for adding to the buffer,
  and flushing the buffer (via self-calling alternate signatures).
  The flushing logic was split off to a flushCssBuffer function.

* Previously, when encountering an '@import' statement, it performed a
  synchronous flush, instead of the usual asynchronous ones. There was
  no reason for this, other than my laziness. I suspect because I was
  using strings, which can't be passed by reference, and I didn't
  think of another way.

  I'm now storing the string in an object, which can be passed by
  reference to the flush function. This means, as before, we can
  keep appending to its string after the flush is scheduled. But,
  unlike before, it also means we can reset our local reference and
  start a new buffer at any time and schedule that one, too.

Bug: T202703
Change-Id: Ifc6dd59e9e8885d65ba425bc579ecbfb09f2ac64

5 years agoresourceloader: Don't defer discovery of critical request via rIC()
Timo Tijhof [Tue, 28 Aug 2018 03:26:28 +0000 (04:26 +0100)]
resourceloader: Don't defer discovery of critical request via rIC()

== Overview

This reverses a small part of the big dec800968eb commit. That
commit eliminated the 2nd of 3 JS requests required on a page.

The first JS request is now modules=startup with the registry and
mw.loader. The main JS request for modules (now 2nd) is triggered
from RLQ, which fires when startup.js calls 'startUp()'.

== Regression

In commit dec800968eb, I thought I was being smart by letting the
browser "take a breath" at the end of startup.js before calling
'startUp()'. I now believe that this artifical is a mistake.

I thought it was a good idea because, before dec800968eb startup.js
made an http request (for jquery). During that network request the
main thread was free to do rendering. Then, when jquery came back,
we called startUp() to trigger our main request for modules (3rd,
now 2nd). While this request no longer exists, the idea was to keep
that thread yield at the end to startup.js.

I now think it was a mistake because requestIdleCallback is not
a "small" thread yield. Rather, I now find in production that in
the majority of cases (all mobile, and desktop first views) the
rIC is not called until *after* the page load event fires.

This means that during the entire page rendering time, the network
and javascript thread were sitting idle. Prioritising rendering and
making the page load complete 0.5s faster is great. But,
underutilising the network and delaying time to JS interation by 1-2
seconds, is bad.

== Cost

The startUp() function is quite light. All it does is a bunch of
pure JavaScript processing (no DOM), and then creates 1 script tag

On desktop (MacBook) with 6x CPU slowdown and mobile emulation
(enwiki/Obama) it clocks startUp() at 35ms.

On a real mobile device (Nexus 5, Android 4.4, the oldest currently
supported Android version/device I could find on BrowserStack) it
clocks startUp() on enwiki/Obama at 44ms.

This seems small enough to make it worth doing right away, without
artificial delay, so that it can kick off the network request in
the background while we're rendering - which is exactly how things
were before commmit dec800968eb was merged.

This means the 'load' event will once again include the main JS
request. After dec800968eb, this request unintentionally started
after the 'load' event. I'm hoping that with the eliminated
request for jquery+mediawiki.base, we'll still keep some of the
winnings we had from a much earlier 'load' event.

Bug: T192623
Change-Id: I4942bfd236c72b0cf4c23b0e2a0d5e5e069c0de0

5 years agoMerge "resourceloader: Remove redundant check in mw.loader.store for Opera 12"
jenkins-bot [Tue, 28 Aug 2018 02:11:08 +0000 (02:11 +0000)]
Merge "resourceloader: Remove redundant check in mw.loader.store for Opera 12"

5 years agoMerge "resourceloader: Remove redundant calls to getState() in mw.loader.enqueue()"
jenkins-bot [Tue, 28 Aug 2018 01:52:10 +0000 (01:52 +0000)]
Merge "resourceloader: Remove redundant calls to getState() in mw.loader.enqueue()"

5 years agoresourceloader: Optimise several map-like objects with Object.create(null)
Fomafix [Sat, 25 Aug 2018 09:57:25 +0000 (11:57 +0200)]
resourceloader: Optimise several map-like objects with Object.create(null)

Change-Id: Ia8a3159509536f58a97faadc2e72fb33f2d0e97f

5 years agoUse StaticArrayWriter in LCStoreStaticArray
Kunal Mehta [Sun, 19 Aug 2018 10:17:52 +0000 (03:17 -0700)]
Use StaticArrayWriter in LCStoreStaticArray

...instead of var_export(), which uses array() syntax and spaces for
indentation.

Also get rid of some unnecessary closure indirection.

Bug: T200626
Change-Id: I5db8ade50fcba5ecf394817b2d14295620314ea7

5 years agoSupport nested arrays in StaticArrayWriter
Kunal Mehta [Sun, 19 Aug 2018 10:15:31 +0000 (03:15 -0700)]
Support nested arrays in StaticArrayWriter

This is needed by LCStoreStaticArray.

Bug: T200626
Change-Id: I76abd3849381b3b98e350a4627f3515eeb00fa2d

5 years agoMerge "resourceloader: Restore mw.loader.store update postponing logic"
jenkins-bot [Mon, 27 Aug 2018 21:44:23 +0000 (21:44 +0000)]
Merge "resourceloader: Restore mw.loader.store update postponing logic"

5 years agoMerge "rdbms: make LBFactorySingle/LoadBalancerSingle set the local domain from the...
jenkins-bot [Mon, 27 Aug 2018 21:33:58 +0000 (21:33 +0000)]
Merge "rdbms: make LBFactorySingle/LoadBalancerSingle set the local domain from the connection"

5 years agoMerge "Make interwiki transclusion use the WAN cache"
jenkins-bot [Mon, 27 Aug 2018 21:17:04 +0000 (21:17 +0000)]
Merge "Make interwiki transclusion use the WAN cache"

5 years agoresourceloader: Restore mw.loader.store update postponing logic
Timo Tijhof [Thu, 23 Aug 2018 02:16:06 +0000 (03:16 +0100)]
resourceloader: Restore mw.loader.store update postponing logic

* Document the conditional that disables mw.loader.store if
  localStorage is unavailable. `raw === undefined` is correct,
  but can be confusing given it can also be null, and we
  specifically don't want to disable the store in that case.
  We only disable the store if raw is undefined.

* Remove the call to mw.loader.store.update() in init().
  If 0 modules were to load on the current page, there is little
  value in flushing an empty `items` object.
  If any modules load, they will be set() in the store and
  schedule an update() at that time, which is preferred and avoids
  unexpected overhead.

* Remove store.enabled check from prune(). It is only called
  from update(), which checks it already.
* Remove boolean return from set(). Not used.

* Remove boolean return from prune(). Not used.

* Restore the 2-second setTimeout debounce from 2013 (c719401661e),
  which got lost in the 2015 refactor (4174b662f623).
  This makes the documentation true again.

* Document the store singleton as @private. It will still be
  indexed by JSDuck and listed in the sidebar (under "private"),
  but will not be listed on the homepage, and the class' page
  will have a notice about it being a private API.

Bug: T202598
Change-Id: Ic0d4a15c241df391ab5f824ca9e754c3938ea108

5 years agoMerge "resourceloader: Remove unused code from mw.loader.register()"
jenkins-bot [Mon, 27 Aug 2018 20:55:35 +0000 (20:55 +0000)]
Merge "resourceloader: Remove unused code from mw.loader.register()"

5 years agoMerge "resourceloader: Remove unused code in private mw.loader#enqueue()"
jenkins-bot [Mon, 27 Aug 2018 20:43:43 +0000 (20:43 +0000)]
Merge "resourceloader: Remove unused code in private mw.loader#enqueue()"

5 years agoMerge "Remove semicolon after class declaration"
jenkins-bot [Mon, 27 Aug 2018 20:31:40 +0000 (20:31 +0000)]
Merge "Remove semicolon after class declaration"

5 years agoMerge "Replace "Bug37714" by "T39714""
jenkins-bot [Mon, 27 Aug 2018 20:31:34 +0000 (20:31 +0000)]
Merge "Replace "Bug37714" by "T39714""

5 years agoMerge "objectcache: Improve WANObjectCache doc for update strategies"
jenkins-bot [Mon, 27 Aug 2018 20:17:02 +0000 (20:17 +0000)]
Merge "objectcache: Improve WANObjectCache doc for update strategies"

5 years agoMerge "API: Update examples to avoid MCR deprecation"
jenkins-bot [Mon, 27 Aug 2018 20:08:52 +0000 (20:08 +0000)]
Merge "API: Update examples to avoid MCR deprecation"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 27 Aug 2018 19:55:42 +0000 (21:55 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I6a4ede0f5c74135b00c63d36f1a8fb9fb5ca323a

5 years agoMake interwiki transclusion use the WAN cache
Aaron Schulz [Fri, 8 Jun 2018 20:43:03 +0000 (13:43 -0700)]
Make interwiki transclusion use the WAN cache

This means that now:
* Entries actually get deleted when expired
* The transclusion cache is shared across wikis
* Large blobs that do not fit in cache no longer cause DB errors
* DB writes are not triggered on GET requests
* Keys are hashed and no longer need to be so restrictive

Also, add a "check key" based purge system and process cache the
text/html values similar to how regular revision text is cached.

Bug: T189702
Change-Id: I8ac12b53c02bb26857175dd5a4af29d49e03dc33

5 years agoMerge "Allow admins to delete user JS/CSS pages"
jenkins-bot [Mon, 27 Aug 2018 19:32:01 +0000 (19:32 +0000)]
Merge "Allow admins to delete user JS/CSS pages"

5 years agoMerge "Paranoia, escape image alignment parameters before outputting."
jenkins-bot [Mon, 27 Aug 2018 19:10:41 +0000 (19:10 +0000)]
Merge "Paranoia, escape image alignment parameters before outputting."

5 years agoRemove semicolon after class declaration
Umherirrender [Mon, 27 Aug 2018 19:08:55 +0000 (21:08 +0200)]
Remove semicolon after class declaration

Change-Id: Iae57172138f8887e37ed401b443531259808e678

5 years agordbms: make LBFactorySingle/LoadBalancerSingle set the local domain from the connection
Aaron Schulz [Mon, 27 Aug 2018 18:50:24 +0000 (11:50 -0700)]
rdbms: make LBFactorySingle/LoadBalancerSingle set the local domain from the connection

Change-Id: I657cea85ae3838bc76e7eb50b9ca66db16746bde

5 years agoMerge "Require editsitecss/editsitejs for editing raw messages"
jenkins-bot [Mon, 27 Aug 2018 17:48:25 +0000 (17:48 +0000)]
Merge "Require editsitecss/editsitejs for editing raw messages"

5 years agoAPI: Update examples to avoid MCR deprecation
Brad Jorsch [Mon, 27 Aug 2018 17:17:55 +0000 (13:17 -0400)]
API: Update examples to avoid MCR deprecation

ApiQueryRevisions and ApiQueryDeletedRevisions each have one example
fetching the content of the revision, which needs to be updated to add
the rvslots/drvslots parameter.

Bug: T202909
Change-Id: Ibc3cbd0fbf45361da31063a3e94afb6a22e300e0

5 years agoMerge "Restore passing of triggering user in edit updates"
jenkins-bot [Mon, 27 Aug 2018 14:05:07 +0000 (14:05 +0000)]
Merge "Restore passing of triggering user in edit updates"

5 years agoReplace underscores with spaces in DeletedContribs form
Daimona Eaytoy [Tue, 8 May 2018 09:44:06 +0000 (11:44 +0200)]
Replace underscores with spaces in DeletedContribs form

If you go to Special:Contributions/User_Foo and click on the link to
Special:DeletedContributions/User_Foo, the form field for selecting the
user is populated with the value "User_Foo", which isn't pretty to see.
Instead, let's replace underscores with spaces to directly show "User
Foo".

Change-Id: I2b144c9dbe41e2dd01bbb530dc5b43547fc4230f

5 years agoMerge "Prepare DiffRenderer to changed parameters for wikidiff2 1.8.0"
WMDE-Fisch [Mon, 27 Aug 2018 08:47:59 +0000 (08:47 +0000)]
Merge "Prepare DiffRenderer to changed parameters for wikidiff2 1.8.0"

5 years agoMerge "Make warning about deprecated SlotDiffRenderer wrapper less noisy"
jenkins-bot [Mon, 27 Aug 2018 03:58:36 +0000 (03:58 +0000)]
Merge "Make warning about deprecated SlotDiffRenderer wrapper less noisy"

5 years agoobjectcache: Improve WANObjectCache doc for update strategies
Timo Tijhof [Thu, 23 Aug 2018 00:29:21 +0000 (01:29 +0100)]
objectcache: Improve WANObjectCache doc for update strategies

Also add headings to separate docs for deployment/administration,
from docs for developers using an existing instance of it.

Change-Id: Id43c7700564c2979549afa5379f644027fb6585b

5 years agoAllow admins to delete user JS/CSS pages
Gergő Tisza [Sun, 26 Aug 2018 22:51:55 +0000 (00:51 +0200)]
Allow admins to delete user JS/CSS pages

As it turns out this is super easy: we do require edit permissions
for some actions but not for delete, so it is enough to just
whitelist it.

Also fix SkinTemplate to not show the undelete action when the
user can undelete some pages but not the current one.

Bug: T200176
Change-Id: I0d326e6afde7ad2c9f7cb7f19ecc6c275c1ef65c

5 years agoRequire editsitecss/editsitejs for editing raw messages
Gergő Tisza [Tue, 31 Jul 2018 22:19:40 +0000 (00:19 +0200)]
Require editsitecss/editsitejs for editing raw messages

Bug: T45646
Change-Id: Ib16db04e499ad28216ee08b8cccccf3f141e2bad

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 26 Aug 2018 20:13:00 +0000 (22:13 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I8b29efe4e068289d8ce775d31aaced06c8066ef8

5 years agoMake warning about deprecated SlotDiffRenderer wrapper less noisy
Gergő Tisza [Sun, 26 Aug 2018 19:00:02 +0000 (21:00 +0200)]
Make warning about deprecated SlotDiffRenderer wrapper less noisy

Bug: T202686
Change-Id: I7623daa32e460ce131e1b27eb6e4397dc572612f

5 years agoRestore passing of triggering user in edit updates
Gergő Tisza [Fri, 24 Aug 2018 23:02:26 +0000 (01:02 +0200)]
Restore passing of triggering user in edit updates

Bug: T200119
Change-Id: I14102a15aa93d1f909c5b347f5dd589f87c2e500

5 years agoSwap arguments of Title::makeName to fix Special:Export
Umherirrender [Sun, 26 Aug 2018 17:52:17 +0000 (19:52 +0200)]
Swap arguments of Title::makeName to fix Special:Export

Follows-up 415243600b27.

Bug: T202817
Change-Id: Ica850230a5d70ae70436510811c0fed04bb995bb

5 years agoresourceloader: Remove redundant check in mw.loader.store for Opera 12
Timo Tijhof [Fri, 24 Aug 2018 03:08:06 +0000 (04:08 +0100)]
resourceloader: Remove redundant check in mw.loader.store for Opera 12

Opera 12 is no longer supported for Grade A. This regex was currently
running on every module script executed on every page in between
each module's execution.

execute() for module A -> handlePending -> mw.loader.store.set()
-> Opera 12 check -> schedule update -> yield to module B.

The serialisation logic in store.set() should probably more
generally deferred and taken out of this path, but until then,
every bit helps.

Change-Id: I8d4628b6d663fe25040c6ef0b4983a4b7eea94c6

5 years agoresourceloader: Remove redundant calls to getState() in mw.loader.enqueue()
Timo Tijhof [Fri, 24 Aug 2018 02:36:40 +0000 (03:36 +0100)]
resourceloader: Remove redundant calls to getState() in mw.loader.enqueue()

The list of module names are known to be registered there.
Thus, no need for getState() and its hasOwn.call(registry) check.

If it was possible for an unknown module name to make its way to this code,
it would break both before and after this commit due to the setting of
registry[module].state which would throw TypeError for setting on undefined.

Change-Id: Ie3cccc7e4c57648279325852f362d5eb72128306

5 years agoresourceloader: Remove unused code from mw.loader.register()
Timo Tijhof [Fri, 24 Aug 2018 02:31:48 +0000 (03:31 +0100)]
resourceloader: Remove unused code from mw.loader.register()

The optional 'dependencies' parameter is only ever used with
an array of strings, never just as a string.

Also fix the missing square-brackets around the parameter name
in the documentation that indicate the parameter as optional.
The code was already allowing it to be missing, and the server
does indeed omit it when a module has no dependencies.
(See ResourceLoaderStartupModuleTest for confirmation of that).

The server-side methods ResourceLoaderModule::getDependencies
and ResourceLoader::makeLoaderRegisterScript already don't
support string-type for this parameter.

Change-Id: I80a1e4b2eefb62e669c031e0d953bf74a9623264

5 years agoresourceloader: Remove unused code in private mw.loader#enqueue()
Timo Tijhof [Fri, 24 Aug 2018 02:26:44 +0000 (03:26 +0100)]
resourceloader: Remove unused code in private mw.loader#enqueue()

The support for 'string' type of the 'dependencies' parameter is
unused. It is a private method and only called with an array
of strings.

Change-Id: I6252ec583242df46ad4c1913519cce4ef61759d7

5 years agoMerge "Make MysqlInstaller check if DB exists in a cleaner way"
jenkins-bot [Sat, 25 Aug 2018 22:17:26 +0000 (22:17 +0000)]
Merge "Make MysqlInstaller check if DB exists in a cleaner way"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 25 Aug 2018 20:15:55 +0000 (22:15 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I8e81a9820c3b8b779fa432101eb74be6831f3b48

5 years agoparser: Simplify code for {{#int:}} if the message doesn't exist
Kunal Mehta [Sat, 25 Aug 2018 08:20:43 +0000 (01:20 -0700)]
parser: Simplify code for {{#int:}} if the message doesn't exist

Ever since 184658eb32f6, the output of a non-existing message will be
HTML safe, regardless of output format, so we can treat non-existing messages
exactly the same as messages that do exist.

The pre-existing "int keyword - non-existing message" parser test verifies
that no change in output has ocurred in this patch.

Change-Id: I0e32be14f1b420d7f222ac3c76e1cc266f912b69

5 years agoMerge "Expand documentation about options in HTMLForm"
jenkins-bot [Sat, 25 Aug 2018 06:51:43 +0000 (06:51 +0000)]
Merge "Expand documentation about options in HTMLForm"

5 years agoMake MysqlInstaller check if DB exists in a cleaner way
Aaron Schulz [Sat, 25 Aug 2018 05:49:15 +0000 (22:49 -0700)]
Make MysqlInstaller check if DB exists in a cleaner way

Query the information schema rather than seeing if selectDB() returns false.
This makes the installer able to handle an exception based failure mode.

Change-Id: I7912b9d3b8501fbc92cb731547ae10fa2b0176db

5 years agoMerge "mediawiki.user: Small perf tweak for generateRandomSessionId"
jenkins-bot [Sat, 25 Aug 2018 05:17:58 +0000 (05:17 +0000)]
Merge "mediawiki.user: Small perf tweak for generateRandomSessionId"

5 years agomediawiki.user: Small perf tweak for generateRandomSessionId
Nuria Ruiz [Thu, 23 Aug 2018 23:07:33 +0000 (16:07 -0700)]
mediawiki.user: Small perf tweak for generateRandomSessionId

Consolidate loop + join into explicit string concatenation

Bug: T201124
Change-Id: Ie7c7ddd29783ada142fbb7b726caa697048802f3

5 years agoMerge "resourceloader: Micro-optimise mw.loader.register version string setting"
jenkins-bot [Fri, 24 Aug 2018 22:33:36 +0000 (22:33 +0000)]
Merge "resourceloader: Micro-optimise mw.loader.register version string setting"

5 years agoMerge "Throw exception when nothing to clone in CloneDatabase"
jenkins-bot [Fri, 24 Aug 2018 21:48:21 +0000 (21:48 +0000)]
Merge "Throw exception when nothing to clone in CloneDatabase"

5 years agoresourceloader: Micro-optimise mw.loader.register version string setting
James D. Forrester [Fri, 24 Aug 2018 21:15:42 +0000 (14:15 -0700)]
resourceloader: Micro-optimise mw.loader.register version string setting

23 bytes over 46, so even though it's slightly slower in Chrome this way
it's faster in Firefox and it's close enough that it's not worth worrying
over.

Change-Id: I5e917c6d6caee730e54d1d5bacb0d9b249b515e2

5 years agoThrow exception when nothing to clone in CloneDatabase
Umherirrender [Thu, 23 Aug 2018 19:02:41 +0000 (21:02 +0200)]
Throw exception when nothing to clone in CloneDatabase

Just in case something goes wrong, when calling.

Change-Id: I4490aee6edccf0b185188250948a47b5fd8ba766

5 years agoMerge "MCR: Add temporary web UI mcrundo action"
jenkins-bot [Fri, 24 Aug 2018 21:19:46 +0000 (21:19 +0000)]
Merge "MCR: Add temporary web UI mcrundo action"

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 24 Aug 2018 20:52:32 +0000 (22:52 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I16270a6272eeb44b42717551b9e00095094aa3a2

5 years agoMerge "resourceloader: Correct @param doc for mw.loader.state()"
jenkins-bot [Fri, 24 Aug 2018 20:05:27 +0000 (20:05 +0000)]
Merge "resourceloader: Correct @param doc for mw.loader.state()"

5 years agoMerge "resourceloader: Optimise several map-like objects with Object.create(null)"
jenkins-bot [Fri, 24 Aug 2018 19:59:50 +0000 (19:59 +0000)]
Merge "resourceloader: Optimise several map-like objects with Object.create(null)"

5 years agoresourceloader: Correct @param doc for mw.loader.state()
Timo Tijhof [Fri, 24 Aug 2018 19:35:24 +0000 (20:35 +0100)]
resourceloader: Correct @param doc for mw.loader.state()

Follows-up 6815e35575.

Bug: T127328
Change-Id: I13fbea2c045518780733adb4702b83584c95b9c7

5 years agoMerge "API: Remove duplicate i18n messages from I700edfa7"
jenkins-bot [Fri, 24 Aug 2018 18:56:53 +0000 (18:56 +0000)]
Merge "API: Remove duplicate i18n messages from I700edfa7"

5 years agoMerge "Fix DifferenceEngine revision loading logic"
jenkins-bot [Fri, 24 Aug 2018 18:24:08 +0000 (18:24 +0000)]
Merge "Fix DifferenceEngine revision loading logic"

5 years agoAPI: Remove duplicate i18n messages from I700edfa7
Brad Jorsch [Fri, 24 Aug 2018 17:42:54 +0000 (13:42 -0400)]
API: Remove duplicate i18n messages from I700edfa7

Change-Id: I2e1cebf0b1e1719054fda31e2f5df1e5b7e99658

5 years agoFix DifferenceEngine revision loading logic
Gergő Tisza [Mon, 20 Aug 2018 14:49:56 +0000 (16:49 +0200)]
Fix DifferenceEngine revision loading logic

Bug: T201218
Bug: T202454
Change-Id: I867900190cb45b983e89769c7fc0f965e2651918

5 years agoMerge "Replace some wfMessage by ContextSource::msg"
jenkins-bot [Fri, 24 Aug 2018 05:18:09 +0000 (05:18 +0000)]
Merge "Replace some wfMessage by ContextSource::msg"

5 years agoresourceloader: Optimise several map-like objects with Object.create(null)
Timo Tijhof [Fri, 24 Aug 2018 01:58:56 +0000 (02:58 +0100)]
resourceloader: Optimise several map-like objects with Object.create(null)

Object.create(null) is specifically for the use case of being
able to store any key/value without worrying about inherited
built-in methods.

As such, using Object.create(null) in these cases has two benefits:

* Removes the need for a hasOwn() call.
  One can instead use the 'in' operator, or look for undefined,
  without there being gotchas due to inherited methods.

* When the known values are always truthy (e.g. when only storing
  value that are also objects or arrays), there is no need for
  any explicit comparison (plain boolean evaluation).

Change-Id: I24f86f9938e4f5ccca81d15aa14a48ac3ddee341

5 years agoAvoid joins when reading MCR revisions.
daniel [Wed, 22 Aug 2018 16:08:23 +0000 (18:08 +0200)]
Avoid joins when reading MCR revisions.

When loading revision slots from the new MCR schema, slot role names
and content model names need to be resolved. Doing so programmatically
based on an in-memory cache avoids having to join against two additional
table every time we load slot meta-data.

This relies on NameTableStore, which was designed for exactly this use
case.

Bug: T198561
Change-Id: Ic005931b669f9d0173ef47ac17331d44fb1141ca

5 years agomediawiki.user: Increase entropy of random token generator
Nuria Ruiz [Wed, 22 Aug 2018 03:11:59 +0000 (20:11 -0700)]
mediawiki.user: Increase entropy of random token generator

generateRandomSessionId now generates a token with 80 bits and it is
unique in a 150 billion space.

The token is used to identify sessions in MediaWiki but also
as a generic random generator across the MediaWiki codebase.

Bug: T201124
Change-Id: I63a241a70b99d9f9e691eac25bb5cfe099a748fc

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 23 Aug 2018 20:42:14 +0000 (22:42 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I9ef6eb28a72cdaa58ddc91119924feddb89e78e6

5 years agoMerge "Don't reset name tables between test runs."
jenkins-bot [Thu, 23 Aug 2018 19:41:16 +0000 (19:41 +0000)]
Merge "Don't reset name tables between test runs."

5 years agoMerge "resourceloader: Implement mw.inspect 'time' report"
jenkins-bot [Thu, 23 Aug 2018 18:18:56 +0000 (18:18 +0000)]
Merge "resourceloader: Implement mw.inspect 'time' report"

5 years agoMerge "Make sure we don't try to use a deleted rev ID."
jenkins-bot [Thu, 23 Aug 2018 18:10:57 +0000 (18:10 +0000)]
Merge "Make sure we don't try to use a deleted rev ID."

5 years agoresourceloader: Implement mw.inspect 'time' report
Timo Tijhof [Tue, 10 Jul 2018 00:28:55 +0000 (17:28 -0700)]
resourceloader: Implement mw.inspect 'time' report

When enabling $wgResourceLoaderEnableJSProfiler, mw.loader gets instrumented
with the following timing values for each of the modules loaded on the page:

* 'total' - This measures the time spent in mw.loader#execute(), and
  represents the initialisation of the module's implementation, including
  the registration of messages, templates, and the execution of the 'script'
  closure received from load.php.

* 'script' – This measures only the subset of time spent in the internal
  runScript() function, and represents just the execution of the module's
  JavaScript code as received through mw.loader.implement() from load.php.

  For user scripts and site scripts, this measures the call to domEval
  (formerly known as "globalEval").

* 'execute' - This measures the self time of mw.loader#execute(), which is
  effectively `total - script`.

To view the report, enable the feature, then run `mw.inspect( 'time' )` from
the browser console, which will render a table with the initialisation
overhead from each module used on the page.

Bug: T133646
Change-Id: I68d1193b62c93c97cf09b7d344c896afb437c5ac

5 years agoDon't reset name tables between test runs.
daniel [Wed, 22 Aug 2018 16:02:49 +0000 (18:02 +0200)]
Don't reset name tables between test runs.

Resetting the content_model and slot_role tables between test runs
requires the corresponding NameTabelStore instances to be reset
as well. We may however have many of them, buried in various services.
There is no easy way to reset them consistently.

Letting information in these tables persist between tests seems
harmless. Tests that need these tables reset can simply add them
to the tablesUsed array.

This is needed for unit tests to work with the new MCR schema.

Bug: T198561
Change-Id: I63e61e1ab74e00c20930a83d3a3f5df53092a197

5 years agoMerge "docs: Remove Doxyfile searching for .php5 and upper-case file extensions"
jenkins-bot [Thu, 23 Aug 2018 17:10:34 +0000 (17:10 +0000)]
Merge "docs: Remove Doxyfile searching for .php5 and upper-case file extensions"

5 years agoMerge "API: Catch Errors as well as Exceptions"
jenkins-bot [Thu, 23 Aug 2018 17:05:19 +0000 (17:05 +0000)]
Merge "API: Catch Errors as well as Exceptions"

5 years agoMerge "rdbms: make schema/prefix handling more consistent in LoadBalancer"
jenkins-bot [Thu, 23 Aug 2018 16:19:59 +0000 (16:19 +0000)]
Merge "rdbms: make schema/prefix handling more consistent in LoadBalancer"

5 years agoMCR: Add temporary web UI mcrundo action
Brad Jorsch [Tue, 17 Jul 2018 19:23:25 +0000 (15:23 -0400)]
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

5 years agoPrepare DiffRenderer to changed parameters for wikidiff2 1.8.0
WMDE-Fisch [Wed, 22 Aug 2018 13:29:17 +0000 (15:29 +0200)]
Prepare DiffRenderer to changed parameters for wikidiff2 1.8.0

The config parameter handling in wikidiff2 will migrate completely to
phpini values. Due to that we will remove the php config variable
wgWikiDiff2MovedParagraphDetectionCutoff and its usage.

In the process of deleting the 4th parameter in the wikidiff2_do_diff()
method, this exception is added so deployment can be handled separately.

On the long run these exceptions will be removed completely and the
(then) current mediawiki will depend on wikdiff2 > 1.8.0

Bug: T194272
Depends-On: I673d2489d5bce1a24a6ea83e168704948564661b
Change-Id: I30262412b0784b84af88ffab6ed0694a08b671e9

5 years agoApiComparePages: Update for MCR
Brad Jorsch [Thu, 26 Jul 2018 21:24:59 +0000 (17:24 -0400)]
ApiComparePages: Update for MCR

The main external change here is that it can now return diffs per slot,
and the various parameters for providing text are deprecated in favor of
templated per-slot versions.

Also, this deprecates the 'fromsection' and 'tosection' behavior
introduced for T183823 (extracting a section's content for the diff) in
favor of the more logical behavior requested in T185723 (expanding
'fromtext-{slot}'/'totext-{slot}' as if for a section edit).

Bug: T200569
Bug: T183823
Bug: T185723
Change-Id: I700edfa766bbc320887f2e0b7507fcdb11e72cdc

5 years agoMerge "filebackend: Use $tmpDirectory instead of wfTempDir()"
jenkins-bot [Thu, 23 Aug 2018 07:55:28 +0000 (07:55 +0000)]
Merge "filebackend: Use $tmpDirectory instead of wfTempDir()"

5 years agordbms: make schema/prefix handling more consistent in LoadBalancer
Aaron Schulz [Wed, 22 Aug 2018 09:28:09 +0000 (02:28 -0700)]
rdbms: make schema/prefix handling more consistent in LoadBalancer

Move "tablePrefix" logic to LoadBalancer::reallyOpenConnection and
make it more consistent for local vs foreign connections. The prefix
for local connections is now set even if $domain does not provide a
database.

Also set the schema even if $domain does not provide a database.

Typically a database domain is either fully specified or comes from
DatabaseDomain::newUnspecified(), but there's no reason not to use
at least the schema/prefix of otherwise unspecified domains. The only
other sensible option would be some sort of exception.

Change-Id: Ib52f4b69e429810e3c5eac92a48aecf7b22e86e6

5 years agodocs: Remove Doxyfile searching for .php5 and upper-case file extensions
Timo Tijhof [Thu, 23 Aug 2018 00:35:57 +0000 (01:35 +0100)]
docs: Remove Doxyfile searching for .php5 and upper-case file extensions

Change-Id: I36bf74bb5e3a7c7e61cddd69ea371f94c8b9a856

5 years agofilebackend: Use $tmpDirectory instead of wfTempDir()
Timo Tijhof [Thu, 23 Aug 2018 00:14:52 +0000 (01:14 +0100)]
filebackend: Use $tmpDirectory instead of wfTempDir()

Follows-up f7e3ac3f95c.

Change-Id: I9583e126e596641956ca3f6646fe4e52eeaca9a2

5 years agoFix typo in formDescriptor array
Jayprakash12345 [Wed, 22 Aug 2018 18:53:05 +0000 (00:23 +0530)]
Fix typo in formDescriptor array

Bug: T202550
Change-Id: I06c6cf596ab0f159ad6a50251788ff3917125ae7

5 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 22 Aug 2018 20:14:16 +0000 (22:14 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I09f190dad5896844071db77b24ca54829b214976

5 years agoMerge "OOUIfy CheckMatrix in PHP and JS"
jenkins-bot [Wed, 22 Aug 2018 20:09:12 +0000 (20:09 +0000)]
Merge "OOUIfy CheckMatrix in PHP and JS"

5 years agoMake sure we don't try to use a deleted rev ID.
Brad Jorsch [Wed, 22 Aug 2018 15:59:56 +0000 (11:59 -0400)]
Make sure we don't try to use a deleted rev ID.

MySQL until 8.0 and MariaDB until some version after 10.1.34 don't save
the auto-increment value to disk, so on server restart it might reuse
IDs from deleted revisions. We can fix that with an insert with an
explicit rev_id value, if necessary.

Bug: T202032
Change-Id: I14e5b6c8ec8b5f1aeb2305fae4b103665f8f6686

5 years agoOOUIfy CheckMatrix in PHP and JS
Moriel Schottlender [Thu, 26 Jul 2018 23:14:41 +0000 (16:14 -0700)]
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

5 years agoReplace some wfMessage by ContextSource::msg
Umherirrender [Wed, 22 Aug 2018 13:41:49 +0000 (15:41 +0200)]
Replace some wfMessage by ContextSource::msg

Change-Id: Ie056af7a002dbbf4e8defc8032bfcc0bdefc6566

5 years agoAPI: Catch Errors as well as Exceptions
Brad Jorsch [Tue, 21 Aug 2018 15:19:15 +0000 (11:19 -0400)]
API: Catch Errors as well as Exceptions

ApiMain (and also api.php) tries to catch any Exception so as to provide
a properly-formatted error message to the client instead of an HTML
error page.

With PHP 7.0, some cases that produce an Exception in HHVM instead
produce an Error. The API code should catch these too.

Fortunately neither Zend PHP nor HHVM care if you try to catch a class
that doesn't exist, so we can just add catch blocks for Throwable and
not worry about it.

Bug: T202416
Change-Id: I189eee466bd09870bc172f2420be393a7c0b1900

5 years agoMerge "Disable warning about direct text table access for now"
jenkins-bot [Wed, 22 Aug 2018 13:18:23 +0000 (13:18 +0000)]
Merge "Disable warning about direct text table access for now"

5 years agoMerge "benchmarks: Minor cleanup for strtr benchmark"
jenkins-bot [Wed, 22 Aug 2018 11:43:13 +0000 (11:43 +0000)]
Merge "benchmarks: Minor cleanup for strtr benchmark"