Commit graph

8080 commits

Author SHA1 Message Date
daniel
00a3439dce Introduce RevisionOutputCache
Bug: T267981
Change-Id: Ib1dc641ed10d786918362b25bd655780d5844ba1
2020-12-14 16:50:28 +00:00
Umherirrender
b64d838062 Skip undo related phpunit tests when diff3 is missing
Change-Id: I7fcbcfcd191805c00bdac07f681d266fe3e1fccb
2020-12-12 20:22:17 +00:00
jenkins-bot
35987b5cf2 Merge "[FileTest] Do not assume /tmp exists on windows" 2020-12-12 20:06:17 +00:00
Umherirrender
8f80236a6f [FileTest] Do not assume /tmp exists on windows
Needs to be a real path, not relative one

6) FileTest::testGetThumbnailSource with data set #2 (array(true,
array('/tmp'), 1024, 2048, '/tmp', 'Temporary path because temp f...
found'))
Temporary path because temp file was found
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/tmp'
+'fsFilePath'

The file_exists in File::getThumbnailSource gets the path '/tmp' and
that does not exists on windows, because it is relative to one of the
core folder

Change-Id: I8618c8b34261451da42f88360a9d65353960e91f
2020-12-12 14:56:12 +00:00
Matěj Suchánek
4633339894 Compute experience level correctly for accounts without registration date
These accounts are usually very old and User::getRegistration returns
null for them because user_registration is null. Treat these accounts
as old enough to be in the most experienced group and only decide
on edit count. Fix queries in recent changes to avoid comparisons
with nulls as well.

Also improve documentation of User::getExperienceLevel.

Change-Id: I6090cf9b9097069469e8e547b217f0d16f0fe372
2020-12-12 13:07:20 +01:00
jenkins-bot
f49e8f4f56 Merge "Clean up temp files correctly after unit tests" 2020-12-12 10:33:19 +00:00
jenkins-bot
355c5782ab Merge "Add dependency injection to RevDelList classes" 2020-12-11 22:11:28 +00:00
jenkins-bot
339f945940 Merge "Make ParserCache use CachedBagOStuff" 2020-12-11 21:58:29 +00:00
DannyS712
649d20f6be Add dependency injection to RevDelList classes
Bug: T268713
Change-Id: I9ee516f4aa35e493a630299e8ba2c60edd4f06ba
2020-12-11 21:43:23 +00:00
jenkins-bot
8a53d3c2df Merge "objectcache: make BagOStuff key encoding more consistent" 2020-12-11 20:35:23 +00:00
Arlo Breault
a6c769e976 Share Parsoid's media styling with content
Since the legacy parser will also be emitting the new media structure
that requires these styles.  For now, the feature is only shipped by
default when $wgUseNewMediaStructure is enabled.

Bug: T51097
Bug: T266148
Change-Id: Id20d716ce145e0bae37621fd6e218a793b5332ae
2020-12-11 11:47:00 -05:00
jenkins-bot
aee4106d9b Merge "Special:Search find variant links before showing the create page link" 2020-12-10 16:54:59 +00:00
David Causse
95db1c18ee Special:Search find variant links before showing the create page link
On a multi–writing system wiki it may happen that Special:Search
show the create page link on a "blue link".
Rely on LanguageConverter::findVariantLink() to find such link.

Bug: T260957
Change-Id: Ic95188543a2aa88764882a7789e4c3a99fd5c3cc
2020-12-09 13:19:09 +01:00
Petr Pchelko
7cf60852fa Article::view - remove the old subtitle from doOutputFromParserCache.
The method is called from two places:
- For new revision ParserCache, when the subtitle doesn't need
to be applied. That call is protected by !oldid check
- For old revision cache, when subtitle is already applied before
checking the cache. So, no need to set it.

Bug: T269727
Change-Id: Ibec845ccfe43ae2cb4bbe0152c932cb74f3cef4b
2020-12-08 21:52:11 -06:00
jenkins-bot
cde402a10d Merge "build: Updating mediawiki/mediawiki-codesniffer to 34.0.0" 2020-12-07 16:40:54 +00:00
Petr Pchelko
66cc685b45 Make ParserCache use CachedBagOStuff
Bug: T269593
Change-Id: I21e6e39eccad22b781252b142c1e5b079c1ee0b4
2020-12-07 10:28:30 -06:00
Umherirrender
2579ca623a build: Updating mediawiki/mediawiki-codesniffer to 34.0.0
Change-Id: I2fb18ddd4c144655a665792901e59f88bcd906dc
2020-12-07 14:55:24 +01:00
Umherirrender
a04a649580 [UploadedFileStreamTest] Skip test with chmod
Change-Id: I361392cc139db1cf3ca071ec558f85594bdb49bc
2020-12-06 10:59:17 +00:00
Reedy
76249a28d2 Validate max length of bp_restrictions and bp_grants
Bug: T260631
Bug: T260633
Change-Id: Ifc35e01c711f1394f45748f693e7a46695b2d471
2020-12-05 02:10:01 +00:00
Aaron Schulz
5c335f9d77 objectcache: make BagOStuff key encoding more consistent
Add "generic" key methods for quickly deriving keys from
key component lists in a bijective manor. This is useful
for BagOStuff classes that wrap other BagOStuff instances
or for parsing keys to get stats.

