Commit graph

5906 commits

Author SHA1 Message Date
Aaron Schulz
1da16f1639 Fix CONCAT assertions in some MCR tests
Change-Id: I9507ae60751f8e9cc5e6205148cf2e37f67f42c5
2018-07-04 08:20:53 +01:00
jenkins-bot
be004af9a2 Merge "Add MediaWikiService::getPerDbNameStatsdDataFactory" 2018-07-03 07:58:40 +00:00
jenkins-bot
4b5773a4de Merge "rdbms: fix Sqlite::tableExists() method to avoid STATUS_TRX_ERROR" 2018-07-03 05:40:03 +00:00
addshore
72c50093a4 Add MediaWikiService::getPerDbNameStatsdDataFactory
Bug: T196609
Change-Id: I08a4909e2855e33569641166b77be5d8bf4e2c34
2018-07-02 18:31:03 +01:00
MusikAnimal
72566c80b1 Allow MediaWikiTestCase::insertPage to use given User
Sometimes you need to create pages with a non-sysop.
Example: I31aedcb9af7584fa5504916c67ca10f205ec9910

Change-Id: I9e48f7c00efbce8c2de3f5db3a74462d47ae8f64
2018-06-29 17:04:33 -04:00
Kevin Israel
a50f61009d MWNamespace: Add getCategoryLinkType() method
This method returns the value used as cl_type for category links that
are "from" pages within the namespace, and is added to avoid duplication
of code across a few classes.

Change-Id: I4e55932a5a27858cfedb12009b455fcd02f9b5df
2018-06-29 15:37:11 +00:00
addshore
fb97a7bad3 Ensure services are added to MediaWikiServicesTest::provideGetService
Change-Id: I3f6ded009ed98b615adb7c46d41bced450972b54
2018-06-29 12:55:35 +00:00
addshore
c37c3a66b7 MediaWikiServicesTest, remove out of date note
provideGetters is now automatically populated using the
provideGetService method so we don't need to actually add
the service there

Change-Id: I07e8f54e5c4aa7ff22d02312bf51ac8d1cc4b5c2
2018-06-29 12:55:28 +00:00
addshore
eb39d5f945 Introduce RevisionStoreFactory & Tests
Bug: T194729
Change-Id: I0a8a441b803816281113e52a2a57cc07af8a1119
2018-06-29 12:55:20 +00:00
daniel
0d51852087 Regression test for autopatrolling rollbacks
Bug: T198449
Change-Id: Ic280c38ac2ba0a0842c484f671e7e99f50cd54d5
2018-06-29 11:59:51 +02:00
jenkins-bot
9fa37f0a8b Merge "objectcache: make MultiWriteBagOStuff handle duplicate add() operations" 2018-06-29 02:16:52 +00:00
Aaron Schulz
6afa7bb86a Make ProcessCacheLRU wrap MapCacheLRU
Change-Id: I190c824af471aee798e2f111b902f38532b8ac99
2018-06-28 20:23:37 +00:00
jenkins-bot
fa219d9652 Merge "Add key expiration and map resizing support to MapCacheLRU" 2018-06-28 19:22:03 +00:00
Aaron Schulz
6612407f9c objectcache: make MultiWriteBagOStuff handle duplicate add() operations
Bug: T198280
Change-Id: Ib1bcde2b3fbfb452f80d8d840c494be2eb70eb87
2018-06-28 16:04:35 +00:00
Aaron Schulz
1f2b2f3f8d Add key expiration and map resizing support to MapCacheLRU
Also implement Serializable in to add stability to anything that
uses naïve serialization (such as for persistent caching).

Change-Id: I03ba654ffd80ba027d47d5d7583abfe48d52818d
2018-06-28 05:53:42 +00:00
Timo Tijhof
b7b84d55d4 resourceloader: Embed 'mediawiki' directly in startup response
Embed the essential files to define mw.loader directly as part of
the startup module.

* This means the internal 'mediawiki' module no longer exists.
  This is safe to remove because:
  1) While registered server-side for loading from startup.js, a PHPUnit
     structure test disallowed being specified as a dependency.
  2) Anything that attempted to load it client-side failed because the
     module was marked in the registry as 'raw', thereby excluding it
     from the data sent to the client-side. As such, it was seen as an
     unknown module that the client refused to fetch from the server.

* Deprecate getStartupModules() and getLegacyModules().
  These are no longer needed. There are no known callers anywhere in
  Wikimedia Git or elsewhere indexed by Codesearch, but easy enough
  to leave as no-op for one release.

* Remove ResourceLoaderRawFileModule class.
  No longer needed. Was created as a hack specifically for the 'mediawiki'
  module so that it would not leak global variables in debug mode.
  It has no usage anywhere in Wikimedia Git, nor elsewhere in Codesearch.
  Remove without deprecation given this was meant to be a 'private' class.

* Introduce (private) getBaseModules(). Previously, this list only existed
  locally in getStartupModulesUrl() by merging getStartupModules() and
  getLegacyModules(). This value was factored out into its own method.

