Commit graph

122579 commits

Author SHA1 Message Date
jenkins-bot
4382d81d39 Merge "REST: Fix status logging in RestStatusTrait" 2024-03-12 19:43:57 +00:00
jenkins-bot
d895a063e7 Merge "UploadJobTrait: Fix casing of MediaWiki in import" 2024-03-12 19:41:20 +00:00
jenkins-bot
61853f72cd Merge "UserLogin: Update CSS for CodexHTMLForm changes" 2024-03-12 19:40:19 +00:00
jenkins-bot
d4e1fee2b7 Merge "languages: Fix casing of MediaWiki in namespaces" 2024-03-12 19:40:10 +00:00
jenkins-bot
8470c15136 Merge "ApiQuerySiteinfo: Fix up comment in recAutopromote" 2024-03-12 19:40:02 +00:00
Daimona Eaytoy
e57f4e1beb REST: Fix status logging in RestStatusTrait
Use the `$message` and `$channel` parameters when logging the error.

Follows-up Id7cbacb744b

Change-Id: Ifcc3fcbe5ed17b2517cf8a296b2d494da0e46177
2024-03-12 19:51:38 +01:00
jenkins-bot
3a8b4265e4 Merge "WikiTextStructure: Use raw text from ParserOutput" 2024-03-12 18:34:36 +00:00
jenkins-bot
9517fdca82 Merge "HandleSectionLinks: Remove old debug logging for resolved bug" 2024-03-12 18:34:28 +00:00
jenkins-bot
773da1b26c Merge "HTMLForm: Wrap Codex-based form fields in a Codex Field component" 2024-03-12 17:37:56 +00:00
jenkins-bot
d6188b5c37 Merge "HTMLFormField: Add getInputCodex() method for Codex output" 2024-03-12 17:37:49 +00:00
Roan Kattouw
f0ad350b26 UserLogin: Update CSS for CodexHTMLForm changes
mw-ui-vform-field no longer applies to the form fields on
Special:UserLogin. Instead, target the missing field with
HTMLSubmitField. Also make a note to remove these styles once Codex's
styles for spacing between form fields have been improved.

Change-Id: I83ef3ef4530fc0b57170a75a8e0ad1a5de8e0e89
2024-03-12 09:45:21 -07:00
jenkins-bot
4c043df5f5 Merge "WikiModule: Fix data structure when preloading title info" 2024-03-12 15:39:05 +00:00
Reedy
7dbded1bf6 languages: Fix casing of MediaWiki in namespaces
Change-Id: I43116f0f41e360488184107eab765afa87f4848b
2024-03-12 15:21:51 +00:00
Reedy
41602895e5 UploadJobTrait: Fix casing of MediaWiki in import
Change-Id: Ibebb59fdcf38f642e6c76e9a979955da4f721cd9
2024-03-12 15:17:51 +00:00
Bartosz Dziewoński
b34c23047d WikiModule: Fix data structure when preloading title info
Follow-up to 6194cf19ce.

Bug: T359939
Change-Id: I72a2c21c68d7d6ad281c28b8e76abcfc9846032e
2024-03-12 15:51:07 +01:00
jenkins-bot
d91c1e7352 Merge "Rest: Turn Rest\EntryPoint into a MediaWikiEntryPoint subclass" 2024-03-12 14:25:41 +00:00
jenkins-bot
9100c074d2 Merge "REST: Introduce trait for handling Status objects" 2024-03-12 14:25:34 +00:00
jenkins-bot
97b85d86a7 Merge "Fix use of deprecated Status::getWikiText()" 2024-03-12 13:52:06 +00:00
daniel
84f314bbf1 REST: Introduce trait for handling Status objects
The new trait provides conveniance methods for logging and throwing
errors based on StatusValue instances.

Change-Id: Id7cbacb744bee79cd8a6f61291a26b36e6243053
2024-03-12 14:48:33 +01:00
daniel
ae9d8e6054 Rest: Turn Rest\EntryPoint into a MediaWikiEntryPoint subclass
The idea is for all entry points to use the MediaWikiEntryPoint
base class, to improve consistency and testability.

