Commit graph

109008 commits

Author SHA1 Message Date
jenkins-bot
2f7da6037a Merge "Fix uses of (error|warning|success)box in core" 2022-03-21 20:16:57 +00:00
Umherirrender
1f71eccf63 phan: Disable null_casts_as_any_type setting
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together

Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
2022-03-21 18:25:07 +00:00
jenkins-bot
50938694e5 Merge "ApiParse: Ignore 'contentformat' param when the query is based on page" 2022-03-21 17:36:04 +00:00
jenkins-bot
6d3d1bbee2 Merge "listFiles: Follow-up 1b432d4c, fix a typo" 2022-03-21 15:54:48 +00:00
jenkins-bot
8ca144b9f5 Merge "user: Let UserArray::newFromResult return empty iterator" 2022-03-21 11:25:05 +00:00
jenkins-bot
2399e91825 Merge "qunit: Remove most mw.config OutputPage vars from SpecialJavaScriptTest" 2022-03-21 11:00:53 +00:00
Translation updater bot
84cdb04467 Localisation updates from https://translatewiki.net.
Change-Id: I77756f651c0d467971bffb3cf1061454fc060403
2022-03-21 08:00:11 +01:00
Timo Tijhof
a970307ab7 qunit: Remove most mw.config OutputPage vars from SpecialJavaScriptTest
As part of making sure tests are not accidentally depending on global
state or some aspect of the skin, Special page, logged-out user, etc,
continue the removal of skin-specific code from SpecialJavaScriptTest.

This follows T131389 which previously removed the HTML layout,
stylesheets, and additional scripts from the test runner page already.

Bug: T89434
Depends-On: I9485b006804e243f9e022ca0668b290cf9d53f32
Depends-On: Ib20c1f5277c5d5a99f5117c82b7cbdeab75d3279
Change-Id: Iaf989bc50363a2525a922f745c0a1a6a992404f9
2022-03-21 03:34:34 +00:00
jenkins-bot
1e21707410 Merge "resourceloader: Set class-wide @covers and ignore coverage of HookRunner" 2022-03-20 23:48:31 +00:00
stang
9c70df0cf6 Fix uses of (error|warning|success)box in core
Replace HTML class for boxes with "mw-message-box-" style.

Bug: T300358
Change-Id: Iddb0fd3ae859714fb03d3a6d4586f8525becaac6
2022-03-20 21:15:26 +00:00
Umherirrender
e92b5edcaa user: Let UserArray::newFromResult return empty iterator
Instead of undocumented null which can break callers

Found by phan strict checks

Change-Id: I16f4de42df6861f8b9d063a7cb1f2b475293c30d
2022-03-20 18:57:53 +00:00
jenkins-bot
e6d7146e7a Merge "rdbms: mark trxStatus() as @internal and cleanup the comments" 2022-03-20 16:16:31 +00:00
jenkins-bot
9a8d8760a3 Merge "rdbms: make DatabaseSqlite release named locks on connection loss" 2022-03-20 15:59:23 +00:00
jenkins-bot
2876074562 Merge "phan: Disable scalar_implicit_cast setting" 2022-03-20 15:55:45 +00:00
jenkins-bot
aeffa36137 Merge "page: Store Wikipage::mIsNew/mIsRedirect as real bool, not integer" 2022-03-20 15:55:37 +00:00
Aaron Schulz
aca6f1979c rdbms: mark trxStatus() as @internal and cleanup the comments
Change-Id: I4cd682cf5df59b092e5985220d31cee3bb94d38a
2022-03-20 15:42:06 +00:00
Aaron Schulz
38344d9a07 rdbms: make DatabaseSqlite release named locks on connection loss
Make closeConnection() and doHandleSessionLossPreconnect() more
consistent with the base class by releasing named locks.

Change-Id: I7f7263c0d6b9473566ccb37113a30e6f360e8e29
2022-03-20 15:32:54 +00:00
Timo Tijhof
6522ff4ae2 resourceloader: Set class-wide @covers and ignore coverage of HookRunner
Change-Id: I49379986f0e7c05fb3442f0de9f496f151c4bed5
2022-03-20 15:17:21 +00:00
Func
845bf42aa9 ApiParse: Ignore 'contentformat' param when the query is based on page
The 'contentformat' param should only have effects when the parsing
is based on the 'text' param, as what the document described.

