lhc/web/wiklou.git
7 years agoMerge "Parser: Allow disabling magic link functionality"
jenkins-bot [Tue, 13 Sep 2016 05:31:47 +0000 (05:31 +0000)]
Merge "Parser: Allow disabling magic link functionality"

7 years agoMerge "SkinTemplate: Improve remote content handling in content navigation URLs"
jenkins-bot [Tue, 13 Sep 2016 05:30:13 +0000 (05:30 +0000)]
Merge "SkinTemplate: Improve remote content handling in content navigation URLs"

7 years agoMerge "Add WikiPage::isLocal()"
jenkins-bot [Tue, 13 Sep 2016 05:23:28 +0000 (05:23 +0000)]
Merge "Add WikiPage::isLocal()"

7 years agoMerge "LocalIdLookup: Use DBAccessObjectUtils"
jenkins-bot [Tue, 13 Sep 2016 05:21:04 +0000 (05:21 +0000)]
Merge "LocalIdLookup: Use DBAccessObjectUtils"

7 years agoMerge "CentralIdLookup: Fix documentation of self::$instances"
jenkins-bot [Tue, 13 Sep 2016 05:16:30 +0000 (05:16 +0000)]
Merge "CentralIdLookup: Fix documentation of self::$instances"

7 years agoMerge "session: Fix phpdoc in Token::toStringAtTimestamp()"
jenkins-bot [Tue, 13 Sep 2016 05:12:13 +0000 (05:12 +0000)]
Merge "session: Fix phpdoc in Token::toStringAtTimestamp()"

7 years agoMerge "WikiPage: Use Title::isKnown() in hasViewableContent()"
jenkins-bot [Tue, 13 Sep 2016 05:06:23 +0000 (05:06 +0000)]
Merge "WikiPage: Use Title::isKnown() in hasViewableContent()"

7 years agoSkinTemplate: Improve remote content handling in content navigation URLs
Kunal Mehta [Tue, 13 Sep 2016 04:43:56 +0000 (21:43 -0700)]
SkinTemplate: Improve remote content handling in content navigation URLs

Use Title::isKnown() to determine whether to display the "view" view link
instead of checking $isForeignFile, since that includes all remote
content. This allows us to remove the GlobalUserPage hook that made the
tab look as if it existed.

Change-Id: Ibee7b64511fba8c2934da3c7a3bdd52090dcb58c

7 years agoMerge "Use late static binding in Article::newFromID()"
jenkins-bot [Tue, 13 Sep 2016 05:02:22 +0000 (05:02 +0000)]
Merge "Use late static binding in Article::newFromID()"

7 years agoParser: Allow disabling magic link functionality
Kunal Mehta [Fri, 9 Sep 2016 07:28:49 +0000 (00:28 -0700)]
Parser: Allow disabling magic link functionality

The magic link functionality is "old backwards-compatibility baggage"
that we probably want to get rid of eventually. The first step to doing
so would be making it configurable and allowing it to be turned off on
wikis that don't use it.

This adds each of the 3 magic link types as individual parser options,
which can be controlled by the $wgEnableMagicLinks setting.

Additionally, wfEscapeWikiText() was updated to only escape enabled
magic link types.

Bug: T47942
Change-Id: If63965f31d17da4b864510146e0018da1cae188c

7 years agoMerge "MapCacheLRU: Support null values in getWithSetCallback()"
jenkins-bot [Tue, 13 Sep 2016 04:58:02 +0000 (04:58 +0000)]
Merge "MapCacheLRU: Support null values in getWithSetCallback()"

7 years agoAdd WikiPage::isLocal()
Kunal Mehta [Tue, 13 Sep 2016 04:32:53 +0000 (21:32 -0700)]
Add WikiPage::isLocal()

WikiFilePage has a isLocal() function which indicates whether the file
is local or not. To better support other remote content, add this method
to the base WikiPage class. It only returns true currently, since all
content represented by WikiPage is local.

Change-Id: Ia39c405af4d131d919a57512e72a112bd65cc461

7 years agoLocalIdLookup: Use DBAccessObjectUtils
Kunal Mehta [Tue, 13 Sep 2016 04:29:41 +0000 (21:29 -0700)]
LocalIdLookup: Use DBAccessObjectUtils

This simplies some code that was re-implementing
DBAccessObjectUtils::getDBOptions().

Change-Id: Ib446f43149abdf23f07f209ccd9698923f0a2c22

7 years agoCentralIdLookup: Fix documentation of self::$instances
Kunal Mehta [Tue, 13 Sep 2016 04:29:09 +0000 (21:29 -0700)]
CentralIdLookup: Fix documentation of self::$instances

Change-Id: I9fd86c174832e130647e74f4fdeb9fdc7c90702e

7 years agosession: Fix phpdoc in Token::toStringAtTimestamp()
Kunal Mehta [Tue, 13 Sep 2016 04:27:50 +0000 (21:27 -0700)]
session: Fix phpdoc in Token::toStringAtTimestamp()

