Commit graph

14052 commits

Author SHA1 Message Date
jenkins-bot
7c92610ada Merge "Fix some typos" 2023-03-23 12:20:11 +00:00
jenkins-bot
f0bf3ddc51 Merge "Make LanguageNameUtils more lenient with input" 2023-03-23 05:21:00 +00:00
Umherirrender
5e8665f67e title: Use Title::makeName instead of ::getFullText in ::isValid
In getFulltext the namespace number is converted to text, for NS_USER
this trigger the gender cache. Use canonical namespace instead.

When Title::canExist is called to fill a LinkBatch (Like done for
Special:Log/block via BlockLogFormatter::getPreloadTitles),
the effect of the batch lookup is not the best, because GenderCache
filled with single database queries instead.

This is similar to the usage of makeName in Title::makeTitleSafe

Handle invalid namespace numbers in Title::makeName the same as in
Title::prefix

Change-Id: Ibbdc7e0762568bb29ae59764c3666f275d201c6c
2023-03-23 04:34:27 +00:00
jenkins-bot
43c842074e Merge "Allow a temp username pattern to be reserved without activating the system" 2023-03-23 02:26:51 +00:00
jenkins-bot
42b9f46c14 Merge "profiler: Add ProfilingContext class" 2023-03-23 00:23:58 +00:00
Aaron Schulz
29bab859fc profiler: Add ProfilingContext class
Use this class to track the entry point and handler used for requests,
making it available for use in profiling, stats, and logging code.

This makes it possible for periodic and/or shutdown profiling callbacks
to know the basic action handler that applies to the request (if any).
Metric names can easily include this string along with MW_ENTRY_POINT
to create per-action profiling dashboards.

This info cannot otherwise be acquired from things like excimer stack
traces since the router and handler classes do not appear in the stack
during PRESEND deferred updates and variations like ApiMain/SpecialPage
"inclusion mode" would have to be detected somehow.

Bug: T330810
Change-Id: Icca5a7a343faeeb18652994c96752acb61a61fd1
2023-03-23 00:08:49 +00:00
Bartosz Dziewoński
1e86517db5 Remove deprecated pager methods/classes
Deprecated in MW 1.39:
* Ic75bd597b210e14612ca3aebb531b659897e8294
* I4e2f36b543462aa5d852733da650fb70d49ebf06

Hard-deprecated in MW 1.40:
* I09e9203b19e3808af9348db8a889d5e118282230

Change-Id: I17bd8f80e87a04674e826d7966aa3ddb011fc7ba
2023-03-22 15:23:56 +00:00
jenkins-bot
cab3c4cd86 Merge "phpunit: Lower report limit to 10 slowest tests" 2023-03-22 05:00:28 +00:00
jenkins-bot
cb12de8a51 Merge "specials: Make Special:Mute only usable for named users" 2023-03-21 19:30:07 +00:00
Matěj Suchánek
c231736471 Fix some typos
Bug: T201491
Change-Id: I5c9408c262f09c936525f35abfacfa92a193b791
2023-03-21 15:58:09 +01:00
jenkins-bot
29d4996254 Merge "TempFSFile: Keep the WeakMap alive" 2023-03-20 12:47:25 +00:00
jenkins-bot
3682678f08 Merge "phpunit: Reduce some complexity in MediaWikiIntegrationTestCase" 2023-03-18 14:51:16 +00:00
jenkins-bot
63f6100b45 Merge "languages: Enforce namespace and special page aliases without spaces" 2023-03-18 13:27:28 +00:00
Tim Starling
7775a3f7b7 TempFSFile: Keep the WeakMap alive
If you store a WeakMap in the object, containing only circular
references in the values, then nothing is keeping the WeakMap alive and
it can be deleted along with its parent TempFSFile by the garbage
collector.

A WeakMap contains normal references to its values, so those normal
references can be marked by the GC like any other references.

Instead, store the WeakMap as a static property.

Bug: T332461
Bug: T332397
Change-Id: Idbaa1019c2bac3d1dd9b001753c2f4c0aaf66e98
2023-03-18 14:20:13 +11:00
jenkins-bot
be360107e1 Merge "Namespace SpecialA* under \MediaWiki\Specials" 2023-03-18 01:22:52 +00:00
Timo Tijhof
beb26ce722 phpunit: Reduce some complexity in MediaWikiIntegrationTestCase
Make it more obviously correct and straight forward, as you want
as little doubt and confusion as possible when debugging a test.
Doubt and confusion from our source code is... enough to make ones
day interesting.

