Commit graph

276 commits

Author SHA1 Message Date
C. Scott Ananian
df9756b9a1 Make Content JsonCodecable
By default this uses the existing ContentHandler::serializeContent() and
::unserializeContent() methods.  But in cases where existing PHP
serialization preserved fields that ::serializeContent() did not,
provide an additional ContentHandler::serializeContentToJsonArray()
and ContentHandler::deserializeContentFromJsonArray() methods which
can be used.  Use these in WikitextContentHandler to preserve the
PST flags.

Added test cases and a ContentSerializationTestTrait to make it
easy to ensure forward- and backward-compatibility in accord with

https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility

The new JsonCodecable codec will be used to improve PageEditStashContent
serialization, which no longer has to PHP-serialize its Content object.
New test case added demonstrating compatibility.

Bug: T264389
Bug: T161647
Change-Id: I544625136088164561b9169a63aed7450cce82f5
(cherry picked from commit 21576d6c1893079777a1a51d0f81c4941c58e376)
2025-09-05 16:12:09 -04:00
alex4401
849577a9b8 WebPHandler: Read all of the VP8L canvas height
In WebP lossless chunks (identified by VP8L), width-minus-1 and height-minus-1 of the canvas are sequentially encoded as 14-bit integers. (spec: https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#3_riff_header)

WebPHandler, when decoding the canvas height, has been skipping two most-significant bits. This results in bogus values being read from larger losslessly-encoded files.

Change-Id: Ib5b26f36a15fa65e7990da2ebd94157faccc70c2
(cherry picked from commit 442b73cebbea6db7b7fc945189d5776602fabc8a)
2025-08-26 12:21:30 +00:00
C. Scott Ananian
30ae82e2b2 ParserOutput: Prepare to allow JsonCodec serialization of TOCData
In a future patch (Ia690f10ccbf4f60f9febca98915155c2df58f0d4) we will
use native JsonCodec serialization of the TOCData object.  But first
we will add forward-compatibility code to deserialize TOCData, so that
if we need to rollback the future release we won't break the parser
cache.

New serialization test cases added, as per
https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility

Bug: T327439
Change-Id: I4652b2709afd33ff5e469e36960391e993bc7bae
(cherry picked from commit bf61f6bc0eaf5013167e4b80860b0a610559c661)
2025-07-26 01:18:35 +00:00
C. Scott Ananian
0809cc355f ParserCacheSerializationTestCases: distinguish empty ToC from missing ToC
Add a new test case for the "empty ToC" case, to complement the
existing serialization test cases for "missing ToC" and "non-empty
ToC".

Change-Id: I8e2ff94f871546232cbf099f98bfcce559de76f2
(cherry picked from commit cb2173c57276142adc466f7494016e2faf15b758)
2025-07-23 01:31:23 +00:00
C. Scott Ananian
5b7a803a5d ParserCacheSerializationTestCases: back port ParserOutput changes from 1.45
Add parser cache data from 1.45, according to the process in

https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility

and synchronizing with I04e715acc721d20c5fbd586ed44cef219f56cf4f.

Change-Id: I55cdbf821f5d9930822a633a6b767f0528e74a5d
2025-07-23 01:25:37 +00:00
jenkins-bot
23ec5ff94e Merge "Add namespace to maintenance/includes classes" 2024-10-15 22:50:33 +00:00
Dreamy Jazz
e2b6281d6d Test findDeprecated.php
Why:
* Maintenance scripts in core have low test coverage
* This can cause issues such as the findDeprecated.php maintenance
  script not working, as described in T374832
* Testing the broken script after fixing it will avoid the script
  breaking again.

What:
* Fix the findDeprecated.php maintenance script to actually
  show when code is hard-deprecated.
* Modify the script to allow mocking of the MediaWiki install
  path in PHPUnit tests
* Create FindDeprecatedTest which tests that the script produces
  an expected output, without being specific about how the
  code finds the methods (to allow the method to be changed
  as discussed in T243403)
** To do this, create a folder in the data folder for the PHPUnit
   tests that has a mock file structure allowing the test to
   use a fixed list of soft and hard deprecated methods.

Bug: T374832
Bug: T371167
Change-Id: Ic4933cef95ef1af7fa3939625ac1747106c71230
2024-10-15 17:08:23 +00:00
James D. Forrester
9f02d18eac Add namespace to maintenance/includes classes
Also a few other fixes of PHP class aliases spotted by phan.

Bug: T353458
Change-Id: Ie79d65722c47c24f8f20f1293355cfd3c2e8c2ad
2024-10-09 11:02:09 -04:00
Dreamy Jazz
649b0f4954 Use import actor store where needed in RC categorisation
Why:
- When temporary users are enabled, creating IP actors is disallowed
  apart from specific cases, such as importing revisions authored by
  anonymous users.
- If such a revision includes a category link and
  wgRCWatchCategoryMembership is true, MediaWiki will fire a job to
  create a corresponding RC entry, which will attempt to attribute the RC
  to the anonymous IP that authored the imported revision and fail in
  doing so.

What:
- Track whether a category membership change job was triggered by an
  import, and allow RecentChange objects created by such jobs to create
  anonymous actors.

Test Plan:
 1. On a wiki with temporary accounts enabled and wgRCWatchCategoryMembership = true,
    import a revision via Special:Import that was authored by an anonymous user
    and contains a category link.
 2. Verify that the import succeeds and that the corresponding RC entry
    shows up.

Bug: T373318
Change-Id: I89abdca9c4ab8796a211df8b37c1bd7173a496e5
2024-10-02 00:45:22 +02:00
Dreamy Jazz
b380904c66 Test checkComposerLockUpToDate.php
Why:
* Maintenance scripts in core are mostly untested and testing them
  will help to avoid regressions.
* Doing this for frequently run scripts is important, as they
  may fail in ways not caught by running them in CI.

What:
* Create CheckComposerLockUpToDateTest that fully tests the
  associated maintenance script.
** Move test case composer JSON files used by the LockFileCheckerTest
   class into the 'phpunit/data' folder instead of placing them
   in the same directory to allow the new test class to use these
   files too.

Bug: T371167
Change-Id: Id473ef440c6b7f8ecbb1c869f9cc0cf98705a0e9
2024-08-29 20:18:39 +00:00
Roan Kattouw
8a39d83175 Codex: Allow a local development version to be used
Developers can use this to test their local version of Codex with
MediaWiki by pointing $wgCodexDevelopmentDir to their local clone of the
Codex repo, e.g. $wgCodexDevelopmentDir = '/home/yourname/git/codex';

Setting $wgCodexDevelopmentDir affects where the following things come
from:
- Codex JS/CSS files for the full library
- Codex JS/CSS files for code-split chunks, and the manifest.json file
  that points to them
- Icons retrieved by CodexModule::getIcons()
- CSS-only icons imported in Less
- Design tokens imported in Less

Other changes in this patch:
- Add CodexModule::makeFilePath() to centralize the repeated path
  concatenation. This makes it easier to switch out the regular path for
  the dev mode path.
- Replace all uses of $IP (which is deprecated) and MW_INSTALL_PATH in
  CodexModule with the BaseDirectory config setting.
- Make CodexModule::getIcons() reset its static cache if the path to the
  icons file changes. Without this, it's impossible to make the unit
  tests pass.
- Move the i18n messages code from the CodexModule constructor to
  getMessages(). It can't be in the constructor because makeFilePath()
  doesn't work there (it fails because the Config object hasn't been set
  up yet).
