lhc/web/wiklou.git
4 years agoStringUtils: Clarify that isValidRegex is for PCRE regexps
Daimona Eaytoy [Thu, 19 Sep 2019 09:55:19 +0000 (11:55 +0200)]
StringUtils: Clarify that isValidRegex is for PCRE regexps

As suggested in c14571ba26e (I257a096319f1e).

Change-Id: Ia91d037f2f4bf8a1bad4eac65fecb1d3e2679d2d

4 years agoMerge "docs: Fix typo on Doxygen main page"
jenkins-bot [Sat, 28 Sep 2019 12:24:40 +0000 (12:24 +0000)]
Merge "docs: Fix typo on Doxygen main page"

4 years agoFix double dot in filename
Reedy [Fri, 27 Sep 2019 16:22:11 +0000 (17:22 +0100)]
Fix double dot in filename

Follows-Up: I7617616df57f7468d06e9b52426b6851bfef0e7d
Change-Id: Ia8be2fd6a13d095e27a6489b0126763573dd6194

4 years agoMerge "resourceloader: Add $modules parameter to makeVersionQuery()"
jenkins-bot [Sat, 28 Sep 2019 01:26:59 +0000 (01:26 +0000)]
Merge "resourceloader: Add $modules parameter to makeVersionQuery()"

4 years agoMerge "Mark mediawiki.page.watch.ajax as targetable to mobile"
Jdlrobson [Fri, 27 Sep 2019 23:03:21 +0000 (23:03 +0000)]
Merge "Mark mediawiki.page.watch.ajax as targetable to mobile"

4 years agoMerge "tests: Replace PHPUnit's loose assertEquals(null) with assertNull()"
jenkins-bot [Fri, 27 Sep 2019 22:43:09 +0000 (22:43 +0000)]
Merge "tests: Replace PHPUnit's loose assertEquals(null) with assertNull()"

4 years agoMerge "build: Lower default Karma logLevel during local development"
jenkins-bot [Fri, 27 Sep 2019 22:23:51 +0000 (22:23 +0000)]
Merge "build: Lower default Karma logLevel during local development"

4 years agoMark mediawiki.page.watch.ajax as targetable to mobile
jdlrobson [Thu, 26 Sep 2019 15:56:58 +0000 (08:56 -0700)]
Mark mediawiki.page.watch.ajax as targetable to mobile

This is explicitly disabled by Minerva so this should have
no impact other than allow the loading of this module on
mobile.

Change-Id: Ib73fb995f5ccb16d99b505abad2466187c3dc5a5

4 years agoMerge "Remove tests that were skipped for MCR-enabled schema"
jenkins-bot [Fri, 27 Sep 2019 21:34:39 +0000 (21:34 +0000)]
Merge "Remove tests that were skipped for MCR-enabled schema"

4 years agoMerge ".pipeline/config.yaml: rename dev stage to publish"
jenkins-bot [Fri, 27 Sep 2019 20:58:32 +0000 (20:58 +0000)]
Merge ".pipeline/config.yaml: rename dev stage to publish"

4 years agoMerge "resourceloader: Add $context to static functions in ResourceLoader"
jenkins-bot [Fri, 27 Sep 2019 20:48:15 +0000 (20:48 +0000)]
Merge "resourceloader: Add $context to static functions in ResourceLoader"

4 years agoMerge "resourceloader: Add type hints for type ResourceLoaderContext"
jenkins-bot [Fri, 27 Sep 2019 20:22:10 +0000 (20:22 +0000)]
Merge "resourceloader: Add type hints for type ResourceLoaderContext"

4 years agoRemove tests that were skipped for MCR-enabled schema
Petr Pchelko [Fri, 27 Sep 2019 19:05:42 +0000 (12:05 -0700)]
Remove tests that were skipped for MCR-enabled schema

Pre-MCR schema is no longer supported, thus we don't need
the tests that are skipped for MCR-enabled schema.

Bug: T214308
Change-Id: I2d78ec668fde1e49710c54be8ab72c474f30f6b8

4 years agotests: Replace PHPUnit's loose assertEquals(null) with assertNull()
Thiemo Kreuz [Tue, 17 Sep 2019 14:03:28 +0000 (16:03 +0200)]
tests: Replace PHPUnit's loose assertEquals(null) with assertNull()

assertEquals( null, … ) still succeeds when the actual value is 0, false,
an empty string, even an empty array. All these should be reported as a
failure, I would argue.

Note this patch previously also touched assertSame( null ). I reverted
these. The only benefit would have been consistency within this codebase,
but there is no strict reason to prefer one over the other. assertNull()
and assertSame( null ) are functionally identical.

Change-Id: I92102e833a8bc6af90b9516826abf111e2b79aac

4 years agoMerge "Fix permission check on protection log"
jenkins-bot [Fri, 27 Sep 2019 18:38:16 +0000 (18:38 +0000)]
Merge "Fix permission check on protection log"

4 years agoMerge "Remove Revision::getRevisionText and gated pre-MCR schema access"
jenkins-bot [Fri, 27 Sep 2019 18:38:09 +0000 (18:38 +0000)]
Merge "Remove Revision::getRevisionText and gated pre-MCR schema access"

4 years agoMerge "rdbms: Remove obsolete comment in LoadBalancerSingle"
jenkins-bot [Fri, 27 Sep 2019 18:35:44 +0000 (18:35 +0000)]
Merge "rdbms: Remove obsolete comment in LoadBalancerSingle"

