Commit graph

15473 commits

Author SHA1 Message Date
Timo Tijhof
2de79774e1 Remove deprecated EventRelayerKafka and KafkaHandler
Also remove the unmaintained kafka-php package from the from "suggested"
and "dev" composer dependencies, as this is now no longer used.

Change-Id: If5668974f417b627df95bce47db18d46fa03327c
2022-03-25 00:07:22 +00:00
Tim Starling
97b8262d1f Use UserRigorOptions directly
Conventionally, public constants are accessed via their declaring
class, except for self:: which is an acceptable shortcut.

Change-Id: If05eab72140267e6ef54736710d751d7f24a7860
2022-03-25 10:06:34 +11:00
Timo Tijhof
3dec1399ac Deprecate EventRelayerKafka and KafkaHandler
These require use of nmred/kafka-php 0.1.0, which is from 2015.
Upstream has had one major release since then, in 2017. There have
been various commits, issues, and pull requests since but nothing
released for five years.

EventRelayer was created for use with WANObjectCache, where WMF
considered use of Kafka as one of the possible transports. This never
happened, and WANObjectCache has not supported EventRelayer since 2019,
removed with change I328eb74f21c23.

The EventRelayer abstraction itself remained unused, until it became
re-purposed for CdnCacheUpdate, which WMF now relays via EventBus.

Monolog KafkaHandler is no longer used, and was similarly created for
WMF's use case. It seems unlikely to be of interest to most third
parties. And those larger installs like WMF would likely be more
interested in SyslogHandler which is more standardised across the
industry (especially for cloud native tooling around containers).

Someone using this can continue to do this by adding a similar class
to their own code instead, possibly published as an extension.

Deprecating this in MW 1.38 (with backport) means we can remove it
shortly after in master, and no longer maintain this unused/untested
integration for which no known users exist, as well as remove our
supported suggested dependency on the unmaintained kafka-php lib.

Change-Id: I475227293ca050acead357efebce12e93a971f65
2022-03-24 18:55:39 +00:00
Alexander Vorwerk
17bab86e7a Revert "phpunit: Set $wgSQLMode from DevelopmentSettings instead of MediaWikiIntegrationTestCase"
This reverts commit 8a54b5ec38.

Bug: T304625
Change-Id: Id54589603d56aa87b6a1e7d9570ebba5346dd70c
2022-03-24 16:55:02 +00:00
jenkins-bot
453b477ee8 Merge "selenium: Use @wdio/spec-reporter" 2022-03-24 16:19:33 +00:00
jenkins-bot
4f8319d03b Merge "phpunit: Revert "testConfigGeneration" structure test to simpler version" 2022-03-24 15:45:37 +00:00
Željko Filipin
aca6ae6d83 selenium: Use @wdio/spec-reporter
@wdio/dot-reporter that we currently use doesn't display much. For
example, it doesn't display skipped tests. It says 5 test suites are
executed, but that's a lie. 3 of those 5 suites are skipped.

@wdio/spec-reporter is more verbose but it actually outputs useful
information, like which tests are running, which are skipped.

This is a revert of aa7133ce86.

Bug: T280331
Change-Id: I7cef7d6a6d1b5e472622a81afc4f9a91523c1ca9
2022-03-24 15:31:45 +00:00
daniel
1137a357db phpunit: Revert "testConfigGeneration" structure test to simpler version
This was changed to support in-place updates of files,
but the idea which was since abandoned. So we can go back to
using stdout.

Change-Id: I825a00258c4f50244679fc47c81b6920dd241647
2022-03-24 14:57:47 +00:00
jenkins-bot
b89c59ba9a Merge "phpunit: Set $wgSQLMode from DevelopmentSettings instead of MediaWikiIntegrationTestCase" 2022-03-24 14:51:48 +00:00
jenkins-bot
33ab5b8aca Merge "Allow managing upload-by-url allowlist as a system message" 2022-03-24 14:49:05 +00:00
Aaron Schulz
8a54b5ec38 phpunit: Set $wgSQLMode from DevelopmentSettings instead of MediaWikiIntegrationTestCase
This avoids a large number of SET query pairs during tests.