- Add a 'mediawiki.skin.codex' import path so that we can stop
  hard-coding the path to the Codex mixins file. Without this, we can't
  make the Codex mixins come from the right place in development mode.
- Consider $wgCodexDevelopmentDir in setting the cache key for compiled
  Less code, since changing this setting can change the output of Less
  compilation (by changing design tokens, icons or mixins).
- Add unit tests for (the non-dev mode behavior of)
  CodexModule::getIcons() and the i18n message key handling.

Bug: T314507
Change-Id: I11c6a81a1ba34fe10f4b1c98bf76f0db40c1ce98
2024-08-22 17:20:24 -07:00
Eric Gardner
095a4ec6f4 CodexModule: use list of i18n message keys from Codex package
Previously, ResourceLoader's CodexModule class was using a hard-coded
list of message keys to add to the payload any time Codex components
get used. But now we can get the list of messages directly from
Codex. This change replaces the hardcoded list of strings with
a call to file_get_contents().

The list of messages is defined in a file called "messageKeys.json"
in the Codex package. In the next release of Codex, this file will
be pulled in via foreign-resources.yml; for now it has been added
manually to the Codex files in resources/lib.

Bug: T371330
Change-Id: Ib7ca66d67153dfba72d8d49b0181d49b007eedce
2024-08-12 15:30:11 -07:00
Dreamy Jazz
58311b0a8d Use fake maintenance scripts in MaintenanceRunnerTest where necessary
Why:
* The MaintenanceRunnerTest class tests using real maintenance
  scripts and the code being tested can include the maintenance
  script files.
