Commit graph

59521 commits

Author SHA1 Message Date
Timo Tijhof
13272a4928 resourceloader: Remove internal 'sync' option from ClientHtml
This only existed for Special:JavaScriptTest, which no longer
uses it as of I739850483.

Change-Id: If60def1a53707d31adf897b10baed109ebb6b8f0
2020-04-23 20:48:04 +00:00
Timo Tijhof
8decad60a6 qunit: Load qunitjs directly instead of via load.php
Much less indirection this way, making the test runner a bit easier
to reason about (maintenance-wise) and easier to debug for developers.
Minification doesn't help here anyway (quite the opposite).

This also means the legacy option to load a module synchronously
from ResourceLoader\ClientHtml can be removed. This option existed
solely to bootstrap the QUnit test runner, and can be removed in a
subsequent commit.

Bug: T250045
Change-Id: I73985048382e9cc754753ed84f04d25214c07599
2020-04-23 21:47:46 +01:00
jenkins-bot
b59a8c783e Merge "Hard deprecate WikiPage::getUndoContent" 2020-04-23 20:19:29 +00:00
jenkins-bot
a43b4bd538 Merge "qunit: Use "test.*" module names only for actual test suites" 2020-04-23 19:55:55 +00:00
DannyS712
d4e06a3d65 Hard deprecate WikiPage::getUndoContent
Replace use in EditPage

Bug: T250680
Change-Id: I12c82b514643e1fdf2f05951a04659bb46312ddc
2020-04-23 07:47:49 +00:00
Translation updater bot
34bddfced5 Localisation updates from https://translatewiki.net.
Change-Id: Ic8f5e82a69d29b1767890481fe9a0d2fced48c71
2020-04-23 08:41:41 +02:00
Timo Tijhof
851eb4b9c8 qunit: Use "test.*" module names only for actual test suites
This will make it easy to later allow the user to select which
component's specs to load and run (via CLI and GUI), e.g. for
an entire extension. We currently only have very narrow or very
wide selection mechanisms ('module' param for 1 module,
'rerun' for 1 test case, 'filter' param for global pattern match).

Bug: T250045
Depends-On: I55fe27e1c74972fcb3cdafefdc78e10e24f95b80
Change-Id: I5c01f720d787c3847228de511ce913284786ad66
2020-04-22 21:11:12 +00:00
Amir Sarabadani
d779d2889a Rename ipb_address to ipb_address_unique
This is how it's named in WMF production and the Postgres. Converging
names would help us to keep everything consistent, for example if we
need to force this index in the code.

For changing this index in Sqlite, we don't need to make a temp table as
this only touches the index and not the table structure.

Bug: T250071
Change-Id: I0838753b809680af3ee06d9c4f6d21d95b8982cc
2020-04-22 13:39:02 +00:00
jenkins-bot
eb88d78c3a Merge "Refactor magic word implementations out of Parser.php" 2020-04-22 08:34:54 +00:00
jenkins-bot
22be7523c4 Merge "Allow the ParserTests framework to hide deprecation warnings" 2020-04-22 07:10:32 +00:00
Translation updater bot
c2fe314e73 Localisation updates from https://translatewiki.net.
Change-Id: I198f793f93428b3a96c779b42d9fc0dd8d7dc33b
2020-04-22 08:54:58 +02:00
C. Scott Ananian
269214d4b6 Allow the ParserTests framework to hide deprecation warnings
Follow up to I0d0df86db2e61cdd1769426bfa7bad4c2ae5e977 to fix the
command-line parserTests runner.

Change-Id: If4a979f0f1377302c89d921c24e7ee0673fa3a26
2020-04-22 01:55:00 -04:00
DannyS712
78ff59aa07 specials/Hook: Hook interface doc comment review
Review hooks in includes/specials/Hook

Bug: T246855
Change-Id: Ia15a8904ec1659dbb0600fb07f79140d2309fa78
2020-04-22 05:19:02 +00:00
jenkins-bot
a83791b317 Merge "More flexible deprecation warnings" 2020-04-22 04:12:52 +00:00
DannyS712
493e2de56d user/Hook: Hook interface doc comment review
Review hooks in includes/user/Hook

Bug: T246855
Change-Id: I0c56b6f2b73dec5491ff81619a2f7bce6c8bebad
2020-04-22 03:36:44 +00:00
Tim Starling
df05164822 More flexible deprecation warnings
* Split MWDebug::sendRawDeprecated() from MWDebug::deprecated(). The new
  function can be used to send arbitrary messages to the deprecation
  log, rather than being constrained by the fixed format of
  MWDebug::deprecated().
