Commit graph

13563 commits

Author SHA1 Message Date
jenkins-bot
af473cf907 Merge "tests: Do not hide deprecation in SpecialPageFatalTest" 2022-12-16 15:29:18 +00:00
Umherirrender
9cd9ab0590 tests: Do not hide deprecation in SpecialPageFatalTest
Since 9cc1cd3 a filterDeprecation() call exists to hide MediWiki
deprecations, let php deprecation show up

Depends-On: Id07a55743bdfe04022b7c96acb6c154c7fe33098
Change-Id: Ia51b00399c584671ccf5d9fb8dfed1e94e5d60f9
2022-12-16 13:04:45 +00:00
Derick Alangi
ce8e5f1549 Introduce HtmlMessageOutputHelper for system messages
This introduces an interface HtmlOutputHelper that is implemented
by both HtmlMessageOutputHelper or HtmlOutputRendererHelper based
on the page we're dealing with.

Bug: T323558
Change-Id: I1fb8dcc5cc05ce3f32f3c1862b88045f1c8e612b
2022-12-16 11:49:56 +01:00
Amir Sarabadani
523ab7cff8 Reorg: Move RawMessage to under language/
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
2022-12-16 11:30:19 +01:00
jenkins-bot
0cc38c8717 Merge "Hard-deprecate protection related deprecated Title function" 2022-12-16 01:22:22 +00:00
jenkins-bot
f3b5f09e4c Merge "Make use of the ?? and ??= operators where it makes sense" 2022-12-16 01:06:50 +00:00
Umherirrender
e3af1aeed1 Hard-deprecate protection related deprecated Title function
Bug: T306131
Change-Id: I513efa22c42dd9194a385bae408af38cae9f1a6a
2022-12-16 00:36:53 +00:00
jenkins-bot
00c2dfa184 Merge "tests: Set UseInstantCommons config to false in WikiPageDbTest" 2022-12-15 19:14:12 +00:00
jenkins-bot
630925a09d Merge "HtmlOutputRendererHelper: test that parser cache is used." 2022-12-15 18:22:11 +00:00
daniel
91c1380d1e HtmlOutputRendererHelper: test that parser cache is used.
This protected against the performance regression that was addressed in
abec307409.

Change-Id: Ie5f7c2c713a10eec19bc19e0ba709f36599fb291
2022-12-15 17:56:14 +00:00
jenkins-bot
a36b69309c Merge "Hard-deprecate BacklinkCache::get/getLinks/getCascadeProtectedLinks" 2022-12-15 14:19:09 +00:00
jenkins-bot
4b2c11a85a Merge "Parsoid: return 404 when page is deleted." 2022-12-15 12:09:47 +00:00
jenkins-bot
dba0bf3877 Merge "add redirects to page/history and link endpoints" 2022-12-15 11:37:43 +00:00
daniel
6decc0ba09 Parsoid: return 404 when page is deleted.
If HtmlOutputRendererHelper can't produce output because the page
doesn't exist, don't crash. Return a 404 instead.

Bug: T325205
Change-Id: I6a713025e2eb447ed61de8949c820bd9cda7594e
2022-12-15 12:13:57 +01:00
Umherirrender
2515199b2f Hard-deprecate BacklinkCache::get/getLinks/getCascadeProtectedLinks
Depends-On: I39a532bcce35191db6abe4fdcdd6f95df74e5e87
Depends-On: I4c8bcec6bb2396b31a7cc73cb7f6f83742dc001a
Change-Id: I09d0aae2400d3b70d8ad59df4e47ee23d3f5072b
2022-12-15 10:51:44 +00:00
Kevin Israel
d2ffc38ff8 tests: Set serialize_precision=-1 in TestSetup
Starting in PHP 7.1, this is now the default[1][2], and results in the
"shortest string that yields d when read in and rounded to nearest."[3]

As such, it would generally be the best choice for tests. The existing
value of 17 has been used only because it was the default at the time
(October 2015, see commit 71443707ad), and -1 for "dtoa mode 0"
simply was not an option yet.

[1]: https://wiki.php.net/rfc/precise_float_value
[2]: https://www.php.net/manual/en/migration71.other-changes.php#migration71.other-changes.ini-file-handling
[3]: https://github.com/php/php-src/blob/php-8.1.13/Zend/zend_strtod.c#L3713-L3714

Change-Id: I95c3c36c90be5aa0af22c3c77ce67641b81786d7
2022-12-14 23:18:13 -05:00
jenkins-bot
bb20303cb6 Merge "Fix whitespaces after comma" 2022-12-15 00:56:34 +00:00
jenkins-bot
c913145a86 Merge "rdbms: Moving replication-related code to its own component" 2022-12-15 00:54:24 +00:00
Amir Sarabadani
9b078129d2 rdbms: Moving replication-related code to its own component
Remove 'insertSelectIsSafe' option, unused.