Change-Id: I440be81d4ee7c505c0f2c11af7edaf513b8ff2d7
2023-03-17 23:48:42 +00:00
jenkins-bot
3855dbec47 Merge "phpunit: Check if composer dependencies are up-to-date" 2023-03-17 23:03:33 +00:00
James D. Forrester
d933d5fcfa Namespace SpecialA* under \MediaWiki\Specials
So begins a series of patches. :-)

Change-Id: I88cb6304e2d1d2e59bd316b6fc181ab7f323e707
2023-03-17 17:42:39 -04:00
Umherirrender
4e7f4c353d languages: Enforce namespace and special page aliases without spaces
Enforce underscores as used by the most languages in the namespace
aliases and special page aliases

Change-Id: I53d895f4b1d241954bd31973ad4996beed91bfb2
2023-03-17 20:57:43 +01:00
jenkins-bot
49778715fc Merge "api: Add watch option for userpage to action=unblock" 2023-03-17 17:37:23 +00:00
jenkins-bot
2d5c55e85a Merge "specials: Add watch option for userpage to Special:Unblock" 2023-03-17 16:17:28 +00:00
Tim Starling
f600d07ec4 Fix tests that fail when $wgUsePigLatinVariant = false
* ParserTestRunner: LocalisationCache needs to be reset since it has a
  reference to LanguageNameUtils which has a copy of
  $wgUsePigLatinVariant. Also factor out some
  MediaWikiServices::getInstance() calls.
* In some other tests, set the variable.

Change-Id: I6c1e9bfad9790cf805809c28a3f8d45952cbb981
2023-03-17 19:56:32 +11:00
jenkins-bot
be451aa5cb Merge "Make messages about editing site code more prominent" 2023-03-16 20:32:44 +00:00
Jon Robson
599a2d796c Make messages about editing site code more prominent
It should be clearer that these pages have special capabilities
than it is currently.

Bug: T311891
Change-Id: Id2114a65635c050a2017926274622f0a3c2d58d6
2023-03-16 19:07:29 +00:00
jenkins-bot
5e91790921 Merge "mediawiki.skin.defaults.less: Add neutral values for all Codex tokens" 2023-03-16 11:28:10 +00:00
Roan Kattouw
e274ef9e55 mediawiki.skin.defaults.less: Add neutral values for all Codex tokens
Skins can choose to provide these values using Codex tokens by importing
one of the Codex themes in their mediawiki.skin.variables.less. To
guarantee that the variables corresponding to Codex tokens always exist,
provide neutral fallback values for all of them in
mediawiki.skin.defaults.less.

To ensure that mediawiki.skin.defaults.less doesn't get out of sync with
Codex when new tokens are added, add a structure test that verifies that
every Codex token has a corresponding default variable. This isn't an
ideal system, and we'll be able to handle this better once Codex has a
real theme system (T286689) and we can upstream this set of neutral
values into Codex itself.

For now, keep (almost) all existing variables' values the same. This
means overriding some of the values from Codex. We should consider whether
some of these should be changed in a follow-up patch. The only values
changed in this patch are:
- @max-width-breakpoint-tablet from calc(719px) to 719px (no visual
  impact; but we should consider changing this to 1119px which is what
  it is in Codex)

Bug: T325237
Change-Id: I04f9e48a1cf9dee915cf51e1e12b17ff0a595a06
2023-03-15 17:23:51 -07:00
jenkins-bot
2eb71612a2 Merge "Hard-deprecate deprecated pager methods/classes" 2023-03-15 21:13:05 +00:00
jenkins-bot
2409ab8f13 Merge "A fake MessageLocalizer for use in unit tests" 2023-03-15 19:05:40 +00:00
Michael Große
966ea3ad1a A fake MessageLocalizer for use in unit tests
The existing MockMessageLocalizer can't be used in unit tests because it
uses real Message objects that make a number of database calls via
services.

Codewise, this is based on \ListToggleTest::testGetHTML and
\EntitySchema\MediaWiki\SpecificLanguageMessageLocalizer.
It came out from the conversation on I4122bc8b2

