Commit graph

647 commits

Author SHA1 Message Date
Umherirrender e46bda7e67 tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: If55e19c0a088aef8ab84a09c8f1949320d035db4
2023-05-20 17:29:11 +02:00
Translation updater bot e6c7e17d64 Localisation updates from https://translatewiki.net.
Change-Id: I465729c4b372737ba2c03979cfb818e9fdb30350
2023-05-08 10:32:59 +02:00
libraryupgrader 07d54a052a build: Updating eslint-config-wikimedia to 0.25.0
Change-Id: I71e6affe97be5d2302818923514b1fc8d1cd91eb
2023-05-05 08:00:06 +00:00
libraryupgrader df1e43e747 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.0 → 0.12.1

npm:
* grunt-eslint: 24.0.0 → 24.0.1

Change-Id: If778aca2ebf10adf5fb91cb8673af736cd5e8bc0
2023-04-29 08:11:32 +00:00
jenkins-bot fc73f3b463 Merge "Update parsertests with new media classes" 2023-04-26 17:47:04 +00:00
Arlo Breault 3c6dba3707 Update parsertests with new media classes
Depends-On: Ifd4001e312a5fa4b7beaad63ba8c4e79e3201b9b
Change-Id: I132330414018cb7d3adbd4c1c4e05af91ffeec2d
2023-04-26 13:16:51 -04:00
Umherirrender 3ae938a116 Use renamed ParserModifyImageHTMLHook interface
Follow-Up: I3043454a502289e5ee2492f7bf2ab01e155c30ba
Change-Id: I3cc4a5d4e4edac76e81c16c1da97427d765cce49
2023-04-22 19:54:54 +02:00
Arlo Breault a0be3eec78 Disable tests to break circular dependency
Needed-By: Ifd4001e312a5fa4b7beaad63ba8c4e79e3201b9b
Change-Id: Ib60edacdae2ff41a0de2b2b584718fd9ce925f97
2023-04-20 16:36:41 -04:00
Translation updater bot d2b0979db6 Localisation updates from https://translatewiki.net.
Change-Id: I9c0e7d5c5e4c429a2995eacc1e4dbd710bc50a38
2023-04-10 09:22:30 +02:00
Translation updater bot 50d0c03154 Localisation updates from https://translatewiki.net.
Change-Id: Ic39ee92217e0d8a4056fca59773dd874f044faec
2023-03-20 09:02:03 +01:00
libraryupgrader 8984f699dd build: Updating npm dependencies
* eslint-config-wikimedia: 0.22.1 → 0.24.0
* grunt: 1.5.3 → 1.6.1

Change-Id: I935f57a98174e76a899b82af98d012a6c6607831
2023-03-16 04:01:13 +00:00
libraryupgrader a9656813c0 build: Updating mediawiki/mediawiki-codesniffer to 41.0.0
Change-Id: Ibd2cfb830215f8b002219ca41164bdf6d24c4029
2023-03-12 07:24:15 +00:00
C. Scott Ananian 58fc38be13 Update parserTests to new format for 'property' option
In I845694d4f2109a8b9125410e8533ca69bbea50fa we changed the format of
parser tests using the 'property' option.  This updates the parser
tests in PageImages to the new format used for metadata in parser tests
(in this case, adding `!! metadata` sections).

Depends-On: I845694d4f2109a8b9125410e8533ca69bbea50fa
Change-Id: Ia7060c9bfcdebe9783ea48d429442bcdbaac459e
2023-03-07 15:24:50 -05:00
Arlo Breault 0ec66379d1 Add explicit wgParserEnableLegacyMediaDOM config to pageImagesParserTests.txt
In preparation for changing the default value.

Bug: T314318
Change-Id: Ie1ae17aec283b41dfc086371b4627b665153f086
2023-02-14 15:56:07 -05:00
Translation updater bot 199f0a90ca Localisation updates from https://translatewiki.net.
Change-Id: I819a500e98e12c8709287c7ccf0a8b8151ff61e8
2023-01-30 08:30:36 +01:00
Translation updater bot bcbd17ad68 Localisation updates from https://translatewiki.net.
Change-Id: I912dd2b68cba250647f2b52125403822b02089a4
2023-01-05 09:09:52 +01:00
jenkins-bot 8df2b55c6a Merge "Use PageReference on ParserFileProcessingHookHandlers::processThisTitle" 2023-01-03 23:13:17 +00:00
Umherirrender 00ec4349d4 Use PageReference on ParserFileProcessingHookHandlers::processThisTitle
Avoid deprecated Parser::getTitle
Parser::getPage can return null, so checking for that as well