* However, if running all tests together (such as when generating
  test coverage) the maintenance scripts may have already been
  loaded by integration tests that exist for those scripts.
* Instead of fixing the specific instances, we should instead
  ensure that (where necessary) the MaintenanceRunnerTest tests
  using fake maintenance scripts only loaded by that test class.
* Doing this prevents the files from being loaded anywhere else
  and ensures that the tests should not fail in this way again.

What:
* Update MaintenanceRunner::expandScriptFile to move the use of
  MS_INSTALL_PATH to a protected method that can then be mocked
  in MaintenanceRunnerTest.
* Update MaintenanceRunnerTest to use fake maintenance scripts
  where necessary. This includes:
** No longer setting the current working directory as the
   MW_INSTALL_PATH, but instead set it as __DIR__.
** Creating several fake maintenance scripts to replace the uses
   of the real ones.
** Updating the data providers to reflect the changes.

Bug: T371188
Change-Id: Ifacdcb8de5af53d2d5f4ed354af0d209384d7325
2024-08-08 13:02:22 +00:00
C. Scott Ananian
6450cd6763 [JsonCodec] Establish forward-compatibility with future codec
Ensure forward compatibility with
Ia1017dcef462f3ac1ff5112106f7df81f5cc384f by adding
forward-compatibility test data generated by
Ia1017dcef462f3ac1ff5112106f7df81f5cc384f and verifying that tests
pass.

Change-Id: I109640b510cef9b3b870a8c188f3b4f086d75d06
2024-06-14 15:31:29 -04:00
C. Scott Ananian
0e6649bdec Add parser cache test data for JsonDeserializable extension data
I realized that even though we have a lot of ParserCache serialization
tests, and we have unit tests for JsonCodec, we don't have any tests
which bring these together and include JsonDeserializable data inside
ParserOutput objects.

Change-Id: I9dfe1050c18010d1447e77e0670e9e601449b110
2024-06-12 21:13:28 -04:00
Bartosz Dziewoński
c7f52f0ddb Make MessageValue implement JsonDeserializable
MessageValue and friends are pure value objects and newable, so
it makes sense for them to be (de)serializable too. There are some
places where we want to serialize messages, such as in ParserOutput.

The structure of the resulting JSON is inspired by the way we
represent Message objects as plain values elsewhere in MediaWiki,
e.g. StatusValue::getStatusArray().

Co-Authored-By: C. Scott Ananian <cscott@cscott.net>
Depends-On: Ia32f95a6bdf342262b4ef044140527f0676402b9
Depends-On: I7bafe80cd36c2558517f474871148286350a4e76
Change-Id: Id47d58b5e26707fa0e0dbdd37418c0d54c8dd503
2024-06-12 15:47:37 -04:00
C. Scott Ananian
47bdd8b1c8 [ParserOutput] Remove unused TOCHTML from ParserCache serialization
This reverts commit b4cf4aa6bd,
which is no longer needed for ParserCache compatibility across
trains.  REL1_42 contains b4cf4aa6bd,
so MW 1.43 will not need this.

This also adds new serialization test cases for 1.43 with this field
removed; see
https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility

