Commit graph

4568 commits

Author SHA1 Message Date
jenkins-bot
c1edd28ba6 Merge "Add tests for ExtensionJsonValidator" 2018-02-12 17:54:43 +00:00
jenkins-bot
433e3d9262 Merge "Complete VersionChecker test coverage" 2018-02-12 17:51:54 +00:00
jenkins-bot
89843b44ce Merge "Update suppressWarning()/restoreWarning() calls" 2018-02-11 22:06:29 +00:00
Brad Jorsch
9b2b375fce ParserOutput: Add 'deduplicateStyles' post-cache transformation
This transformation will find <style> tag with a "data-mw-deduplicate"
attribute. For each value of the attribute, the first instance will be
kept as-is, while any subsequent tags with the same value will be
replaced by a <link rel="mw-deduplicated-inline-style"> with its href
referring to the "data-mw-deduplicate" value using a custom scheme.

This also adds an $attribs parameter to Html::inlineStyle() so the
data-mw-deduplicate attribute can be added.

Note this doesn't actually depend on Ib931e25c, but action=mobileview
will break if it starts being used without that patch.

Bug: T160563
Change-Id: I055abdf4d73ec65771eaa4fe0999ec907c831568
Depends-On: Ib931e25ce85072000e62c486bbe5907f03372494
2018-02-11 05:55:56 +00:00
Reedy
fbc0347466 Update MediaWiki\quietCall() -> Wikimedia\quietCall()
Bug: T182273
Change-Id: Id7d8e176fcd93040e30e46cb64fc6a3d36bc8230
2018-02-10 10:49:33 +00:00
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00:00
Kunal Mehta
08b2cf6638 Add tests for ExtensionJsonValidator
Change-Id: I883a502fc3ed6cd7b8651d9e5e78dba7177ead9c
2018-02-09 23:37:22 -08:00
Kunal Mehta
4ca1b96184 Complete VersionChecker test coverage
And fix a few typos in the error messages and the accidental inclusion
of whitespace.

Change-Id: I4ea90c5543e394c3f30b1da1456e4676377188f7
2018-02-09 23:14:07 -08:00
Kunal Mehta
d3b580977d registration: Simplify extracting path based globals
The code for ParserTestFiles and ServiceWiringFiles was identical, so
unify it into one function. For most extensions, this should save two
unnecessary function calls as a bonus.

Change-Id: If5ed189f97b7d3b9cd7b550f3ad2e90abe30005d
2018-02-09 22:33:10 -08:00
Kunal Mehta
cf2deaa7f4 Complete ExtensionProcessor test coverage
Change-Id: I80103e9b7eaba0bb3efa3b736f3f188a536f2919
2018-02-09 22:33:04 -08:00
jenkins-bot
4a56e5eb44 Merge "Add a few more @covers to ParserIntegrationTest" 2018-02-10 00:30:06 +00:00
jenkins-bot
8fd5a99f4e Merge "Fix ParserOutput::getText 'unwrap' flag for end-of-doc comment" 2018-02-09 22:34:46 +00:00
Gergő Tisza
5859eff1b0
Fix ParserOutput::getText 'unwrap' flag for end-of-doc comment
The closing div might be followed by debug information in HTML comments.

Bug: T186927
Change-Id: I72d4079dfe9ca9b3a14476ace1364eb5efdee846
2018-02-09 14:17:22 -08:00
addshore
6cf900ffb0 Add clearWatchedItems to WatchedItemStore
Change-Id: I67d1057c76ddccece4727f4df701a3ad14c3bbaa
2018-02-09 11:38:47 -08:00
Kunal Mehta
6c4d32e394 Add a few more @covers to ParserIntegrationTest
Change-Id: I638077683d9d3cb40f81b4f4d594f16c349f1519
2018-02-09 11:19:03 -08:00
Aaron Schulz
e59b0556f4 rdbms: make DOMAIN_ANY ignore bogus MySQL DB names in config
This regressed in 14ee3f2, trying to select the server config
"dbname" value as the database on connect. If that config is
bogus, then the connection attempt would fail. Instead, always
pass null to the driver's connection function if the DB domain
doesn't matter.

This affected WMF sites during lag checks, on account of the
"serverTemplate" value in $wgLBFactoryConf always using the local
wiki domain (whether the cluster had such a database or not).

Use strlen() as mysqli sees null and "" as the same for $dbname.

