Commit graph

1179 commits

Author SHA1 Message Date
Umherirrender
10c01b23c0 Rest: Move ModuleConfigurationException into correct folder
The folder name must match the namespace used for the class.

Change-Id: I768a4f8c9031e51b4a61174f39164204f6331dc2
2025-07-02 00:24:28 +01:00
Translation updater bot
c129ebd2d2
Localisation updates from https://translatewiki.net.
Change-Id: Id745ce901c7efff83a022e0879125ca9fdebd44a
2025-07-01 07:34:28 +02:00
Translation updater bot
38a0f5d5e9
Localisation updates from https://translatewiki.net.
Change-Id: If2a15063f338e83caea4b85b0b87d67defbe80b4
2025-06-24 07:33:27 +02:00
Translation updater bot
5e27e3d4c9
Localisation updates from https://translatewiki.net.
Change-Id: Id506abba0a9655c6e4d23cf2f901db8e97312661
2025-06-17 07:32:55 +02:00
Translation updater bot
d5e97d42ac
Localisation updates from https://translatewiki.net.
Change-Id: Id5113b17063ac0d61bc9ab3638814ad4d6e13e8e
2025-06-10 07:33:07 +02:00
Translation updater bot
834c1a5407
Localisation updates from https://translatewiki.net.
Change-Id: Ia44339c067661faed77d8b6b7670a62fc47589ba
2025-06-03 07:32:43 +02:00
Translation updater bot
b7432b90c0
Localisation updates from https://translatewiki.net.
Change-Id: I8263419b865039c2a45179ad5a48d3185b6c71e6
2025-05-13 07:34:39 +02:00
Translation updater bot
c2b5de68b3
Localisation updates from https://translatewiki.net.
Change-Id: I89e0bab6d19294ff1f993e65df12ccfbea228710
2025-04-22 07:33:11 +02:00
Translation updater bot
0f365d630b
Localisation updates from https://translatewiki.net.
Change-Id: I7757816ae8ab62edf8825b2055bbcab9e9b7c6f8
2025-04-15 07:32:55 +02:00
Timo Tijhof
b53b5e1d33 REST: Remove unused setUseParserCache() as potential footgun
Added in 2022 with I7d97c9e2d4 (c6a0d433ec) for Ie430acd075
(e82f11c246) which was (after a revert and re-apply) eventually
removed after the warmup completed (I852060c8a4, 3df4952385).

Bug: T322672
Bug: T387478
Change-Id: I1921b4f985fb27b2227aef4a0eba6751c1c0b8d5
(cherry picked from commit 2a5cf3fde93263156557bc1efd21c5a74ce67725)
2025-04-05 11:35:48 +00:00
Translation updater bot
9de43c4fca
Localisation updates from https://translatewiki.net.
Change-Id: I8d8f8f876ce596712cfa46ec6d774ad14e5b8c1b
2025-04-01 07:32:43 +02:00
Translation updater bot
50fb129172
Localisation updates from https://translatewiki.net.
Change-Id: I0e3e387ab8ffd8d042bb81165a51ffcd6411e050
2025-03-25 06:33:36 +01:00
Translation updater bot
052664c1f0
Localisation updates from https://translatewiki.net.
Change-Id: I7db45053212cc3abc595a82f9136090d09dfceab
2025-03-11 06:32:45 +01:00
daniel
548d5eb8de REST page metadata endpoints: handle supressed data gracefully
Why:
- Revision meta-data output was failingfor revisions with suppressed
  user or comment

What:
- Handle suppressed user and comment gracefully
- add regression test

Bug: T386368
Bug: T387397
Change-Id: Ic6d3fc89d24030f5c3fd422637816de9976fc709
(cherry picked from commit 8c53a15ba0fae2677aa8e28055f06ef557595be6)
2025-03-10 17:18:37 +00:00
Translation updater bot
369b31f5ea
Localisation updates from https://translatewiki.net.
Change-Id: I8efdea63dce69f70911877f8c402daa05247f012
2025-03-04 06:34:04 +01:00
Translation updater bot
3f040e33bd
Localisation updates from https://translatewiki.net.
Change-Id: If360ec9295a3fd250b27dec146e81f205e0c6e54
2025-02-25 06:32:49 +01:00
Translation updater bot
086f0b5236
Localisation updates from https://translatewiki.net.
Change-Id: Ie6671ad9a673374b4d70a6fdfe0447e310d1db56
2025-02-18 06:32:08 +01:00
Translation updater bot
921fcc4d4c
Localisation updates from https://translatewiki.net.
Change-Id: If800b2998c86a9d9333057ccbcfe4e638dfbaca4
2025-02-11 06:32:37 +01:00
Máté Szabó
c4e9f987f1 rest: Return a 400 for invalid render IDs
Why:

- The REST API takes an optional renderid param when converting HTML
  back to source wikitext, which is user-provided and may be invalid.
- Invalid render IDs cause an InvalidArgumentException to be thrown that
  causes a 500 response.

What:

- Introduce a new error message for invalid render IDs in the REST API.
- Return a 400 with this new error message for HTML reverse-parses with
  an invalid render ID.

Bug: T385568
Change-Id: I062419fe8952329a39781a49cdca2e94c3996447
(cherry picked from commit cd1d42a5066e4bcb9b9d4ed9b4f7714fd428fea3)
2025-02-04 14:54:50 +00:00
Translation updater bot
9530b23ee3
Localisation updates from https://translatewiki.net.
Change-Id: I7c5c2921596e509850cfa828ff4da00e9fbb6ea0
2025-01-14 06:31:37 +01:00
Translation updater bot
6c023c219b
Localisation updates from https://translatewiki.net.
Change-Id: If6383924ed055260ce45fd363dd37c889f3d0cd2
2024-12-03 06:32:00 +01:00
Translation updater bot
c149a70c0e
Localisation updates from https://translatewiki.net.
Change-Id: Iee6d9a093d36164b67739c76651500c6eff23414
2024-11-26 06:31:54 +01:00
Translation updater bot
d5a793d5a2
Localisation updates from https://translatewiki.net.
Change-Id: Ide69282dbb21c4f1bb12e5ad90444472711cbf19
2024-11-19 06:32:07 +01:00
Translation updater bot
21eaa87821
Localisation updates from https://translatewiki.net.
Change-Id: Ifd10ef063d76695c30c0bc703b955d5c96c2430b
2024-11-12 06:32:03 +01:00
bpirkle
f5a7e973c7 REST: make http method available during response schema generation
A previous change made it possible to include response schemas in
generated OpenAPI specs. However, it did not provide the http method
to the code that generates/includes these schemas. Because some
handlers support multiple http methods, this is necessary. So add it.

Bug: T375530
Change-Id: Ie681d576cdffc387d78a1686e058903761b749ac
(cherry picked from commit 576b29092d5fd6a8480e02ddc2141b69cf698936)
2024-11-07 19:06:59 +00:00
Andre Klapper
aab00c9530 Use explicit nullable type on parameter arguments
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead.

Followup to e662614f, using PHPStan.

Bug: T376276
Change-Id: I60d639b042b537bf2f531cc132f1b75a66b85acb
(cherry picked from commit da0a395efa7847916371f9c0a6b271faa022ff59)
2024-10-23 17:20:01 +00:00
jenkins-bot
b60d69a6ac Merge "REST: Add items wrapper for restbase compat to some response bodies" 2024-10-21 18:40:15 +00:00
jenkins-bot
f057afcc4d Merge "Deprecate ::setMetrics() calls with StatsdDataFactoryInterface" 2024-10-21 17:12:19 +00:00
jenkins-bot
cd58285157 Merge "Parsoid: SiteConfig::prefixedStatsFactory() can never return null" 2024-10-21 10:16:12 +00:00
C. Scott Ananian
4d4715326a Deprecate ::setMetrics() calls with StatsdDataFactoryInterface
HtmlInputTransformHelper::setMetrics() and
HtmlToContentTransform::setMetrics() take a StatsFactory now; deprecate
passing a StatsdDataFactoryInterface.

Depends-On: I0d8eb6cacd761fa4959419b10d59046e61c714ff
Change-Id: I2374731f6d37a191fc4a865d2665f2ca18182db1
2024-10-18 18:45:00 -04:00
C. Scott Ananian
c49d9199a5 Parsoid: SiteConfig::prefixedStatsFactory() can never return null
SiteConfig::$statsFactory is non-nullable, and
StatsFactory::withComponent() never returns null.