Change-Id: I716e2efe7a491002e6e6b2300016165fffe3c0d6
2024-05-17 21:46:00 +00:00
C. Scott Ananian
5ff1629b26 [ParserCache] Add serialization test cases for REL1_42
This matches the current status of the ParserOutput serialization for
REL1_42, which uses an empty string for the unused TOCHTML property.

Change-Id: Idcad27d0403dabf7478268e43aeb710da9af9fcd
2024-05-17 21:45:45 +00:00
Roan Kattouw
3211083394 tests: Add CodexModule tests for full library mode
Also convert the data provider to a generator.

Change-Id: Id9cfe88d789f655ae7fc26ce48c7bba08fbee33e
2024-05-16 12:00:46 -04:00
Roan Kattouw
fe62ebafd2 CodexModule: Remove CODEX_MODULE_DIR, instead use CODEX_LIBRARY_DIR
CODEX_MODULE_DIR is always the /modules subdirectory of
CODEX_LIBRARY_DIR, so remove it and derive it that way instead.

- Update tests accordingly
- Rename test data files accordingly
- Use CODEX_LIBRARY_DIR in one place where we had neglected to use a
  constant

Change-Id: Ieb347c2d128f3addfb11f6aca79d63969434f342
2024-05-15 17:12:20 -04:00
Brian Wolff
89f59b39b6 Extract XMP & Exif from WebP files
In addition to the webp spec, this also detects two non-standard
conventions sometimes found in real files: Allowing a fourcc
of "XMP\0" instead of the standard "XMP " and allowing the prefix
"Exif\0\0" at the beginning of the EXIF chunk.

Bug: T338341
Bug: T353981
Change-Id: I0ddc3322e1c2f4d4d7bb11732e05fd4ffb5eb692
2024-05-11 09:41:21 +00:00
Isabelle Hurbain-Palatin
8de2e66ca7 Localization output transform
This is an output transform to resolve the mw:I18n and mw:LocalizedAttrs
to their localized forms.

Bug: T358191
Change-Id: Id32bc05ff72eb2d9fba7f8c2f192c9f7812cbc70
2024-05-06 15:24:38 -04:00
jenkins-bot
f99f308bf4 Merge "Drop 1.35 db updates" 2024-05-05 06:50:24 +00:00
Alexander Vorwerk
11a0759199 Reenable DoctrineSchemaChangeBuilderTest for sqlite
was disabled in I60b66ff86e4c62 due to some weird issues with supporting
doctrine/dbal 2 and 3.

Regenerating the sqlite .sql patch with dbal 3

Follow-Up: I17d74705cdd5a2e1af0bda66bfa466067b8387a8
Change-Id: I2349e2cbb1760edef12e857c6269056322f57205
2024-05-03 13:24:17 +00:00
Alexander Vorwerk
bda3118e56 Drop 1.35 db updates
Per official policy, updates from versions older than two LTS releases
are not supported.