Bug: T186764
Change-Id: I6699d17c0125a08415046211fee7906bbaf2c366
2018-02-09 06:43:24 +00:00
jenkins-bot
6d5edd8755 Merge "ApiFormatBase: Encode filenames in Content-Disposition" 2018-02-08 21:16:26 +00:00
jenkins-bot
e21a451bcf Merge "Add @covers tags for parser tests" 2018-02-08 21:01:24 +00:00
jenkins-bot
967aa24198 Merge "DI for CommentStore in RevisionStore" 2018-02-08 20:44:31 +00:00
Thiemo Mättig
c6387060d8 Fix some broken @var comments and add missing uses
Change-Id: I2091f4107b6c23d9c3b698999147ce3a2ec38b66
2018-02-08 20:00:25 +00:00
addshore
423ba71f42 DI for CommentStore in RevisionStore
Change-Id: I527388514489e79c53b6016a8bd3119ee1750c83
2018-02-08 18:09:41 +00:00
Kunal Mehta
3e16cc20e8 Add @covers tags for parser tests
Change-Id: I24d3550a07be7a5699475047eb78806f36caec2e
2018-02-07 22:18:43 -08:00
Brad Jorsch
7bc541a4a7 ApiFormatBase: Encode filenames in Content-Disposition
The return value for ApiFormatBase::getFilename() was formerly
documented as "must be encoded for inclusion in a Content-Disposition
header's filename parameter." While this is ok for the common use case
where the module is returning a constant string or can assume whatever
it gets back from getExtensionsForType() is ok, it's not in general a
good idea to make all callers handle that.

Further, it's not possible to represent characters outside of the
ISO-8859-1 character set in a 'filename' parameter. You have to use
'filename*' to do that (see RFC 5987 and RFC 6266).

So, this patch changes the definition of getFilename() to remove the
encoding requirement, and adds code to properly convert and escape the
value for the 'filename' and (if necessary) 'filename*' parameters.

Note this may give unexpected results (double encoding) if any module
actually is returning an encoded filename. I don't see any such cases in
core or in extensions in Gerrit.

Change-Id: I0c2749a847b639f228efff4e1917a61612a1f7d1
2018-02-07 15:12:33 -05:00
jenkins-bot
0f078a2166 Merge "Add @covers for BlockLevelPass" 2018-02-07 15:54:37 +00:00
Kunal Mehta
449e31a179 MWHttpRequest: Restore ability to pass null for $options
Prior to 3de744597e, it was possible to pass `null` for $options.
Restore that by setting the default type to be null, and explicitly
document that null is a supported value in the doc block.

Also update the signature of MWHttpRequestTester to match.

Change-Id: I74d586afa5527e0a30ea99f3989f4dd12fa9fea1
2018-02-06 13:05:02 -08:00
addshore
d9c25c2f47 DI for CommentStore in WatchedItemQueryService
Change-Id: I93d9ed5f66297da7009d5b99aa9ed48e1b10582f
2018-02-06 16:50:16 +00:00
jenkins-bot
409e870719 Merge "Mock CommentStore in some RevisionTest tests" 2018-02-06 15:32:03 +00:00
jenkins-bot
bbedc24556 Merge "Pass $key into CommentStore methods and use MediawikiServices" 2018-02-06 15:31:59 +00:00
jenkins-bot
4ec304436f Merge "Add @covers for RemexStripTagHandler" 2018-02-06 14:52:59 +00:00
addshore
0db2e18216 Mock CommentStore in some RevisionTest tests
Change-Id: I16b00a5514547d93a2308393098e3b363505374e
2018-02-06 12:40:47 +00:00
jenkins-bot
92571d7c1a Merge "[MCR] RevisionStore::getTitle final logged fallback to master" 2018-02-06 11:42:52 +00:00
Kunal Mehta
48cfdf7163 Add @covers for BlockLevelPass
This class was split out of Parser, so it now needs separate covers tags.

Change-Id: I06c4a6a4fac3d6ff13924e3ca45ee134f7eeab20
2018-02-05 21:21:37 -08:00
Kunal Mehta
2ab7ae9d24 Add @covers for RemexStripTagHandler
This internal class is only used by Sanitizer::stripAllTags().

Change-Id: Ib913ee14524539216305da7e3183c07ab7d72cb5
2018-02-05 21:15:52 -08:00
Fomafix
73a514b574 Remove superfluous spaces and semicolons in comments
Change-Id: Ib4b452f1843ec250c8c1fcc2a738d80726b6135d
2018-02-05 19:05:57 +00:00
jenkins-bot
1f2836da5f Merge "Force CommentMigration MIGRATION_OLD in 2 RevisionTest tests" 2018-02-05 15:44:18 +00:00
addshore
e5879da149 Pass $key into CommentStore methods and use MediawikiServices
This allows CommentStore to be added to MediaWikiServices
without the need of an aditional Factory.

This change includes a compatability layer to allow the behaviour
from 1.30 to continue to be used while deprecated.