Change-Id: I5297e4c43495b7e959798a21929f6d24d0b4b466
2023-03-15 17:55:51 +01:00
Bartosz Dziewoński
f8367c8c98 Hard-deprecate deprecated pager methods/classes
Deprecated in MW 1.39 in commits:
* Ic75bd597b210e14612ca3aebb531b659897e8294
* I4e2f36b543462aa5d852733da650fb70d49ebf06

Depends-On: I8b3adfe907ae16279ec3d480b7eedec5901884f2
Depends-On: I376361bc86a6085fe94a5439b04239ab123a515c
Change-Id: I09e9203b19e3808af9348db8a889d5e118282230
2023-03-15 16:45:59 +01:00
jenkins-bot
e9fd5b097d Merge "SiteConfig: Get rid of of Cite-specific method" 2023-03-15 15:31:16 +00:00
jenkins-bot
20604e64fb Merge "MaintenanceRunner: keep track of script class explicitly." 2023-03-15 15:31:08 +00:00
daniel
3e7b16aff3 MaintenanceRunner: keep track of script class explicitly.
Reduce potential for confusion between file names and class names in
MaintenanceRunner.

Change-Id: I8be566925beced6ef6f1075e430d6afc38dbae6b
2023-03-15 15:43:09 +01:00
jenkins-bot
c2786d8824 Merge "tests: Allow $subPage to be null" 2023-03-14 22:35:31 +00:00
Tim Starling
b39f13975c Allow a temp username pattern to be reserved without activating the system
Split concepts of "match pattern" and "reserved pattern". Add config
"reservedPattern" which specifies a username pattern to be denied for
creation, but unlike matchPattern, it does not immediately flag all
accounts with such names as temp accounts. This can be used before
migration or after rollback to safely prevent creation of conflicting
accounts.

* Add TempUserConfig::isTempName(), which does what isReservedName()
  previously did, i.e. determines if a name is a temp username.
* Make TempUserConfig::isReservedName() return true if the name matches
  either the match pattern or the reserved pattern.
* UserNameUtils::isTemp() continues to determine whether a username is
  actually a temp username.
* Add UserNameUtils::isTempReserved() as a proxy for
  TempUserConfig::isReservedName()

Bug: T307064
Change-Id: I26755731fad89530a06824181106cd7b4e077d9e
2023-03-15 09:02:20 +11:00
Subramanya Sastry
580d3a3d76 SiteConfig: Get rid of of Cite-specific method
Bug: T268777
Depends-On: Ie6bc2c1cef2aca3166a8af6921cad29ebb8ef3a2
Change-Id: I0c01f62a4f290862d91436eca1baa0f5ee1af5fc
2023-03-14 10:21:38 -05:00
jenkins-bot
59deac9ea8 Merge "ParsoidHandlerTest: check no etag is emitted perdefault" 2023-03-14 14:23:43 +00:00
jenkins-bot
8edb7ceae2 Merge "MaintenanceRunner: load script file early if possible" 2023-03-14 14:10:54 +00:00
daniel
4f2f40f6a0 ParsoidHandlerTest: check no etag is emitted perdefault
The page/html endpoint should only return an ETag if stashing was
requested. Otherwise, the ETag is meaningless.

Bug: T331629
Change-Id: I55d7c5e33ef7275695ee93e2937da1a998e2eda3
2023-03-14 14:05:16 +00:00
Kevin Israel
63e07eed60 MaintenanceRunner: load script file early if possible
If possible, load the script file before running Setup.php. This way,
script files can control the setup process by defining constants. This
is needed by scome scripts, namely:
- instal.php, to override config loading by defining MW_CONFIG_CALLBACK
- generateConfigSchema.php, for setting MW_USE_CONFIG_SCHEMA_CLASS
- mergeMessageFileList.php, for setting MW_NO_EXTENSION_MESSAGES
- shell.php, for setting MW_NO_SESSION

Note that this will not work for scripts defined in extensions.

In order to allow script files to be loaded based on class name,
AutoLoader.php is included before Setup.php is run.

This is a modified version of I638f99c3cc6f8ab8216bd65ada959a6a11ff454b.