Change-Id: I8fb08e226c1a37580f95ee622a0703eee312d9ba
2024-05-03 12:53:12 +00:00
Roan Kattouw
bfdd414e51 tests: Import Codex token files by reference
Importing them without using (reference) causes comments from the Codex
file to be output (but only if they're /* comments */, not // comments),
which will break these tests when we upgrade to Codex 1.5.0.

Bug: T363712
Change-Id: Idb5b70e342d3f08edcabda2e8477ec2d259846cb
2024-04-30 14:47:41 -07:00
Alexander Vorwerk
3c5762912d Add 1.42 snapshot to sqlite db tests
Change-Id: I7766727892e8ad785d244a2457a44436786cb137
2024-04-23 22:59:58 +02:00
Roan Kattouw
0900b7d2a1 Update Codex from v1.3.5 to v1.3.6
Bug: T350477
Bug: T358031
Bug: T358038
Bug: T358860
Bug: T360343
Bug: T360349
Bug: T360577
Bug: T361056
Bug: T361104
Bug: T361472
Change-Id: I12813bf0db89b72aa8f2a28ccccb3477e4361ac8
2024-04-02 16:22:04 -07:00
Abijeet
8ddc4ee2ef Add TranslationAliasesDirs to specify special page aliases in JSON
The TranslationAliasesDirs configuration allows defining translatable
aliases in JSON files. The value should be a name or names of folders
that contains files that have localized aliases. Each language should
have a separate file.

Currently, it supports defining special page aliases but in the
future can be extended to support magic words and namespace aliases.

The patch adds a script: ConvertExtensionsMessagesToTranslationAlias
that can be used to convert existing ExtensionMessagesFiles to the new
format.

Bug: T89947
Change-Id: Ief16a48a8dc8742854f67301791aa2a0b0531116
2024-03-06 18:13:28 +05:30
Derick Alangi
7ad9467261
ResourceLoader: Fix regression of color mapping in Less.php
Less.php no longer requires mapping color names (9bdb3fda04/lib/Less/Colors.php (L9))
to their respective hex values, see: I0e6fa0fa88b4ab8dc41c55524661
(T352866).

If the color name is valid CSS, the color keyword (e.g. "green" is
preseved by the less compiler).

Change-Id: Ic91c9bb1d7b931f389cfaf3457d2fee845b9c3f0
2024-02-25 23:33:12 +03:00
Doğu Abaris
d1b1934a76 test: Add PHPUnit tests for BmpHandler
Covered:
- `testMustRender`: Confirmed handler's necessity to render the file.
- `testGetThumbType`: Verified thumb type returned for BMP files.
- `testGetSizeAndMetadata`: Tests with various BMP file sizes.

Change-Id: Ib01914e1ab66ca10ff4e089a0fd591d0b544edf5
2024-02-08 17:05:02 +00:00
Reedy
5a324df8ae Stop supporting composer 1.x
Bug: T316558
Change-Id: Ie512b43a601502deb50de24e1f3efc45b0223ced
2024-01-24 22:19:38 +00:00
Anne Tomasevich
c8117c78ca CodexModule: Throw exception for non-entry points
If a generated chunk is listed in the codexComponents array,
an exception will be thrown informing the developer that the
item is not an export of Codex and cannot be required.

Text fixtures and expected values were updated to match
recent changes to the manifest that made composables
explict entries.

Bug: T353191
Change-Id: Ie3e35501993b1ad5d29ebecbcc8203e7f4ea8c81
2024-01-17 12:29:47 -05:00
Anne Tomasevich
4baf4dd8be CodexModule: Add unit test for code splitting
This requires the path to the Codex modules directory
to be configurable, so we can use static manifest and
component files in tests. This is achieved by changing
the constant storing the Codex modules dir from private
to protected so it can be overridden when creating a
test module.

Bug: T350054
Change-Id: Icd3c6c5d2a82f5a5fb1c38b52e54893034e7375c
2023-12-01 00:52:23 +00:00
Roan Kattouw
0566beabac ResourceLoader: Preserve newlines in Vue templates in debug mode
Ironically, our replacements to improve readability of Vue templates in
debug mode actually ended up eating newlines in the string that is sent
to the Vue template compiler. This caused bugs when inline comments were
used in multi-line JS expressions in templates.

Bug: T351771
Change-Id: I6b3ad5736a836ba75f57a49fd9b7ca2e237074c0
2023-11-21 17:22:13 -08:00
Amir Sarabadani
beb3261b8d Remove language coverter for Kazakh
This has been constantly mentioned as buggy and broken and there is no
official version of latin or Arabic (see the ticket for more details).

This can be turned back as an extension if needed by third party users.

Bug: T350684
Bug: T268143
Depends-On: I6180dca2c49b3119751766268acc56087aaf8414
Change-Id: Ifbf3c8954d885daf891f8d9efc11743d898302f0
2023-11-20 10:31:16 -05:00
Derk-Jan Hartman
8d2d229b30 SVGReader: Detect CSS animated SVGs
This does a string check on animated and @keyframe in style elements
for SVGs. If there is a match it will treat this SVG as animated.

While in theory this could be a false positive, without fulling
parsing the CSS, the chances of that seem minor and there are no
real negative consequences either.

Bug: T332790
Change-Id: I4b8b0781e8f9135d9ab856f3ec06f5a76c66c9a8
2023-11-05 21:21:08 +01:00
Umherirrender
2d25906bbb tests: Add test file for sqlite updates since 1.41
Change-Id: I641a044e50590233e023c2de28ccc18f8b498287
2023-10-29 21:21:10 +01:00
Timo Tijhof
c7e29903ac ResourceLoader: Remove ResourcesTest::testCommentedLocalFileReferences
* Unrelated to the ResourcesTest structure test as it isn't testing
  any of core's resources.

* Moved to the libs/Minify repo in change Ia9018a966a5325d.

Change-Id: If87035777633635fe4ad0f01790e7084f56f65a0
2023-10-20 19:47:50 -07:00
Volker E
5863935f15 Update Codex from v0.19.0 to v0.20.0
In preparation for Codex's upcoming 1.0 release, this patch makes
some additional changes in how the library is vendored into MW.

* foreign-resources.yml: codex-search is removed as a stand-alone
  package (the upstream NPM package has also been deprecated).
  The search-specific build of Codex now lives in the main "codex"
  package. The foreign-resources.yml file has been updated to pull
  in the codex-search scripts and styles from this new location.
* resources.php: The resource module definitions for codex-search
  and codex-search-styles have been updated to use the relocated
  CSS/JS files.
* UMD bundles: Upstream, Codex now designates the CJS bundle as the
  primary entry point. A UMD bundle of the main Codex library is still
  produced but this is intended mainly for usage through CDNs or basic
  script-tag inclusion; in the future the codex.umd.js bundle may be
  removed from MediaWiki and users should not rely on it. The
  codex-search.umd.js bundle has been removed.
* MJS bundles: Codex also produces .mjs (ESM) bundles upstream;
  for users outside of MediaWiki these are the recommended bundles
  to use. However, within MediaWiki only the CommonJS build should be
  used, as ResourceLoader does not support delivery of ESM scripts at
  present. The codex.mjs and codex-search.mjs bundles have been removed
  from MediaWiki with this patch.

Bug: T335324
Bug: T340020
Bug: T340119
Bug: T344848
Bug: T345281
Bug: T345688
Bug: T346099
Bug: T346435
Bug: T346988

Change-Id: I84b26ddf5f9a0a98faf0df8c7acaa5f678032786
2023-09-27 14:10:59 -07:00
thiemowmde
986290ffed Make ExifRotationTest dramatically faster
Down from about 1000ms to 200ms. By using much smaller images. The
absolute size of the images is not relevant for this test. Only the
ratio.

There was nothing special about the "landscape-plain.jpg" image. But
"portrait-rotated.jpg" was: It's technically stored in landscape, but
marked with an EXIF tag for rotation. I used exiftool to copy the EXIF
data to the smaller version, so it behaves the same as before.

Change-Id: Ie977dfbceff02e4dfde38a5ef82e8ff81b4d6980
2023-09-12 09:47:16 +02:00
Lucas Werkmeister
fee22e61d8 LocalisationCache: Add tests for preload behavior
The new block in testRecacheExtensionMessagesFiles() covers the
underlying issue of T343343 and T343375; see change Icc3324aca7 for an
explanation of the issue.

In order for this test to not crash, we also need to adjust some of the
other tests and data. MessagesEn.php defines $preloadedMessages, and
LocalisationCache assumes (quite rightly so, really) that all of these
messages will be found in the configured MessagesDirs. But in the test,
we override MessagesDirs to point at the test’s JSON files, while still
using the original MessagesEn.php with its $preloadedMessages. Now that
we are triggering the preload mechanism (I think it wasn’t reached by
the tests previously?), it triggers a PHP deprecation (since PHP 8) on
the missing messages, which makes the test fail:

> explode(): Passing null to parameter #2 ($string) of type string is deprecated

I decided to fix this by adding fake entries for all $preloadedMessages
to the test en.json file. This makes the other tests that compare the
entire messages array fail, so instead only compare the three messages
those tests care about ("present-*"). I don’t like this very much, but I
dislike the other two approaches I can think of even more: check
defined( 'MW_PHPUNIT_TEST' ) in the original MessagesEn.php file, or add
a test-specific MessagesEn.php using the Language::getMessagesFileName
hook.

Bug: T342418
Bug: T343343
Bug: T343375
Change-Id: Iee11cb5c52cb9dd777b70a1daa06f41f2c3ca187
2023-08-08 13:09:34 +02:00
Lucas Werkmeister
368881a277 LocalisationCache: Add CORE_ONLY_KEYS, ALL_EXCEPT_CORE_ONLY_KEYS
Previously, it was technically possible to set some keys in extension
messages files that didn’t make much sense (e.g. $rtl['en'] = true;).
This prevents optimizing language creation, so going forward, we will no
longer support that; ALL_KEYS is now split into CORE_ONLY_KEYS and
ALL_EXCEPT_CORE_ONLY_KEYS (with a test verifying that no key is missing
or overlapping or anything), and ALL_EXCEPT_CORE_ONLY_KEYS are silently
skipped when loading extension messages files.

To demonstrate that it’s okay to silently skip these keys, patch set 1
of this change on Gerrit instead raised a deprecation warning; CI
indicated that this warning was never hit. Codesearch [1] also suggests
that no known extension was actually using any of these keys. (The
DonationInterface [2] and LandingCheck [3] codesearch results can be
ignored: both of these define es-419 as a new language, using the
Language::getMessagesFileName hook to register their MessagesEs_419.php
as a “core” message file, not an extension message file.)

[1]: https://codesearch.wmcloud.org/search/?q=^\%24(fallback|rtl|(digit|separator)TransformTable|fallback8bitEncoding|link(PrefixExtension|Trail|PrefixCharset)|date(Formats|Preferences|PreferenceMigrationMap)|defaultDateFormat|digitGroupingPattern).*%3D&files=\.php%24
[2]: f8b5fe95f7/gateway_common/messages/MessagesEs_419.php (11)
[3]: 2537439aee/messages/MessagesEs_419.php (11)

Bug: T342418
Change-Id: Ia3dffea390d4efdfa3a3cea549d079507718ef48
2023-07-28 16:32:59 +02:00
Lucas Werkmeister
274fd222df LocalisationCache: Expand tests
To ensure that Ia3dffea390 and I7ec2d87c0f don’t change this behavior.

Bug: T342418
Change-Id: I4646b1c84116f51b6c2a826a41dc5c975d3d205c
2023-07-28 16:30:52 +02:00
Alexander Vorwerk
6434f6f572 Add 1.40 snapshot to sqlite db tests
Change-Id: I837a78d652d644ba8a86a835b29781f267066dda
2023-05-26 11:34:55 +02:00
Amir Sarabadani
95e52c56c8 rdbms: Stop supporting MySQL in SQLite via regex
Given that we now have abstract schema, any schema produced for SQLite
will be produced specificly for SQLite, no need to do regex gymnastics
that are hard to understand, maintain and obviously prone to break.

Bug: T326181
Change-Id: I58741ff82460cfd9a350440d50b293ba67e3c939
2023-05-05 01:20:01 +02:00
jenkins-bot
222bcd8081 Merge "ResourceLoader: Descriptive error for Less imports from codex-design-tokens" 2023-04-11 02:04:01 +00:00
Roan Kattouw
aaecb49e9b ResourceLoader: Descriptive error for Less imports from codex-design-tokens
Importing Less files from @wikimedia/codex-design-tokens/ doesn't work,
on purpose. Instead of letting these imports fail with a nondescript
"file not found" error that doesn't help the developer understand why it
didn't work, provide a descriptive error message that points them in the
right direction.

Bug: T328602
Change-Id: I992ccde79a59ad51c7ebfe3ac7548a6e531f4a59
2023-03-30 16:19:38 -07:00
jenkins-bot
10b17b5132 Merge "mediawiki.skin.defaults.less: Import all Codex mixins" 2023-03-30 10:07:45 +00:00
Roan Kattouw
da432a5233 mediawiki.skin.defaults.less: Import all Codex mixins
This makes all Codex mixins available anywhere that the skin variables
are imported, so MediaWiki code doesn't need to import these mixins
separately. This also ensures that the tokens are present when the
mixins are used.

Bug: T328602
Change-Id: If2b4073115d9082829e4917c87c167d18f5431d9
2023-03-28 16:24:37 -07:00