Bug: T354216
Change-Id: I3678afe32c7c1a313d2dcb1808286c25ecd167eb
2024-03-12 14:37:18 +01:00
jenkins-bot
b2737df1f9 Merge "styles: Update color in CSS and Less from #d33 to #d73333" 2024-03-12 11:37:43 +00:00
Translation updater bot
41642c66c6 Localisation updates from https://translatewiki.net.
Change-Id: I7e33e0e58c0bd95bd3cacb052422c0606fa55ccd
2024-03-12 08:06:35 +01:00
jenkins-bot
c658c3e79d Merge "content: Remove unclear assertEquals() on Status objects" 2024-03-12 06:52:51 +00:00
Timo Tijhof
3dad835561 content: Remove unclear assertEquals() on Status objects
We don't usually compare object serializations with assertEquals as
they tend to make it difficult to know what is and isn't being asserted,
giving the illusion that it checks "everything" but can in some cases
be closer to "too much" or "nothing".

Actual logic:
* https://github.com/sebastianbergmann/phpunit/blob/9.6.17/src/Framework/Assert.php#L330
* https://github.com/sebastianbergmann/phpunit/blob/9.6.17/src/Framework/Constraint/Equality/IsEqual.php
* https://github.com/sebastianbergmann/comparator/blob/5.0.1/src/ObjectComparator.php
* https://github.com/sebastianbergmann/exporter/blob/5.1.2/src/Exporter.php

This means sub classes or value objects are needlessly discarded,
as well as potentially irrelevant state in the object is becoming
part of the test.

It is not a surprise then, that these assertions are not comparing
against any particular desired outcome, but are literally a copy-paste
of the source code, including functions that have no effect in testing
such as `ContentHandler::getLocalizedName( 'testing' )` === 'testing',
and untested expressions like `$wikipage->getTitle()->getPrefixedText()`
instead of an explicit expectation.

Replace this with assertStatusError and limit the assertion to
being !isOK, and error using the specified interface message key.

Testing that the correct parameters are passed is imho not a part
of this test, since the test isn't actually validating it to be
correct or sensible in terms of message contents and parsed outcome,
it is only verifying that we have correctly copied the source, which
still needs the same review as it otherwise would.

Change-Id: I8c7a660489e9000f9790f8d69478a05ad8c446b6
2024-03-12 06:28:08 +00:00
Roan Kattouw
c12ba1fc20 HTMLForm: Wrap Codex-based form fields in a Codex Field component
Besides expanding getCodex() to build the Field component and its
constituent parts, this required adding parameters to pass the
cdx-message--inline class to the error box generation code, and passing
the error status to getCodexHtml() so that field subclasses can add
status CSS classes to the components they generate.

Bug: T359021
Change-Id: Iab3f3c81f4de034a3a04b54caf269de6fde4a7f2
2024-03-11 21:29:29 -07:00
jenkins-bot
1548f25ea0 Merge "Improve rate limit tests" 2024-03-12 03:25:56 +00:00
daniel
aae0e46169 Improve rate limit tests
Change-Id: I1a33dcc9c09d986b4825d7e6e4f5c5b4fa308dd1
2024-03-12 14:00:07 +11:00
lwatson
f8335926ef styles: Update color in CSS and Less from #d33 to #d73333
This patch promotes a consistent design decision across projects in
MediaWiki core, extensions, and skins. The darker red color meets the
W3C Web Content Accessibility Guidelines (WCAG) at Level AA that text
or images of text must have a contrast ratio of at least 4.5:1 (or 3:1
for large text).

Note: Updated the color palette labels from deprecated tokens to the
current option token.

Bug: T343239
Change-Id: Id2260a8b1e7b091bda1af9aabfcc4ac8cdd67760
2024-03-11 19:31:16 -04:00
jenkins-bot
bd762624ae Merge "filebackend: Clean up batch handling in doQuickOperationsInternal()" 2024-03-11 22:56:41 +00:00
jenkins-bot
6d973e0b10 Merge "Improve i18n of ApiChangeContentModel messages" 2024-03-11 22:51:58 +00:00
jenkins-bot
4eb17e8807 Merge "tests: Add coverage for various trivial HTMLForm methods" 2024-03-11 22:45:21 +00:00
jenkins-bot
9e212b86c2 Merge "migrateBlocks.php: Skip existing IDs" 2024-03-11 22:45:10 +00:00
jenkins-bot
642db70596 Merge "resourceloader: Raise USERJSPARSE_CACHE_VERSION following Peast upgrade" 2024-03-11 22:22:18 +00:00
jenkins-bot
3fabbf33b4 Merge "parser: Remove LoggerSpi override from ParserOutputAccessTest" 2024-03-11 20:03:42 +00:00
jenkins-bot
c9a96593f0 Merge "ResourceLoader: Add preload for foreign WikiModule title info" 2024-03-11 19:53:55 +00:00
jenkins-bot
07ff1f5e70 Merge "ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule" 2024-03-11 19:50:59 +00:00
jenkins-bot
5e926dfbdc Merge "Bump wikimedia/parsoid to 0.19.0-a22" 2024-03-11 19:41:49 +00:00
Timo Tijhof
6194cf19ce ResourceLoader: Add preload for foreign WikiModule title info
=== Objective ===