Co-authored-by: PleaseStand <pleasestand@live.com>
Change-Id: I2bf3b91c0a7162413cd1392252cb4f29a0d3d594
2023-03-14 10:18:29 +01:00
jenkins-bot
c54ce6a4e2 Merge "cache: simplify LinkCache good/bad link handling" 2023-03-14 02:39:43 +00:00
Aaron Schulz
1af3c45405 cache: simplify LinkCache good/bad link handling
Combine the good/bad MapCacheLRU instances and use class constants
for row/flag keys of entry arrays. Treat query flags the same way
for missing/existing link entries.

Discourage the use of READ_LATEST via code comments.

Simplify fetchPageRow() given that page_touched is already part
of getSelectFields().

Avoid method call overhead for getGoodLinkFieldObj() type casting.

Create getPersistentCacheKey() method to avoid duplication.

Change-Id: I8701466650fd4988de2fa5aba02d64eac7bd6c1a
2023-03-14 02:20:48 +00:00
Tim Starling
e8bbca2690 Renameuser: Also rename user talk pages
Fix regression from Iaefdcec05ea2a858066b43b

Change-Id: I637067de3874f86e7682753afe304fe4947841f6
2023-03-14 13:00:12 +11:00
jenkins-bot
5434c71393 Merge "Use Bcp47Code when interfacing with Parsoid" 2023-03-13 19:11:03 +00:00
jenkins-bot
ec7d4deb5f Merge "TransformHandler: Load stashed page bundle based on ETag." 2023-03-13 18:39:16 +00:00
jenkins-bot
d1300d649e Merge "Revert "Revert "TransformHandler: Load stashed page bundle based on ETag.""" 2023-03-13 18:38:43 +00:00
daniel
74d6e57e6a TransformHandler: Load stashed page bundle based on ETag.
Allow clients to use an If-Match header with the
transform/html/to/wikitext endpoint.

This follows up on Ida81a314f015e205f2081c68a82d486145097c92
(reverted and reapplied)
It adds support for stashing in wt2html, enabling it for Parsoid's
page/html endpoint. It also ensures we are only emitting ETags if
stashing is enabled.

This also removes handling for use-stash from ParsoidHandler,
which did nothing.

Bug: T310464
Bug: T331629
Needed-By: I08f1388faaccef6c1d9a393f8011011d30a25ec7
Change-Id: I9d6eaf45d5b4978afc17493720777e77f0e645b2
2023-03-13 18:18:03 +00:00
C. Scott Ananian
5ad8dea80a Use Bcp47Code when interfacing with Parsoid
It is very easy for developers and maintainers to mix up "internal
MediaWiki language codes" and "BCP-47 language codes"; the latter are
standards-compliant and used in web protocols like HTTP, HTML, and
SVG; but much of WMF production is very dependent on historical codes
used by MediaWiki which in some cases predate the IANA standardized
name for the language in question.

Phan and other static checking tools aren't much help distinguishing
BCP-47 from internal codes when both are represented with the PHP
string type, so the wikimedia/bcp-47-code package introduced a very
lightweight wrapper type in order to uniquely identify BCP-47 codes.
Language implements Bcp47Code, and LanguageFactory::getLanguage() is
an easy way to convert (or downcast) between Bcp47Code and Language
objects.

This patch updates the Parsoid integration code and the associated
REST handlers to use Bcp47Code in APIs so that the standalone Parsoid
library does not need to know anything about MediaWiki-internal codes.
The principle has been, first, to try to convert a string to a
Bcp47Code as soon as possible and as close to the original input as
possible, so it is easy to see *why* a given string is a BCP-47 code
(usually, because it is coming from HTTP/HTML/etc) and we're not stuck
deep inside some method trying to figure out where a string we're
given is coming from and therefore what sort of string code it might
be.  Second, we've added explicit compatibility code to accept
MediaWiki internal codes and convert them to Bcp47Code for backward
compatibility with existing clients, using the @internal
LanguageCode::normalizeNonstandardCodeAndWarn() method.  The intention
is to gradually remove these backward compatibility thunks and replace
them with HTTP 400 errors or wfDeprecated messages in order to
identify and repair callers who are incorrectly using
non-standard-compliant language codes in web standards
(HTTP/HTML/SVG/etc).

Finally, maintaining a code as a Bcp47Code and not immediately
converting to Language helps us delay or even avoid full loading of a
Language object in some cases, which is another reason to occasionally
push Bcp47Code (instead of Language) down the call stack.