Bug: T225730
Change-Id: Ic2729428297162763a772e6a16549ded8de06c01
2022-03-24 09:13:54 +00:00
Arlo Breault
6fb75e0777 Broken media in galleries might not have the file namespace
The added test throws without this change.

Bug: T304564
Change-Id: Ie284db4deacc9b24622209b544543b59cd2f7ba1
2022-03-23 23:33:58 +00:00
Taavi Väänänen
caa8a2c3f0
Allow managing upload-by-url allowlist as a system message
This patch introduces a new system message,
MediaWiki:copyupload-allowed-domains, which lets sysops to define which
domains can be used with the upload-by-url tool. This feature is behind
an off-by-default feature flag, which lets system administrators
disable this feature if it is not wanted.

Bug: T300407
Change-Id: Iae7dafbd71182695444210409d550e5b6d10928b
2022-03-23 11:11:41 +02:00
jenkins-bot
ecd6d385f8 Merge "Improve handling of class-level test setup failures in run()" 2022-03-23 00:59:44 +00:00
jenkins-bot
04426c6a05 Merge "rdbms: rename wasKnownStatementRollbackError() to isKnownStatementRollbackError()" 2022-03-22 23:16:04 +00:00
jenkins-bot
259d5133f4 Merge "Fix core newtalk 304 suppression and update deferral" 2022-03-22 23:00:56 +00:00
Aaron Schulz
e0a53cba15 rdbms: rename wasKnownStatementRollbackError() to isKnownStatementRollbackError()
Pass the error number as an argument, similar to isConnectionError()

Fix related mysql documentation links

Change-Id: Id32ef2fd27de65376960de3f5138ffdf7654ff71
2022-03-22 22:59:09 +00:00
Aaron Schulz
509614bbda Improve handling of class-level test setup failures in run()
Signal that the test run needs to stop and record the exception via
addError() so that it will be displayed in the output and the exit
code will reflect test failure.

Previously, errors would cause the tests to suddenly stop, and any
buffered output about previous errors, warnings, and failed tests
was lost.

Bug: T292239
Change-Id: I5b2a7bcbb38760fcd10fccfbf000f4a8511f8774
2022-03-21 21:43:07 -07:00
Arlo Breault
0f1bab753d Render broken media in galleries as in Parsoid
This makes it consistent with broken media outside of galleries and
matches the output of Parsoid.

Only applied when `$enableLegacyMediaDOM` is not set.

Bug: T304112
Change-Id: I45eebc8073c2bfe2177eceb1a1b34378268235da
2022-03-21 19:42:41 -04:00
jenkins-bot
2f7da6037a Merge "Fix uses of (error|warning|success)box in core" 2022-03-21 20:16:57 +00:00
jenkins-bot
50938694e5 Merge "ApiParse: Ignore 'contentformat' param when the query is based on page" 2022-03-21 17:36:04 +00:00
stang
9c70df0cf6 Fix uses of (error|warning|success)box in core
Replace HTML class for boxes with "mw-message-box-" style.

Bug: T300358
Change-Id: Iddb0fd3ae859714fb03d3a6d4586f8525becaac6
2022-03-20 21:15:26 +00:00
Timo Tijhof
6522ff4ae2 resourceloader: Set class-wide @covers and ignore coverage of HookRunner
Change-Id: I49379986f0e7c05fb3442f0de9f496f151c4bed5
2022-03-20 15:17:21 +00:00
Func
845bf42aa9 ApiParse: Ignore 'contentformat' param when the query is based on page
The 'contentformat' param should only have effects when the parsing
is based on the 'text' param, as what the document described.

Bug: T206253
Change-Id: Ia12b8697e515c6ba89ea81f085292d1ef018bf58
2022-03-20 20:33:20 +08:00
Aaron Schulz
3f6e4c1746 Fix phpunit failures due to invalid testGetResultAllTables provider
Use the correct casing for MySQLPlatform