Remove 'topologicalPrimaryConnRef' option, no longer used as of two
months ago with I41a57247503 (8c9398f7f9).

Remove unneeded DatabaseSqlite::getTopologyBasedServerId
implementation which can inherit null instead of overriding with string
of "0". Only caller is SqlBagOStuff::makeTimestampedModificationToken
which can be used as MainStash DB, where its important that a given
server always has the same unique name within a set of db hosts that
may replicate to each other. By inheriting null as topology server ID,
it SqlBagOStuff will use IDatabase::getServerName instead. That in turn
uses the 'host' connection parameter, which defaults to null in
DatabaseFactory, and then falls back to the string "unknown" which is
as good as "0" for this purpose.

Bug: T299691
Change-Id: Iceb65c28cdd3c4a89b3c8b34c3f95d3285718ec0
2022-12-15 00:37:02 +00:00
Umherirrender
fd516a98e1 Fix whitespaces after comma
Change-Id: Ide6de0a53661e6f650099d7b1f274a02699441df
2022-12-15 01:24:14 +01:00
jenkins-bot
0fb254ffa5 Merge "cache: Inject HookContainer into BacklinkCache" 2022-12-14 22:03:37 +00:00
jenkins-bot
4f97dd079c Merge "Replace deprecated Linker::commentBlock/revComment" 2022-12-14 21:57:55 +00:00
jenkins-bot
5d783a3986 Merge "specials: Replace deprecated Linker::revComment/formatComment/Block" 2022-12-14 21:37:31 +00:00
jenkins-bot
f59e8aca77 Merge "site\MediaWikiPageNameNormalizer: Replace deprecated Http::get" 2022-12-14 21:35:35 +00:00
jenkins-bot
59e24a4559 Merge "actions: Replace deprecated Linker::commentBlock" 2022-12-14 21:33:22 +00:00
Umherirrender
1e62e1af8f site\MediaWikiPageNameNormalizer: Replace deprecated Http::get
Bug: T305813
Change-Id: I138aecd6275b7e9b2a852565e67e083460b8286d
2022-12-14 21:12:30 +00:00
jenkins-bot
0b16163e24 Merge "Replace comment about deprecated Http::request" 2022-12-14 20:39:27 +00:00
Derick Alangi
fe091a7cad Parsoid: Default parsoid version to "0.0.0" for unsupported models
When parsoid was dealing with content for content models that it does
not support, the corresponding pagebundle used `null` as the version
which will break when converting the it to JSON.

This patch fixes this by just using a version which is not specified
like 0.0.0

A better fix would be for page bundle to not explode when the version is
set to null. The other real fix is for Parsoid to not ask for rendering of
pages that are not wikitext.

Bug: T325137
Change-Id: Iff1ce432d1b2d30f3f74c53a0602c11034db5874
2022-12-14 13:07:18 +01:00
jenkins-bot
80f5774ff7 Merge "Parsoid: implicitly enable linting in API endpoints" 2022-12-14 02:55:42 +00:00
jenkins-bot
3757f5ca4e Merge "PageEditStash: Serialize ad-hoc to restore WRITE_ALLOW_SEGMENTS" 2022-12-13 23:43:03 +00:00
Aaron Schulz
18770c6ad9 PageEditStash: Serialize ad-hoc to restore WRITE_ALLOW_SEGMENTS
Large objects can actually be store via segmentation, but this broke
after commit 91043c8fe8, which limited WRITE_ALLOW_SEGMENTS to values
that are either a large string or a cache-wrapper array for a large
string (e.g. from WANObjectCache).

Add TODO comments about using JSON.

Bug: T204742
Bug: T322823
Change-Id: Ie7109c9f2613423959768479361c2b4efd95a76e
2022-12-13 23:18:17 +00:00
jenkins-bot
f6ffea59fd Merge "search: Avoid setting height in search thumbnails" 2022-12-13 18:51:38 +00:00
daniel
4f22f967c5 Parsoid: implicitly enable linting in API endpoints
Logging linter data should be enabled automatically by
HtmlOutputRendererHelper.

This change enables linting data for requests coming in via the
v1/page/{title}/html endpoint.

