lhc/web/wiklou.git
4 years agoProvide command to adjust phpunit.xml for code coverage
Kosta Harlan [Sun, 21 Jul 2019 18:34:23 +0000 (20:34 +0200)]
Provide command to adjust phpunit.xml for code coverage

Our current recommendation for adjusting PHPUnit configuration for
extension code coverage reports is to manually modify
tests/phpunit/suite.xml. This is cumbersome and annoying, since
suite.xml is version controlled.

This patch proposes a composer script to simplify editing
the (non-version controlled) phpunit.xml config in the root of the
MediaWiki repo. It is useful if you are interested in generating
code coverage reports based on unit tests only, not integration tests.

Usage: composer phpunit:coverage-edit -- extensions/GrowthExperiments

When you're done, you can run `rm phpunit.xml` to switch back to the
default phpunit.xml.dist.

The script will use the default includes/src/maintenance directories,
but a future improvement would be to identify the relevant directories
via the AutoloadClasses property of extension.json.

Another improvement would be to provide an option for passing
arbitrary paths in core, in case you are working on tests for a
specific class and want to generate coverage reports instantly.

We could probably also remove
dockerfiles/quibble-coverage/phpunit-suite-edit.py (which inspired
this patch) and use composer phpunit:coverage-edit instead.

Bug: T100294
Change-Id: Ia0ef41f67ca4a64b0d1ca0ddcee488c29630af0b

4 years agoMerge "docs: Remove unused Doxygen custom commands"
jenkins-bot [Thu, 5 Sep 2019 01:22:44 +0000 (01:22 +0000)]
Merge "docs: Remove unused Doxygen custom commands"

4 years agoMerge "resources: Upgrade OOjs from v2.2.2 to v3.0.0"
jenkins-bot [Thu, 5 Sep 2019 01:22:38 +0000 (01:22 +0000)]
Merge "resources: Upgrade OOjs from v2.2.2 to v3.0.0"

4 years agoMerge "docs: Convert doxygen_first_page.php to proper Markdown"
jenkins-bot [Wed, 4 Sep 2019 23:55:11 +0000 (23:55 +0000)]
Merge "docs: Convert doxygen_first_page.php to proper Markdown"

4 years agoMerge "docs: Remove unused PERL_PATH and unused file patterns from Doxyfile"
jenkins-bot [Wed, 4 Sep 2019 23:18:53 +0000 (23:18 +0000)]
Merge "docs: Remove unused PERL_PATH and unused file patterns from Doxyfile"

4 years agoMerge "Update OOUI to v0.34.0"
jenkins-bot [Wed, 4 Sep 2019 23:05:53 +0000 (23:05 +0000)]
Merge "Update OOUI to v0.34.0"

4 years agodocs: Remove unused Doxygen custom commands
Timo Tijhof [Wed, 4 Sep 2019 22:42:27 +0000 (23:42 +0100)]
docs: Remove unused Doxygen custom commands

These have no matches in this repo: `@arrayof`, `@null`, `@boolean`,
`@bool`, `@integer`, `@int`, `@string`, `@str`, `@mixed`, `@public`.

Change-Id: If95ffb679df88656f059e8d94def8aa25459ccbe

4 years agodocs: Convert doxygen_first_page.php to proper Markdown
Timo Tijhof [Wed, 4 Sep 2019 22:19:55 +0000 (23:19 +0100)]
docs: Convert doxygen_first_page.php to proper Markdown

Doxygen has native support for indexing of Markdown pages.
It basically parses them the same way it parses the uglier
methodology of creating a PHP file containing a the markdown
text in a large comment that would start with `@page` or `@mainpage`.

* http://doxygen.nl/manual/commands.html#cmdpage
* http://doxygen.nl/manual/commands.html#cmdmainpage
* http://doxygen.nl/manual/markdown.html#md_page_header

The internal reference name and page title (comparable to the string
passed to `@mainpage` or `@page`) are by default derived from the
file name (without suffix).

The internal reference name (for use in cross-page links) can also
be overidden with an `{#something}` annotation in the first heading.

When using the annotation `{#mainpage}` it changes the page type
from a regular `@page` to the `@mainpage`.

Change-Id: I0c25a49088825744773c4d87dde5688894b2004e

4 years agoresources: Upgrade OOjs from v2.2.2 to v3.0.0
James D. Forrester [Wed, 28 Aug 2019 15:53:23 +0000 (08:53 -0700)]
resources: Upgrade OOjs from v2.2.2 to v3.0.0

Change-Id: I2eaf300015b2954479f5d1d0711ec934a9aa294b

4 years agodocs: Remove unused PERL_PATH and unused file patterns from Doxyfile
Timo Tijhof [Wed, 4 Sep 2019 21:46:31 +0000 (22:46 +0100)]
docs: Remove unused PERL_PATH and unused file patterns from Doxyfile

* File patterns - Keep only ".php" and ".inc". The other file types
  either don't exist in this repo, or exist but have 0 parseable doc
  blocks for Doxygen to find. Also remove README, it leads to various
  pointless attempts for Doxygen to parse files by this name without
  any documentable entity in them. Such as;

  > mediawiki/includes/jobqueue/README:82: warning: Reached end of file
  > while still inside a nested comment. Nesting level 1.