Change-Id: I731ee4e828da06a1fb668d099b0e9a31b72aeabf
2022-03-19 20:58:45 +00:00
Func
5339aa645b ApiParse: Fail gracefully when the requested format is not supported
Format like 'application/json' is not supported for content model
wikitext, don't fail as internal exception.

This fix the case when providing text/title parameter.

Bug: T206253
Change-Id: I20ef52aa961143b7c50283c0d06acea9f220619c
2022-03-19 19:29:28 +00:00
Alexander Vorwerk
82739980fd parser: change 'level' in parse api back to string
We changed to operate on an int internally in I92daeb0f7be8a0.
Let's cast it back to a string for the api in order to prevent
a breaking change, which is not really necessary.

Bug: T304171
Change-Id: I5f5a9203b4dd085cb5defba72c6650532bc9e8d1
2022-03-18 19:52:24 +01:00
jenkins-bot
d2391847a9 Merge "objectcache: Clean up getMultiWithUnionSetCallback() test cases" 2022-03-18 16:58:43 +00:00
jenkins-bot
65ad80c12e Merge "objectcache: clarify usage of getMultiWithUnionSetCallback()" 2022-03-18 15:43:15 +00:00
Timo Tijhof
c2c663e6e1 objectcache: Clean up getMultiWithUnionSetCallback() test cases
It took me a good half hour to understand what these tests are doing,
and another half hour to build up a modicum of confidence that the
current behaviour is the indeed the desired behaviour.

* Remove random strings.

* Remove indirection and computed expected values as much as possible
  in favour of inlined literals that explicitly expect outcomes.

* Remove confusing second argument from the data provider
  getMultiWithUnionSetCallback_provider, which wasn't used, and
  add labels to it.

* Remove some of the existing inline comments.

* Add some inline comments with what I've understood.

* Fix bug in "C: Repeat case with recently created check keys",
  which claimed to be observing that caches were ignored due to the
  check key being too new, when in fact it was a cache miss simply
  because the key didn't exist yet upto this point. Make it actually
  repeating by adding a second call afterwards to observe the
  stated behaviour.

Bug: T303092
Change-Id: I874a20ecd49464f7b0e6a0b579c000dc0e804c0a
2022-03-18 15:41:08 +00:00
jenkins-bot
4d236a74ee Merge "LoadBalancerTest: Avoid using hard-coded table prefix" 2022-03-18 13:39:05 +00:00
jenkins-bot
7894e49ea8 Merge "Generate config name constants." 2022-03-18 11:09:44 +00:00
jenkins-bot
18875c2c0f Merge "Generate DefaultSettings.php from schema" 2022-03-18 11:02:51 +00:00
daniel
6880561a4d Generate config name constants.
We can generate a class that contains constants for all config variable
names. This removes the need to rely on string literals when calling
Config::get, and it provides a place for documentation that integrates
better with IDEs than the markdown file.

Change-Id: I817dc14c4ce8fc0a29d9c07e8fd393c4f359cade
2022-03-18 10:32:58 +01:00
daniel
1ee8fde16b Generate DefaultSettings.php from schema
Avoid having to maintain defaults twice.

Change-Id: I7a883fe3c952cc653d43b7e399631ec3beab0bc3
2022-03-18 10:25:52 +01:00
Subramanya Sastry
484c97653e Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit 9ec4dac79ae3d926507817137d113204d0947958

Change-Id: Idaa6cb8975499e8ecbbbb123dbbfa7e6316ed6aa
2022-03-18 13:33:23 +05:30
jenkins-bot
45a0be0436 Merge "Sync up with Parsoid mediaParserTests.txt" 2022-03-18 07:56:49 +00:00
jenkins-bot
f5f57616b7 Merge "Sync up with Parsoid legacyMediaParserTests.txt" 2022-03-18 07:56:43 +00:00
jenkins-bot
29e0cf9c9d Merge "Use class constants to define config schema, rather than config-schema.yaml" 2022-03-18 07:44:45 +00:00
Subramanya Sastry
0d87f9107f Sync up with Parsoid mediaParserTests.txt
This now aligns with Parsoid commit 9ec4dac79ae3d926507817137d113204d0947958