Make the proxy BagOStuff classes (ReplicatedBagOStuff,
MultiWriteBagOStuff, CachedBagOStuff) use "generic" keys
so that they can convert to appropriate keys when making
backing cache instance method calls.

Make EmptyBagOStuff, HashBagOStuff, APCUBagOStuff,
RedisBagOStuff, and RESTBagOStuff use "generic" keys rather
than those of MediumSpecificBagOStuff::makeKeyInternal().
This lets proxy BagOStuff classes bypass key conversions
when used with instances of these classes as backing stores.

Also:
* Fix missing incr(), incrWithInit(), and decr() return
  values in MultiWriteBagOStuff.
* Make MultiWriteBagOfStuff, ReplicatedBagOStuff, and
  CachedBagOStuff use similar backend method forwarding
  styles by using a new BagOStuff method.
* Improved various related bits of documentation.

Bug: T250239
Bug: T235705
Change-Id: I1eb897c2cea3f5b756dd1e3c457b7cbd817599f5
2020-12-02 20:20:42 -08:00
jenkins-bot
e2c4b32c58 Merge "Make ParserCache respect ParserOptions::isSafeToCache" 2020-12-02 20:31:58 +00:00
Petr Pchelko
4417b13d58 Make ParserCache respect ParserOptions::isSafeToCache
Bug: T269154
Change-Id: I8e9ecd2787aa8d172e708ba64ea936e63fbc6b36
2020-12-02 14:02:36 -06:00
jenkins-bot
8431b39335 Merge "Flip $wgParserCacheUseJson default" 2020-12-02 19:45:00 +00:00
jenkins-bot
0f55a111b4 Merge "Inject WikiPageFactory into SpecialMyLanguage" 2020-12-01 16:04:01 +00:00
jenkins-bot
33737fb7f6 Merge "Use the old HookContainer to set up the post-reset services" 2020-12-01 10:23:10 +00:00
Tim Starling
c8f51d1fb7 Use the old HookContainer to set up the post-reset services
HookContainer::salvage() expects to be called immediately after the
object is constructed, and I enforced this expectation by asserting that
$this->handlersByName is empty.

However, MediaWikiServices::resetGlobalInstance() calls
HookContainer::run() in between construction and salvage(). The effect
is that the assertion is hit if any hooks were executed using the old
HookContainer.

So, call onMediaWikiServices() using the old pre-reset HookContainer,
instead of using a partially-constructed HookContainer for this purpose.
Pass the new MediaWikiServices instance as the argument, since that is
the thing that the hook is configuring.

Bug: T263925
Change-Id: I2b462d82c82314b11563a5ba1f02c6fb6d29e608
2020-12-01 13:04:12 +11:00
Petr Pchelko
d45b16eeed Flip $wgParserCacheUseJson default
Bug: T263579
Change-Id: I56d43ac67f916c31db5a5d70e6be3e2484bc9b90
2020-11-30 15:11:08 -06:00
daniel
2c7ba6f62b PoolWorkArticleViewOld: use WANObjectCache
Use WANObjectCache instead of the local cluster object cache.

Bug: T268278
Change-Id: Ic16feffecaf4b75c284c6ef34de42ac113e625f8
2020-11-30 16:38:56 +00:00
Reedy
deb55049ae CollationTest: Stop checking for intl being loaded
Bug: T267669
Change-Id: I4ee41ebe09eac7864bb5b64d36ad6efb7f990b3b
2020-11-29 00:22:40 +00:00
jenkins-bot
bc0633d41c Merge "Check for Title::canHaveTalkPage in User::addWatch" 2020-11-28 07:49:38 +00:00
jenkins-bot
970cf8fc15 Merge "Implement FauxRequest::getPostValues()" 2020-11-28 00:19:56 +00:00
Lucas Werkmeister
5639786d3e Implement FauxRequest::getPostValues()
Change-Id: I709834c82f06e1da00df7667bd8bcc72a3d263a4
2020-11-27 09:38:08 +01:00
jenkins-bot
4641b20bdb Merge "Chain MutableRevisionRecord method calls 2" 2020-11-27 08:36:31 +00:00
Ammar Abdulhamid
71571191d4 Chain MutableRevisionRecord method calls 2
Change-Id: I86578cfbc892f171a4e433283b86d1b78fe4167d
2020-11-27 05:26:54 +01:00
jenkins-bot
7fe85a6781 Merge "tests: Fix method signature mismatches" 2020-11-26 19:47:48 +00:00
Máté Szabó
aa847d5369 tests: Fix queryFlags parameter type in RevisionStoreDbTestBase
RevisionStoreDbTestBase is mistakenly passing an array instead of an integer as
a query flags parameter in many places, which eventually gets passed to
DBAccessObjectUtils that uses it with a bitwise operator. PHP < 8 handles this
silently, but PHP >= 8 throws "TypeError: Unsupported operand types: array &
int" here.