Bug: T327379
Depends-On: I830867d58f8962d6a57be16ce3735e8384f9ac1c
Change-Id: I982e0df706a633b05dcc02b5220b737c19adc401
2023-03-13 13:25:09 -04:00
jenkins-bot
4e2d0f1fe5 Merge "Preserve non-PageBundle metadata set by Parsoid" 2023-03-13 17:14:50 +00:00
C. Scott Ananian
bce63d1912 Preserve non-PageBundle metadata set by Parsoid
The Parsoid entrypoints should always have a "real" ParserOutput
passed as the ContentMetadataCollector object, so that recursive
invocations of extensions, etc, can set appropriate metadata
properties in the ParserOutput.

This is part of a belt-and-suspenders fix for T331084, where a
StubMetadataCollector is being used in production -- production should
never use a stub, it should always use a real ParserOutput object.
The other fix for T331084 is
I30ea2bb24e6c9b0950a8f46dc8e5b9bf5ee3378b, which ensures that if you
*were* to use a StubMetadataCollector in production, it wouldn't throw
an error when a numeric category string was encountered.

Bug: T331084
Change-Id: I8711a51fc1bcac48eae92ab1ba15a33fe05937ed
2023-03-13 11:24:57 -04:00
jenkins-bot
6de76f1fad Merge "Add ParserOutput::getLanguage()" 2023-03-13 14:18:47 +00:00
jenkins-bot
3f8cd1f3f4 Merge "Allow marking recent changes about logged actions with bot flag" 2023-03-13 08:48:07 +00:00
jenkins-bot
6e915707fe Merge "Renameuser: tweaks and followups" 2023-03-13 08:19:39 +00:00
Aaron Schulz
65aa3c0a3e rdbms: various fixes to LoadBalancer::reconfigure
Use server names to handle the case where server indexes get
shifted around due to the depooling or provisioning of a server.

Previously, loads could be assigned to a wrong server, assigned
to a server that was depooled, or assigned to a server that is
to new to appear in the current "servers" array. This would mean
that getReaderIndex() or getLagTimes() could trigger exceptions.

Only change loads for depooled servers. Update the loads of other
servers to the current loads only makes sense in the context of
using all the current servers. This does not apply to reconfigure()
since it does not see newly pooled servers (for simplicity).

Handle servers depooled only from custom query groups.

Bug: T322156
Change-Id: I9f710aa32f5d5b74796bb80a8426a5f653b8e4d3
2023-03-13 14:23:04 +11:00
Matěj Suchánek
94d080d305 Allow marking recent changes about logged actions with bot flag
There was no clean way to do this but using the global state.

The parameter is three-state to keep backward compatibility.

Bug: T304428
Change-Id: I01c5f8e9646cbe861516100c3b8d165aefb95ca0
2023-03-13 01:59:35 +01:00
Tim Starling
9e534bd0d8 Renameuser: tweaks and followups
* Use IConnectionProvider
* Inject services into the job
* Use JobSpecification to avoid unnecessary service construction

Bug: T27482
Change-Id: I75ac8c53b874742a3a54526692767d0f549e5259
2023-03-13 09:20:53 +11:00
jenkins-bot
bd5cccf7c4 Merge "Deprecate ParserOutput::{get,set}TOCHTML()" 2023-03-12 21:41:20 +00:00
libraryupgrader
7375f3a5fe build: Updating mediawiki/mediawiki-codesniffer to 41.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Usage.ForbiddenFunctions.eval

Change-Id: I6fd0a9296c88a77c3abec6e5e8d568bb469c2d6e
2023-03-11 19:04:09 +00:00
C. Scott Ananian
29853113f7 Deprecate ParserOutput::{get,set}TOCHTML()
No uses in deployed code outside mediawiki-core:

 https://codesearch.wmcloud.org/deployed/?q=%5Bgs%5DetTOCHTML%5C%28&i=nope&files=&excludeFiles=&repos=

Bug: T293513
Change-Id: I3fd82150ac581afbeb94f401672702063586fff0
2023-03-10 20:34:33 -05:00
C. Scott Ananian
183a6da420 Add ParserOutput::getLanguage()
Provide a way for backend code to determine the primary language of a
ParserOutput, eg for setting the Content-Language header of an API
response.

This is read-only and backed by extension data at the moment for
transition purposes; if this API sticks we'll graduate it to a
"real" property in the future, with appropriate serialization
to/from JSON (T303329).