Bug: T206253
Change-Id: Ia12b8697e515c6ba89ea81f085292d1ef018bf58
2022-03-20 20:33:20 +08:00
Func
ad03485be1 listFiles: Follow-up 1b432d4c, fix a typo
Sorry for my mistake and inconvenience caused.

Bug: T293576
Change-Id: I27c8b603bb2365f9078944046a3dd8049415d379
2022-03-20 17:30:34 +08:00
Aaron Schulz
4718e2c529 objectcache: add makeTimestampedModificationToken() type hint
All callers pass in floats and this is the expected type, used
to fill $microseconds.

Bug: T303628
Change-Id: I6c6176b4cc308646d86a5b9d2afdc91aadda4a0d
2022-03-19 21:26:35 +00:00
Aaron Schulz
3f6e4c1746 Fix phpunit failures due to invalid testGetResultAllTables provider
Use the correct casing for MySQLPlatform

Change-Id: I731ee4e828da06a1fb668d099b0e9a31b72aeabf
2022-03-19 20:58:45 +00:00
Func
5339aa645b ApiParse: Fail gracefully when the requested format is not supported
Format like 'application/json' is not supported for content model
wikitext, don't fail as internal exception.

This fix the case when providing text/title parameter.

Bug: T206253
Change-Id: I20ef52aa961143b7c50283c0d06acea9f220619c
2022-03-19 19:29:28 +00:00
Umherirrender
6dd8a2bb32 phan: Disable scalar_implicit_cast setting
Make phan stricter about scalar types by setting scalar_implicit_cast to
false (the default in mediawiki-phan-config)

Bug: T242536
Bug: T301991
Change-Id: Ia2fe30b17804186571722e728578121c8b75d455
2022-03-18 18:52:24 +00:00
Alexander Vorwerk
82739980fd parser: change 'level' in parse api back to string
We changed to operate on an int internally in I92daeb0f7be8a0.
Let's cast it back to a string for the api in order to prevent
a breaking change, which is not really necessary.

Bug: T304171
Change-Id: I5f5a9203b4dd085cb5defba72c6650532bc9e8d1
2022-03-18 19:52:24 +01:00
Umherirrender
ed2805e309 page: Store Wikipage::mIsNew/mIsRedirect as real bool, not integer
Storing ints and bools in the fields is confusing.
Cast to bool when setting. Use ints for the database.

Found by phan strict checks

Change-Id: I98b4f0e80182d29a1836f722d8739ecdb33bab05
2022-03-18 18:51:41 +00:00
jenkins-bot
fdcbeb6a6c Merge "Simplify TransactionManager::pendingWriteQueryDuration" 2022-03-18 18:31:11 +00:00
jenkins-bot
d2391847a9 Merge "objectcache: Clean up getMultiWithUnionSetCallback() test cases" 2022-03-18 16:58:43 +00:00
jenkins-bot
1254d4d91c Merge "Cast block id to string in BlockManager::getCookieValue" 2022-03-18 15:50:41 +00:00
jenkins-bot
65ad80c12e Merge "objectcache: clarify usage of getMultiWithUnionSetCallback()" 2022-03-18 15:43:15 +00:00
Timo Tijhof
c2c663e6e1 objectcache: Clean up getMultiWithUnionSetCallback() test cases
It took me a good half hour to understand what these tests are doing,
and another half hour to build up a modicum of confidence that the
current behaviour is the indeed the desired behaviour.

* Remove random strings.

* Remove indirection and computed expected values as much as possible
  in favour of inlined literals that explicitly expect outcomes.

* Remove confusing second argument from the data provider
  getMultiWithUnionSetCallback_provider, which wasn't used, and
  add labels to it.

* Remove some of the existing inline comments.

* Add some inline comments with what I've understood.

* Fix bug in "C: Repeat case with recently created check keys",
  which claimed to be observing that caches were ignored due to the
  check key being too new, when in fact it was a cache miss simply
  because the key didn't exist yet upto this point. Make it actually
  repeating by adding a second call afterwards to observe the
  stated behaviour.