* Remove reliance on global state via WikiMap.
* Reduce reliance on MediaWikiServices::getInstance().

=== Details ===

Note that this does not increase or introduce use of cross-wiki
database connections. preloadTitleInfo() is not an optimistic
optimisation. We only pass modules to preloadTitleInfo() if the
caller will call WikiModule->getTitleInfo() shortly thereafter.

The Zend hack is no longer needed, as this existed to support PHP 5.5
as per <https://3v4l.org/EU6Ro>.

Remove needless complexity around levering array_intersect_key. This
made sense originally in I82e215745 (dbd11e04aa), when the arrays
had the same keys, but since Ibe7881577 (dbe592df6d) they don't.
Given they don't match, take the direct approach instead.

Bug: T359522
Change-Id: I7d407a1989d28ef329ab430841251c910fe78732
2024-03-11 19:07:13 +00:00
Timo Tijhof
3903c8cfec ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule
* Remove references to IDatabase from preloadModuleInfo() and with
  it the last reference to Rdbms in the ResourceLoader service
  (progressing T32956).

* Simplify WikiModule::preloadTitleInfo() so that it doesn't need
  an IDatabase object unless
  1) there are non-zero WikiModule objects in the batch, and
  2) there is a cache miss.

* Remove needless IDatabase parameters passed or mocked for this
  method. Note that WikiModule already had `@group Database` set
  since each WikiModule::getDB() is called and uses an unmocked
  database. The mocked database was only injected to satisfy the
  method signature.

Bug: T32956
Bug: T359522
Change-Id: I022f02d6e6bbae46c3258a7c07a1d6723506d8bc
2024-03-11 19:39:24 +01:00
jenkins-bot
33f98c4b0b Merge "SpecialRedirect: Mark the value field as required" 2024-03-11 17:19:26 +00:00
jenkins-bot
9232985bd8 Merge "ParserOutput::setPageProperty(): Emit deprecation warning for non-scalar values" 2024-03-11 17:08:20 +00:00
jenkins-bot
e59064b183 Merge "docs: Migrate Vue wrapper to JSDoc" 2024-03-11 17:07:18 +00:00
Arlo Breault
c2f65cb896 Bump wikimedia/parsoid to 0.19.0-a22
Depends-On: Ib452405b206cab9d65b1b10650d56471469b5585
Change-Id: If7f9807c90a49a3953119be5f2b2f4771ea55e86
2024-03-11 12:47:29 -04:00
jenkins-bot
74157f863b Merge "Use transactional time limit on api Upload (except checkstatus)" 2024-03-11 15:44:12 +00:00
jenkins-bot
89eb923eb3 Merge "build: Restore Doxygen output for MediaWiki release tags" 2024-03-11 15:01:18 +00:00
jenkins-bot
031b95e6ab Merge "ParserCache: split metricSuffix into discrete components" 2024-03-11 12:46:04 +00:00
Translation updater bot
193e580dee Localisation updates from https://translatewiki.net.
Change-Id: Ie24fd3de7b5c4242733cd59ffcb5cd106c2e99f5
2024-03-11 08:06:17 +01:00
Tim Starling
2ff4491860 migrateBlocks.php: Skip existing IDs
When copying blocks from ipblocks to the new block table, skip rows for
which the relevant ID already exists in the block table. In write-both
mode, it is expected that some blocks will have already been copied.
This also allows the script to be run multiple times on a wiki, so that
it can be used to clean up the current situation in production.

Bug: T355034
Change-Id: I54e65adef685bfc7d4f63853cd50ca0f55e2ecdb
2024-03-11 12:25:11 +11:00
jenkins-bot
f0a19f5f4a Merge "build: Fix line indents" 2024-03-11 00:12:18 +00:00
Umherirrender
f3524224f0 build: Fix line indents
Fixed SkinModuleTest::provideGetFeatureFilePathsOrder as nesting of
arrays for parameters is wrong

Change-Id: I9875008adf62d284c48662ebfbd245d72e5be064
2024-03-11 00:14:16 +01:00