Commit graph

2113 commits

Author SHA1 Message Date
jenkins-bot 327f82e680 Merge "Allow pages in gadget namespace to begin with a lowercase letter" 2022-08-27 17:45:22 +00:00
Siddharth VP 03ae3a0ff1 Allow pages in gadget namespace to begin with a lowercase letter
* By convention, JavaScript and CSS files on disk are almost always
named with a leading lowercase. It is good to have parallelism
with on-wiki page names (such as while uploading git-managed source
files on disk). With the introduction of packaged gadgets (T198758), it
is preferable to write require('./data.json') rather than
require('./Data.json')
* There could be existing pages like MediaWiki:Gadget-Foo.js and
MediaWiki:Gadget-foo.js. During the migration, both titles would
conflictingly have the same move destination Gadget:Foo.js.

Bug: T300000
Change-Id: I2172112caf06cf37ff8808808feb06991010fee9
2022-08-27 17:48:02 +05:30
Siddharth VP 08cf009f36 Migrate usage of Database::selectFieldValues to SelectQueryBuilder
Bug: T312440
Change-Id: I4a54426667cd4c6070b0ff7953e6478dc25b96c8
2022-08-27 17:17:27 +05:30
Translation updater bot 777a1303a8 Localisation updates from https://translatewiki.net.
Change-Id: Ibc38725991ec85a558683ff065881d733ccc4de5
2022-08-26 08:22:48 +02:00
Translation updater bot d370e9c8b9 Localisation updates from https://translatewiki.net.
Change-Id: I4b378e85a9232bb3c7d4ac0c57cd0a3a3b6da545
2022-08-19 08:29:32 +02:00
jenkins-bot 27c6d6d42a Merge "Remove default values for the constructor of SpecialPage" 2022-08-14 14:21:32 +00:00
Translation updater bot 185b248900 Localisation updates from https://translatewiki.net.
Change-Id: Ie4100a055cf73da9f58bf1d1f3b8341f1847cd9f
2022-08-09 08:19:42 +02:00
Fomafix dda2f5a129 Remove default values for the constructor of SpecialPage
Change-Id: Ibdc2d3906f3020798cd885d6fba7e5149d1b5cdf
2022-08-08 15:44:05 +00:00
Translation updater bot 04ab1daf12 Localisation updates from https://translatewiki.net.
Change-Id: I7db4bbbdf7f4db299b13daa553c8d3b30515d3fa
2022-08-08 08:58:38 +02:00
Translation updater bot 759775bb45 Localisation updates from https://translatewiki.net.
Change-Id: Ia5d177e684794294051dbdc1cec57da84a003aa4
2022-08-04 08:42:48 +02:00
Translation updater bot 17cfa8d56f Localisation updates from https://translatewiki.net.
Change-Id: I0e419c9e153ec02ed4ea87d0e583f0105652bfb0
2022-07-29 08:53:09 +02:00
Translation updater bot c198fc8d46 Localisation updates from https://translatewiki.net.
Change-Id: Icb8e23242c391516161d34230a2cb6fe8538c8ca
2022-07-25 08:36:39 +02:00
Fomafix adc1aaa001 Remove LEFT-TO-RIGHT MARK (U+200E) from source code comments
'LEFT-TO-RIGHT MARK' (U+200E) is not needed in the source code
comments.

c8caf26ffd9 removed already the LRM/RLM from Names.php.