CommentStore::newKey has been deprecated.
Keys are now passed into the public methods of CommentStore
where needed.
The following CommentStore methods have had their signatures changed
to introduced a $key parameter, but when used in conjunction with
CommentStore::newKey behaviour will remain unchanged:
  * CommentStore::getFields
  * CommentStore::getJoin
  * CommentStore::getComment
  * CommentStore::getCommentLegacy
  * CommentStore::insert
  * CommentStore::insertWithTemplate

Change-Id: I3abb62a5cfb0dcd456da9f4eb35583476ae41cfb
2018-02-05 15:34:12 +00:00
Kunal Mehta
79de8fd02f Use wikimedia/object-factory 1.0.0
Deprecate the unnamespaced version and move it to includes/compat.

Bug: T147167
Depends-On: I39c805bfb98b32f32f3d0dc1eee9e823afe1c21a
Change-Id: I3780c7adf51683f3f7adb35a88f9a25a0a2e2530
2018-02-04 12:52:44 -08:00
jenkins-bot
a5f91ac24f Merge "JavaScriptMinifier: Fix "Uninitialized offset" in regexp char class parsing" 2018-02-02 23:54:28 +00:00
jenkins-bot
f234f0f64f Merge "Do not concat exception class name in Timestamp compat" 2018-02-02 21:38:29 +00:00
jenkins-bot
689c847a32 Merge "Add tablesUsed to RevisionStoreDbTest" 2018-02-02 19:46:37 +00:00
addshore
1c65dd29a3 Add tablesUsed to RevisionStoreDbTest
Bug: T183777
Change-Id: Ie8bc2a9aca341a44c22828c9e9c3a7f89c7f87cd
2018-02-02 19:37:44 +00:00
jenkins-bot
78a9d810ab Merge "Remove wrapclass from parser cache key" 2018-02-02 18:41:02 +00:00
WMDE-Fisch
64d7c7e6ec Do not concat exception class name in Timestamp compat
It seems this is not necessary and confused my IDE in thinking
'Exception' is an alias for TimestampException.

Given that we use a namespaced reference to the class,
ClassCollector still won't see it. Updated test to verify that.

Change-Id: I7c9258c5739a64959442af1296e2b93395260894
2018-02-02 10:40:48 -08:00
jenkins-bot
b6af56e2cc Merge "rdbms: Bump TransactionProfiler log entries to WARNING" 2018-02-02 04:00:28 +00:00
Aaron Schulz
f6c9b7a7b7 rdbms: Bump TransactionProfiler log entries to WARNING
Change-Id: I4816cfb8c8cd3b8e3dd2fe10c028c4654cc82854
2018-02-02 03:52:31 +00:00
jenkins-bot
dd2e27c4b1 Merge "deferred: Make MWCallableUpdate support a list of DB handles" 2018-02-02 03:51:32 +00:00
jenkins-bot
4af9e538a4 Merge "objectcache: use region prefixes for mcrouter-backed WAN cache" 2018-02-02 03:34:06 +00:00
jenkins-bot
74426f3cf7 Merge "Warn if stateful ParserOutput transforms are used" 2018-02-02 02:45:27 +00:00
Brad Jorsch
8b0e7298ac
Remove wrapclass from parser cache key
This will result in an exception from WikiPage::getParserOutput() if
anything was missed.

This also hard-deprecates ParserOptions::setWrapOutputClass( false )

Bug: T181846
Change-Id: Ica541e1f6b52f5eec6d28cff60ba64bf525258c7
Depends-On: Ie5d6c5ce34c05b8fe2353d3bb36b2a3a4166ec4b
Depends-On: Ibfaefde2f3811151ec712554cbc9cf2415ed017f
Depends-On: I55048bbae5d4d2d0c79c241c1784448b82db3bb4
Depends-On: I23a26ba0dfbe83007cd40e97d71a2139a5ecddc7
Depends-On: Ibc013a41f4a463f4014fbbce7ce27f8690161728
Depends-On: Ie936dff918dc0869503a924298b4580402038b52
2018-02-01 14:26:03 -08:00
Brad Jorsch
d511626236
Add 'unwrap' ParserOutput post-cache transform
And deprecate passing false for ParserOptions::setWrapOutputClass().

There are three cases for the Parser wrapper: the default
mw-parser-output, a custom wrapper, or no wrapper. As things currently
stand, we have to fragment the parser cache on each of these options,
which uses a nontrival amount of storage space (T167784).

Ideally we'd do all the wrapping as a post-cache transform, but
TemplateStyles needs to know the wrapper in use in order to properly
prefix its CSS rules (that's why we added the wrapper in the first
place). So, second best option is to make *un*wrapping be a post-cache
transform and make "custom wrapper" be uncacheable.

This patch does the first bit (unwrapping as a post-cache transform),
and a followup will do the second part once the deprecation process is
satisfied.

Bug: T181846
Change-Id: Iba16e78c41be992467101e7d83e9c3134765b101
2018-02-01 14:24:27 -08:00