Change-Id: Ib14a1ee44b81476447717bc6aa00b54de1dca995
2024-10-18 18:45:00 -04:00
Translation updater bot
206c49bde0
Localisation updates from https://translatewiki.net.
Change-Id: I3c825fd44ee1cb98abde8062d415a039d2a0aeb1
2024-10-18 09:04:00 +02:00
jenkins-bot
53bd99f5dc Merge "Use statslib for metrics emitted by HtmlInputTransformHelper, HtmlToContentTransform" 2024-10-17 23:46:56 +00:00
Yiannis Giannelos
331c181598 Use statslib for metrics emitted by HtmlInputTransformHelper, HtmlToContentTransform
Bug: T359475
Change-Id: I7d4ca748c106dfd560dae31294decfb2b181e2db
2024-10-17 21:28:04 +02:00
jenkins-bot
1d0377f1ba Merge "Adding token validation to the edit handler" 2024-10-17 14:51:30 +00:00
Translation updater bot
51c6df1cc4
Localisation updates from https://translatewiki.net.
Change-Id: I7845b834d7497f34569961c94a2e02845c4d431d
2024-10-17 09:04:59 +02:00
jenkins-bot
abc8da60be Merge "Use explicit nullable type on parameter arguments" 2024-10-16 23:10:14 +00:00
Amir Sarabadani
2db1020868 Stop using heavy Language object when not needed
Two easy cases, way more can be done.

Bug: T376565
Change-Id: I3b875c4b6b2c2bdf7171a712898d50e26d86c807
2024-10-16 21:34:52 +02:00
Umherirrender
e662614f95 Use explicit nullable type on parameter arguments
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead

Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a

Break one long line in SpecialPage.php

Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
2024-10-16 20:58:33 +02:00
bpirkle
330e1633c2 REST: Add items wrapper for restbase compat to some response bodies
Bug: T374136
Change-Id: I995916f53eb9408923456cce8b1f3be391fbf942
2024-10-16 12:58:10 -05:00
James D. Forrester
a5387c7c20 Namespace all remaining classes in includes/parser
Bug: T353458
Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
2024-10-15 23:54:32 +01:00
jenkins-bot
deba2439b7 Merge "REST: Allow specifying param descriptions as MessageValue objects" 2024-10-15 15:24:56 +00:00
jenkins-bot
3867124e9b Merge "REST: Allow specifying response body schemas in json files" 2024-10-14 14:46:17 +00:00
bpirkle
08a2e410e6 REST: Allow specifying response body schemas in json files
Previously, response body schemas could be specified by handlers as
php associative arrays, that were included in the final OpenApi spec.
This mixed the schemas with code, and required developers to deal with
specs in multiple formats. Instead, allow specs to be specified in
JSON format, in separate files. In addition to keeping schemas in JSON,
this gives each schame its own git history.

Bug: T376290
Change-Id: Ic27f422df0ab12a3a0b1cbce79eb0be30f7b7815
2024-10-10 20:42:14 -05:00
jenkins-bot
ae3afe014b Merge "Remove meaningless @var documentation from constants" 2024-10-09 22:03:23 +00:00
C. Scott Ananian
79896b6e0d Ensure HtmlOutputRendererHelper::setPageLanguage() splits the cache
HtmlOutputRendererHelper sets ParserOptions::setTargetLanguage(),
but this isn't actually included in ParserOptions::$cacheVaryingOptionsHash
so even though this setting changes the ParserOutput it wasn't
being included in the cache key.

Bug: T376783
Change-Id: Ie76020dc4fa3545f827e1674051530b479f01f31
2024-10-09 10:55:22 -04:00
thiemowmde
b1c9ec74fa Remove meaningless @var documentation from constants
A constant is not a variable. The type is hard-coded via the value
and can never change. While the extra @var probably doesn't hurt much,
it's redundant and error-prone and can't provide any additional
information.

Change-Id: Iee1f36a1905d9b9c6b26d0684b7848571f0c1733
2024-10-09 09:33:12 +02:00
bpirkle
27b5faf93b REST: Allow specifying param descriptions as MessageValue objects
Previously, parameter descriptions could only be specified as
strings. We want OpenAPI specs generated from parameter
definitions to be internationalizable, so allow specifying
descriptions as MessageValue objects, which can be translated
using normal MediaWiki mechanisms.

Associated improvements to ResponseFactory.

Bug: T376493
Change-Id: If1cbe4f7bfd5c375e64b802b666c0247d65b1ee0
2024-10-08 16:42:52 -05:00
Translation updater bot
db7e41ad76
Localisation updates from https://translatewiki.net.
Change-Id: I5b553e46652ce409459e85675c40982fc61c12f2
2024-10-07 09:05:49 +02:00
Yiannis Giannelos
fec9daae4e Use statslib for metrics emitted by HtmlOutputRendererHelper
Bug: T359476
Change-Id: If8bc5a7f7383dcb67dadf1f4c02d1b69d7c8fa53
2024-10-04 14:52:30 -04:00