* Remove 'PERL_PATH'. This has been unused since Doxygen 1.8.0,
  the last build on doc.wikimedia.org from Jenkins uses Doxygen 1.8.13.
  As of Doxygen 1.8.16 a deprecation warning was also added,
  https://github.com/doxygen/doxygen/commit/6d1535c.

Change-Id: I99bd80f9cf7bae8d37caf0b9325bd30a16020497

4 years agoMerge "resourceloader: Drop support for low Suhosin 'max_value_length' values"
jenkins-bot [Wed, 4 Sep 2019 21:53:44 +0000 (21:53 +0000)]
Merge "resourceloader: Drop support for low Suhosin 'max_value_length' values"

4 years agoMerge "localisation: Release data from memory in LCStoreStaticArray::finishWrite"
jenkins-bot [Wed, 4 Sep 2019 21:53:34 +0000 (21:53 +0000)]
Merge "localisation: Release data from memory in LCStoreStaticArray::finishWrite"

4 years agoMerge "rdbms: migrate DatabaseMysqlBase::getServerVersion() to using the local server...
jenkins-bot [Wed, 4 Sep 2019 21:28:58 +0000 (21:28 +0000)]
Merge "rdbms: migrate DatabaseMysqlBase::getServerVersion() to using the local server cache"

4 years agoresourceloader: Drop support for low Suhosin 'max_value_length' values
Timo Tijhof [Sat, 31 Aug 2019 22:30:22 +0000 (23:30 +0100)]
resourceloader: Drop support for low Suhosin 'max_value_length' values

Move the default of 2000 to DefaultSettings.php, and promote
the installer warning to a hard value.

Recommend that the setting be disabled, or increased to 5000.

Change-Id: Ifb0aadf8b52fd2d5c2a32f55e38eaa9c2600dfb5

4 years agoMerge "rdbms: assorted LBFactoryMulti/LBFactorySimple cleanups"
jenkins-bot [Wed, 4 Sep 2019 20:47:14 +0000 (20:47 +0000)]
Merge "rdbms: assorted LBFactoryMulti/LBFactorySimple cleanups"

4 years agoMerge "resourceloader: Document encodeJsonForScript() type as mixed"
jenkins-bot [Wed, 4 Sep 2019 20:47:04 +0000 (20:47 +0000)]
Merge "resourceloader: Document encodeJsonForScript() type as mixed"

4 years agoMerge "rdbms: cleanup visibility of Database::makeSelectOptions()"
jenkins-bot [Wed, 4 Sep 2019 20:40:59 +0000 (20:40 +0000)]
Merge "rdbms: cleanup visibility of Database::makeSelectOptions()"

4 years agolocalisation: Release data from memory in LCStoreStaticArray::finishWrite
Timo Tijhof [Wed, 4 Sep 2019 20:35:10 +0000 (21:35 +0100)]
localisation: Release data from memory in LCStoreStaticArray::finishWrite

With this change, the memory behaviour of LCStoreStaticArray
matches the other LCStore implementations. Specifically, that when
mass-rebuilding LocalisationCache entries for all language codes,
the computed data should be released from memory after
calling LCStore::finishWrite().

This doesn't affect user-facing web requests, even in the case
of stock MW where every once in a while a user request can lazy-
regenerate the LCStore, there is a process-cache in front of LCStore
in the LocalisationCache class.

The rebuildLocalisationCache.php clears that via
LocalisationCacheBulkLoad::unload(), but due to LCStoreStaticArray
internally holding on to the data, it was still leaking.

The leak was found by @Nikerabbit as part of testing for T218207.

To test this, amend rebuildLocalisationCache.php and add the
following on line 161, as the first line of the doRebuild/foreach/if
block:

  echo "[$code-start-mem] " . round(memory_get_usage(true)/1024/1024, 2) . " MB\n";

If you then have LocalSettings.php configured like so:

  $wgCacheDirectory = $wgTmpDirectory;
  $wgLocalisationCacheConf['store'] = 'array';

Then before this patch, running rebuildLocalisationCache.php,
shows memory starting at 12 MB and growing 2-3 MB for every language
until the very end, closing with 970 MB memory use.

After this patch, it starts at 12 MB and stops growing at 32 MB.

When configuring as `['store'] = 'files'`, which uses LCStoreCDB,
the memory starts at 12 MB and stops growing at 44 MB, both before
and after this patch.

Bug: T218207
Change-Id: I0d215efee5b31766776a068b16811d52f9879312

4 years agordbms: assorted LBFactoryMulti/LBFactorySimple cleanups
Aaron Schulz [Tue, 23 Jul 2019 00:07:11 +0000 (17:07 -0700)]
rdbms: assorted LBFactoryMulti/LBFactorySimple cleanups

Ignore "groupLoads" in "serverTemplate" for consistency with "load".
These server config map values should come from "groupLoadsBySection"
and "sectionLoads" only.