Change-Id: Idafd29784ec712547e36fea88a8c159784b97f2b
2022-12-13 13:35:06 +01:00
jenkins-bot
6d55633dcf Merge "phpunit: improve isolation by calling User::clearInstanceCache" 2022-12-13 11:23:12 +00:00
jenkins-bot
30a893b6ff Merge "ChangeTags: When showing a tag, also link to a filtered RecentChanges view" 2022-12-13 07:53:45 +00:00
jenkins-bot
bdbaa2d0fc Merge "rdbms: improve Database::queryMulti() error handling" 2022-12-13 00:47:33 +00:00
James D. Forrester
efd2591125 ChangeTags: When showing a tag, also link to a filtered RecentChanges view
This isn't quite what was proposed in the original discussion (as the main
link for the tag still goes to the help page, with the secondary link to
RC, rather than the other way around), but this has the benefit of not
being a breaking change that needs dozens of messages to be immediately
altered in hundreds of languages across many repos (167 tags as of writing:

https://codesearch-beta.wmcloud.org/search/?q=%5C%22tag-&files=en%5C.json%24&excludeFiles=&repos=

Bug: T301063
Change-Id: I142f8f0667e8a4aac2f91b141a0d7311c3ef7c43
2022-12-12 18:42:33 -05:00
jenkins-bot
98d4979e94 Merge "Parsoid: Enable lint data and parser cache together" 2022-12-12 22:33:55 +00:00
jenkins-bot
81ee9e8ca8 Merge "Revert "REST: collect metrics on endpoint access"" 2022-12-12 22:16:02 +00:00
daniel
5559d2d471 Parsoid: Enable lint data and parser cache together
The previous attempt at restoring call to the ParserLogLinterData hook
had the undesirable effect of bypassing parser cache. This change
optionally enables the call to the lind data hook without disabling
parser cache.

This patch us working under the assumption that we only need to log lint
data for canonical parses.

Follow-Up to I1f69498ef75

Change-ID: I39ab54ca6e9f9a6a58b59cdd6feea07638fc908f
2022-12-12 22:57:07 +01:00
jenkins-bot
374d578707 Merge "ParsoidOutputAccess: generate dummy output for unsupported models." 2022-12-12 20:13:31 +00:00
jenkins-bot
947c3ddba0 Merge "ParsoidOutputAccess: only cache output for wikitext" 2022-12-12 20:09:30 +00:00
Daniel Kinzler
5c7cca8776 Revert "REST: collect metrics on endpoint access"
This reverts commit d32c260ed0.

Reason for revert: Timo has reservations, I'll submit an updated version later.

Change-Id: I71d4d61a879fda4dccfc105127446cfedde75a7b
2022-12-12 20:05:06 +00:00
daniel
75d6892134 ParsoidOutputAccess: generate dummy output for unsupported models.
While RESTbase insists on getting Parsoid renderings for any content
model, don't waste CPU cycles trying to render garbage. Just output
dummy content. Nobody should ever see it.

Bug: T324711
Change-Id: I407171a5f515b594603b287a7a9e49f54e837161
2022-12-12 19:57:31 +00:00
Aaron Schulz
aa3459fb12 rdbms: improve Database::queryMulti() error handling
Allow automatic retry if the first query fails due to the
connection having already been lost. Hide packet warnings
in doMultiStatementQuery(), which can occur due to dropped
connections.

Make queryMulti() actually mark the transaction or session
as corrupt when needed,

Improve executeQuery() handling of empty $sqls arrays.
Pass the full SQL statement array to beginIfImplied().

Add re-connection tests for queryMulti().

Related documentation changes:
* Clarify affectedRows()/insertId() documentation.
* Update queryMulti() documentation to mention exceptions.
* Add comments about avoiding direct BEGIN/COMMIT/ROLLBACK.
  These should be avoided in queryMulti() as well.

Bug: T322689
Change-Id: I51d213acccfacc48674dbcf08c177cd9872c6e15
2022-12-12 19:52:58 +00:00
jenkins-bot
b340554a4d Merge "ParsoidHandler: test wt2html with old revision" 2022-12-12 13:22:36 +00:00
jenkins-bot
08cf3b486a Merge "LanguageVariantConverter: Add fallback to core LanguageConverter" 2022-12-12 12:24:26 +00:00
Amir Sarabadani
efe5830f4e search: Avoid setting height in search thumbnails
See Ib7a7a5bce3ce10e60 for more context

This standardizes the thumbnails on new vector.

Bug: T322621
Depends-On: I12643edfad16acb072757ec29ae3ba08fc11d65b
Change-Id: I3dc682d2dcea0a0615bc0b861ee0dded84304ae4
2022-12-12 08:58:39 +01:00
jenkins-bot
78bfce6ec9 Merge "Replace comments about deprecated Linker::commentBlock/formatComment" 2022-12-11 20:12:25 +00:00
jenkins-bot
22e34233eb Merge "pager: Fix navigations when date range is set" 2022-12-11 20:02:48 +00:00