Change-Id: I7a737760bd69983703bc324592e56c5ee4acfaad
2022-07-22 16:24:39 +00:00
Translation updater bot 3f515ebfbf Localisation updates from https://translatewiki.net.
Change-Id: I8914478e26cb00401061e099520b87a44753df5c
2022-07-21 09:03:44 +02:00
Translation updater bot 65e70d94cd Localisation updates from https://translatewiki.net.
Change-Id: I73d6d097003f86d6e47495323681c33ec112d836
2022-07-19 08:16:35 +02:00
Translation updater bot 62f01a1c12 Localisation updates from https://translatewiki.net.
Change-Id: I4bb3a991d855fecebe80974c200f51dde4053495
2022-07-15 08:43:28 +02:00
Translation updater bot 3d63f4ef39 Localisation updates from https://translatewiki.net.
Change-Id: Ia686f910ee113b468bedc00a76c048265d4d15f2
2022-07-11 09:49:41 +02:00
Translation updater bot 5f5a483256 Localisation updates from https://translatewiki.net.
Change-Id: I5bcd1ead43934ef95193a08b433207a478537a91
2022-07-05 08:38:14 +02:00
Translation updater bot 11ebb4a227 Localisation updates from https://translatewiki.net.
Change-Id: I2ac469c38bac72626f6638b88a8df44bc92134e9
2022-07-04 08:22:08 +02:00
na1307 13cdf606a1
Add Korean special page alias
Change-Id: Ie00880dac6cfbe13cb4a14c7eddd419efc5ec5a7
2022-06-30 21:46:08 +09:00
Reedy 67b8bf23d0 SpecialGadgets: Don't call explode() on null
Bug: T311557
Change-Id: I05455a309bee4a4f59dc5351484dfffc682a329a
2022-06-29 00:51:24 +00:00
Reedy 6e30b50063 MediaWikiGadgetsDefinitionRepo::loadGadgets(): Cast ttl to int
Bug: T311367
Change-Id: I4ca0d075bad91903f24906c34d1fbac915fde735
2022-06-28 19:56:01 +00:00
Translation updater bot 6c446f8c5b Localisation updates from https://translatewiki.net.
Change-Id: I9aa298906aa49d5f848e0447b19c7cb1032da1b0
2022-06-22 08:13:26 +02:00
Translation updater bot 32cda9d7e9 Localisation updates from https://translatewiki.net.
Change-Id: Ic9857a7e95384971bfb02eaa798ebd6fea959c77
2022-06-20 08:16:58 +02:00
Translation updater bot 2258653f23 Localisation updates from https://translatewiki.net.
Change-Id: Ic29d4c61de044752a87de70ea8e7e55d615d230b
2022-06-13 08:28:12 +02:00
MarcoAurelio 47e7c249c2 Namespace translations for Kyrgyz language
Authored by: <https://phabricator.wikimedia.org/p/Bosogo/>

Bug: T309866
Change-Id: I3c2eacef138e89465f9ca169e1b22b6d509f63b8
2022-06-09 09:57:02 +00:00
Translation updater bot 84928cf99d Localisation updates from https://translatewiki.net.
Change-Id: Ib9147c832442265f92164e4316a7af447c36a62f
2022-06-09 08:16:40 +02:00
jenkins-bot d1e87aefff Merge "Add namespace names for [pcm] Nigerian Pidgin" 2022-06-03 10:44:55 +00:00
Jon Harald Søby c825368ec8 Add namespace names for [pcm] Nigerian Pidgin
As reported on
https://incubator.wikimedia.org/wiki/Special:PermaLink/5456586#Nigerian_Pidgin_namespaces

Change-Id: I5e2502b9405f8c798d98872573479edb0b330c0e
2022-06-03 12:03:28 +02:00
Translation updater bot ef596fef7a Localisation updates from https://translatewiki.net.
Change-Id: I9bb14ac9719c8b1baef7cdf4a00a22fc67b52528
2022-06-03 08:57:38 +02:00
libraryupgrader 7db49a7f2e build: Updating grunt to 1.5.3
Change-Id: I3c2decb38404ca6f9b7d4c9efe713382e2c0632c
2022-05-28 01:01:45 +00:00
DannyS712 4cdb1486e3 Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due
to T308443.