Simplify LBFactoryMulti::makeServerArray() to not bother setting values
that LoadBalancer already sets ('flags', 'master', 'replica').

Move down private methods and clean up a various code comments.

Change-Id: I0fe7f913a37236380127bef8d02768a9d1209596

4 years agoresourceloader: Document encodeJsonForScript() type as mixed
Umherirrender [Wed, 4 Sep 2019 17:13:11 +0000 (19:13 +0200)]
resourceloader: Document encodeJsonForScript() type as mixed

Objects passed to it since 23d066618def55361aa32a60ef9
json_encode allows mixed type, so use it also here.

Change-Id: I0897a6a144fd1c90b3ead205cedf21c19682b9df

4 years agoUpdate OOUI to v0.34.0
Volker E [Wed, 4 Sep 2019 19:42:13 +0000 (12:42 -0700)]
Update OOUI to v0.34.0

Release notes:
 https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.34.0

Bug: T35242
Bug: T225669
Bug: T226872
Bug: T226872
Bug: T230160
Depends-On: Ic50014955550f6c310155f38834ad03cbd77af20
Change-Id: I1520084a0d546279180320d2b03d390be6689d05

4 years agoMerge "filerepo: Use @method LocalRepo::newFile() to document the return type"
jenkins-bot [Wed, 4 Sep 2019 19:40:00 +0000 (19:40 +0000)]
Merge "filerepo: Use @method LocalRepo::newFile() to document the return type"

4 years agoMerge "build: Exclude MemcachedClient from phan"
jenkins-bot [Wed, 4 Sep 2019 19:02:20 +0000 (19:02 +0000)]
Merge "build: Exclude MemcachedClient from phan"

4 years agobuild: Exclude MemcachedClient from phan
Umherirrender [Wed, 4 Sep 2019 18:23:25 +0000 (20:23 +0200)]
build: Exclude MemcachedClient from phan

Change-Id: I46557802d10592a53e4ee4f6126a4aeed3f714a4

4 years agoMerge "Introduce RevisionStore::newRevisionsFromBatch"
jenkins-bot [Wed, 4 Sep 2019 18:13:34 +0000 (18:13 +0000)]
Merge "Introduce RevisionStore::newRevisionsFromBatch"

4 years agofilerepo: Use @method LocalRepo::newFile() to document the return type
Aaron Schulz [Thu, 29 Aug 2019 23:03:43 +0000 (16:03 -0700)]
filerepo: Use @method LocalRepo::newFile() to document the return type

This avoids PhpStorm IDE warnings

Change-Id: I521aa1b1243ceabd40e7da18bf73ab95af7039cc

4 years agoMerge "filebackend: improve internal use of FileBackend constants"
jenkins-bot [Wed, 4 Sep 2019 17:39:27 +0000 (17:39 +0000)]
Merge "filebackend: improve internal use of FileBackend constants"

4 years agoMerge "Add NS_MAIN to NamespaceInfo::$canonicalNames"
jenkins-bot [Wed, 4 Sep 2019 17:03:24 +0000 (17:03 +0000)]
Merge "Add NS_MAIN to NamespaceInfo::$canonicalNames"

4 years agoMerge "build: Update wikimedia/ip-set from 2.0.1 to 2.1.0"
jenkins-bot [Wed, 4 Sep 2019 17:03:17 +0000 (17:03 +0000)]
Merge "build: Update wikimedia/ip-set from 2.0.1 to 2.1.0"

4 years agoMerge "Upgrade phan config to 0.7.1"
jenkins-bot [Wed, 4 Sep 2019 16:21:12 +0000 (16:21 +0000)]
Merge "Upgrade phan config to 0.7.1"

4 years agobuild: Update wikimedia/ip-set from 2.0.1 to 2.1.0
Timo Tijhof [Wed, 4 Sep 2019 16:07:37 +0000 (17:07 +0100)]
build: Update wikimedia/ip-set from 2.0.1 to 2.1.0

This release remove use the Wikimedia/quietCall function wrappers
in favour of calling Wikimedia\AtEase directly. This is used
in WebStart/WebRequest::getIP/ProxyLookup::isConfiguredProxy.

Bug: T189966
Depends-On: I31a371d206ac22df4d95c2d72c85b8b2d89722fd
Change-Id: Icdf34bde803cdea90ca9f6b730391514d6485618

4 years agoAdd NS_MAIN to NamespaceInfo::$canonicalNames
David Barratt [Wed, 4 Sep 2019 16:07:50 +0000 (12:07 -0400)]
Add NS_MAIN to NamespaceInfo::$canonicalNames

The main namespace is missing from the list of canonical names.

Bug: T232004
Change-Id: I2ec9af3ba657d87d3a0eb7febafb3ca4eb7c59ac

4 years agoMerge "EditPage: Don't set 'hookaborted' error if the hook set a better error"
jenkins-bot [Wed, 4 Sep 2019 15:27:44 +0000 (15:27 +0000)]
Merge "EditPage: Don't set 'hookaborted' error if the hook set a better error"