4 years agoMerge "Force usage of MCR aware database schema"
jenkins-bot [Fri, 27 Sep 2019 17:52:33 +0000 (17:52 +0000)]
Merge "Force usage of MCR aware database schema"

4 years ago.pipeline/config.yaml: rename dev stage to publish
Brennen Bearnes [Fri, 27 Sep 2019 17:43:52 +0000 (11:43 -0600)]
.pipeline/config.yaml: rename dev stage to publish

This should align with the "publish" pipeline defined in
integration/config.

Bug: T218360
Change-Id: Iba27755416843dd547ac1889d932a3b5ea9d1fd2

4 years agoFix permission check on protection log
Ammar [Fri, 27 Sep 2019 13:39:15 +0000 (14:39 +0100)]
Fix permission check on protection log

*I2341e6f inverted the permission check, such that now the link is only shown to unprivileged users

Bug: T234017
Change-Id: I0977f1ab1a72840303aeca2367a30546d83117d4

4 years agordbms: Remove obsolete comment in LoadBalancerSingle
Lucas Werkmeister [Thu, 26 Sep 2019 15:49:48 +0000 (17:49 +0200)]
rdbms: Remove obsolete comment in LoadBalancerSingle

This comment was added in commit 0b583944e4, but
later rendered obsolete by commit 143333b172.

Change-Id: I1a64ab75a9883a88d5767722e27724520f8a0dcc

4 years agoRemove Revision::getRevisionText and gated pre-MCR schema access
Petr Pchelko [Fri, 20 Sep 2019 18:11:35 +0000 (11:11 -0700)]
Remove Revision::getRevisionText and gated pre-MCR schema access

- fixT22757.php appears to have been written for T22757 which has been
resolved, I assume it can be removed.

- compressOld.php - rev_text_id access is gated on MCRSchemaMigrationStage
READ_OLD. IT's safe to use the old_text and old_flags directly as we
select for them. Also the query ensures external blobs are not selected,
so we can use decompressData instead of Revision::getRevisionText.
Tested locally.

- recompressTracked.php uses a temporary table for tracking the blobs.
Table is populated by trackBlobs which explicitly queries for old_id,
so using it directly in recompressTracked is ok.
Tested locally.

- checkStorage.php the affected code attempts to fix broken revisions
from a dump, however, it looks like it doesn't work - the code expects
revision IDs as input, however it receives an array of text table old_id
values. Untested.

Bug: T198343
Change-Id: I753019565c15d270c831c995c07c7f1aad887cb6

4 years agoresourceloader: Add $context to static functions in ResourceLoader
Fomafix [Mon, 9 Sep 2019 15:50:13 +0000 (17:50 +0200)]
resourceloader: Add $context to static functions in ResourceLoader

This change allows to use the context in the functions.

The following internal static functions from ResourceLoader get now a
reference to the ResourceLoaderContext object:
* makeLoaderImplementScript
* makeLoaderStateScript
* makeLoaderRegisterScript
* makeLoaderSourcesScript

ResouceLoader::encodeJsonForScript is duplicated to
ResourceLoaderContext::encodeJson loading the debug mode from context.

ResourceLoader::encodeJsonForScript is kept for other usages without
context.

The debug mode is loaded from $context->getDebug() instead of from
ResourceLoader::inDebugMode(). This does not support to enable the debug
mode by setting the cookie 'resourceLoaderDebug' or the configuration
variable wgResourceLoaderDebug. Only the URL parameter debug=true
enables the debug mode. This should be sufficient for the subsequent
ResourceLoader requests. The tests don't need the global variable
wgResourceLoaderDebug anymore. The initial ResourceLoader context in
OutputPage still uses ResourceLoader::inDebugMode() with cookie and
global configuration variable.

This change adds the parameter $context with a ResourceLoaderContext
object to ResourceLoaderModule::getDeprecationInformation and deprecates
omitting the parameter. Ifa1a3bb56b731b83864022a358916c6aca5d7c10
updates this in extension ExtJSBase.

Bug: T229311
Change-Id: I5341f18625209446a6d006f60244990f65530319

4 years agoMerge "Split down patch-comment-table.sql"
jenkins-bot [Fri, 27 Sep 2019 15:18:11 +0000 (15:18 +0000)]
Merge "Split down patch-comment-table.sql"

4 years agoMerge "MWTestCase: include table prefix in domain for temp table only mode."
jenkins-bot [Fri, 27 Sep 2019 14:47:09 +0000 (14:47 +0000)]
Merge "MWTestCase: include table prefix in domain for temp table only mode."

4 years agodocs: Fix typo on Doxygen main page
apaskulin [Fri, 27 Sep 2019 14:45:59 +0000 (07:45 -0700)]
docs: Fix typo on Doxygen main page

This PR fixes a typo and removes a few extra words
from the Doxygen landing page.

Change-Id: Ieb09c0e72129f4c6b0ccd574daf2f9316f580259

4 years agoMerge "Speed up ApiQuerySiteinfoTest:testContinuation"
jenkins-bot [Fri, 27 Sep 2019 13:42:20 +0000 (13:42 +0000)]
Merge "Speed up ApiQuerySiteinfoTest:testContinuation"

4 years agoMerge "API: Use ConvertibleTimestamp::setFakeTime for testing curtimestamp"
jenkins-bot [Fri, 27 Sep 2019 12:01:55 +0000 (12:01 +0000)]
Merge "API: Use ConvertibleTimestamp::setFakeTime for testing curtimestamp"

