These exceptions are not documented with @throws and they're really not
meant to be caught.
Bug: T86704
Change-Id: I07f32e42c6fd4bc8785bac91547858f15a9fc2a8
Add links to more detailed help for the continue parameter.
[[API:Continue]] is currently a redirect to the existing continuation
documentation, but may be expanded to a full page given how
important continuation is to API usage.
Change-Id: I4b26e786371d941deea25c1f0c403e0c5783596f
I was thinking add validations to HTMLApiField and other field types
if any, but then I found one field type that hard to implement proper
length validation, which is used for the `email-blacklist` preference.
The API will not save options that exceed the limit after this patch,
as if the validation is done by respective html fields.
Bug: T326696
Change-Id: Ib6b04db33bc6a806a49a16a1797c191faf5fb59d
* ParserOutput::setSections()/::getSections() are expected
to be deprecated. Uses in extensions and skins will need to be
migrated in follow up patches once the new interface has stabilized.
* In the skins code, the metadata is converted back to an array.
Downstream skin TOC consumers will need to be migrated as well
before we can remove the toLegacy() conversion.
* Fixed SerializationTestTrait's validation method
- Not sure if this is overkill but should handle all future
complex objects we might stuff into the ParserCache.
* This patch emits a backward-compatible Sections property in order to
avoid changing the parser cache serialization format. T327439 has
been filed to eventually use the JsonCodec support for object
serialization, but for this initial patch it makes sense to avoid
the need for a concurrent ParserCache format migration by using a
backward-compatible serialization.
* TOCData is nullable because the intent is that
ParserOutput::setTOCData() is MW_MERGE_STRATEGY_WRITE_ONCE; that is,
only the top-level fragment composing a page will set the TOCData.
This will be enforced in the future via wfDeprecated() (T327429),
but again our first patch is as backward-compatible as possible.
Bug: T296025
Depends-On: I1b267d23cf49d147c5379b914531303744481b68
Co-Authored-By: C. Scott Ananian <cananian@wikimedia.org>
Co-Authored-By: Subramanya Sastry <ssastry@wikimedia.org>
Change-Id: I8329864535f0b1dd5f9163868a08d6cb1ffcb78f
Allow the use of PARAM_HELP_MSG_PER_VALUE for PARAM_TYPE='string'
and PARAM_ISMULTI=true, which is the setting used for templated
parameters (PARAM_TEMPLATE_VARS).
It's common for templated parameters to take the variable parts
of the name from some fixed set, but they are required to use
PARAM_TYPE=string so it makes sense to allow the use of multi-
valued parameter documentation for that case.
The other option would have been to allow templated parameters
to be enums, which also makes sense and could be a complimentary
improvement; there are two reasons to prefer the current approach:
* Getting the list of allowed values might have a performance
impact that we only want to incur when the (optional) parameter
is used, while an enum requires the value list to be generated
every time the API module is used. So there would be some
value in using string type for templated parameters with a
known set of documentable values even if enum were also allowed.
* Per-value documentation might be useful outside the template
use case for non-restricted multi-valued strings: maybe all
values are allowed but there are some values with special
meanings that are worth documenting.
Change-Id: I53f9ae840c0a7eee76c4b57f95390b5045707efd
Notable changes:
* In SqlBagOStuff::getConnectionFromServerInfo, only two loggers were
injected. The rest implicitly got a NullLogger due to being absent.
These are now effectively unsilenced.
* Database::__construct() required almost all parameters, even the
loggers. I've wanted to move some of DatabaseFactory into the ctor
here for a while. In order to make this change not a breaking
change, the new 'logger' parameter is optional with NullLogger as
default. This allowed some of the test cases, which were simply
passing NullLogger, to be fixed by passing nothing instead of
passing the new option name.
The Database class is behind a dozen layers of indirection for
real use, so this will still be injected just fine (DBF, LB, LBF,
MWLBF, etc.).
* In LegacyLogger, the handling for $wgDBerrorLog was previously
limited to DBConnection and DBQuery. This now includes errors
from other (generally, newer) parts of Rdbms as well, which were
previously missing.
This only affects sites (typically CI and dev setup) where
$wgDBerrorLog is used, as opposed to the more common
$wgDebugLogGroups by-channel configuration.
* TransactionProfiler gets its logger injected in a rather odd way,
via entrypoints (MediaWiki.php, ApiMain.php, and MaintenanceRunner)
as opposed to service wiring. This is kept as-is for now.
* In LBFactoryTest, in particular testInvalidSelectDBIndependent2,
there are cases that intentionally produce failures of which
the result is then observed. In CI we assert that dberror.log is
empty so instead of adding the missing logger fields to that
LBFactory instance, the only one set (replLogger) is removed.
The alternative is to set 'logger' now, which would naturally
cause CI failures due to unexpected entries coming through to
non-mocked error log.
Bug: T320873
Change-Id: I7ca996618e41b93f488cb5c4de82000bb36e0dd3
so that extensions (i.e. CheckUser) can implement their own comment
store without having a lot of code duplication
basically the comment store version of I3a6486532f2ef36
Bug: T233004
Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
Patch Ifa7a9bc replaced some longer `=== null` constructs with the
new ??= operator we have since PHP 7.4. However, some of these can be
simplified even more with the ?? operator we have since PHP 7.0.
Follow-Up: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
Change-Id: I7b05e723810558bb5437adc97eab54ca04d38c06
The validation added with 75ec894 expect the timestamp of the continue
paramter in the database format, which is not true for cl_timestamp
under mysql, because that is a real timestamp datatype on the database
(T283461)
Using IDatabase::timestamp to use the correct format on postgres as well
Bug: T323910
Follow-Up: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
Change-Id: I5372ee4b56e97f20d2431acae84438b8687a5361
This may seem a bit weird but anything else related to actor is already
under user/ including ActorCache, ActorNormalization, ActorStore and
ActorStoreFactory.
Bug: T321882
Change-Id: I7072b374bba7a0cd9d905e399c822bf30bd5c0d8
To follow Message. This is approved as part of RFC T166010.
Also namespace it but doing it properly with PSR-4 would require
namespacing every class under language/ and that will take some time.
Bug: T321882
Change-Id: I195cf4c67bd51410556c2dd1e33cc9c1033d5d18