Similarly, this patch only includes the most basic code to handle
the various ParserOutput merge cases in
ParserOutput::merge{Internal,Html,Tracking}MetaDataFrom(),
ParserOutput::collectMetadata(), and
OutputPage::addParserOutput{Content,Metadata,Text,}(); mostly
inherited from the fact that the storage is backed by extension
data at the moment.

Generally only the "top-level" parser output gets to set the
primary language; we'll presumably need to ensure that the
language is consistent during merge.

Change-Id: I767daba22805a877d9b806fd77334e508902844b
2023-03-10 18:42:29 -05:00
jenkins-bot
cadc2c3b1c Merge "objectcache: remove deprecate BagOStuff::incr() method" 2023-03-10 22:23:31 +00:00
jenkins-bot
c465c44d52 Merge "objectcache: remove deprecate BagOStuff::decr() method" 2023-03-10 22:21:12 +00:00
jenkins-bot
927a17faf8 Merge "Stats: add copy to statsd feature" 2023-03-10 21:48:18 +00:00
Aaron Schulz
a1cb96ee19 objectcache: remove deprecate BagOStuff::incr() method
Change-Id: I107c04e05585c975dc37ce402746a4671f2f43b5
2023-03-10 13:31:34 -08:00
Aaron Schulz
7fe2000005 objectcache: remove deprecate BagOStuff::decr() method
Change-Id: I8284289f3d37c763eabdecba9b8d0c4beed4e5de
2023-03-10 13:07:20 -08:00
Subramanya Sastry
071d368495 Revert "Revert "TransformHandler: Load stashed page bundle based on ETag.""
This reverts commit c4f40bd107.

Change-Id: Iff0f9859a83506059f100ddd60b74cfdd1279071
2023-03-10 13:44:46 -06:00
jenkins-bot
2e6f8c18e6 Merge "Language: Hard-deprecate Language::factory/getParentLanguage" 2023-03-10 17:03:37 +00:00
jenkins-bot
92bafcb73e Merge "Hard-deprecate manual construction of LinkBatch objects" 2023-03-10 17:00:06 +00:00
jenkins-bot
9213528d05 Merge "Remove deprecated Language::commafy and mw.language.commafy" 2023-03-10 16:56:06 +00:00
Fomafix
7f4e9bfa39 Remove deprecated Language::commafy and mw.language.commafy
Language::commafy and mw.language.commafy have been deprecated in
4bc5c761 included in MW 1.36.

Bug: T331708
Change-Id: I874c2c904fa4a7f04486113d1d92709c21d1f5bb
2023-03-10 15:16:06 +00:00
jenkins-bot
96255d911e Merge "Treat $wgHooks as a regular setting" 2023-03-10 14:14:07 +00:00
jenkins-bot
2463955d5c Merge "Tests: treat wgHooks like a regular config variable." 2023-03-10 14:14:00 +00:00
Tim Starling
f71096084f Renameuser: refactoring round 2
* Split up SpecialRenameuser::execute() into several smaller methods
* Some style and consistency tweaks: camel case variable names etc.
* Use $oldName instead of $oldTitle->getText() -- the title was
  created without validation, so these are definitely the same.
* Use conversion to boolean instead of is_object().
* Don't bother calling UserNameUtils::isCreatable(). We already asked
  for RIGOR_CREATABLE in newFromName which causes a call to the same
  method. The error message is the same either way.
* Use SelectQueryBuilder.
* Remove unused method showLogExtract().

Bug: T27482
Change-Id: Ic5d394a9a386695c5684028c38268a4d5262ca69
2023-03-10 11:07:45 +11:00
Tim Starling
0175458f55 Renameuser: refactoring round 1
* Use dependency injection or centralize access to the service
  container.
* Remove code from RenameUserJob which was obsoleted by the actor table
  migration. This job class is not used to update revision or logging
  anymore.