4 years agoForce usage of MCR aware database schema
Clara Andrew-Wani [Tue, 24 Sep 2019 22:07:36 +0000 (18:07 -0400)]
Force usage of MCR aware database schema

Bug: T214308
Change-Id: I2ae4e82a12f730617563eb6f911fc406b9195391

4 years agoMWTestCase: include table prefix in domain for temp table only mode.
daniel [Fri, 27 Sep 2019 11:10:22 +0000 (13:10 +0200)]
MWTestCase: include table prefix in domain for temp table only mode.

This patch allows PageUpdaterTest and DerivedPageDataUpdaterTest to
function properly. Without this patch, the fail when run by themselves.

See phab ticket for analysis.

Bug: T234031
Change-Id: I0804b503bc8b860343a5141c0bfb25fe6855c87d

4 years agoRemove MySQL index aliasing for user_newtalk indexes
Brad Jorsch [Wed, 18 Sep 2019 16:44:15 +0000 (12:44 -0400)]
Remove MySQL index aliasing for user_newtalk indexes

While these have not yet caused problems, we should probably deprecate
the whole confusing "index aliasing" feature. Cleaning this up needs to
be done first.

Method MWLBFactory::setSchemaAliases() is being considered private due
to the @internal notation, and so is being removed without deprecation.

Bug: T233240
Change-Id: Ib04b7bc4af53382fde01bd8550cc7e361124255f

4 years agoSpeed up ApiQuerySiteinfoTest:testContinuation
Antoine Musso [Fri, 27 Sep 2019 08:42:56 +0000 (10:42 +0200)]
Speed up ApiQuerySiteinfoTest:testContinuation

The test fills $wgUrlProtocols with 86000 entries, forging oversized
strings which ends up eventually truncated to 100 bytes.  The aim is to
overflow $wgAPIMaxResultSize to trigger an apiwarn-truncatedresult
warning.

The test takes 230 ms on my machine and when generating code coverage
almost a minute.

A faster approach is just to lower the $wgAPIMaxResultSize limit to
trigger the warning.

Test plan:

  $ php tests/phpunit/phpunit.php \
      tests/phpunit/includes/api/ApiQuerySiteinfoTest.php \
      --filter testContinuation