Bug: T308718
Change-Id: I4cabf840fe5bfac65542a08675865b2ce3952ecc
2022-05-28 00:59:46 +00:00
Translation updater bot ab0e224fce Localisation updates from https://translatewiki.net.
Change-Id: I7caadb0caeead88ee54820ddbd39f75f7e54293a
2022-05-23 08:16:53 +02:00
libraryupgrader f4e4469aa8 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 38.0.0 → 39.0.0
* mediawiki/mediawiki-phan-config: 0.11.0 → 0.11.1
* php-parallel-lint/php-console-highlighter: 0.5.0 → 1.0.0
* php-parallel-lint/php-parallel-lint: 1.3.1 → 1.3.2

npm:
* eslint-config-wikimedia: 0.20.0 → 0.22.1
* grunt: 1.4.0 → 1.5.2
* grunt-eslint: 23.0.0 → 24.0.0
* async: 3.2.0 → 3.2.3
  * https://github.com/advisories/GHSA-fwr7-v2mv-hh25

Change-Id: Ia1fc04b195651dcd3356081b7189fc2f043f41e9
2022-05-21 04:11:05 +00:00
Translation updater bot 1f2f0d0432 Localisation updates from https://translatewiki.net.
Change-Id: Ib83da50ef9a173e61c7c97a1ab279628ffee5f66
2022-05-17 08:28:08 +02:00
jenkins-bot 6e047225cc Merge "Remove legacy handling for EditFilterMergedContent hook" 2022-04-27 16:10:50 +00:00
Translation updater bot 9180ab87b8 Localisation updates from https://translatewiki.net.
Change-Id: I2abc86bcfa81b1a0d88fe2c4e9459eb4b752a340
2022-04-25 08:17:55 +02:00
Translation updater bot 2c479393f6 Localisation updates from https://translatewiki.net.
Change-Id: I45eb0b5988e66289ff7998fcb831867151355ce1
2022-04-21 08:12:14 +02:00
Fomafix 85351609fd Use classic hook for CodeEditorGetPageLanguage
This hook needs the old call structur as there is not a interface for
it.

When CodeEditor extension is changed to provide that interface, this
needs to be moved to another class, because the extension is optional
and the interface not loaded on all installs.

This change is a follow-up to b504a6f496
and reverts the change for hook CodeEditorGetPageLanguage because
onCodeEditorGetPageLanguage is still a static function.

Bug: T271014
Change-Id: I0ac6f353be099c4c9b4cb36b65cb463b7b7b89ea
2022-04-19 13:42:45 +00:00
Ammarpad c279d5cc36 Remove legacy handling for EditFilterMergedContent hook
Extension now requires MW 1.39

Change-Id: Ic63b6f66cec49fe72e5a291fe8d7685101324e4a
2022-04-18 05:19:30 +00:00
Fomafix b504a6f496 Use HookHandlers and implement hook interfaces
Bug: T271014
Change-Id: I50d42df04038d1214fd9835c3d3b0f602037ac62
2022-04-17 12:00:24 +00:00
Translation updater bot b839ee8b0a Localisation updates from https://translatewiki.net.
Change-Id: I632806d22091ef3976b959d1403b4a4b57d2743c
2022-04-15 09:56:27 +02:00
jenkins-bot f77367d6a7 Merge "Rewrite and simplify MediaWikiGadgetsDefinitionRepo cache" 2022-04-06 22:51:28 +00:00
jenkins-bot 09c2ddeaf2 Merge "GadgetRepo: Fix missing purging on delete and simplify hook handling" 2022-04-06 17:33:35 +00:00
jenkins-bot 8f6d10baae Merge "tests: Use setGroupPermissions() to fix flaky test" 2022-04-05 21:14:54 +00:00
jenkins-bot 85b37dd0b1 Merge "GadgetRepo: Add or improve type hints in various methods" 2022-04-05 21:14:52 +00:00
Timo Tijhof db04e488b6 Rewrite and simplify MediaWikiGadgetsDefinitionRepo cache
* Remove most APCu logic, including the reverse checking of WANCache
  touch time to validate the APCu key
  The APCu expiry had a 7-15s blind TTL before this check took place.
  Keep the conservative part of this (blind TTL). This should be
  more than enough to debounce memcached traffic.