4 years agoMerge "ApiBase: Always validate that 'limit' is numeric"
jenkins-bot [Wed, 4 Sep 2019 15:15:43 +0000 (15:15 +0000)]
Merge "ApiBase: Always validate that 'limit' is numeric"

4 years agoMerge "Include change tags in revision import structure"
jenkins-bot [Wed, 4 Sep 2019 09:46:56 +0000 (09:46 +0000)]
Merge "Include change tags in revision import structure"

4 years agoUpgrade phan config to 0.7.1
Daimona Eaytoy [Sun, 1 Sep 2019 14:00:35 +0000 (16:00 +0200)]
Upgrade phan config to 0.7.1

This allows us to remove many suppressions for phan false positives.

Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 4 Sep 2019 07:10:01 +0000 (09:10 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1f3f259b07e4b7bd6ccd305af12fb8e9400a7407

4 years agordbms: cleanup visibility of Database::makeSelectOptions()
Aaron Schulz [Wed, 4 Sep 2019 03:05:49 +0000 (20:05 -0700)]
rdbms: cleanup visibility of Database::makeSelectOptions()

Change-Id: I2e18dd3d450ceec9895d3143074743bc206a943d

4 years agordbms: migrate DatabaseMysqlBase::getServerVersion() to using the local server cache
Aaron Schulz [Wed, 4 Sep 2019 02:47:35 +0000 (19:47 -0700)]
rdbms: migrate DatabaseMysqlBase::getServerVersion() to using the local server cache

Change-Id: If667f761b2173226ccf1129ec864d1ce9729024a

4 years agoMerge "Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback"
jenkins-bot [Wed, 4 Sep 2019 03:00:09 +0000 (03:00 +0000)]
Merge "Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback"

4 years agofilebackend: improve internal use of FileBackend constants
Aaron Schulz [Fri, 30 Aug 2019 07:01:29 +0000 (00:01 -0700)]
filebackend: improve internal use of FileBackend constants

Add more result constants and split up FileBackend::UNKNOWN for
clarity. This follows up 5719815f3b, which added that constant.

Make internal FileBackendStore::doGet* methods distinguish I/O errors
from missing files; the return types of public FileBackend methods are
unchanged. Avoid process caching any mtime/size/sha1 values in the
case of I/O errors. Use error constants consistently for stat methods
when given invalid paths.

Also:
* Factor out FileBackendStore::processCacheAndPersistStatEntries() method
  to reduce significant code duplication.
* Consolidate duplicated isPathUsable() checks in FileOp subclasses to
  FileOp::precheck().
* Remove null process cache value check from FileBackend::getFileStat()
  as null values are never stored in the process cache to begin with.
* Reformat some oddly wrapped lines to look cleaner.

Change-Id: Id0e4b0da0bb2ed3184847b35142d587c7f3d953d

4 years agoUnsuppress phan issues, part 8
Daimona Eaytoy [Sun, 1 Sep 2019 12:45:11 +0000 (14:45 +0200)]
Unsuppress phan issues, part 8

And also clean up the config.

Bug: T231636
Depends-On: Ie6233561de78457cae5e4e44e220feec2d1272d8
Change-Id: I82a279e1f7b0fdefd3bb712e46c7d0665429d065

4 years agoMerge "Fix PhpStorm IDE warnings in ServiceWiring.php"
jenkins-bot [Wed, 4 Sep 2019 00:03:39 +0000 (00:03 +0000)]
Merge "Fix PhpStorm IDE warnings in ServiceWiring.php"

4 years agoMerge "Localisation updates from https://translatewiki.net."
jenkins-bot [Tue, 3 Sep 2019 23:24:57 +0000 (23:24 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoFix PhpStorm IDE warnings in ServiceWiring.php
Aaron Schulz [Thu, 29 Aug 2019 04:50:12 +0000 (21:50 -0700)]
Fix PhpStorm IDE warnings in ServiceWiring.php

Change-Id: Ic1352311908a08a19346ebbee5f5ce73db7633f3

4 years agoApiBase: Always validate that 'limit' is numeric
Bartosz Dziewoński [Fri, 30 Aug 2019 17:21:34 +0000 (19:21 +0200)]
ApiBase: Always validate that 'limit' is numeric

Bug: T231582
Change-Id: I956d4d623bfeace1b542039283e04a970fd40121

4 years agoMerge "resourceloader: Compile documentElement.className server-side"
jenkins-bot [Tue, 3 Sep 2019 21:04:23 +0000 (21:04 +0000)]
Merge "resourceloader: Compile documentElement.className server-side"

4 years agoIntroduce RevisionStore::newRevisionsFromBatch
Petr Pchelko [Fri, 30 Aug 2019 18:26:00 +0000 (11:26 -0700)]
Introduce RevisionStore::newRevisionsFromBatch

Bug: T228988
Change-Id: Ia82e47e44dd70def6d6d5d4f598f9ae969645aae

4 years agoMerge "resourceloader: Reduce width of module hash from 7 chars to 5"
jenkins-bot [Tue, 3 Sep 2019 19:21:39 +0000 (19:21 +0000)]
Merge "resourceloader: Reduce width of module hash from 7 chars to 5"

4 years agoInclude change tags in revision import structure
Adam Wight [Thu, 22 Aug 2019 13:11:11 +0000 (15:11 +0200)]
Include change tags in revision import structure

This makes it possible to import change tags, which will be leveraged by
Extension:FileImporter.

Bug: T227849
Change-Id: I70a8df2b2be0ec11806eb8d798115c52683cc787

4 years agoMerge "WebRequest: Optimise WebRequest::getPathInfo()"
jenkins-bot [Tue, 3 Sep 2019 19:01:00 +0000 (19:01 +0000)]
Merge "WebRequest: Optimise WebRequest::getPathInfo()"

4 years agoMerge "Better grouping for code adding elements to arrays"
jenkins-bot [Tue, 3 Sep 2019 19:00:53 +0000 (19:00 +0000)]
Merge "Better grouping for code adding elements to arrays"

4 years agoMerge "resourceloader: Add wgWikiID to mw.config in the startup module"
jenkins-bot [Tue, 3 Sep 2019 18:39:32 +0000 (18:39 +0000)]
Merge "resourceloader: Add wgWikiID to mw.config in the startup module"

4 years agoWebRequest: Optimise WebRequest::getPathInfo()
Timo Tijhof [Mon, 2 Sep 2019 01:03:02 +0000 (02:03 +0100)]
WebRequest: Optimise WebRequest::getPathInfo()

Called for all PHP web requests from WebStart.php via
WebRequest::interpolateTitle.

* Use isset() instead of empty() where we only need to check
  that the key is supported.

* Don't import global `$wgUsePathInfo` in the common case.

* Migrate from deprecated wrapper Wikimedia\suppressWarnings
  to AtEase::suppressWarnings.

* Use strpos() instead of preg_match(). Consistently faster,
  albeit not by much (for 100 iterations: 0.04ms vs 0.23ms).

* Don't create unused $matches array for the common case.

Bug: T189966
Change-Id: I0de126953c25f3629cb85a0d4e46598baf261c15

4 years agoMerge "Removing highlighting from mobile rcfilters"
jenkins-bot [Tue, 3 Sep 2019 18:31:41 +0000 (18:31 +0000)]
Merge "Removing highlighting from mobile rcfilters"

4 years agoresourceloader: Add wgWikiID to mw.config in the startup module
Roan Kattouw [Thu, 4 Jul 2019 01:41:07 +0000 (18:41 -0700)]
resourceloader: Add wgWikiID to mw.config in the startup module

This was previously just added by Echo, but it's generally useful.

We should probably deprecate wgDBname, because wgWikiID is a better wiki
identifier that also works when two wikis have different table prefixes
in the same database, but that'll take some work because a number of
things rely on it right now (including ResourceLoader itself, for its
localStorage keys).

Change-Id: I4d289267991f1f9a8e0710ec6ee5a2131306c510

4 years agoMerge "Unsuppress another phan issue (part 7)"
jenkins-bot [Tue, 3 Sep 2019 17:45:53 +0000 (17:45 +0000)]
Merge "Unsuppress another phan issue (part 7)"

4 years agoMerge "preferences: Add typehint in saveFormData() for PreferencesFormOOUI"
jenkins-bot [Tue, 3 Sep 2019 17:41:35 +0000 (17:41 +0000)]
Merge "preferences: Add typehint in saveFormData() for PreferencesFormOOUI"

4 years agoBetter grouping for code adding elements to arrays
Daimona Eaytoy [Tue, 3 Sep 2019 17:38:57 +0000 (19:38 +0200)]
Better grouping for code adding elements to arrays

Change-Id: I7cc8c810f0dcf1ee84b9d5f14967ec2568e3e0be
Follow-up: I50377746f01749b058c39fd8229f9d566224cc43

4 years agoRemoving highlighting from mobile rcfilters
Jan Drewniak [Thu, 29 Aug 2019 09:30:19 +0000 (11:30 +0200)]
Removing highlighting from mobile rcfilters

Removes the highlighting feature from rcfilters (e.g. Special:RecentChanges)
when OO.ui.isMobile() is true (isMobile is true when MobileFrontend
is enabled).

Also prevents the "enhanced" list view module from being loaded in mobile mode,
as the option to do so is disabled for mobile.

Bug: T231054
Change-Id: I1d4e1fdef6469f461ff4dad168ce01c856531d1c

4 years agoUnsuppress another phan issue (part 7)
Daimona Eaytoy [Sat, 31 Aug 2019 16:14:38 +0000 (18:14 +0200)]
Unsuppress another phan issue (part 7)

Bug: T231636
Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0
Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8

4 years agoMerge "Revert "Modify -—with-extensions to throw extension dependency errors""
jenkins-bot [Tue, 3 Sep 2019 17:15:04 +0000 (17:15 +0000)]
Merge "Revert "Modify -—with-extensions to throw extension dependency errors""

4 years agopreferences: Add typehint in saveFormData() for PreferencesFormOOUI
Daimona Eaytoy [Mon, 2 Sep 2019 16:13:02 +0000 (16:13 +0000)]
preferences: Add typehint in saveFormData() for PreferencesFormOOUI

This was temporarily removed in 3bcf5655870f for compat with
the GlobalPreferences extension. The old typehint of HTMLForm
was incorrect (as discovered by a Phan rule that was disabled
for core), because getModifiedUser() only exists in the
PreferencesFormOOUI subclass.

Change-Id: I792286ed44f03467b5d875e61c52b1953252b55f
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0

4 years agoMerge "resourceloader: Move mw.user skeleton from startup to base"
jenkins-bot [Tue, 3 Sep 2019 16:50:02 +0000 (16:50 +0000)]
Merge "resourceloader: Move mw.user skeleton from startup to base"

4 years agoRevert "Modify -—with-extensions to throw extension dependency errors"
Jforrester [Tue, 3 Sep 2019 16:35:48 +0000 (16:35 +0000)]
Revert "Modify -—with-extensions to throw extension dependency errors"

This reverts commit d9eec3c9124d87fd44e6917d5b1512b78352afb3.

Reason for revert: Breaking most of CI

Bug: T231876
Change-Id: I9b64a2bb770ee2e7ee717669070843814f37e81e

4 years agoLocalRepo: Remove leading 0 from 32-byte SHA1 keys
Marko Obrovac [Tue, 3 Sep 2019 13:57:33 +0000 (15:57 +0200)]
LocalRepo: Remove leading 0 from 32-byte SHA1 keys

Bug: T230667
Change-Id: I3d9de7a92495e894b4b44b0a5b0646b6d720f7c2

4 years agoModify -—with-extensions to throw extension dependency errors
Clara Andrew-Wani [Thu, 29 Aug 2019 14:56:27 +0000 (10:56 -0400)]
Modify -—with-extensions to throw extension dependency errors

Changes the behavior of -—with-extensions from silently skipping
extensions that lack another extension dependency to throwing an
install exception.

Bug: T225512
Change-Id: Ia5b41841aaf55fa5c4971ae67218f8231f8adcb8

4 years agoMerge "FileJournal tests"
jenkins-bot [Tue, 3 Sep 2019 11:22:00 +0000 (11:22 +0000)]
Merge "FileJournal tests"

4 years agoFileJournal tests
Aryeh Gregor [Thu, 22 Aug 2019 06:47:54 +0000 (09:47 +0300)]
FileJournal tests

100% unit test coverage for FileJournal and NullFileJournal. 100%
integration test coverage for DBFileJournal. Unit tests for
DBFileJournal once it supports injection.

I removed FileJournal and NullFileJournal from the list of classes that
FileBackendTest tests. It doesn't actually test them, it just happens to
run code from them without checking its correctness at all.

Depends-On: Ic22075bb5e81b7c2c4c1b8647547aa55306a10a7
Change-Id: I46d10ab7b87c23937aa04d7ec1922abfcf3bd611

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 3 Sep 2019 07:34:55 +0000 (09:34 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib8d7da32b31673e1c96b5ecb1f66eac8220217e4

4 years agoRemove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback
Aaron Schulz [Sun, 1 Sep 2019 16:57:51 +0000 (09:57 -0700)]
Remove unused variable in MultiHttpClient CURLOPT_READFUNCTION callback

Also make sure the result is a string as is required

Change-Id: I90107efd8f253aebc9b83fc2272aedf65ba161ba

4 years agoMerge "Add $specialPageAliases and $magicWords for Tajik"
jenkins-bot [Mon, 2 Sep 2019 23:17:22 +0000 (23:17 +0000)]
Merge "Add $specialPageAliases and $magicWords for Tajik"

4 years agoMerge "Correct the wording of the backend-fail-hash message"
jenkins-bot [Mon, 2 Sep 2019 23:12:30 +0000 (23:12 +0000)]
Merge "Correct the wording of the backend-fail-hash message"

4 years agoMerge "Use IDatabase::buildStringCast in Special:MediaStatistics"
jenkins-bot [Mon, 2 Sep 2019 23:12:21 +0000 (23:12 +0000)]
Merge "Use IDatabase::buildStringCast in Special:MediaStatistics"

4 years agoMerge "Use Maintenance::getConfig in some maintenance scripts"
jenkins-bot [Mon, 2 Sep 2019 23:12:15 +0000 (23:12 +0000)]
Merge "Use Maintenance::getConfig in some maintenance scripts"

4 years agoMerge "Add Martin Urbanec to .mailmap"
jenkins-bot [Mon, 2 Sep 2019 23:03:18 +0000 (23:03 +0000)]
Merge "Add Martin Urbanec to .mailmap"

4 years agoMerge "phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase"
jenkins-bot [Mon, 2 Sep 2019 20:52:18 +0000 (20:52 +0000)]
Merge "phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase"

4 years agophpunit: Repair GLOBALS reset in MediaWikiUnitTestCase
Timo Tijhof [Wed, 7 Aug 2019 13:40:55 +0000 (14:40 +0100)]
phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase

This code didn't work because the $GLOBALS array is exposed by reference.
Once this reference was broken by unset(), the rest just manipulated a
local array that happens to be called "GLOBALS". It must not be unset or
re-assigned. It can only be changed in-place.

Before this, the execution of a MediaWikiUnitTestCase test stored a
copy of GLOBALS in unitGlobals, then lost the GLOBALS pointer and
created a new variable called "GLOBALS". As such, the tearDown() function
didn't do what it meant to do, either – which then results in odd
failures like T230023

Rewrite it as follows:

* In setup, store the current GLOBALS keys and values, then reduce
  GLOBALS to only the whitelisted keys and values.

* In teardown, restore the original state.

* As optimisation, do this from setUpBeforeClass as well, so that
  there are relatively few globals to reset between tests.
  (Thanks @Simetrical!)

The following tests were previously passing by accident under
MediaWikiUnitTestCase but actually did depend on global config.

* MainSlotRoleHandlerTest (…, ContentHandler, $wgContentHandlers)
* SlotRecordTest (…, ContentHandler, $wgContentHandlers)
* WikiReferenceTest (wfParseUrl, $wgUrlProtocols)
* DifferenceEngineSlotDiffRendererTest (DifferenceEngine, wfDebug, …)
* SlotDiffRendererTest (…, ContentHandler, $wgContentHandlers)
* FileBackendDBRepoWrapperTest (wfWikiID, "Backend domain ID not provided")
* JpegMetadataExtractorTest (…, wfDebug, …, LoggerFactory, …)
* ParserFactoryTest (…, wfDebug, …, LoggerFactory, InvalidArgumentException)
* MediaWikiPageNameNormalizerTest (…, wfDebug, …, LoggerFactory, …)
* SiteExporterTest (SiteImporter, wfLogWarning, …)
* SiteImporterTest (Site::newForType, $wgSiteTypes)
* ZipDirectoryReaderTest (…, wfDebug, …, LoggerFactory, …)

Bug: T230023
Change-Id: Ic22075bb5e81b7c2c4c1b8647547aa55306a10a7

4 years agoMerge "Fix duplicate Jon Harald Søby in CREDITS"
jenkins-bot [Mon, 2 Sep 2019 19:37:19 +0000 (19:37 +0000)]
Merge "Fix duplicate Jon Harald Søby in CREDITS"

4 years agoCorrect the wording of the backend-fail-hash message
Amir Aharoni [Mon, 2 Sep 2019 19:08:22 +0000 (22:08 +0300)]
Correct the wording of the backend-fail-hash message

Change-Id: I5dfc0fa4ecc04cd2e31a633b3a6473eca48ec6c4

4 years agoMerge "Permit case independent unit test directories"
jenkins-bot [Mon, 2 Sep 2019 17:08:22 +0000 (17:08 +0000)]
Merge "Permit case independent unit test directories"

4 years agoMerge "objectcache: Optimise array_map in MemcachedBagOStuff::makeKey()"
jenkins-bot [Mon, 2 Sep 2019 17:00:21 +0000 (17:00 +0000)]
Merge "objectcache: Optimise array_map in MemcachedBagOStuff::makeKey()"

4 years agoMerge "ProxyLookup: Optimise in_array in isConfiguredProxy()"
jenkins-bot [Mon, 2 Sep 2019 17:00:13 +0000 (17:00 +0000)]
Merge "ProxyLookup: Optimise in_array in isConfiguredProxy()"

4 years agoMerge "Rework ApiUploadTest"
jenkins-bot [Mon, 2 Sep 2019 16:54:56 +0000 (16:54 +0000)]
Merge "Rework ApiUploadTest"

4 years agoMerge "Correctly format null error reporting level"
jenkins-bot [Mon, 2 Sep 2019 16:54:48 +0000 (16:54 +0000)]
Merge "Correctly format null error reporting level"

4 years agoMerge "Use the existing link renderer in the special page pagers"
jenkins-bot [Mon, 2 Sep 2019 13:11:13 +0000 (13:11 +0000)]
Merge "Use the existing link renderer in the special page pagers"

4 years agoApiQueryCategories: Supply limit for DB query
Brad Jorsch [Wed, 28 Aug 2019 20:34:30 +0000 (16:34 -0400)]
ApiQueryCategories: Supply limit for DB query

The limit is applied in PHP, but all matching rows are being fetched
from the database. We should only fetch the number of rows needed.

Bug: T231462
Change-Id: Ie64ea6f79a187942c476868c383a1349d110aa7c

4 years agoMerge "Revert "Reset $wgContLang consistently for tests""
jenkins-bot [Mon, 2 Sep 2019 11:28:10 +0000 (11:28 +0000)]
Merge "Revert "Reset $wgContLang consistently for tests""

4 years agoMerge "Permit destructors in MediaWikiTestCaseTrait::createNoOpMock"
jenkins-bot [Mon, 2 Sep 2019 11:11:57 +0000 (11:11 +0000)]
Merge "Permit destructors in MediaWikiTestCaseTrait::createNoOpMock"

4 years agoRevert "Reset $wgContLang consistently for tests"
Ladsgroup [Mon, 2 Sep 2019 11:03:18 +0000 (11:03 +0000)]
Revert "Reset $wgContLang consistently for tests"

This reverts commit 09407afd74104bb3a674e4f5c48d10b15914d0db.
Reason for revert: It broke Wikibase on master.

Bug: T231799
Change-Id: Ie347abb24183ce3000af4d653ce2343ec7a63290

4 years agoAdd Martin Urbanec to .mailmap
Lucas Werkmeister [Mon, 2 Sep 2019 10:49:06 +0000 (12:49 +0200)]
Add Martin Urbanec to .mailmap

Commit 6ded91313c, presumably created on Gerrit, uses the author name
Urbanecm instead of Martin Urbanec; without this .mailmap entry to fix
it, maintenance/updateCredits.php would add another entry for that name
(he’s already credited under the proper name).

Change-Id: I14c6a58f969f8d10bdd0e3d17566af5ad53e5a8b

4 years agoFix duplicate Jon Harald Søby in CREDITS
Lucas Werkmeister [Mon, 2 Sep 2019 10:40:09 +0000 (12:40 +0200)]
Fix duplicate Jon Harald Søby in CREDITS

There are some commits from “jhsoby <jhsoby@gmail.com>”. Update the
.mailmap to correct the name of those commits (the existing line would
only update <jhsoby@users.mediawiki.org> commits), and remove the jhsoby
line from the CREDITS.

Also remove jeblad from CREDITS – he already has a .mailmap entry
mapping <john.blad@wikimedia.de> to John Erling Blad, but
maintenance/updateCredits.php never removes CREDITS entries, so while it
adds a correct John Erling Blad entry it won’t remove jeblad by itself.

Change-Id: I987d1cb1e5190899d944c0880211296580abbcb6

4 years agoMerge "phpunit: Add more info to LocalSettings.php error in MediaWikiIntegrationTestCase"
jenkins-bot [Mon, 2 Sep 2019 08:55:51 +0000 (08:55 +0000)]
Merge "phpunit: Add more info to LocalSettings.php error in MediaWikiIntegrationTestCase"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 2 Sep 2019 07:19:57 +0000 (09:19 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I17cb40921799c2b97f8c8bfca201c6a77939ce48

4 years agoresourceloader: Reduce width of module hash from 7 chars to 5
Timo Tijhof [Mon, 29 Jul 2019 16:15:23 +0000 (17:15 +0100)]
resourceloader: Reduce width of module hash from 7 chars to 5

In a nut shell:

* We very often (52% of modules on enwiki) pad the hash with a zero,
  which means the amount of bits we currently compute already fit in
  6 characters already for most modules. For some modules (3%) we
  even padded two zeroes.

* For the (now documented) use cases, the space of 78 Giga
  (78 billion, or 78 milliard) seems more than we need. The space of
  60 million should be enough.

  This follows-up dfd046412f from 2016, which previously shortened the hash
  down from 8 chars of base 64 (or 12 chars of hex) to 7 chars of base 32.
  Before that change, the space was 281 Tera (64^8, or 16^12).

For more details see the added inline comment for ResourceLoader::makeHash,
and also the data at <https://phabricator.wikimedia.org/T229245>.

Bug: T229245
Change-Id: I9ad11772a33b3a44cb625275b1d7353e1393ee49

4 years agoMerge "Remove Oracle reference from WikiMap"
jenkins-bot [Sun, 1 Sep 2019 23:58:11 +0000 (23:58 +0000)]
Merge "Remove Oracle reference from WikiMap"

4 years agoRemove Oracle reference from WikiMap
Aaron Schulz [Thu, 15 Aug 2019 12:37:29 +0000 (08:37 -0400)]
Remove Oracle reference from WikiMap

Bug: T230418
Change-Id: I06536034a9d7f176e65b087cc2d3ad65d172961b

4 years agoReset $wgContLang consistently for tests
Aryeh Gregor [Sun, 1 Sep 2019 08:39:50 +0000 (11:39 +0300)]
Reset $wgContLang consistently for tests

We already reset $wgParser to a stub in a number of places where it
might have changed. Let's give $wgContLang the same treatment so we can
avoid special-case code.

This deprecates setContentLang(), which is no longer needed. The magic
of $wgContLang is now handled by setMwGlobals() and setService().

This is a follow-up to e4f69ee, which fixed one case of this problem.

Change-Id: I90925ef8b2a7478cce90d474db1b8b4539e45c15

4 years agoMerge "Avoid multiply calls to MediaWikiServices::getInstance() in one function"
jenkins-bot [Sun, 1 Sep 2019 22:43:06 +0000 (22:43 +0000)]
Merge "Avoid multiply calls to MediaWikiServices::getInstance() in one function"

4 years agoMerge "rdbms: clean up use of ATTACH queries in DatabaseSqlite"
jenkins-bot [Sun, 1 Sep 2019 22:31:08 +0000 (22:31 +0000)]
Merge "rdbms: clean up use of ATTACH queries in DatabaseSqlite"