Change-Id: I90f04d514934621ee7fdc0ebe519673d7ba1d82f
2023-01-03 23:32:11 +01:00
Translation updater bot a387f18f9e Localisation updates from https://translatewiki.net.
Change-Id: I86d0ba378495a9d5d143eb613fd7e12d801eefb0
2023-01-03 08:21:07 +01:00
Translation updater bot d3c6d39d63 Localisation updates from https://translatewiki.net.
Change-Id: I902e53be35da9b3a8bff004d436f08e9d6dc931d
2023-01-02 08:44:03 +01:00
Translation updater bot fca29f3ebe Localisation updates from https://translatewiki.net.
Change-Id: I53c2fd3baff515277062083bde1f9f111485e107
2022-12-21 09:17:07 +01:00
jenkins-bot 3368093c4d Merge "Temporarily disable failing heading parser test case" 2022-12-15 19:07:11 +00:00
jenkins-bot 3dfd1f636f Merge "Replace deprecated Http::get" 2022-12-14 20:50:00 +00:00
Amir Sarabadani 491eeedc28 Fix brittle test
It really shouldn't test everything. Blocking I3dc682d2dce

Change-Id: I12643edfad16acb072757ec29ae3ba08fc11d65b
2022-12-12 08:28:37 +01:00
Umherirrender de7bf883d2 Replace deprecated Http::get
Bug: T305813
Change-Id: Icd3e64fc13e291761b287c4059315df39cd88d1e
2022-12-11 15:54:20 +01:00
Translation updater bot 7a83acf385 Localisation updates from https://translatewiki.net.
Change-Id: I320a09902d406266dd09ed712d67cd2f8ddc557d
2022-11-29 08:59:04 +01:00
jenkins-bot 7245136ded Merge "Adopt getWithSet idiom for getPageImage in-process cache" 2022-11-29 06:07:56 +00:00
Bartosz Dziewoński af76b17c7e Temporarily disable failing heading parser test case
The heading markup is changing in T13555.

Change-Id: Ib92193b6b43ca4b8f8f36475ed0a7793866b50c0
2022-11-24 15:37:24 +01:00
Timo Tijhof d50f90ba78 Adopt getWithSet idiom for getPageImage in-process cache
Follows-up I9b08b4de2648bf.

Bug: T322528
Change-Id: I8e974b66e3a0cdee2c6ef5eeb38719cff60dc93c
2022-11-23 01:38:14 +00:00
Amir Sarabadani 8fe805f25e Make sure pithumbsize set width and not height
This unifies image thumbnail sizes so instead of being random image
sizes, it would be only one thumbsize.

Bug: T323223
Change-Id: Ib7a7a5bce3ce10e60819e6ca056fe30f11e969a5
2022-11-21 19:52:44 +01:00
jenkins-bot 9902ffb55c Merge "Remove size check" 2022-11-17 23:16:29 +00:00
jenkins-bot e588a4eeff Merge "Add in-process cache for result of getPageImage() DB query" 2022-11-17 16:21:41 +00:00
libraryupgrader d99802768c build: Updating mediawiki/mediawiki-codesniffer to 40.0.1
Change-Id: Idfb908cfb13308c1c3a600705b0ed60d9215008f
2022-11-17 07:15:05 +00:00
Matthias Mullie c75b00d14d Ensure array is passed to getProperties
PageImages::getPropNames can return either array or string,
and PageProps::getProperties accepts both.
But the latter's return value will be different depending
on the type of input: with an array as input, the returned
array's values will be an associative array where the index
is the propname; with a string, it's just the propvalue.

This difference matters because the code below assumes an
array with propname keys.