* Make getStartupModulesUrl() private and rename to getBaseModulesUrl().
  It is only used internally to export the 'baseModulesUri' value.
  Its name was already confusing before, but it would've been even more
  confusing now given it doesn't even call getStartupModules() any more.

Bug: T192623
Change-Id: I14ba282d7b65e99ca54b7c2f77ba6e1adaddd11c
2018-06-27 17:06:35 +00:00
jenkins-bot
3ce5436159 Merge "resourceloader: Add @covers for FileModuleTest" 2018-06-27 07:25:50 +00:00
jenkins-bot
d106692dfe Merge "resourceloader: Add test for getVersionHash parent-definition requirement" 2018-06-27 07:25:45 +00:00
Kunal Mehta
e1990c6f0e Skip MediaWikiTestCaseSchema1Test on Postgres
According to Anomie, the idea behind this test is semi-broken, and would
benefit from T191231 being implemented first.

Bug: T195807
Change-Id: I9561fd0a82c37cf044e292e00499ecb611fcded6
2018-06-26 15:25:43 +00:00
Timo Tijhof
ae9c32b508 resourceloader: Add test for getVersionHash parent-definition requirement
Change-Id: I69cdfea96c1e64bd8a7495eb6e56d0aefbe37643
2018-06-26 16:24:31 +01:00
Timo Tijhof
a0339862ac resourceloader: Add @covers for FileModuleTest
Add @covers for various helper methods used by public methods, where the helper
methods actually contain most of the logic being tested in FileModuleTest.

I've changed these methods from protected to private (confirmed no usage)
to further pin down that their contract doesn't matter beyond making the
public methods work.

Change-Id: I2aef0d322b38bc3595e7d2c2339112b16fc66b8d
2018-06-26 02:06:03 +00:00
jenkins-bot
fd414914c2 Merge "Revert "Use pathinfo() in AutoLoaderStructureTest::testPSR4Completeness"" 2018-06-25 13:04:27 +00:00
Hashar
afb2269cb9 Revert "Use pathinfo() in AutoLoaderStructureTest::testPSR4Completeness"
This reverts commit 634c2ec2af.

Reason for revert: that strips the PSR4 directories from the class.

Example:
$dir BlueSpiceFoundation/src/"
$file BlueSpiceFoundation/src/ConfigDefinition/IntSetting.php

$abbrFileName: IntSetting
$expectedClassName: BlueSpice\IntSetting

$abbrFileName should be relative to $dir and not just the filename.

Bug: T198077
Change-Id: Ie934e309fee0392439b4e26d86249f0650e5ea67
2018-06-25 12:38:07 +00:00
jenkins-bot
c2f3a2c5a4 Merge "Use pathinfo() in AutoLoaderStructureTest::testPSR4Completeness" 2018-06-25 12:05:26 +00:00
Antoine Musso
634c2ec2af Use pathinfo() in AutoLoaderStructureTest::testPSR4Completeness
When setting AutoloadNamespaces to './' in extension.json, the test
AutoLoaderStructureTest::testPSR4Completeness would fail. The directory
path is not made canonical while the file is, which causes the substr()
call being used to strip too many characters. For example:

  $dir : /mediawiki/extensions/Wikidata.org/./
  $file: /mediawiki/extensions/Wikidata.org/Hooks.php

$abbrFileName = substr( substr( $file, strlen( $dir ) ), 0, -4 );
>>> oks

Use pathinfo() to parse the filename. Yields 'Hooks' as expected.

Bug: T198077
Change-Id: Ia8a11d87788b32ddb426a16a61b410b05ff5f15e
2018-06-25 11:47:52 +00:00
jenkins-bot
e60b416eb9 Merge "resourceloader: Add coverage for StartupModule::getDefinitionSummary" 2018-06-25 08:05:31 +00:00
Timo Tijhof
afffa55567 resourceloader: Add coverage for StartupModule::getDefinitionSummary
Change-Id: I913c8ecd5f51db851ef408c4281cdd75a0e0b239
2018-06-24 02:59:44 +01:00
Fomafix
125cbd8c01 Use \u{00A0} instead of   or  
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of
the HTML/XML entities   or   or  .

With the UTF-8 character the generated HTML is shorter and better to read.

Also change the special value for the label in HTMLForm from   to
U+00A0 but also support   for backward compability.

Bug: T154300
Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
2018-06-24 01:20:13 +00:00
daniel
c7564daa80
[MCR] Rollback for all slots
Bug: T194034
Change-Id: Ifd23bc1cd64ddc090e1c1c26aacda37e8ba7a18b
2018-06-23 15:14:47 +02:00
jenkins-bot
712396e716 Merge "Make undo fail if more than just the main slot is affected." 2018-06-23 08:59:37 +00:00
Aaron Schulz
d16bfb0a30 rdbms: fix Sqlite::tableExists() method to avoid STATUS_TRX_ERROR
Sqlite used the base implementation of trying a SELECT 1 query and
seeing if it failed. Instead, make it use the sqlite_master table.
Also remove the base version of that method since it would always
cause this problem and all subclasses have proper implementations.

Make LoadBalancerTest::assertWriteAllowed() more explicit and add
more assertions there.