Bug: T27482
Change-Id: I2bbea713f4c68a15e22e5c3f64d8decbd0b0a9de
2023-03-10 11:07:45 +11:00
Kosta Harlan
5ecbb62f7f phpunit: Check if composer dependencies are up-to-date
Bug: T330228
Change-Id: I2caddfb8f2991034adce372f12bf81b0c2acb965
2023-03-09 18:26:06 -05:00
James D. Forrester
7a52350c7f Follow-up 0f13e81a1: Fix namespace of FileDeleteForm
Change-Id: I1587380f669d5434c7f32ed359ab48fc6f79ce6b
2023-03-09 15:27:10 -05:00
jenkins-bot
14bdee307a Merge "SrConverter: add test case for initial and final roman numerals" 2023-03-09 18:31:54 +00:00
C. Scott Ananian
3867cc5235 SrConverter: add test case for initial and final roman numerals
A naive reading of the SrConverter code might lead one to believe that
final roman numerals aren't properly handled -- but split actually
returns an empty string in the trailing position in that case, so the
code works correctly.  Add a test case demonstrating that conversion
is handled correctly for initial and final roman numerals.

Change-Id: Ia4857cab74bbb581baf46a51a080cf098cbb61d8
2023-03-09 13:08:06 -05:00
jenkins-bot
f8412ed847 Merge "Revert "TransformHandler: Load stashed page bundle based on ETag."" 2023-03-09 16:19:06 +00:00
Subramanya Sastry
c4f40bd107 Revert "TransformHandler: Load stashed page bundle based on ETag."
This reverts commit ee8dd055c8.

Reason for revert: breaks officewiki

Bug: T331629
Depends-On: I46f16eae9c137d43aad22bfd4be460cfb635614b
Change-Id: Ieb0dedfb5ae3168749a9ab6d930be527337348e8
2023-03-09 15:36:54 +00:00
Kosta Harlan
aec02e5e5c
phpunit: Lower report limit to 10 slowest tests
We currently output 50 slow tests in integration test runs. I'm not sure
if anyone is taking action based on this report, but if so, it seems
like reporting the top 10 (or even fewer, top 5?) would be sufficient.

Change-Id: Id2eed09e404a00090671bc67271d35be5c93fdf3
2023-03-09 14:08:38 +01:00
daniel
db729e46f6 Treat $wgHooks as a regular setting
$wgHooks should be treated like a regular setting, which cannot be
manipulated after bootstrapping is complete. This will allow us to
greatly simplify the logic in HookContainer.

Replacing $wgHooks with a fake array after bootstrapping allows us to
detect any remaining live access to $wgHooks without breaking
functionality.

The plan is to have the fake array emit deprecation warnings in the 1.40
release, and make it throw exceptions in later releases.
See Iddcb760cf8961316d6527e81b9aa968657d8354c for the deprecation
warnings.

Bug: T331602
Change-Id: I0ebba9a29f81b0d86ad8fd84d478fb244f9e9c15
2023-03-09 10:20:44 +01:00
daniel
d19f30cede Tests: treat wgHooks like a regular config variable.
Prepare phpunit tests for a world where $wgHooks behaves like other
config variables: on-the-fly manipulation doesn't have an effect,
service objects need to be reset after changing it.

Change-Id: I34385f4c52febfe1c91bd7ea4100c06d1331adc8
2023-03-09 12:25:46 +11:00
Umherirrender
f396a8d77c specials: Add watch option for userpage to Special:Unblock
Disable the checkbox for auto blocks and range blocks

Bug: T257662
Change-Id: I883c21c4255247dac766ea5e02d7084cec43fabd
2023-03-08 22:01:45 +00:00
Umherirrender
14f3cb2b17 api: Add watch option for userpage to action=unblock
Bug: T257662
Change-Id: I73e26bb97a16579a76ea8dc992157d8180193f27
2023-03-08 22:49:55 +01:00
Timo Tijhof
19d11ae2a3 OutputPage: Remove unused $IP override in test case
Follows-up I61e947fb17cf64 (ef2a622e49).

Change-Id: I76a07206b4eb9993a65ae1529940b74ba8352a83
2023-03-08 20:58:19 +00:00
Umherirrender
9e0c40424c Hard-deprecate manual construction of LinkBatch objects
Bug: T325591
Change-Id: I4f267b052e98cbb36cb76dae59a5279b01eae97c
2023-03-08 20:43:01 +01:00
jenkins-bot
c03f7a2b38 Merge "OutputPageTest: override config consistently" 2023-03-08 14:34:06 +00:00
jenkins-bot
f23fe158a8 Merge "rdbms: Rename internal ServerInfoHolder to ServerInfo" 2023-03-08 00:13:42 +00:00
Timo Tijhof
27aa07815c rdbms: Rename internal ServerInfoHolder to ServerInfo
Follows-up I177d57e2e34aea (3909c1440a).