Change-Id: Ia2616e7713f63a546e7b0e71b7f09a13e166963c
2022-03-18 12:44:07 +05:30
Subramanya Sastry
5f18500f29 Sync up with Parsoid legacyMediaParserTests.txt
This now aligns with Parsoid commit 9ec4dac79ae3d926507817137d113204d0947958

Change-Id: I4da21cd17af20e6dd5cb6dc79800ca9b006abc2d
2022-03-18 12:43:54 +05:30
Tim Starling
1155648ecf Fix core newtalk 304 suppression and update deferral
Deferring newtalk updates caused the skin to show the notification on
the same user talk page view request in which it is cleared. Even if the
user refreshed the page, it would still show the notification since a
304 response was given.

So, move the newtalk part of WatchlistManager
::clearTitleUserNotifications down to TalkPageNotificationManager, so
that the in-process updates can be done immediately, with the DB updates
being deferred. TalkPageNotificationManager is now responsible for
deferring the relevant parts.

Originally (2002) the newtalk status was set by calling
User::saveSettings(), which had the side-effect of updating
user_touched. Restore this behaviour, which is fast now due to the
"quick touched" cache. Also update the touched timestamp when the
notification is cleared.

Change-Id: Ic3c14bca7bed04f46afffa971fa0a57224c666ce
2022-03-18 16:52:12 +11:00
jenkins-bot
a7efb70efd Merge "Add a class on the span representing the broken media element" 2022-03-18 03:52:32 +00:00
Umherirrender
9492d49eb9 Revert "tests: Add @group Broken to
MediaWikiIntegrationTestCaseSchemaTest"

This reverts commit 37ef5c0cfe.
This reverts commit 9327bdd953.

Reason for revert: The tests are not the issue

Bug: T292239
Change-Id: I84f70532ed22cf6db7fd9ad9bc291e194031ad24
2022-03-17 23:02:55 +00:00
Arlo Breault
15798c8b93 Add a class on the span representing the broken media element
Span alone is too generic and relying on first-child might be error
prone, since active formatting elements can sometimes be re-opened
inside the media structure.

Further, in T270150, we'd like to move away mirroring of the DOM.

A similar patch on the Parsoid side is in
I1244f510f90ce05682566645d88ba3ef6e8d9892

Bug: T304010
Bug: T270150
Change-Id: I3b4fc62361e4fc7cf55f1fe74c78d3fbaeb59d69
2022-03-17 17:31:47 -04:00
jenkins-bot
14564ef874 Merge "WatchedItemStoreIntegrationTest: Call setMwGlobals without $ on name" 2022-03-17 20:28:21 +00:00
daniel
2fe23d6860 Use class constants to define config schema, rather than config-schema.yaml
Instead of maintaining the config schema as a yaml file, we
maintain it as a set of constants in a class. From the information in
these constants, we can generate a JSON schema (yaml) file, and an
php file containing optimized arrays for fast loading.

Advantages:
- PHP doc available to IDEs. The generated markdown file is no longer
  needed.
- Can use PHP constants when defining default values.

NOTE: needs backport to 1.38

Change-Id: I663c08b8a200644cbe7e5f65c20f1592a4f3974d
2022-03-17 21:20:03 +01:00
Ladsgroup
31c1ca8658 Revert "rdbms: make automatic connection recovery apply to more cases"
This reverts commit 4cac31de4e.

Reason for revert: Blocking the train, reverting the chain.

Change-Id: I7f275b3a25379c6f3256e90947c8eed4b232c0f4
2022-03-17 20:11:10 +01:00
jenkins-bot
e8a02b7ca8 Merge "Revert "rdbms: Followups to automatic connection recovery patch"" 2022-03-17 18:48:42 +00:00
jenkins-bot
c23b978cd7 Merge "Revert "rdbms: provide $owner argument in LoadBalancer::flushPrimarySessions()"" 2022-03-17 18:46:00 +00:00