* Simplify WAN handling with plain key and delete (using the default
  holdoff tombstone, which should take care of edge cases like second
  DC warming up the WAN key shortly after a delete).

* Fix incorrect method doc about being by section. The returned
  list is not by section.

Change-Id: If14ff83a29367df58d1824615bcf0bcd2edc886f
2022-04-05 21:39:45 +01:00
Timo Tijhof ab753d805e GadgetRepo: Fix missing purging on delete and simplify hook handling
== Motivation ==

On a local dev wiki and in CI, where no gadgets are defined yet,
fetchStructuredList() is called on every load.php request and doing
uncached database look ups. This is because T39228 (stale cache
after Gadgets-definition was empty or created) was fixed by disabling
the cache until the page exists. This seems like a poor solution,
and commit I3092bcb162d032 recognises that the problem was not
understood at the time. I propose to instead cache it always and
purge it when the page is modified in any way.

Cold calling fetchStructuredList() accounted for ~170ms of ~400ms
when trying out debug v2 (T85805), thus making it significantly
slower and causing a chain of dozens of requests to pile up.

== Previously ==

* Legacy repo (MediaWikiGadgetsDefinitionRepo) only implemented
  handlePageUpdate.
* handlePageUpdate was called from onPageSaveComplete for both
  any page edit, and for creations in the experimental namespace.
* The experimental GadgetDefinitionNamespaceRepo is based on
  ContentHandler rather than global hooks. This system does not
  have a create-specific callback. It called update for edit/create,
  and delete for delete. The experimental repo relied on create being
  called from the global hook for the legacy repo, and update was
  then called twice.
* There was no global hook for onPageDeleteComplete, thus the
  legacy repo did not get purges.

== Changes ==

* Add onPageDeleteComplete hook to fix purges after deletion,
  with the legacy repo now implementing handlePageDeletion() and doing
  the same as handlePageUpdate().

* Fix handlePageUpdate() docs to reflect that it covers page create,
  since onPageSaveComplete() called it either way.

* Fix experimental repo to include its namespace purge in
  its handlePageUpdate() method.

* Get rid of now-redundant handlePageCreation().

* Get rid of handlePageDeletion() since its implementations would
  now be identical to handlePageUpdate().

  All these hooks and handle*() methods are just for a memc key
  holding gadget metadata. We don't need to microoptimise this
  on a per-page basis. Gadget edits are rare enough that purging them
  as a whole each time is fine. We do the same in MediaWiki core
  with ResourceLoaderGadgetsModule already.

Bug: T85805
Change-Id: Ib27fd34fbfe7a75c851602c8a93a2e3e1f2c38a0
2022-04-05 21:39:45 +01:00
Timo Tijhof 6f452d11b9 tests: Use setGroupPermissions() to fix flaky test
Locally these tests are failing for me on master every time.
In WMF CI, it seems they are passing right now, although they
too would start failing as of Ib27fd34fbfe7a7. My guess is that
my change there causes the service container to be initialised
earlier and thus causes the modified global to no longer be seen.

At the very least this should have been using setMwGlobals(), which
would have also avoided the issue by ensuring a service reset,
however use setGroupPermissions() since it's tailor made for this
purpose, and avoids potential problems later with default groups
not existing.

Change-Id: I8f02ffc996d6077ca6e7433229b1ea5d8fc6ce7c
2022-04-05 21:07:28 +01:00
Timo Tijhof f0c75c4a78 GadgetRepo: Add or improve type hints in various methods
Change-Id: Ia1a3e5a69ac02822d9062262e69e6c48325c15a0
2022-04-05 20:32:16 +01:00