Change-Id: Ic7332abc5512a74f62ff01e1bd9566047b81cb59
2023-03-07 23:36:39 +00:00
jenkins-bot
a04c506bfd Merge "rdbms: make LBFactoryMulti actually support "DEFAULT" in "sectionsByDB"" 2023-03-07 23:15:29 +00:00
jenkins-bot
39e2001335 Merge "objectcache: Remove $wgMainWANCache and $wgWANObjectCaches" 2023-03-07 23:07:49 +00:00
Timo Tijhof
39ead04e98 objectcache: Remove $wgMainWANCache and $wgWANObjectCaches
We always wrap the local cluster cache, and there are no subclasses
of WANObjectCache. It was never documented or recommended how these
would be used. It is a left-over from the original 2015 Multi-DC plan
in which WANObjectCache would work differently. See task for details.

Note that this requires no configuration changes, even in the
theoretical case of these variables being used, as the only
option is to use the main cache, and that's also the default.

* Update WAN overrides to override the underlying main cache
  instead.
* Fix EditPageTest which was previously implicitly using a 'hash'
  as main cache but also relying on wan cache to be 'none'.
  The part that it actually needs is the 'none'. When WAN cache is
  enabled, testUpdateNoMinor fails due to an edit conflict because
  one of the edits it makes is made with a current timestamp whereas
  it expects to simulate wpEdittime in the year 2012 which, when
  caching is enabled, is ignored and becomes the current time instead.
  I don't understand exactly why, but I'm going to conserve that
  behaviour for now.
* Fix TemplateCategoriesTest, which was failing due to an unexpected
  cache hit:
  > [objectcache] fetchOrRegenerate(…:page:10:…): volatile hit
  This could be solved in a more realistic way by splitting the test,
  or by explicitly resetting services half-way the test to clear
  WikiPageFactory, PageStore and WANCache process state.
  For now, keep the prior behaviour of no cache in this test.

Bug: T305093
Bug: T329680
Depends-On: If890622eed0d0f8b4bd73d36ba1815a3d760ea05
Depends-On: Ie1def75208822bdf19bb2cfd7e6edf32c2000e6b
Depends-On: I35cce61dc3ee90dcee3dd6f0b36f84133be029ed
Change-Id: I53781a8c06ebb2583f6ca83dd91bbfe8a5c88b13
2023-03-07 22:47:04 +00:00
daniel
ef2a622e49 OutputPageTest: override config consistently
This patch makes OutputPageTest independent of local configuration.

Change-Id: I61e947fb17cf64ba1d448ce68b84b74f38b7a7da
2023-03-07 21:06:23 +01:00
Tim Starling
b20eadaca4 rdbms: Deprecate and replace SelectQueryBuilder::lockForUpdate()
SelectQueryBuilder::lockForUpdate() is confusable with a mutator that
enables for update mode, by analogy with lockInShareMode().
IDatabase::lockForUpdate() is a nice shortcut but the name is confusing
when the return value is used.

So,

* Deprecate SelectQueryBuilder::lockForUpdate()
* Add SelectQueryBuilder::acquireRowLocks(), which performs the query
  but throws away the results.
* Migrate callers of IDatabase::lockForUpdate() to SelectQueryBuilder.

Change-Id: I3f18e9c48349838dcf0ba00a5beb67eace3029e1
2023-03-07 12:12:37 +11:00
jenkins-bot
f25a1fc796 Merge "Stats: add static labels feature" 2023-03-06 23:33:42 +00:00
jenkins-bot
1977a209be Merge "Stats: add timing start and stop helper functions" 2023-03-06 23:31:37 +00:00
jenkins-bot
8181cc0d55 Merge "Stats: simplify metrics configuration, enforce builder pattern" 2023-03-06 23:31:17 +00:00
jenkins-bot
97b1ee72b1 Merge "TransformHandler: Load stashed page bundle based on ETag." 2023-03-06 22:36:52 +00:00
Cole White
13f556ab3a Stats: add copy to statsd feature
Enables copying a metric to statsd at the specified namespace.

Bug: T240685
Change-Id: I15d6f100a31fbb98ad89568a2024e926cb47f937
2023-03-06 18:40:36 +00:00