Bug: T234016
Change-Id: I3dc96d394d8b98dda8f151d14544b829c92f9b10

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 27 Sep 2019 06:24:47 +0000 (08:24 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ic52edc08609d9b9d03b7173ae43810f0dad140c1

4 years agoresourceloader: Add type hints for type ResourceLoaderContext
Fomafix [Fri, 27 Sep 2019 04:43:44 +0000 (06:43 +0200)]
resourceloader: Add type hints for type ResourceLoaderContext

Change-Id: I10fc4b9277f94fc495149fe0d0077b054090387b

4 years agoIn recompressTracked.php, fix the names of things related to child processes
Tim Starling [Fri, 27 Sep 2019 00:58:21 +0000 (10:58 +1000)]
In recompressTracked.php, fix the names of things related to child processes

The forbidden word was used in two senses, confusing the search and
replace done in 3d5016569da984050e.

Change-Id: I220a58fd536c828ab5e03a779e45f222d0298f9a

4 years agoMerge "objectcache: fully respect "pcTTL" in WANObjectCache instead of using INF...
jenkins-bot [Fri, 27 Sep 2019 00:13:37 +0000 (00:13 +0000)]
Merge "objectcache: fully respect "pcTTL" in WANObjectCache instead of using INF when >= 0"

4 years agoMerge "filebackend: avoid use of wfWikiId() in FileBackendGroup"
jenkins-bot [Fri, 27 Sep 2019 00:13:30 +0000 (00:13 +0000)]
Merge "filebackend: avoid use of wfWikiId() in FileBackendGroup"

4 years agoMerge "Add .pipeline/ with dev image variant"
jenkins-bot [Thu, 26 Sep 2019 23:20:56 +0000 (23:20 +0000)]
Merge "Add .pipeline/ with dev image variant"

4 years agoMerge "Add a run mode to $wgDisableQueryPageUpdate"
jenkins-bot [Thu, 26 Sep 2019 23:17:16 +0000 (23:17 +0000)]
Merge "Add a run mode to $wgDisableQueryPageUpdate"

4 years agofilerepo: make FileRepo::store/storeBatch() accept FSFile as similar methods already do
Aaron Schulz [Sun, 15 Sep 2019 19:32:08 +0000 (12:32 -0700)]
filerepo: make FileRepo::store/storeBatch() accept FSFile as similar methods already do

Change-Id: I92ce979a71fabd9e2095e7db43fa6fc8c2e0ef75

4 years agoAdd a run mode to $wgDisableQueryPageUpdate
Umherirrender [Mon, 19 Aug 2019 14:49:43 +0000 (16:49 +0200)]
Add a run mode to $wgDisableQueryPageUpdate

The run mode is used to show a different message on the special page,
instead of the current one "Updates for this page are currently
disabled. Data here will not presently be refreshed." even the data gets
updated with a different cron job.

Bug: T78711
Change-Id: Ib63d16bfea477dec43323b39671cc068530e2f0b

4 years agoresourceloader: Add $modules parameter to makeVersionQuery()
Timo Tijhof [Thu, 26 Sep 2019 17:34:17 +0000 (18:34 +0100)]
resourceloader: Add $modules parameter to makeVersionQuery()

The 'version' and 'modules' parameters are a somewhat problematic
part of the ResourceLoaderContext object as we often pass around
the context but may be dealing with only a subset of the modules
in the outer request, or even entirely different ones (e.g.
for OutputPage's fake context 'modules' and 'version' are both
null).

This is already visible in ClientHtml where we create a derivative
context just to call setModules() and have makeVersionQuery()
work. This is now fixed.

This change is in preparation for use in ResourceLoaderImage
(to fix T233343) where we'll need to compute a version for only
1 module of a larger set, and ideally without needing to create
another context.

Bug: T233343
Change-Id: Icc1a4fd1f58c4e49e58eee43ca4ba2de6cfffc76

4 years agoMerge "installer: Deprecate WebInstaller::getInfoBox, getWarningBox and getErrorBox"
jenkins-bot [Thu, 26 Sep 2019 20:16:01 +0000 (20:16 +0000)]
Merge "installer: Deprecate WebInstaller::getInfoBox, getWarningBox and getErrorBox"

4 years agoMerge "Clean up ar_usertext_timestamp index mess"
jenkins-bot [Thu, 26 Sep 2019 19:41:56 +0000 (19:41 +0000)]
Merge "Clean up ar_usertext_timestamp index mess"

4 years agoMerge "You are reviewing an old revision should be a warningbox"
jenkins-bot [Thu, 26 Sep 2019 19:41:48 +0000 (19:41 +0000)]
Merge "You are reviewing an old revision should be a warningbox"

4 years agoMerge "newRevisionsFromBatch: don't throw on duplicate row."
jenkins-bot [Thu, 26 Sep 2019 19:39:58 +0000 (19:39 +0000)]
Merge "newRevisionsFromBatch: don't throw on duplicate row."

4 years agoinstaller: Deprecate WebInstaller::getInfoBox, getWarningBox and getErrorBox
Volker E [Tue, 17 Sep 2019 01:53:29 +0000 (18:53 -0700)]
installer: Deprecate WebInstaller::getInfoBox, getWarningBox and getErrorBox

Since MW 1.31 there are messageBox, warningBox, errorBox and successBox
available which should be used instead.

These are simple wrappers around Html::messageBox and related methods
which should be used directly instead. Internal usage has been migrated
as of a9252abb1cf0, but these public methods remain for now. Once
removed we can also removed the internal Html::infoBox() method.

Bug: T232903
Change-Id: I2756c88987754c4e3f84d98c531d8396098cd7fe

4 years agoMerge "Fill GenderCache for used pages in action=query&prop=fileusage"
jenkins-bot [Thu, 26 Sep 2019 17:03:04 +0000 (17:03 +0000)]
Merge "Fill GenderCache for used pages in action=query&prop=fileusage"

4 years agoAPI: Use ConvertibleTimestamp::setFakeTime for testing curtimestamp
Brad Jorsch [Thu, 26 Sep 2019 16:29:29 +0000 (12:29 -0400)]
API: Use ConvertibleTimestamp::setFakeTime for testing curtimestamp

Mainly to avoid spurious test failures when CI is being extremely slow.

Bug: T233752
Change-Id: Ie2cdd84dc076a852fbdce52f661ef893f9a2d45b

4 years agoMerge "Parser: Use 'Special:Badtitle/Parser' instead of 'NO TITLE'"
jenkins-bot [Thu, 26 Sep 2019 14:15:53 +0000 (14:15 +0000)]
Merge "Parser: Use 'Special:Badtitle/Parser' instead of 'NO TITLE'"

4 years agoCommentStore: Accept SCHEMA_COMPAT_* constants
Brad Jorsch [Fri, 20 Sep 2019 18:35:39 +0000 (14:35 -0400)]
CommentStore: Accept SCHEMA_COMPAT_* constants

Extensions doing an actor and comment migration at the same time will
likely want to use the same constants for each, and that will most
likely be using write-both/read-old and write-both/read-new for the
middle stages rather than write-both/read-both and write-new/read-both
as implemented by the MIGRATION_* constants. See Ie29fd05 for example.

This patch changes CommentStore's internal logic to work correctly when
passed write-both/read-old or write-both/read-new.

Bug: T233449
Change-Id: Iebec80f969ad1c4f9f51a4f25656319cca32b0dd

4 years agoexception: Let MediaWiki.php control final output for ErrorPageError
Timo Tijhof [Wed, 18 Sep 2019 18:05:42 +0000 (19:05 +0100)]
exception: Let MediaWiki.php control final output for ErrorPageError

The same way it does already for non-error output. This makes
it so that doPreOutputCommit() consistently happens between
the staging of output and the actual sending of output.

It is still allowed for code to bypass this, such as for fatal
errors and for handlers that disable OutputPage (like Special:Export).

But for cases where we do want to perform doPreOutputCommit(), it
should be run consistently between staging and sending so that it
can make appropiate decisions based on the current state of
OutputPage.

Previously, the state of OutputPage seen by doPreOutputCommit()
would be the broken/incomplete output of a seemingly succesful
(possibly cacheable) user action, which would then, after
doPreOutputCommit() runs, be completely replaced by $e->report()/
$out->showErrorPage().

This is a prerequisite for being able to reliably send cookie-block
cookies on error pages (next patch).

Bug: T233594
Change-Id: Iaeaf5e55a5868e6be534ddda73f3b56b9d6ef8f0

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 26 Sep 2019 06:23:52 +0000 (08:23 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I49be2a7100bff079264a48b07e14b0edf30472be

4 years agoYou are reviewing an old revision should be a warningbox
jdlrobson [Mon, 9 Sep 2019 22:07:12 +0000 (15:07 -0700)]
You are reviewing an old revision should be a warningbox

It's warning you about the outdated nature of the content.

Given this message can be customised and thus styled, this will
have presentation issues on certain wikis (see screenshots).

If we go ahead with this change we'll probably want to give editors
a 2 weeks heads up via tech news.

https://phabricator.wikimedia.org/F30285062
https://phabricator.wikimedia.org/F30285074
https://phabricator.wikimedia.org/F30285084

Bug: T232415
Change-Id: I7dab00d5500937c03166398d92ea65a599bf3e22

4 years agoFill GenderCache for used pages in action=query&prop=fileusage
Umherirrender [Tue, 10 Sep 2019 17:42:58 +0000 (19:42 +0200)]
Fill GenderCache for used pages in action=query&prop=fileusage

Add an utility function
ApiQueryBase::executeGenderCacheFromResultWrapper

GenderCache stops working when there are more than 1000 cache missed
and returning the default value (T200238)
Fill the cache with all needed users avoids this behaviour
and it saves one query per user page.

Change-Id: I911dcb160a7b169091b9e8f66fb3908d0f2a1ba4

4 years agoMerge "Pass "services" through from coreRoutes.json to ObjectFactory"
jenkins-bot [Wed, 25 Sep 2019 15:48:02 +0000 (15:48 +0000)]
Merge "Pass "services" through from coreRoutes.json to ObjectFactory"

4 years agordbms: fix active GTID filtering in DatabaseMysqlBase
Aaron Schulz [Wed, 19 Jun 2019 08:10:15 +0000 (09:10 +0100)]
rdbms: fix active GTID filtering in DatabaseMysqlBase

In masterPosWait(), only $pos will have the known active domain/server set
since it usually comes from getMasterPos(). However, the reference position,
from getReplicaDB(), does not have the active domains set since querying
gtid_domain_id on the replica would be incorrect and getting a connection
to the master could be expensive.

Remove obsolete hacks for jobs that used to store master positions.

Also, use the regular Database::query() method for stylistic consistency.

Bug: T224422
Change-Id: I41bbb9f337e46451aa17788dbd446db4a213a5a7

4 years agoMerge "Updated wikimedia/avro from 1.8.0 to 1.9.0"
jenkins-bot [Wed, 25 Sep 2019 07:53:14 +0000 (07:53 +0000)]
Merge "Updated wikimedia/avro from 1.8.0 to 1.9.0"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 25 Sep 2019 06:34:37 +0000 (08:34 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I27b08eefba6d5f7e8358fb0b2ea7f84552cb38c0

4 years agoMerge "resourceloader: Convert ImageModule test to stricter unit test"
jenkins-bot [Wed, 25 Sep 2019 06:10:12 +0000 (06:10 +0000)]
Merge "resourceloader: Convert ImageModule test to stricter unit test"

4 years agoMerge "Special:Contributions form collapsed when offset is defined"
jenkins-bot [Wed, 25 Sep 2019 02:29:14 +0000 (02:29 +0000)]
Merge "Special:Contributions form collapsed when offset is defined"

4 years agofilebackend: avoid use of wfWikiId() in FileBackendGroup
Aaron Schulz [Thu, 4 Jul 2019 08:13:29 +0000 (01:13 -0700)]
filebackend: avoid use of wfWikiId() in FileBackendGroup

Also warn when there is a risk of automatic backend domain collisions

Change-Id: Id488b5b947ef5fe8f4b0a8e96560bfd44fcc0327

4 years agoSpecial:Contributions form collapsed when offset is defined
jdlrobson [Thu, 28 Mar 2019 00:06:35 +0000 (17:06 -0700)]
Special:Contributions form collapsed when offset is defined

Form on Special:Contributions is collapsed while assuming
user is paging through results when target, start or end date
offset is defined.

Bug: T117736
Bug: T191868
Change-Id: I05030f1473b13bbe66bf56b9affc8d33f7210b81

4 years agoPass "services" through from coreRoutes.json to ObjectFactory
Tim Starling [Mon, 23 Sep 2019 05:30:46 +0000 (15:30 +1000)]
Pass "services" through from coreRoutes.json to ObjectFactory

Allows service injection into REST handlers.

Change-Id: I83d1780903febe0499c6a575a0e6725dc01e5b0c

4 years agoMerge "Replace infobox usages and extend successbox, warningbox and errorbox"
jenkins-bot [Wed, 25 Sep 2019 00:44:28 +0000 (00:44 +0000)]
Merge "Replace infobox usages and extend successbox, warningbox and errorbox"

4 years agoMerge "Make Special:Contributions use OOUI"
jenkins-bot [Wed, 25 Sep 2019 00:38:05 +0000 (00:38 +0000)]
Merge "Make Special:Contributions use OOUI"

4 years agoMerge "Avoid uses of wfWikiId() in maintenance/"
jenkins-bot [Tue, 24 Sep 2019 23:55:54 +0000 (23:55 +0000)]
Merge "Avoid uses of wfWikiId() in maintenance/"

4 years agoReplace infobox usages and extend successbox, warningbox and errorbox
Volker E [Tue, 17 Sep 2019 04:39:49 +0000 (21:39 -0700)]
Replace infobox usages and extend successbox, warningbox and errorbox

Adding optional $className parameter to provide additional
styling options.
Optional parameter $heading was introduced for MobileFrontend. Therefore
leaving inconsistent parameter order is necessary for the time being.

Bug: T232903
Change-Id: I5857b2c58a47a83156c32f086a73fe2bd48ab0c8

4 years agoAdd .pipeline/ with dev image variant
Brennen Bearnes [Wed, 15 May 2019 00:14:11 +0000 (18:14 -0600)]
Add .pipeline/ with dev image variant

This adds a .pipeline/, containing:

  - blubber.yaml which, for now, defines a single variant for creating
    a Docker image to be used by the local-charts[0] environment.  This
    image is built on dev-stretch-php72-fpm-apache2, which is defined in
    dev-images[1].

  - dev_prereq.sh which installs some extensions, runs composer, and
    creates a stub LocalSettings.php in the dev image as a blubber builder
    command.

  - config.yaml for building the dev image.

This depends on publication of dev/stretch-php72-fpm-apache2 to
docker-registry.wikimedia.org:

  - https://phabricator.wikimedia.org/T223327
  - https://phabricator.wikimedia.org/T223329

It can be tested locally by:

  1. Installing Docker, blubber[2], and Minikube

  2. Building the images in dev-images with `make`

  3. Saving a copy of the dev-stretch-php72-fpm-apache2 image:

     $ docker save -o dev-stretch-php72-fpm-apache2.tar
       docker-registry.wikimedia.org/dev/dev-stretch-php72-fpm-apache2

  4. Importing that image into Minikube's docker:

     $ eval $(minikube docker-env)
     $ docker load --input ./dev-stretch-php72-fpm-apache2.tar

  5. Building an image tagged "docker-registry.wikimedia.org/dev/mediawiki"
     from the root of this repository:

     $ blubber .pipeline/blubber.yaml dev | docker build --pull=false -t docker-registry.wikimedia.org/dev/mediawiki -f - .

That image should now be usable by local-charts.

[0]. https://gerrit.wikimedia.org/r/plugins/gitiles/releng/local-charts/
[1]. https://gerrit.wikimedia.org/r/plugins/gitiles/releng/dev-images/
[2]. https://wikitech.wikimedia.org/wiki/Blubber/Download

Bug: T218360
Change-Id: I1c8192e67c39e86c4903a9137dba7c02faee3145
Depends-On: I8a5a5f2c24d81fb94b104a3a98627d9fbe6059bf

4 years agoresourceloader: Convert ImageModule test to stricter unit test
Timo Tijhof [Tue, 24 Sep 2019 22:48:48 +0000 (23:48 +0100)]
resourceloader: Convert ImageModule test to stricter unit test

Bug: T233343
Change-Id: I1f9d0b6b735c9192bb32baf249eefea76c65929e

4 years agoMerge "Maintenance.php: Fix mwdebug error"
jenkins-bot [Tue, 24 Sep 2019 22:50:22 +0000 (22:50 +0000)]
Merge "Maintenance.php: Fix mwdebug error"

4 years agoMerge "exception: Add missing early return for UserNotLoggedIn error page"
jenkins-bot [Tue, 24 Sep 2019 22:50:14 +0000 (22:50 +0000)]
Merge "exception: Add missing early return for UserNotLoggedIn error page"

4 years agoAvoid uses of wfWikiId() in maintenance/
Aaron Schulz [Tue, 24 Sep 2019 22:42:00 +0000 (15:42 -0700)]
Avoid uses of wfWikiId() in maintenance/

Change-Id: I81904c0ba7120d7da2454929ffec5c1c0892be02

4 years agoMerge "Enable preservation of grapheme clusters in highlightQuery"
jenkins-bot [Tue, 24 Sep 2019 21:51:19 +0000 (21:51 +0000)]
Merge "Enable preservation of grapheme clusters in highlightQuery"

4 years agoMerge "phan: Removed PhanUndeclaredTypeParameter suppression"
jenkins-bot [Tue, 24 Sep 2019 21:50:36 +0000 (21:50 +0000)]
Merge "phan: Removed PhanUndeclaredTypeParameter suppression"

4 years agoMerge "Improve the top section of Special:Watchlist for small screens"
jenkins-bot [Tue, 24 Sep 2019 21:19:47 +0000 (21:19 +0000)]
Merge "Improve the top section of Special:Watchlist for small screens"

4 years agoMerge "Simplify NewFilesPager::getQueryInfo"
jenkins-bot [Tue, 24 Sep 2019 20:57:34 +0000 (20:57 +0000)]
Merge "Simplify NewFilesPager::getQueryInfo"

4 years agoMerge "resourceloader: Remove "expected error" noise from mw.loader tests"
jenkins-bot [Tue, 24 Sep 2019 20:54:31 +0000 (20:54 +0000)]
Merge "resourceloader: Remove "expected error" noise from mw.loader tests"

4 years agoEnable preservation of grapheme clusters in highlightQuery
tjones [Tue, 24 Sep 2019 20:42:05 +0000 (16:42 -0400)]
Enable preservation of grapheme clusters in highlightQuery

Make use of the option to preserve grapheme clusters in highlightQuery
in OOUI's LabelElement.js so that partial matches in the main search
page on Special:Search don't break graphemes.

Bug: T35242
Depends-On: Iac79095a1b40ef92b3cfd9421916928217639434
Change-Id: I5c458da39156db8a39412b91cf647aacd43fbbb9

4 years agoMerge "Improve documentation of newRevisionsFromBatch()"
jenkins-bot [Tue, 24 Sep 2019 20:25:00 +0000 (20:25 +0000)]
Merge "Improve documentation of newRevisionsFromBatch()"

4 years agoImprove the top section of Special:Watchlist for small screens
Jan Drewniak [Tue, 24 Sep 2019 09:26:20 +0000 (11:26 +0200)]
Improve the top section of Special:Watchlist for small screens

Bug: T225127#5518870
Change-Id: I2d3e2cf27150487190b34cc9b76db9905599e27b

4 years agophan: Removed PhanUndeclaredTypeParameter suppression
Umherirrender [Tue, 24 Sep 2019 19:20:28 +0000 (21:20 +0200)]
phan: Removed PhanUndeclaredTypeParameter suppression

Fixed the non-namespaced WebRequest by adding a backslash

Change-Id: I9f1e3e000d9a512a74f93145cd5e66b1b38ab8b2

4 years agonewRevisionsFromBatch: don't throw on duplicate row.
daniel [Tue, 24 Sep 2019 17:39:54 +0000 (19:39 +0200)]
newRevisionsFromBatch: don't throw on duplicate row.

Bug: T228988
Change-Id: I907fe25692a74b591300b2f182ac6234c22c8071

4 years agoMerge "LogPager: Add IGNORE INDEX to avoid MariaDB optimizer bug"
jenkins-bot [Tue, 24 Sep 2019 17:41:06 +0000 (17:41 +0000)]
Merge "LogPager: Add IGNORE INDEX to avoid MariaDB optimizer bug"

4 years agoImprove documentation of newRevisionsFromBatch()
daniel [Tue, 24 Sep 2019 17:18:08 +0000 (19:18 +0200)]
Improve documentation of newRevisionsFromBatch()

Document purpose and behavior of the $title parameter.

Bug: T228988
Change-Id: I89966321ec3b4feb5a59e06b8a656d76c4bd9ef2

4 years agobuild: Lower default Karma logLevel during local development
Timo Tijhof [Tue, 24 Sep 2019 16:46:53 +0000 (17:46 +0100)]
build: Lower default Karma logLevel during local development

Follows-up fa63a70ae90 which enabled this for CI to investigate
a Jenkins-specific issue, but it makes for a very noisy and visually
unpleasant local experience because these Karma lines interweave
with the structural output from the qunit/karma reporter.

With this change applied, the local experience from 'npm run qunit'
has clean output again like so:

```

  mediawiki.storage
    ✔ set/get(Object) with storage support
    ✔ set/get(Object) with storage methods disabled
    ✔ set/get(Object) with storage object disabled
  mediawiki.template
    ✔ add
    ✔ compile
    ✔ get

Finished in 13 secs

SUMMARY:
✔ 440 tests completed
```

Change-Id: I21555468ed30ca3a2220eba1d8a78cc140a13399

4 years agoresourceloader: Remove "expected error" noise from mw.loader tests
Timo Tijhof [Tue, 24 Sep 2019 16:42:42 +0000 (17:42 +0100)]
resourceloader: Remove "expected error" noise from mw.loader tests

After commit bbded40a2b26c, the stub for mw.track no longer worked
as originally intended, causing the stack traces to be printed
to the Karma output and browser console again.

The test still passed because mw.trackError calls mw.track, but
it no longer stubbed out the trace logging noise.

Also simplify some assertion messages while at it, these are meant
to describe the subject (the compared value) not be the value
itself (which is the second param) and not the error message
(which QUnit produces).

Change-Id: I657bf4479a40e1b73b45426df98882aed32b4cba

4 years agoLogPager: Add IGNORE INDEX to avoid MariaDB optimizer bug
Brad Jorsch [Fri, 20 Sep 2019 19:38:52 +0000 (15:38 -0400)]
LogPager: Add IGNORE INDEX to avoid MariaDB optimizer bug

This is basically the same thing we fixed for ApiQueryLogEvents in
I16dba2158.

Bug: T223151
Change-Id: I53a7ed59de3eed2b0b4f1b1fb7f6d302b1de276c

4 years agoobjectcache: fully respect "pcTTL" in WANObjectCache instead of using INF when >= 0
Aaron Schulz [Tue, 24 Sep 2019 09:40:34 +0000 (02:40 -0700)]
objectcache: fully respect "pcTTL" in WANObjectCache instead of using INF when >= 0

This was broken since 611e2d55963b91

Change-Id: I612eaf211ff698d5ab1c911aa58195b7bc44f00c

4 years agoMark $wgMainPageIsDomainRoot as experimental
Niklas Laxström [Tue, 24 Sep 2019 06:53:19 +0000 (08:53 +0200)]
Mark $wgMainPageIsDomainRoot as experimental

Change-Id: I328c1022aec8918cbc5b4ee50de3d1dbe5586cfd

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 24 Sep 2019 06:27:32 +0000 (08:27 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ie40b3da759701a2eb31d05a3230b547d5182c24a

4 years agoMerge "resourceloader: Reduce severity of unknown page module warning"
jenkins-bot [Tue, 24 Sep 2019 00:56:30 +0000 (00:56 +0000)]
Merge "resourceloader: Reduce severity of unknown page module warning"

4 years agoMerge "resourceloader: Remove redundant closure of some startup and base files"
jenkins-bot [Tue, 24 Sep 2019 00:56:22 +0000 (00:56 +0000)]
Merge "resourceloader: Remove redundant closure of some startup and base files"

4 years agoresourceloader: Reduce severity of unknown page module warning
Timo Tijhof [Mon, 23 Sep 2019 23:47:18 +0000 (00:47 +0100)]
resourceloader: Reduce severity of unknown page module warning

These are silently skipped and generally no cause for alarm.
For example, when enabling a gadget by default and then
disabling/deleting it, cached HTML will still have it queued,
which is silently skipped and the other queued modules are loaded
just fine.

The same for when merging module bundles where the destination
is already loaded, in such case it is tolerated to let cached
ParserOutput objects still queuing it silently skip it.
Keeping it existent just to avoid a warning isn't particularly
useful and might even obscure problems or give the illusion that
it is still working and providing compatibility (e.g. loading the
new code), which might not be true.

The silent skipping of modules originally did not have any
logging or warning attached to it, it was silent from 2010
to April 2019. In 2017, commit 37df741514 adds a console warning
when a circular dependency is detected.

In April 2019, commit d059dffa2 optimised away this redundant
silent skipping of unknown modules, in favour of re-using the
code for circular dep detection, which did the same thing already,
but with a debug warning. This meant it now showed scary stack
traces when all there's only an stale module ref, which are normal
in RL and generaly nothing to worry about. This was amplified
by Minerva's tracking of client-side errors going beyond just
'global.error' but also listerning to recoverable internal errors
from 'resourceloader.exception', which now included these
debug warnings.

Change-Id: Ie71adbe18e8dbeb661ddb9d7d3d1d0897891d515

4 years agoresourceloader: Remove redundant closure of some startup and base files
Timo Tijhof [Tue, 24 Sep 2019 00:09:04 +0000 (01:09 +0100)]
resourceloader: Remove redundant closure of some startup and base files

* errorLogger: Contains only top-level assignments and statements,
  no scope needed. If it does need a scope at some point, then it
  should be converted to packageFiles first so that the closure
  still isn't needed (see T50886).

* requestIdleCallback: This file should do nothing in modern browsers,
  except alias a native method, and expose the fallback for testing.
  Remove the closure and with it the (usually) unused local var.

* mediawiki.js: Use the shorter Object.hasOwnProperty instead,
  we already do this in several files. Both provide a quick reference
  to the native method. Object.prototype.hasOwnProperty is more direct
  visually, but also less direct at run-time (3 lookups instead of 2).
  MW does not support environments that extend native classes such as
  Object or their prototypes, so this makes no difference in that
  regard and is already done in several core files. (More wide changes
  to be done separately).

Change-Id: I98ed4da4807c54254669053cef47a3e67b4ad2cf

4 years agoexception: Add missing early return for UserNotLoggedIn error page
Timo Tijhof [Mon, 23 Sep 2019 23:33:20 +0000 (00:33 +0100)]
exception: Add missing early return for UserNotLoggedIn error page

Follows-up d0439af89f6b254c.

If the UserNotLoggedIn class is constructed with an unsupported
message parameter, thrown, and handled by MWExceptionHandler, the
report() method would get called, and it would call the parent,
which stages a full error page and sends it via OutputPage::output.

Due to the missing return statement, it would then still execute
the remaining code, which messes up the internal state of the
already-sent OutputPage object by changing its redirect target
(which will never be used, but might confuse other consumers),
and trying to re-send output() and redirect headers, which will
fail with a warning.

Fixing this is required for T233594 and Iaeaf5e55a586, which allows
ErrorPageError to be "stage only" without ending output. Without
this fix, it would call the parent and do stage-only, but then
the remaining code in this method also work and actually succeed
at sending an invalid message to the user.

To preserve current (accidentally correct) behaviour, this needs
to be fixed first.

Bug: T233594
Bug: T17484
Change-Id: Ic5d73becd889839399a5b425cbbe22a3401acea9

4 years agoMerge "Fix type for timeout and connectTimeout in HttpRequestFactory::create"
jenkins-bot [Mon, 23 Sep 2019 20:11:36 +0000 (20:11 +0000)]
Merge "Fix type for timeout and connectTimeout in HttpRequestFactory::create"

4 years agoAmend expanded HTMLForm legend styling
Volker E [Mon, 23 Sep 2019 19:08:21 +0000 (12:08 -0700)]
Amend expanded HTMLForm legend styling

Follow-up to I6964296bc68705 providing same top and bottom padding
when expanded.

Change-Id: Ib69f730f9fa713bc8a6d7bf0fdbb7a6d26b1f0ab

4 years agoMake Special:Contributions use OOUI
jdlrobson [Sat, 2 Apr 2016 08:03:42 +0000 (11:03 +0300)]
Make Special:Contributions use OOUI

Changes:
* IP address/username is now a single label & input element combination
* Add page-specific styles in separate LESS file
* Remove no longer necessary CSS rule

Bug: T117736
Bug: T219238
Change-Id: I979078d8937898acae22bc28d5ed51da1d4ed627

4 years agoFix type for timeout and connectTimeout in HttpRequestFactory::create
Umherirrender [Sun, 22 Sep 2019 19:29:12 +0000 (21:29 +0200)]
Fix type for timeout and connectTimeout in HttpRequestFactory::create

Both can have a string 'default'

Change-Id: I9c49cf7db762f251b010bc5469d4c1b4a7797f45