Bug: T248925
Change-Id: I4e29b2709fe5e6d583727d45e005b3f16a1e3f4d
2020-11-26 19:39:34 +01:00
Máté Szabó
40d50dd2fc tests: Fix method signature mismatches
These cause fatals on PHP 8.

Bug: T248925
Change-Id: Ifc8536e99f4676180d47df483e55c89e9f834c32
2020-11-26 19:02:57 +01:00
jenkins-bot
71f311facb Merge "Replace $wgDisable{Lang,Title}Conversion with LanguageConverterFactory methods" 2020-11-25 20:31:56 +00:00
jenkins-bot
e48c564a7a Merge "Inject LanguageConverterFactory into special pages" 2020-11-25 18:45:09 +00:00
C. Scott Ananian
c64e71615e Replace $wgDisable{Lang,Title}Conversion with LanguageConverterFactory methods
Replace direct access to $wgDisableLangConversion with
LanguageConverterFactory::isConversionDisabled(), and replace direct
access to $wgDisableTitleConversion with
LanguageConverterFactory::isTitleConversionDisabled().  However, most
places that check ::isTitleConversionDisabled() actually want
::isLinkConversionDisabled(), so add that too (and deprecate
isTitleConversionDisabled()).

Code search:
https://codesearch.wmcloud.org/search/?q=Disable%28Lang|Title%29Conversion&i=nope&files=&repos=

This change removes a number of spurious dependencies on the global
configuration and reduces code duplication (for example, if the logic
for disabling language conversion were ever to change).

Depends-On: I6fa8230ae97b0e34c381003548e61f9b7387d363
Change-Id: Icc4687638ff1815003dd903854efdbd904854f1e
2020-11-25 12:47:26 -05:00
Umherirrender
d5c868386e Inject LanguageConverterFactory into special pages
The function SpecialPage::getLanguageConverter does not use service
injection and it seems not useful to inject the factory into every
special page when not used on each special page or used from code
directly in the SpecialPage class.

Bug: T259960
Depends-On: I550f2db0c652193755ad4ad04cececad00be72ea
Change-Id: I11e5d67b7051c159b8d32bf056a0e24aa3b526ae
2020-11-25 18:39:57 +01:00
jenkins-bot
490e887c3c Merge "Inject services into SpecialRecentChanges/SpecialRecentChangesLinked" 2020-11-25 17:20:00 +00:00
Umherirrender
fc794afe9a Inject services into SpecialRecentChanges/SpecialRecentChangesLinked
This covers only directly used services by this special page and pager
Services used by the base class are not part of this patch set

Bug: T259960
Depends-On: I62855be191ea87bdc5157b6ab879c47815644156
Change-Id: I730ce17548fad3e35e8d8b6730eb3aafd734eac9
2020-11-25 08:53:46 -08:00
Timo Tijhof
af52ed44fd resourceloader: Fix malformed "https:/w/resources" mapping in CSSMin
Follows-up cd54c03e86, in which I forgot a call to setScheme()
in the `isServerLess` branch.

For "server-less" URLs, we mock both schema and host, but only
strip the host. This left something I did not think was allowed
in the Net_URL2 class, which is to produce a URL that has a full
protocol and scheme, no host, and then a full path.

Moreoever, not only is this allowed by the Net_URL2 class in PHP,
modern browsers Firefox and Chrome also actually support this
and interpret it as a "domain relative" (?) URL.

Bug: T268308
Change-Id: I26ed3e5e9a6922badd979bbe6f5588e319ec3ebb
2020-11-25 00:38:53 +00:00
jenkins-bot
48e2e75f29 Merge "Add ChangeTags::getTagsWithData" 2020-11-25 00:07:42 +00:00
jenkins-bot
a27e2f17c2 Merge "Inject services into SpecialWatchlist/SpecialEditWatchlist" 2020-11-24 19:16:53 +00:00
jenkins-bot
c3bc6cf768 Merge "Inject services into SpecialContributions/SpecialDeletedContributions" 2020-11-24 18:52:57 +00:00
Umherirrender
7f03231ace Inject services into SpecialContributions/SpecialDeletedContributions
This covers only directly used services by this special page and pager
Services used by the base class are not part of this patch set

Have to change another service to avoid global state

Bug: T259960
Depends-On: I07203e22f4b254df5c8cd6180d915a1537b7de30
Change-Id: Ifed2cbd2eee7166daf2e7d9bab017786247f88f6
2020-11-24 17:18:40 +00:00
jenkins-bot
3769fe943f Merge "Remove deprecated wfMemcKey() function" 2020-11-24 16:53:37 +00:00
jenkins-bot
dfd523d7c2 Merge "Deprecate the use of Skin::setupSkinUserCss to alter the internal array of styles" 2020-11-24 05:11:32 +00:00