Change-Id: I35664eb9e89ffb945eb35bf3af58e1efdea0a8ff

7 years agoWikiPage: Use Title::isKnown() in hasViewableContent()
Kunal Mehta [Tue, 13 Sep 2016 04:27:25 +0000 (21:27 -0700)]
WikiPage: Use Title::isKnown() in hasViewableContent()

The current implementation of hasViewableContent() is basically the same
as Title::isKnown(), except that it switched the order of
isAlwaysKnown() and exists(). (Also it used WikiPage::exists() instead
of Title::exists(), but they're functionality equivalent).

This will make refactoring Title::isAlwaysKnown() easier in the future
as there is one less caller.

Change-Id: I698f08fb0f3e6c3bc702ec7d523d7eda063e18ca

7 years agoUse late static binding in Article::newFromID()
Kunal Mehta [Tue, 13 Sep 2016 04:24:50 +0000 (21:24 -0700)]
Use late static binding in Article::newFromID()

Address the FIXME and remove subclass implementations by using late
static binding.

Change-Id: I4f1793c87dfe08f768a283128d14ee2226a9e275

7 years agoMapCacheLRU: Support null values in getWithSetCallback()
Kunal Mehta [Tue, 13 Sep 2016 04:23:09 +0000 (21:23 -0700)]
MapCacheLRU: Support null values in getWithSetCallback()

The rest of this class supports having a key with a null value by using
array_key_exists() instead of isset(). So Use $this->has() in
getWithSetCallback() so a null value is still identified as set.

Change-Id: Ida74a6f7e284e98f9a7d76d97312ebe2ee343f10

7 years agoMerge "Reorganize RefreshLinksJob code slightly and avoid deprecated functions"
jenkins-bot [Tue, 13 Sep 2016 04:39:50 +0000 (04:39 +0000)]
Merge "Reorganize RefreshLinksJob code slightly and avoid deprecated functions"

7 years agoMerge "Tweak $wgTrxProfilerLimits to lower noise a bit"
jenkins-bot [Tue, 13 Sep 2016 04:38:38 +0000 (04:38 +0000)]
Merge "Tweak $wgTrxProfilerLimits to lower noise a bit"

7 years agoMerge "Make safeWaitForMasterPos() use mWaitTimeout instead of hard-coded value"
jenkins-bot [Tue, 13 Sep 2016 04:33:26 +0000 (04:33 +0000)]
Merge "Make safeWaitForMasterPos() use mWaitTimeout instead of hard-coded value"

7 years agoMerge "Avoid using deprecated methods in JobQueueDB"
jenkins-bot [Tue, 13 Sep 2016 04:27:03 +0000 (04:27 +0000)]
Merge "Avoid using deprecated methods in JobQueueDB"

7 years agoMerge "Remove pointless getTransactionProfiler() method"
jenkins-bot [Tue, 13 Sep 2016 04:25:29 +0000 (04:25 +0000)]
Merge "Remove pointless getTransactionProfiler() method"

7 years agoMake DeferredUpdates::execute() protected
Aaron Schulz [Sun, 11 Sep 2016 12:19:57 +0000 (05:19 -0700)]
Make DeferredUpdates::execute() protected

Update the only caller, which is a deprecated wrapper method.
Locking down this internal method makes it secure against
misuse with regards to recursion checks.

Change-Id: I3ed52dbe4c0ad52c7b5de92e81bfdc98a1737bcf

7 years agoReorganize RefreshLinksJob code slightly and avoid deprecated functions
Aaron Schulz [Tue, 13 Sep 2016 04:11:11 +0000 (21:11 -0700)]
Reorganize RefreshLinksJob code slightly and avoid deprecated functions

Change-Id: I6ff4bec61b37bfbffc1e96eac61d692dd7feb31a

7 years agoSimplify LBFactory ticket code in CategoryMembershipChangeJob
Aaron Schulz [Tue, 13 Sep 2016 03:44:19 +0000 (20:44 -0700)]
Simplify LBFactory ticket code in CategoryMembershipChangeJob

Change-Id: I5800bbf6fa718604ffa12d8cde1aa3675fced6fd

7 years agoMerge "Update Bugzilla references to Phabricator references"
jenkins-bot [Tue, 13 Sep 2016 03:24:34 +0000 (03:24 +0000)]
Merge "Update Bugzilla references to Phabricator references"

7 years agoAvoid using deprecated methods in JobQueueDB
Aaron Schulz [Tue, 13 Sep 2016 02:56:37 +0000 (19:56 -0700)]
Avoid using deprecated methods in JobQueueDB

Change-Id: Ib35b8792e3e4902b52c3e708d8c6e756f35986bd

7 years agoRemove pointless getTransactionProfiler() method
Aaron Schulz [Tue, 13 Sep 2016 02:56:09 +0000 (19:56 -0700)]
Remove pointless getTransactionProfiler() method

Change-Id: Ib019e8317568105b95138cfdc0962b06a55154b9

7 years agoTweak $wgTrxProfilerLimits to lower noise a bit
Aaron Schulz [Tue, 13 Sep 2016 02:13:38 +0000 (19:13 -0700)]
Tweak $wgTrxProfilerLimits to lower noise a bit

Change-Id: I22ae7a5c2ba5f39007019e47ea0dff17a4cc971a

7 years agoMerge "Make LBFactory::waitForReplication() mask wait latency with callbacks"
jenkins-bot [Tue, 13 Sep 2016 01:31:28 +0000 (01:31 +0000)]
Merge "Make LBFactory::waitForReplication() mask wait latency with callbacks"

7 years agoMerge "Avoid creating DB replication lag in clearAllNotifications()"
jenkins-bot [Tue, 13 Sep 2016 01:27:59 +0000 (01:27 +0000)]
Merge "Avoid creating DB replication lag in clearAllNotifications()"

7 years agoMerge "EditPage: Don't throw exceptions for invalid content models"
jenkins-bot [Tue, 13 Sep 2016 00:46:42 +0000 (00:46 +0000)]
Merge "EditPage: Don't throw exceptions for invalid content models"

7 years agoMerge "Allow putting the app ID in the password for bot passwords"
jenkins-bot [Tue, 13 Sep 2016 00:38:14 +0000 (00:38 +0000)]
Merge "Allow putting the app ID in the password for bot passwords"

7 years agoSupport masking the WRITE_SYNC latency from ChronologyProtector
Aaron Schulz [Wed, 24 Aug 2016 21:22:11 +0000 (14:22 -0700)]
Support masking the WRITE_SYNC latency from ChronologyProtector

* Use OutputPage::output() as the method to mask latency, since it
  takes a good while to run. By the time it runs, cache replication
  should have caught up, so the reap call will likely not block.
* For redirects emitted after changes in POST, instead of masking
  with OutputPage, add a parameter to the redirect and block on
  the positions appearing. This uses the redirection RTT to mask
  the replication latency.

Change-Id: Ib23690c302e8033610fef9a0ef451dafe8a5803e

7 years agoMake LBFactory::waitForReplication() mask wait latency with callbacks
Aaron Schulz [Mon, 12 Sep 2016 23:46:02 +0000 (16:46 -0700)]
Make LBFactory::waitForReplication() mask wait latency with callbacks

This simply moves the call order down a bit.

Change-Id: I78559f769133d5addb590a65af7d535604de8407

7 years agoMerge "WebRequest: Use getRawVal instead of getGPCVal where possible"
jenkins-bot [Mon, 12 Sep 2016 22:21:50 +0000 (22:21 +0000)]
Merge "WebRequest: Use getRawVal instead of getGPCVal where possible"

7 years agoMerge "Make JobQueueGroup::push() update the queuesHaveJobs() cache"
jenkins-bot [Mon, 12 Sep 2016 22:20:20 +0000 (22:20 +0000)]
Merge "Make JobQueueGroup::push() update the queuesHaveJobs() cache"

7 years agoMerge "Add structure test for ContentHandler::makeEmptyContent()"
jenkins-bot [Mon, 12 Sep 2016 22:11:14 +0000 (22:11 +0000)]
Merge "Add structure test for ContentHandler::makeEmptyContent()"

7 years agoEditPage: Don't throw exceptions for invalid content models
Kunal Mehta [Mon, 12 Sep 2016 09:52:51 +0000 (02:52 -0700)]
EditPage: Don't throw exceptions for invalid content models

If a user tries to use an unrecognized content model using the "model"
request parameter, show a nice, localized error instead of an exception.

Bug: T145367
Change-Id: I50e7d332727c9afc22c1658d32c981db4305185b

7 years agoMake safeWaitForMasterPos() use mWaitTimeout instead of hard-coded value
Aaron Schulz [Mon, 12 Sep 2016 20:57:22 +0000 (13:57 -0700)]
Make safeWaitForMasterPos() use mWaitTimeout instead of hard-coded value

Change-Id: Idd5db66f5e7cea9fc3f3a4f47bd38e08e42559f6

7 years agoFollow-up dfd0464: Remove LICENSE.txt for deleted library 'phpjs-sha1'
Ed Sanders [Mon, 12 Sep 2016 20:50:46 +0000 (13:50 -0700)]
Follow-up dfd0464: Remove LICENSE.txt for deleted library 'phpjs-sha1'

Change-Id: Ia4bbd23c2e78eea9277dc8b1ade8bd3345559c9a

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 12 Sep 2016 20:18:47 +0000 (22:18 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I634a673bf12cc66b2fbffb9a3abd2a2a0237ebe4

7 years agoMerge "mw.special.movePage: Don't fail if no "Move associated talk page" checkbox"
jenkins-bot [Mon, 12 Sep 2016 15:39:48 +0000 (15:39 +0000)]
Merge "mw.special.movePage: Don't fail if no "Move associated talk page" checkbox"

7 years agoMerge "Add missing dependency to 'mediawiki.Upload.BookletLayout' module"
jenkins-bot [Mon, 12 Sep 2016 15:33:10 +0000 (15:33 +0000)]
Merge "Add missing dependency to 'mediawiki.Upload.BookletLayout' module"

7 years agoMerge "Sync up with Parsoid parserTests."
jenkins-bot [Mon, 12 Sep 2016 15:30:23 +0000 (15:30 +0000)]
Merge "Sync up with Parsoid parserTests."

7 years agoMerge "Change file namespace name & and specialpages titles in Urdu"
jenkins-bot [Mon, 12 Sep 2016 15:26:34 +0000 (15:26 +0000)]
Merge "Change file namespace name & and specialpages titles in Urdu"

7 years agoSync up with Parsoid parserTests.
Subramanya Sastry [Mon, 12 Sep 2016 14:06:04 +0000 (09:06 -0500)]
Sync up with Parsoid parserTests.

This now aligns with Parsoid commit 94316242479f272b51db431a0f8fb6d77bd8f639

Change-Id: I411e3b733f4f1e5da5fa2500354575af77e09c88

7 years agoChange file namespace name & and specialpages titles in Urdu
محمد شعیب [Thu, 8 Sep 2016 08:42:26 +0000 (08:42 +0000)]
Change file namespace name & and specialpages titles in Urdu

It is requested by Urdu Wikipedia community that file namespace should be changed from "ملف:" to "فائل:", and hence need to change all those special page names where "ملف" word is being used and change to word "فائل". Plus some minor corrections.

Bug: T144437
Change-Id: I09070412fa7f3ce98520704ae60c660c682018e5

7 years agoAdd missing dependency to 'mediawiki.Upload.BookletLayout' module
Bartosz Dziewoński [Mon, 12 Sep 2016 13:04:39 +0000 (15:04 +0200)]
Add missing dependency to 'mediawiki.Upload.BookletLayout' module

Bug: T145315
Change-Id: Idadbf3adf4a145530774abc5fc8cf5fe4920330d

7 years agoAvoid creating DB replication lag in clearAllNotifications()
Aaron Schulz [Mon, 12 Sep 2016 13:01:04 +0000 (06:01 -0700)]
Avoid creating DB replication lag in clearAllNotifications()

Change-Id: Ifad51cf2aaa9867513615d48753436cf686d7f1c

7 years agoMerge "add IGNORE INDEX option to mysql database handler"
jenkins-bot [Mon, 12 Sep 2016 12:33:59 +0000 (12:33 +0000)]
Merge "add IGNORE INDEX option to mysql database handler"

7 years agoMerge "Make WikiPage::doPurge() clear the file cache too"
jenkins-bot [Mon, 12 Sep 2016 10:24:54 +0000 (10:24 +0000)]
Merge "Make WikiPage::doPurge() clear the file cache too"

7 years agoMerge "Make PurgeJobUtils avoid creating DB replication lag"
jenkins-bot [Mon, 12 Sep 2016 10:22:16 +0000 (10:22 +0000)]
Merge "Make PurgeJobUtils avoid creating DB replication lag"

7 years agoMerge "Clean up array() syntax from docs, part VI"
jenkins-bot [Mon, 12 Sep 2016 10:15:58 +0000 (10:15 +0000)]
Merge "Clean up array() syntax from docs, part VI"

7 years agoClean up array() syntax from docs, part VI
Amir Sarabadani [Mon, 12 Sep 2016 10:06:37 +0000 (14:36 +0430)]
Clean up array() syntax from docs, part VI

Change-Id: Ib0eea494e2065c7ab356dc45fd174544a9c1c942

7 years agoMerge "Improve compatibility checks in WaitConditionLoop"
jenkins-bot [Mon, 12 Sep 2016 09:59:52 +0000 (09:59 +0000)]
Merge "Improve compatibility checks in WaitConditionLoop"

7 years agoImprove compatibility checks in WaitConditionLoop
Aaron Schulz [Mon, 12 Sep 2016 09:47:06 +0000 (02:47 -0700)]
Improve compatibility checks in WaitConditionLoop

* Check if getrusage() is not defined.
* Assume worse-case CPU usage in such cases to avoid spin loops.
* Move these checks to the constructor so they only happen once.

Change-Id: I180629c17b3323e8841a25c2d920390116ae6b74

7 years agoMerge "Special:UserRights: Trim value of $mTarget if it's a string"
jenkins-bot [Mon, 12 Sep 2016 09:34:23 +0000 (09:34 +0000)]
Merge "Special:UserRights: Trim value of $mTarget if it's a string"

7 years agoparserTests.php: Fix exit status
Tim Starling [Mon, 12 Sep 2016 06:43:38 +0000 (16:43 +1000)]
parserTests.php: Fix exit status

The return value of Maintenance::execute() is discarded, not used as an
exit status.

Change-Id: I9dd92e43b5b1df1a63d0e8302d360d0bb0f57e7b

7 years agoRelease notes for parser tests refactor
Tim Starling [Mon, 12 Sep 2016 06:29:24 +0000 (16:29 +1000)]
Release notes for parser tests refactor

Change-Id: Ic5cd1e368067024bd264ae991d04f61c58535cd1

7 years agoRefactor parser tests
Tim Starling [Thu, 8 Sep 2016 01:25:22 +0000 (11:25 +1000)]
Refactor parser tests

Merge the PHPUnit parser test runner with the old parserTests.inc,
taking the good bits of both. Reviewed, pared down and documented the
setup code. parserTests.php is now a frontend to a fully featured
parser test system, with lots of developer options, whereas PHPUnit
provides a simpler interface with increased isolation between test
cases.

Performance of both frontends is much improved, perhaps 2x faster for
parserTests.php and 10x faster for PHPUnit.

General:

* Split out the pre-Setup.php global variable configuration from
  phpunit.php into a new class called TestSetup, also called it from
  parserTests.php.
* Factored out the setup of TestsAutoLoader into a static method in
  Maintenance.
* In Setup.php improved "caches" debug output.

PHPUnit frontend:

* Delete the entire contents of NewParserTest and replace it with a
  small wrapper around ParserTestRunner. It doesn't inherit from
  MediaWikiTestCase anymore since integrating the setup code was an
  unnecessary complication.
* Rename MediaWikiParserTest to ParserTestTopLevelSuite and made it an
  instantiable TestSuite class instead of just a static method. Got rid
  of the eval(), just construct TestCase objects directly with a
  specified name, it works just as well.
* Introduce ParserTestFileSuite for per-file setup.
* Remove parser-related options from phpunit.php, since we don't
  support them anymore. Note that --filter now works just as well as
  --regex used to.
* Add CoreParserTestSuite, equivalent to ExtensionsParserTestSuite,
  for clarity.
* Make it possible to call MediaWikiTestCase::setupTestDB() more than
  once, as is implied by the documentation.

parserTests.php frontend:

* Made parserTests.php into a Maintenance subclass, moved CLI-specific
  code to it.
* Renamed ParserTest to ParserTestRunner, this is now the generic
  backend.
* Add --upload-dir option which sets up an FSFileBackend, similar
  to the old default behaviour

Test file reading and interpretation:

* Rename TestFileIterator to TestFileReader, and make it read and buffer
  an entire file, instead of iterating.
* The previous code had an associative array representation of test
  specifications. Used this form more widely to pass around test data.
* Remove the idea of !!hooks copying hooks from $wgParser, this is
  unnecessary now that all extensions use ParserFirstCallInit. Resurrect
  an old interpretation of the feature which was accidentally broken: if
  a named hook does not exist, skip all tests in the file.
* Got rid of the "subtest" idea for tidy variants, instead use a
  human-readable description that appears in the output.
* When all tests in a file are filtered or skipped, don't create the
  articles in them. This greatly speeds up execution time when --regex
  matches a small number of tests. It may possibly break extensions, but
  they would have been randomly broken anyway since there is no
  guarantee of test file execution order.
* Remove integrated testing of OutputPage::addCategoryLinks() category
  link formatting, life is complicated enough already. It can go in
  OutputPageTest if that's a thing we really need.

Result recording and display:

* Make TestRecorder into a generic plugin interface for progress output
  etc., which needs to be abstracted for PHPUnit integration.
* Introduce MultiTestRecorder for recorder chaining, instead of using
  a long inheritance chain. All test recorders now directly inherit from
  TestRecorder.
* Move all console-related code to the new ParserTestPrinter.
* Introduce PhpunitTestRecorder, which is the recorder for the PHPUnit
  frontend. Most events are ignored since they are never emitted in the
  PHPUnit frontend, which does not call runTests().
* Put more information into ParserTestResult and use it more often.

Setup and teardown:

* Introduce a new API for setup/teardown where setup functions return a
  ScopedCallback object which automatically performs the corresponding
  teardown when it goes out of scope.
* Rename setUp() to staticSetup(), rewrite. There was a lot of cruft in
  here which was simply copied from Setup.php without review, and had
  nothing to do with parser tests.
* Rename setupGlobals() to perTestSetup(), mostly rewrite. For
  performance, give staticSetup() precedence in cases where they were
  both setting up the same thing.
* In support of merged setup code, allow Hooks::clear() to be called
  from parserTests.php.
* Remove wgFileExtensions -- it is only used by UploadBase which we
  don't call.
* Remove wgUseImageResize -- superseded by MockMediaHandlerFactory which
  I imported from NewParserTest.
* Import MockFileBackend from NewParserTest. But instead of
  customising the configuration globals, I injected services.
* Remove thumbnail deletion from upload teardown. This makes glob
  handling as in the old parserTests.php unnecessary.
* Remove math file from upload teardown, math is actually an extension
  now! Also, the relevant parser tests were removed from the Math
  extension two years ago in favour of unit tests.
* Make addArticle() private, and introduce addArticles() instead, which
  allows setup/teardown to be done once for each batch of articles
  instead of every time.
* Remove $wgNamespaceAliases and $wgNamespaceProtection setup. These were
  copied in from Setup.php in 2010, and are redundant since we do
  actually run Setup.php.
* Use NullLockManager, don't set up a temporary directory just for
  this alone.

Fuzz tests:

* Use the new TestSetup class.
* Updated for ParserTestRunner interface change.
* Remove some obsolete references to fuzz tests from the two frontends
  where they used to reside.

Bug: T41473
Change-Id: Ia8e17008cb9d9b62ce5645e15a41a3b402f4026a

7 years agoRenames preparatory to parser tests refactor
Tim Starling [Thu, 8 Sep 2016 01:07:06 +0000 (11:07 +1000)]
Renames preparatory to parser tests refactor

Since in several cases, with an all-in-one commit, git's file rename
detection failed, I split the renames out into their own commit to
make review easier. Some changes here won't make complete sense without
the following commit.

* Moved TestsAutoLoader to tests/common/. It will be joined by a friend.
* Renamed ParserTest to ParserTestRunner, since the former name was
  overly generic.
* Renamed TestFileIterator to TestFileReader. Please see the subsequent
  commit for rationale.
* Moved parserTests.php to tests/parser/. It was the only file left in
  tests/, and it should have been moved to tests/parser years ago,
  analogous to phpunit.php.
* Renamed NewParserTest to ParserIntegrationTest. This was a tricky one,
  apparently the name has to end in "Test" or else the structure test
  will fail. Analogous to ParserMethodsTest etc. Rationale: because it's
  not new anymore.
* Renamed MediaWikiParserTest to ParserTestTopLevelSuite and moved it to
  the suites directory. A more descriptive name. Being in suites/
  shields it from StructureTests, and is correct anyway.

Change-Id: Iddc6eaf815fdd64b3addb8570b4b6303ab99d634

7 years agoAvoid "No transaction is active" saveFileDependencies() tests errors
Aaron Schulz [Mon, 12 Sep 2016 03:46:43 +0000 (20:46 -0700)]
Avoid "No transaction is active" saveFileDependencies() tests errors

Unit tests run in CLI mode without DBO_TRX

Change-Id: Icee9cf84cb9e057b329dd3960fcc9b238af478a3

7 years agoMerge "Avoid "Column md_module cannot be null" error in unit tests"
jenkins-bot [Mon, 12 Sep 2016 03:06:17 +0000 (03:06 +0000)]
Merge "Avoid "Column md_module cannot be null" error in unit tests"

7 years agoMerge "Use memory job queue for unit tests"
jenkins-bot [Mon, 12 Sep 2016 01:11:29 +0000 (01:11 +0000)]
Merge "Use memory job queue for unit tests"

7 years agoUse memory job queue for unit tests
Aaron Schulz [Mon, 12 Sep 2016 00:23:54 +0000 (17:23 -0700)]
Use memory job queue for unit tests

Change-Id: I13586b9873bf09acd4a458a7af75a25d9b980fca

7 years agoadd IGNORE INDEX option to mysql database handler
Ariel T. Glenn [Mon, 4 Jul 2016 10:56:40 +0000 (13:56 +0300)]
add IGNORE INDEX option to mysql database handler

BUG: T29112
Change-Id: I9a5a4f7983ebd37b7889abb8433e5acc44b8f9ac

7 years agoAvoid "Column md_module cannot be null" error in unit tests
Aaron Schulz [Mon, 12 Sep 2016 00:07:52 +0000 (17:07 -0700)]
Avoid "Column md_module cannot be null" error in unit tests

Change-Id: I06755cbd907d8a595e55080e37779eb9d0c026ab

7 years agoMake PurgeJobUtils avoid creating DB replication lag
Aaron Schulz [Sun, 11 Sep 2016 23:14:44 +0000 (16:14 -0700)]
Make PurgeJobUtils avoid creating DB replication lag

Large affected rows counts were being reported in DBPerformance logs.

Change-Id: Ia5504aa4fbd27473771c65688f0b9e78e3a5caae

7 years agoMerge "Display an error message when the validataion of a radio input fails because...
jenkins-bot [Sun, 11 Sep 2016 23:56:41 +0000 (23:56 +0000)]
Merge "Display an error message when the validataion of a radio input fails because user did not provide any input."

7 years agoDisplay an error message when the validataion of a radio input fails because user...
Huji Lee [Sun, 11 Sep 2016 23:38:59 +0000 (19:38 -0400)]
Display an error message when the validataion of a radio input fails because user did not provide any input.

Bug: T107486
Change-Id: Ie3a9cc11f285cadec1dde32f820643d1aabd0d1b

7 years agoMerge "Remove useless LoadBalancer::parentInfo() method and calls"
jenkins-bot [Sun, 11 Sep 2016 23:26:10 +0000 (23:26 +0000)]
Merge "Remove useless LoadBalancer::parentInfo() method and calls"

7 years agoMerge "Use ESTIMATE_DB_APPLY for total transaction time estimate"
jenkins-bot [Sun, 11 Sep 2016 23:16:58 +0000 (23:16 +0000)]
Merge "Use ESTIMATE_DB_APPLY for total transaction time estimate"

7 years agoMerge "Add LBFactory::getChronologyProtectorTouched() method"
jenkins-bot [Sun, 11 Sep 2016 23:08:50 +0000 (23:08 +0000)]
Merge "Add LBFactory::getChronologyProtectorTouched() method"

7 years agoUse ESTIMATE_DB_APPLY for total transaction time estimate
Aaron Schulz [Sun, 11 Sep 2016 22:51:15 +0000 (15:51 -0700)]
Use ESTIMATE_DB_APPLY for total transaction time estimate

Individual write queries already do this, but the COMMIT step
still used the old accounting.

Change-Id: I416a524d6652f933cbc49033b49745db732c8b92

7 years agoRemove useless LoadBalancer::parentInfo() method and calls
Aaron Schulz [Sun, 11 Sep 2016 22:15:34 +0000 (15:15 -0700)]
Remove useless LoadBalancer::parentInfo() method and calls

Change-Id: I3550d1249c63ee5bec51dd343b3e26b515c4827e

7 years agoUpdate Bugzilla references to Phabricator references
Sébastien Santoro [Sun, 11 Sep 2016 21:41:26 +0000 (21:41 +0000)]
Update Bugzilla references to Phabricator references

Change-Id: I28dbaf05d29062c485042d432fec5d11e9c6d193

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 11 Sep 2016 20:19:31 +0000 (22:19 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7f5b889fba9e6a54d318b58f68c58179d1f5fba7

7 years agoAdd LBFactory::getChronologyProtectorTouched() method
Aaron Schulz [Thu, 8 Sep 2016 20:07:15 +0000 (13:07 -0700)]
Add LBFactory::getChronologyProtectorTouched() method

This lets callers check whether a user recently change a DB and
possibly try harder to reflect certain changes or refresh caches.

Also simplified some logging code a bit.

Change-Id: Ia1168cf0d46cfdee046838ce4c5a6294e4d81760

7 years agoMerge "Simplify some LoadBalancer methods that do iteration"
jenkins-bot [Sun, 11 Sep 2016 20:06:15 +0000 (20:06 +0000)]
Merge "Simplify some LoadBalancer methods that do iteration"

7 years agomw.special.movePage: Don't fail if no "Move associated talk page" checkbox
Bartosz Dziewoński [Sun, 11 Sep 2016 17:21:22 +0000 (19:21 +0200)]
mw.special.movePage: Don't fail if no "Move associated talk page" checkbox

Bug: T145320
Change-Id: I9dd364ef75d2359374066840a8e855343b2edbaf

7 years agoMake WikiPage::doPurge() clear the file cache too
Aaron Schulz [Sun, 11 Sep 2016 16:37:44 +0000 (09:37 -0700)]
Make WikiPage::doPurge() clear the file cache too

Change-Id: I6d2419d0948c9a191464ea8faf63913b7c5d5b1a

7 years agoUse DB_REPLICA in ContribsPager
Aaron Schulz [Sun, 11 Sep 2016 13:36:51 +0000 (06:36 -0700)]
Use DB_REPLICA in ContribsPager

Change-Id: Ic225b9c41d989722677caf323846783d7e0638a4

7 years agoSimplify some LoadBalancer methods that do iteration
Aaron Schulz [Sun, 11 Sep 2016 03:10:41 +0000 (20:10 -0700)]
Simplify some LoadBalancer methods that do iteration

Use foreachOpenConnection() and foreachOpenMasterConnection() in
more methods rather that copying that code. Also made the logic
for closeConnection() simpler by using the "serverIndex" field LB
always sets on the connection handles.

Change-Id: I5cb66da2395773d64b84d4115cbcdfc69c9e5e00

7 years agoSpecial:UserRights: Trim value of $mTarget if it's a string
Glaisher [Sun, 11 Sep 2016 13:03:52 +0000 (18:03 +0500)]
Special:UserRights: Trim value of $mTarget if it's a string

Bug: T145329
Change-Id: I28dd6241525e5ee7d9b09151933321a2f0004252

7 years agoMake JobQueueGroup::push() update the queuesHaveJobs() cache
Aaron Schulz [Sun, 11 Sep 2016 11:57:12 +0000 (04:57 -0700)]
Make JobQueueGroup::push() update the queuesHaveJobs() cache

This makes it so jobs can run sooner with $wgJobRunRate

Bug: T145206
Change-Id: Ia7673f51312f90a696fa056bd3daf7f3f440782b

7 years agoMerge "Force primary index for RevDelRevisionList query"
jenkins-bot [Sun, 11 Sep 2016 00:49:07 +0000 (00:49 +0000)]
Merge "Force primary index for RevDelRevisionList query"

7 years agoMerge "Revert "Clean up user handling in UploadStash""
jenkins-bot [Sun, 11 Sep 2016 00:35:32 +0000 (00:35 +0000)]
Merge "Revert "Clean up user handling in UploadStash""

7 years agoMerge "Use Database::timestamp in LocalFile::loadFieldsWithTimestamp"
jenkins-bot [Sun, 11 Sep 2016 00:28:14 +0000 (00:28 +0000)]
Merge "Use Database::timestamp in LocalFile::loadFieldsWithTimestamp"

7 years agoForce primary index for RevDelRevisionList query
Roan Kattouw [Mon, 11 Apr 2016 18:08:10 +0000 (11:08 -0700)]
Force primary index for RevDelRevisionList query

To work around an optimizer bug in MySQL where the
index on (rev_page, rev_id) is picked which mysteriously
leads to very slow execution times and timeouts.

In theory, the index being forced here is (rev_id),
which is fine for this query. In WMF production,
it can also be (rev_id, rev_user) (still fine), or
(rev_page, rev_id) (the index we're trying to avoid).
Mysteriously, the optimizer bug doesn't happen if
(rev_page, rev_id) is the primary key, so this still
behaves OK.

Bug: T104313
Change-Id: I15c68ba29309dca8dea274f19389d139a82784aa

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 10 Sep 2016 20:49:05 +0000 (22:49 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1cf537e516dca258169590bfec492452b2abf956

7 years agoUse Database::timestamp in LocalFile::loadFieldsWithTimestamp
umherirrender [Sat, 10 Sep 2016 20:36:50 +0000 (22:36 +0200)]
Use Database::timestamp in LocalFile::loadFieldsWithTimestamp

Postgres needs a special timestamp format on sql which is handled by
Database::timestamp.

Bug: T145066
Change-Id: I8db958ecbea7c12af8caf8354490e59500975e4b

7 years agomw.ForeignApi: Allow anonymous requests
Bartosz Dziewoński [Sat, 10 Sep 2016 19:01:26 +0000 (21:01 +0200)]
mw.ForeignApi: Allow anonymous requests

When 'anonymous: true' is passed:

* Send 'origin=*' in the query parameters, so that MediaWiki treats
  the request as anonymous (same as for JSONP requests).
* Set 'withCredentials: false' in AJAX options, so that the browser
  doesn't try to send cookies and accepts the response with the
  'Access-Control-Allow-Origin: *' header.

Bug: T145294
Change-Id: Ic93d733cb9e1b1d7301f8975c68ab7ded778845a

7 years agoRevert "Clean up user handling in UploadStash"
Bartosz Dziewoński [Sat, 10 Sep 2016 15:27:49 +0000 (15:27 +0000)]
Revert "Clean up user handling in UploadStash"

This reverts commit 58713d2b1611e55fcd0cf7647af8d96ebc1e88bf.

Bug: T145228
Change-Id: Ic62f19109f98fab9dd029acccecd6518b649e34b

7 years agoAdd structure test for ContentHandler::makeEmptyContent()
Kunal Mehta [Sat, 10 Sep 2016 08:54:15 +0000 (01:54 -0700)]
Add structure test for ContentHandler::makeEmptyContent()

This adds a structure test that verifies all registered ContentHandlers
will return a valid content object (as determined by
Content::isValid()), when makeEmptyContent() is called. Additionally, if
the handler extends TextContentHandler, it will verify it is an instance
of TextContentHandler::getContentClass().

This is a structure test so it is run for content handlers created by
extensions as well.

Change-Id: Idd67d824f2f7cc1819b1d8b186be058e63c4513d

7 years agoMerge "Clean up tests for FauxRequest/WebRequest"
jenkins-bot [Sat, 10 Sep 2016 06:34:19 +0000 (06:34 +0000)]
Merge "Clean up tests for FauxRequest/WebRequest"

7 years agoMake the page JOIN in RevDelRevisionList actually apply
Aaron Schulz [Sat, 10 Sep 2016 06:21:32 +0000 (23:21 -0700)]
Make the page JOIN in RevDelRevisionList actually apply

The table was missing from the tables array

Change-Id: I613a2075e5d18210c8187587462b0f000769aec2

7 years agoWebRequest: Use getRawVal instead of getGPCVal where possible
Timo Tijhof [Fri, 9 Sep 2016 22:46:08 +0000 (15:46 -0700)]
WebRequest: Use getRawVal instead of getGPCVal where possible

Avoid getGPCVal() for simple methods that only need a boolean,
number or specific string outcome.

This saves overhead of touching $wgContLang or UtfNormal\Validator
and makes load.php initialisation no longer depend on it.

Change-Id: I8ce1fa31f5102b3fa18b0d0b9f56c42cb90146a1

7 years agoClean up tests for FauxRequest/WebRequest
Timo Tijhof [Fri, 9 Sep 2016 22:35:19 +0000 (15:35 -0700)]
Clean up tests for FauxRequest/WebRequest

Follows-up 1ac5474b7b and d18d030d57.

* Always mock WebRequest in WebRequestTest.
  Avoid using FauxRequest, can easily cause false positives (it's already
  avoided in one case of that reason).

* Add a few smoke/integration tests in FauxRequest to make sure the parent
  methods work as expected, given the internal method being overridden
  in FauxRequest.

Change-Id: I1bf528f3c578ecb171a3ff4f17b26f9bb02b4f47