Change-Id: I6c7b0bea8894c45dfe8931748d6687f0e5d1e101
2018-06-22 22:33:45 +00:00
jenkins-bot
75c03d08fa Merge "API: Check assert parameters earlier in the request" 2018-06-22 21:36:36 +00:00
jenkins-bot
75106ac214 Merge "MCR: rename $baseRevId paramter to match actual semantics." 2018-06-22 14:42:07 +00:00
daniel
ef1edcea3c Make undo fail if more than just the main slot is affected.
Bug: T194412
Change-Id: Ifdf9bc9d884844f9ffeb8019d9b13d5737862063
2018-06-22 15:18:41 +02:00
daniel
731a113aac MCR: rename $baseRevId paramter to match actual semantics.
The $baseRevId in WikiPage::doEditContent is used only to indicate what
revision an edit reverted to. It is not used to indicate the actual base
revision of an edit in any sense. Specifically, EditPage never sets it.

So, this change renames the parameter to $originalRevId to match $undidRevId.
It also renames PageUpdater::setBaseRevisionId to setOriginalRevisionId.
Further, this introduces a paramter to PageUpdater::hasEditConflict():

Before this change, PageUpdater::hasEditConflict() was based on the
revision set via PageUpdater::setBaseRevisionId(), assuming the semantics
of "base revision" used by EditPage. However, this is NOT how the $baseRevId
parameter in WikiPage works.

Bug: T197685
Change-Id: Ib78257d4d6ee7c4ec093d5706904c599b02c73e0
2018-06-22 11:57:59 +00:00
Brad Jorsch
d927830935 API: Check assert parameters earlier in the request
Specifically, check the assert and assertuser parameters before setting
up the action module, so errors in parsing the module's parameters due
to being logged out don't override the client's intended "am I logged
in?" check.

Note this means that assertion failures will no longer use custom module
output formatters. This seems like an acceptable tradeoff: on Wikimedia
sites in May 2018 there were no requests that would have been affected
by this change.

Bug: T197672
Change-Id: I02a71395d5ed9f445e57162f2136292825f8dbb5
2018-06-21 14:50:47 -04:00
Amir Sarabadani
bd8cd912a7 Turning change_tag_def store to a service
This will be useful when reading the table.

Bug: T194162
Change-Id: I8c0a0075910a79465a648a052b4e7fbc888b10e7
2018-06-21 09:40:56 +02:00
jenkins-bot
5572895c9f Merge "Xhprof: support tideways-xhprof extension" 2018-06-20 22:55:26 +00:00
jenkins-bot
9d914bed08 Merge "Blob can't be false" 2018-06-20 20:04:10 +00:00
daniel
564257dc50 Blob can't be false
Change-Id: Ic06fcfaac71128c0ff7e9079685eac18206f2004
2018-06-20 17:32:35 +02:00
Edward Chernenko
9d4a7e4d75 Xhprof: support tideways-xhprof extension
The "tideways" extension was renamed by their developers, see
https://tideways.com/profiler/blog/releasing-new-tideways-xhprof-extension

While doing so, they also renamed enable/disable functions:
tideways_enable -> tideways_xhprof_enable
tideways_disable -> tideways_xhprof_disable

Change-Id: I63bc97dba461dd46241a094dfc59439c0d28a219
2018-06-19 14:43:40 +00:00
jenkins-bot
284bc0b5eb Merge "When encountering bad blobs, log the text row id." 2018-06-19 12:32:44 +00:00
daniel
2f9e892c74 When encountering bad blobs, log the text row id.
Change-Id: Ie7c932f229854fd3582d507fa7cc154ffdd21f55
2018-06-19 13:59:01 +02:00
jenkins-bot
43ab31487a Merge "Make ChangeTag use NameTableStore for change_tag_def table" 2018-06-18 15:37:20 +00:00
Amir Sarabadani
ed802248e3 Make ChangeTag use NameTableStore for change_tag_def table
Also adding a regression test to fix upsert AUTO_INCREMENT issue

Bug: T193868
Change-Id: I0363c93a824c41d12b33aedb05e92e1d9943c40d
2018-06-17 22:32:30 +02:00
jenkins-bot
85724779ef Merge "Add maintenance to populate change_tag_def table and ct_tag_id field" 2018-06-16 12:59:28 +00:00
Amir Sarabadani
f1e450564f Add maintenance to populate change_tag_def table and ct_tag_id field
Bug: T193871
Change-Id: I5e863ffcfad5f2b66fb8d50666494acae3480d1a
2018-06-15 17:57:27 +02:00
daniel
257f877904 Ignore order of slot roles in test assertions
Bug: T197271
Change-Id: I1448c3907157d4d79f69f5344e6069b4f8be43bc
2018-06-15 10:01:04 +00:00
jenkins-bot
1669047884 Merge "Fix flaky MessageBlobStoreTest assertion failures" 2018-06-15 00:11:14 +00:00
jenkins-bot
84fa176c9c Merge "Avoid deprecated LinkCache::singleton()" 2018-06-14 23:48:54 +00:00