Bug: T323152
Change-Id: I422951ec0cd5c651b32c65e88a557d49f2f22712
2022-11-16 09:33:37 +01:00
Amir Sarabadani bb555ae71d Add in-process cache for result of getPageImage() DB query
There has been cases of different extensions calling this function
for the same page title within the same web request, leading to
duplicate queries and roundtrips. This avoids those.

Maybe in future we could have APCu cache for it.

Bug: T322528
Change-Id: I9b08b4de2648bf794bfdbfe57de9db433cfd79ee
2022-11-15 20:18:43 +01:00
Matthias Mullie 9391a1f18c Remove size check
Size is not a useful (and thus far, unused) value that
is expensive to compute & we want to get rid of.

Let's not expect any particular value (or it even
existing) because that may not remain true for much longer.

Bug: T323125
Change-Id: I20d5c4358e225be7759ed38afb2267d6f811fa34
2022-11-15 18:39:22 +01:00
jenkins-bot d7d9c0275f Merge "Only provide free images for search purposes" 2022-11-10 17:48:20 +00:00
Matthias Mullie 5dcd4d13e2 Only provide free images for search purposes
Bug: T320661
Change-Id: Ic26e7e815365f6aa81b6fbfb464d0f41b80e4ae8
2022-11-10 13:26:56 +01:00
Tim Starling 33ee32f448 Use preg_replace_callback() flag introduced in PHP 7.4
Should improve performance by avoiding the need to run the regex
twice.

Change-Id: Ic737c1c2189c1bfc046cdcb099cdcbc0edde0a97
2022-11-10 13:58:31 +11:00
libraryupgrader fd123da0a3 build: Updating minimatch to 3.0.8
* https://github.com/advisories/GHSA-f8q6-p94x-37v3

Change-Id: Ic00d887ef92f96a6e3bb5d680328f39a61d4deec
2022-10-21 10:46:26 +00:00
libraryupgrader f807a8bbf0 build: Updating mediawiki/mediawiki-phan-config to 0.12.0
Change-Id: Ibd1a0df2c1786ccd45554ddf150602af681c6247
2022-10-09 08:12:35 +00:00
libraryupgrader dc2efbb7f4 build: Updating grunt-banana-checker to 0.10.0
Change-Id: Id8357b68ffcf2c2cb46c938bc689da64778803f4
2022-10-07 02:59:39 +00:00
jenkins-bot 74ec9b8a18 Merge "Drop some code that now lives in core" 2022-10-03 11:30:52 +00:00
Translation updater bot 105d05ccf8 Localisation updates from https://translatewiki.net.
Change-Id: I37ceba59fa2150345fc6b0eb3cf64599d323800f
2022-09-30 08:54:35 +02:00
Matthias Mullie 6a6af45ab3 Drop some code that now lives in core
The default thumbnail size (SearchResultThumbnailProvider::THUMBNAIL_SIZE),
the code to build a SearchResultThumbnail object from a File object
(SearchResultThumbnailProvider::buildSearchResultThumbnailFromFile),
and the code that provides thumbnails from NS_FILE pages (now already
provided in the hook's $results param) have essentially been adopted
in core and no longer need to be handled here.

Also updated test to reflect that NS_FILE results will no longer be
provided by this extension (since core already provides them)

Depends-On: I2a679b51758020d3e822da01a1bde1ae632b0b0a
Change-Id: I2eafc8556022432929973755d8cd76010ea24f39
Bug: T306883
2022-09-27 10:46:14 +02:00
Translation updater bot 2df53d17db Localisation updates from https://translatewiki.net.
Change-Id: If0165504c77b31bf09be7b78477938a41f21f856
2022-09-26 08:15:57 +02:00
jenkins-bot 499ffd7934 Merge "Inject services into hook handler" 2022-09-09 16:43:49 +00:00
jenkins-bot bfdd3d028d Merge "Inline ParserFileProcessingHookHandlers::processFile" 2022-09-09 16:39:10 +00:00
jenkins-bot 630decba6a Merge "Update hook FQCN" 2022-09-05 19:53:20 +00:00
jenkins-bot d6a007ebd1 Merge "Allow thumbnails to be provided in a different size" 2022-09-05 19:53:10 +00:00