* Split formatCallerDescription() from sendMessage() to allow the caller
  of sendRawDeprecated() to do its own caller formatting.
* Use the new function in MWLBFactory::logDeprecation()
* In tests, replace the ugly implementation of hideDeprecated() with one
  that works by setting a list of regexes to filter. hideDeprecated()
  now filters deprecation warnings that are a string match to the
  supplied function. filterDeprecated() can be used to filter a regex,
  and is intended to be used to filter warnings sent via
  sendRawDeprecated(). The filter list is reset at the start of each
  test, instead of leaking across tests as before.

Change-Id: I0d0df86db2e61cdd1769426bfa7bad4c2ae5e977
2020-04-22 12:37:22 +10:00
jenkins-bot
e1b19a35d0 Merge "HookContainer: add b/c for non-static handler with colons in the function name" 2020-04-22 01:01:44 +00:00
jenkins-bot
207420f0b2 Merge "filerepo: Improve $wgLocalFileRepo docs" 2020-04-21 21:28:17 +00:00
Aaron Schulz
cbc700e186 rbms: optimize and rename truncateTable() to truncate()
Allow truncation of multiple tables. This also provides for
a way to avoid risky keywords like CASCADE for Postgres.

For Postgres, use RESTART IDENTITY, which has been supported
since Postgres 8.4.

Avoid TRUNCATE/DELETE queries for empty temp tables, which is
useful for integrations tests that frequently call this method.

Reorganize and tweak the regexes in Database::getTempWrites().
It now recognizes multi-table DROP/TRUNCATE (Postgres-style).

Change-Id: Idd49f118b20ea5a0f7a3e8c00369aabcd45dd44e
2020-04-21 01:26:18 -07:00
jenkins-bot
2c7668ed27 Merge "Localisation updates from https://translatewiki.net." 2020-04-21 06:45:38 +00:00
Translation updater bot
3afa76dd87 Localisation updates from https://translatewiki.net.
Change-Id: Id8685da10e73b0562536062b7dd899159a8043f7
2020-04-21 08:44:06 +02:00
jenkins-bot
f898b49c98 Merge "docs: Hook interface doc comment review" 2020-04-21 06:41:19 +00:00
Tim Starling
aac9d32b98 HookContainer: add b/c for non-static handler with colons in the function name
A non-static call with colons in the function name worked with
call_user_func_array(), but now that we use $func(...$args) instead, it
fails with "Call to undefined method C::C::f()". So strip out the part
before the double-colon.

Bug: T240307
Change-Id: I52e6ad5d90ba188895448aeeb4268142d56ea265
2020-04-21 11:10:01 +10:00
jenkins-bot
cc89a81451 Merge "Automatically generated hook interfaces" 2020-04-21 00:07:41 +00:00
jenkins-bot
b62e83f3b5 Merge "Replace uses and hard deprecate Article:: and WikiPage::getRevision" 2020-04-20 23:29:43 +00:00
apaskulin
c44488f725 docs: Hook interface doc comment review
Edited doc comments for hook interfaces to improve
consistency and add type hints.

Bug: T246855
Change-Id: I38fa802463cd6f39bf5946dbbeb1b3ebaea604b2
2020-04-21 09:10:08 +10:00
DannyS712
4721717527 Replace uses and hard deprecate Article:: and WikiPage::getRevision
Bug: T250532
Bug: T239975
Change-Id: Ic8f2baa0ac805d5196a7107bdc7a1abb36eba139
2020-04-20 23:06:48 +00:00
jenkins-bot
4ca946e155 Merge "Replace ArticleRollbackComplete hook with RollbackComplete" 2020-04-20 22:58:57 +00:00
jenkins-bot
d4538888ac Merge "rdbms: Move Profiler @ingroup docs from file to class" 2020-04-20 20:12:13 +00:00
jenkins-bot
3b788f80cd Merge "FeedUtils: Amend Base10 color" 2020-04-20 20:05:13 +00:00
Timo Tijhof
6c5f64937c rdbms: Move Profiler @ingroup docs from file to class
The Profiler doc overview was missing these two classes,
it instead listed the class files as entries intead, which wasn't
very useful.