Bug: T303092
Change-Id: I874a20ecd49464f7b0e6a0b579c000dc0e804c0a
2022-03-18 15:41:08 +00:00
Umherirrender
569476a0f4 Simplify TransactionManager::pendingWriteQueryDuration
No need for the switch
phan does not see correct type for $rtt due to conditions

Also adjust $rtt to be a float as set by IDatabase::ping

Found by phan strict checks

Change-Id: Ia76e1062e06b00ae13d5c1a516d78b4e5cf6f1f5
2022-03-18 15:19:24 +00:00
Umherirrender
3110cfceac Cast block id to string in BlockManager::getCookieValue
The functions returns the block id, which is typed as string.
Also MWCryptHash::hmac needs a string

Found by phan strict checks

Change-Id: I457dd094d033671c22e221a94746579a25fe8b7a
2022-03-18 16:05:06 +01:00
jenkins-bot
8f86ffab04 Merge "media: Limit result array of explode() to minimum needed" 2022-03-18 13:55:33 +00:00
jenkins-bot
4d236a74ee Merge "LoadBalancerTest: Avoid using hard-coded table prefix" 2022-03-18 13:39:05 +00:00
jenkins-bot
5e6021e01b Merge "parser: Cast return of Timestamp::format to int for n" 2022-03-18 13:02:44 +00:00
jenkins-bot
a2bdaea11e Merge "parser: Fix various scalar types to match documentation" 2022-03-18 13:02:21 +00:00
jenkins-bot
e7341b3511 Merge "maintenance: Improve updateSpecialPages.php and related documentation" 2022-03-18 13:01:30 +00:00
jenkins-bot
7894e49ea8 Merge "Generate config name constants." 2022-03-18 11:09:44 +00:00
jenkins-bot
18875c2c0f Merge "Generate DefaultSettings.php from schema" 2022-03-18 11:02:51 +00:00
daniel
6880561a4d Generate config name constants.
We can generate a class that contains constants for all config variable
names. This removes the need to rely on string literals when calling
Config::get, and it provides a place for documentation that integrates
better with IDEs than the markdown file.

Change-Id: I817dc14c4ce8fc0a29d9c07e8fd393c4f359cade
2022-03-18 10:32:58 +01:00
daniel
1ee8fde16b Generate DefaultSettings.php from schema
Avoid having to maintain defaults twice.

Change-Id: I7a883fe3c952cc653d43b7e399631ec3beab0bc3
2022-03-18 10:25:52 +01:00
Subramanya Sastry
484c97653e Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit 9ec4dac79ae3d926507817137d113204d0947958

Change-Id: Idaa6cb8975499e8ecbbbb123dbbfa7e6316ed6aa
2022-03-18 13:33:23 +05:30
jenkins-bot
45a0be0436 Merge "Sync up with Parsoid mediaParserTests.txt" 2022-03-18 07:56:49 +00:00
jenkins-bot
f5f57616b7 Merge "Sync up with Parsoid legacyMediaParserTests.txt" 2022-03-18 07:56:43 +00:00
jenkins-bot
29e0cf9c9d Merge "Use class constants to define config schema, rather than config-schema.yaml" 2022-03-18 07:44:45 +00:00
Translation updater bot
749aa8ae22 Localisation updates from https://translatewiki.net.
Change-Id: I802076f869a100304a2c8d92c08354282af32930
2022-03-18 08:22:25 +01:00
Subramanya Sastry
0d87f9107f Sync up with Parsoid mediaParserTests.txt
This now aligns with Parsoid commit 9ec4dac79ae3d926507817137d113204d0947958

Change-Id: Ia2616e7713f63a546e7b0e71b7f09a13e166963c
2022-03-18 12:44:07 +05:30
Subramanya Sastry
5f18500f29 Sync up with Parsoid legacyMediaParserTests.txt
This now aligns with Parsoid commit 9ec4dac79ae3d926507817137d113204d0947958

Change-Id: I4da21cd17af20e6dd5cb6dc79800ca9b006abc2d
2022-03-18 12:43:54 +05:30
jenkins-bot
a7efb70efd Merge "Add a class on the span representing the broken media element" 2022-03-18 03:52:32 +00:00