Bug: T232911
Change-Id: I6fe66fd16e7b5006e0af83d95b45a7ed25f060d7
2020-04-20 20:05:53 +01:00
jenkins-bot
53c9726f53 Merge "Remove hash style comments and dividers" 2020-04-20 18:48:54 +00:00
jenkins-bot
10799c051c Merge "UserNameUtils: use ITextFormatter instead of MessageLocalizer" 2020-04-20 17:27:12 +00:00
jenkins-bot
2f02f4edfa Merge "MutableRevisionRecord: ensure consistent hash and size" 2020-04-20 17:05:53 +00:00
jenkins-bot
1421ca6b65 Merge "Optimize email sending on password reset" 2020-04-20 17:03:09 +00:00
daniel
ec34eb39b9 MutableRevisionRecord: ensure consistent hash and size
This ensures that getSha1() and getSize() will return values consistent
with the revision's content, even if the content was changed indirectly
via the MutableRevisionSlots object returned from getSlots(), after
getSha1() or getSized() had already been called and the values cached.

While mechanism that triggers T239717 remains unknown, the root cause
appears to be that the cached hash and size may get out of sync with
the actual content of the new revision. The suspected mechanism is a
side-effect of a parser hook triggered during PST.

Bug: T239717
Change-Id: I0b61eb639282334df884313cdfbb3521fbfe7e88
2020-04-20 09:51:08 -07:00
Aaron Schulz
1260bf71da Migrate CdnCacheUpdate to MultiHttpClient and deprecate SquidPurgeClient
Bug: T250417
Change-Id: I4ed471c0b50a94426cfea4ae326454b98419e218
2020-04-20 17:03:32 +01:00
jenkins-bot
ad4c3e47cc Merge "Replace uses and hard deprecate Revision::newFromTitle" 2020-04-20 15:29:28 +00:00
Sam Wilson
368df9e5b5 Remove hash style comments and dividers
The modern style is to use forward slash comments, and the
dividers date from before this class was refactored to separate
these sections by method. Some @todos are also reformatted.

Change-Id: Ib642e83802cc78025ab22614a8e5fa9472d4bf59
2020-04-20 18:31:37 +08:00
jenkins-bot
ec55eb4424 Merge "Localisation updates from https://translatewiki.net." 2020-04-20 06:40:21 +00:00
Translation updater bot
2a00428040 Localisation updates from https://translatewiki.net.
Change-Id: Ibdafc82a472000f13981b9c9bdfee46ede3c4efb
2020-04-20 08:39:32 +02:00
jenkins-bot
8655ac0358 Merge "Deprecate ParserOptions::getTidy() and ParserOptions::setTidy()" 2020-04-20 06:19:41 +00:00
jenkins-bot
e1ec7b9837 Merge "Add ParserBeforePreprocess hook" 2020-04-20 06:05:45 +00:00
C. Scott Ananian
85e1525862 Deprecate ParserOptions::getTidy() and ParserOptions::setTidy()
These options no longer have any effect.

Bug: T198214
Change-Id: Icc3eaed7ab8a3070c4339b272d580328ba40912d
2020-04-19 22:53:39 -07:00
Tim Starling
f5aaf75ad1 Automatically generated hook interfaces
Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.

Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:

* The source root, maintenance and tests, which use includes/Hook. Test
  hooks need to be autoloadable in a non-test request so that
  implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
  the parent ../Hook:
    * includes/filerepo/file
    * includes/search/searchwidgets
    * includes/specials/forms
    * includes/specials/helpers
    * includes/specials/pagers

Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.

Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
2020-04-20 13:31:05 +10:00
jenkins-bot
6660f5ccd8 Merge "Hard deprecate WikiPage::insertProtectNullRevision" 2020-04-19 01:29:40 +00:00
jenkins-bot
5a939b9a7d Merge "Make WikiPage::$mLastRevision private" 2020-04-18 22:04:28 +00:00
DannyS712
ff60a486e9 Make WikiPage::$mLastRevision private
Will need to be overhauled to be a RevisionRecord, ensure not
used elsewhere until then (no current uses outside of the class):
https://codesearch.wmflabs.org/search/?q=mLastRevision&i=nope&files=&repos=

Bug: T246284
Change-Id: I9ea66b0e9c37bac8fd903f8de3c69ab91e42320c
2020-04-18 21:50:29 +00:00
Aaron Schulz
2e26a4dfbb objectcache: improve documentation for BagOStuff::setNewPreparedValues()
Change-Id: I0a30da88e693a3a0ad43b70ab5724e361a07149f
2020-04-18 21:47:41 +00:00
Aaron Schulz
f7141fa09f objectcache: add size metrics to WANObjectCache::getWithSetCallback()
Track the serialized value bytes/second spent on cache backfills for
each key class. The combination of a Count and Timing metrics within
checkAndSetCooloff() permits calculation of bytes/call as well.

Bug: T248962
Change-Id: I324e29e85bc4df7689bd2d5fb45cf8750b92a8d9
2020-04-18 20:59:44 +00:00