Commit graph

7182 commits

Author SHA1 Message Date
jenkins-bot
8c53f65794 Merge "Replace deprecated PHPUnit method in test" 2020-04-02 17:48:17 +00:00
C. Scott Ananian
8c18f2b41c Add a wfDeprecated to an overlooked code path where parser output is not tidy
We formally deprecated running the parser with tidy disabled in 1.33, but
I missed a hard-deprecation on this code path.

Be careful not to spam the logs with deprecation warnings triggered by
(deprecated) API requests, though.

Change-Id: I10f64e76ec0c5aee8b26fc00bc11ebb0e39f961b
2020-04-02 11:53:53 -04:00
Ammar Abdulhamid
3fbed46f0b Replace deprecated PHPUnit method in test
The method has been simply renamed to expectExceptionMessageMatches()
and the old name, kept as alias, will be removed in PHPUnit 9

Bug: T243600
Change-Id: Ida95d92ba28faab012370a1ac62c7a09a91221aa
2020-04-02 10:06:58 +01:00
Ppchelko
64650aaba9 Revert "WikiPage/Article split. Rely on Article inside Action"
This partialy reverts commit 07f57bd271.

Reason for revert: Article::newFromWikiPage causes an infinite loop
if 'ArticleFromTitle' hook handler ends up calling Action::getActionName.

The revert preserves new getArticle and getWikiPage methods since there
are a few extension changes merged dependent on these. Alternatively this partial revert, we could do a full revert with all the dependencies  https://gerrit.wikimedia.org/r/c/mediawiki/core/+/585343

Bug: T249162
Change-Id: Ifa642a631caa2d265ee097711dc8727f84435ef0
2020-04-01 22:30:51 +00:00
DannyS712
93e278b5db Hard deprecate Revision::getSerializedData
Bug: T246284
Change-Id: I49ac11b4f952b2494349cc49360501dd3bfc2c90
2020-03-31 16:33:04 +00:00
jenkins-bot
1afd5f4cb3 Merge "Add tests for ContentHandler::getPageViewLanguage" 2020-03-31 15:18:25 +00:00
jenkins-bot
39f62eee87 Merge "Hard deprecate old signature for WikiPage::doDeleteArticleReal" 2020-03-31 03:56:42 +00:00
DannyS712
3d8915f2d2 Hard deprecate old signature for WikiPage::doDeleteArticleReal
Bug: T247869
Change-Id: Ifd53d4e5bd5d209903cad4f088c8f99ee7630eef
2020-03-31 03:16:22 +00:00
jenkins-bot
fdfd446f1c Merge "Hard deprecate Revision::getRecentChange and ::getTextId, both unused" 2020-03-31 02:56:10 +00:00
DannyS712
a96fd717a7 Hard deprecate Revision::getRecentChange and ::getTextId, both unused
Bug: T246284
Change-Id: I10197231642b45ad60e4588f94edad2bacf2f46e
2020-03-31 02:38:27 +00:00
jenkins-bot
751fcb315e Merge "resourceloader: Export ResourceModules as extension attribute" 2020-03-30 23:26:29 +00:00
jenkins-bot
c564ae6722 Merge "resourceloader: Export ResourceModuleSkinStyles as extension attribute" 2020-03-30 23:24:31 +00:00
Timo Tijhof
a999da181e resourceloader: Export ResourceModules as extension attribute
Instead of exporting this as a global variable, export it as an extension
attribute.

The $wgResourceModules configuration variable will continue to be supported
for its main purpose of adding modules. However it may no longer be used to
access the complete registry. In actuality, it was already incomplete because
modules defined via 'ResourceLoaderRegisterModules' hooks were already absent.

The full copy is now owned only by the ResourceLoader class and publicly
available via isModuleRegistered() and getModuleNames().

This opens the door to making it a lazy-loaded attribute, which would help
reduce the size of the "main" APCu cache key for ExtensionRegistry.
This is not possible with global variables as those must be exported
unconditionally from Setup.php.

Bug: T32956
Bug: T247265
Change-Id: I13cf05af458131ce8439eee770d7a62bd9404288
2020-03-30 23:11:05 +00:00
Timo Tijhof
69e9b31fc5 resourceloader: Export ResourceModuleSkinStyles as extension attribute
Instead of exporting this as a global variable, export it as an extension
attribute.

The $wgResourceModuleSkinStyles configuration variable will continue
to be supported for its main purpose of setting skin styles. However
it may no longer be used to read these settings. The canonical copy
of this is now restricted to the ResourceLoader class and not (yet)
made publicly available (I found no use cases for it).

This opens the door to making it lazy-loaded attribute, which would help
reduce the size of the "main" APCu cache key for ExtensionRegistry.

This is not possible with global variables as those must be exported
unconditionally from Setup.php.

Bug: T32956
Bug: T247265
Change-Id: I4ecf558d9c630c91959786d2573c34e619223cef
2020-03-30 16:08:00 -07:00
jenkins-bot
7fa2b595c5 Merge "phpunit: Change optional params before required params to also be required" 2020-03-30 21:29:45 +00:00
jenkins-bot
65906da2c2 Merge "MCR: provide MultiContentSave hook to replace PageContentSave" 2020-03-30 17:09:45 +00:00
DannyS712
9dd9b0cb46 Hard deprecate Revision::setUserIdAndName
Bug: T246284
Change-Id: I97d476bbffac99f8169e13a3f7c1dfca967be8ea
2020-03-30 16:10:53 +00:00
jenkins-bot
1b8df07387 Merge "rdbms: add "loadMonitor" parameter to LBFactoryMulti/LBFactorySimple" 2020-03-29 16:42:27 +00:00
Max Semenik
84f15a0a79 phpunit: Change optional params before required params to also be required
Bug: T248078
Change-Id: I7e1d4229d84f5960fd496f281084dbec4739da4c
2020-03-29 15:45:17 +00:00
Max Semenik
b04e62f31d phpunit: Simplify StructureTest
* Get rid of a long regexp that had to be maintained and
  was broken anyway, resulting in a false negative.
* Fix that false negative.
* Make the failures array a bit more readable.

Bug: T248075
Change-Id: I4e4e5d6487d23b0d64f29c113d84bddce758e516
2020-03-29 15:40:45 +00:00
Aaron Schulz
fcfea80fa3 rdbms: add "loadMonitor" parameter to LBFactoryMulti/LBFactorySimple
This allows full configuration of the LoadMonitor, not just setting
the class name like loadMonitorClass allows. Deprecate the later.

Also fix obsolete LoadBalancer constructor documentation and
standardize the style of LBFactoryMulti::__construct() comments.

Change-Id: Icfdc0d6bbf227dce56e65ad679b93ce3f604e9f7
2020-03-27 20:43:00 -07:00
jenkins-bot
7befa95957 Merge "Set logger to null in RefreshSecondaryataUpdateTest integration test" 2020-03-27 20:51:40 +00:00
Edward Chernenko
9cf8427865 MCR: provide MultiContentSave hook to replace PageContentSave
Old hook PageContentSave only received the main slot of the article.
In order for extensions to intercept changes in all slots, they should
receive a RevisionSlots object with new content.

PageContentSave hook is still preserved for backward compatibility.

Note: parameters $iswatch and $section (from PageContentSave) are
not added into the new hook, because they are obsolete in the old hook.

Note: new hook also doesn't unnecessarily pass-by-reference (T193950),
which was an issue with the old hook.

Bug: T205982
Change-Id: I55455639c5ff6ccbf3917d85c1ab0dac847ec853
2020-03-27 23:06:33 +03:00
DannyS712
aff1cfd0b0 Hard deprecate Revision::isUnpatrolled
Bug: T246284
Change-Id: I5817ec0041cb2119a5febc8dd57f66700743e752
2020-03-27 19:35:33 +00:00
Nikki Nikkhoui
8b43050319 Set logger to null in RefreshSecondaryataUpdateTest integration test
The code is appropriately logging when it encounters an exception.
However, the CI interprets that as an actual exception being thrown.
Setting the logger to null allows the CI to complete.

Bug: T248189
Change-Id: I9ce7c451b9951892e509afa048213e7691498e47
2020-03-27 10:56:05 -07:00
jenkins-bot
3811118cbc Merge "Use class keyword for classname resolution" 2020-03-27 14:38:06 +00:00
jenkins-bot
55d3efdb7c Merge "Add a new UserNameUtils service" 2020-03-27 08:58:48 +00:00
Ammar Abdulhamid
61ff46196e Use class keyword for classname resolution
Change-Id: I149abf837c6bd79f05648b1acbfaf45dc900125e
2020-03-27 09:33:01 +01:00
jenkins-bot
b2be858d92 Merge "Remove direct access to Action::page and Article::page properties" 2020-03-27 04:36:51 +00:00
ArtBaltai
726a2650d3 Remove direct access to Action::page and Article::page properties
Bug: T239975
Change-Id: Id0d4d1e099edbdd67cabbed423dfff68cc48d323
2020-03-27 04:10:51 +00:00
DannyS712
1d4df4f221 Hard deprecate Revision::getQueryInfo and ::getArchiveQueryInfo
Bug: T246284
Change-Id: I708f265aac3016e34d02936cf5dff98a3036ef0f
2020-03-26 23:53:19 +00:00
jenkins-bot
0de13c6125 Merge "Fix mismatching type hints in PHPDoc tags" 2020-03-26 13:35:31 +00:00
jenkins-bot
839c9f8d6e Merge "Hard deprecate Revision::userWasLastToEdit" 2020-03-26 02:04:32 +00:00
jenkins-bot
6d791abd80 Merge "Define POST handler for /page/: create page" 2020-03-26 01:33:50 +00:00
DannyS712
23242d04d1 Add a new UserNameUtils service
This replaces User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonicalName, and ::isIP.

Unlike User::isIP, UserNameUtils::isIP will //not// return true
for IPv6 ranges.

UserNameUtils::isIPRange, like User::isIPRange, accepts a name and
simply calls IPUtils::isValidRange.

User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonical, ::isIP, and ::isValidRange are all soft deprecated

A follow up patch will add this to the release notes, to avoid merge
conflicts.

Bug: T245231
Bug: T239527
Change-Id: I46684bc492bb74b728ff102971f6cdd4d746a50a
2020-03-26 01:31:14 +00:00
jenkins-bot
727c9e6d32 Merge "Hard deprecate Revision::base36Sha1" 2020-03-26 01:25:52 +00:00
DannyS712
ecf7f3fb28 Hard deprecate Revision::userWasLastToEdit
Bug: T246284
Change-Id: I908dd6025a2a78edf7d3c3661f540aeb498c4bad
2020-03-26 01:17:25 +00:00
jenkins-bot
bddb01d35a Merge "Purge expired watchlist items" 2020-03-26 00:38:56 +00:00
Sam Wilson
83804ade46 Purge expired watchlist items
Add two methods to remove expired watchlist items:
1. A job that's triggered on about 10% of page edits; and
2. A new maintenance script.

Bug: T244804
Change-Id: Ica8ab92837c38fa4d484726c94d5181c08387e28
2020-03-26 07:54:20 +08:00
DannyS712
90eb2dc46d Hard deprecate Revision::base36Sha1
Bug: T246284
Change-Id: I12b80940358ea2f941483b5edf74e8c8472ace31
2020-03-25 21:11:37 +00:00
jenkins-bot
b8244b1eb7 Merge "Hard deprecate Article:doDeleteArticle and WikiPage::doDeleteArticle" 2020-03-25 20:01:08 +00:00
daniel
65342f8353 Define POST handler for /page/: create page
NOTE: once this is merged, also merge Ie7b47e6868cc on the OAuth repo,
to fix unit tests after a breaking change to Router's constructor
signature.

Bug: T230842
Change-Id: I8f5b92918a58e44a4f2d8c78d234d9f64c2d06bf
2020-03-25 20:49:20 +01:00
jenkins-bot
5268ed3543 Merge "Hard deprecate Revision::loadFromTimestamp" 2020-03-25 19:44:45 +00:00
DannyS712
bec59e0251 Hard deprecate Article:doDeleteArticle and WikiPage::doDeleteArticle
Bug: T248000
Change-Id: I066de4715f726d8c7b0b509f6e8878548501081d
2020-03-25 19:27:50 +00:00
jenkins-bot
1576ae0c5a Merge "Deprecate Revision::loadFromPageId" 2020-03-25 19:24:01 +00:00
Petr Pchelko
aa1ea49a51 Hard deprecate Revision::loadFromTimestamp
Bug: T246284
Depends-On: Ia8d49b3158baf578ccd3476d6537be36dcea7e13
Change-Id: Ic4df02a7e21d4d1c0140e0f5a985a90f66983fab
2020-03-25 12:21:02 -07:00
jenkins-bot
56bf3cc24f Merge "Tests: Replace ::doDeleteArticle with WikiPage::doDeleteArticleReal" 2020-03-25 19:16:26 +00:00
Petr Pchelko
b3ab937939 Deprecate Revision::loadFromPageId
Bug: T246284
Depends-On: Id4ec83cc0ac0685857064486697a7daed979ea69
Change-Id: I5de750322e30052700f509d2908456ebd5be95ef
2020-03-25 12:10:48 -07:00
Petr Pchelko
a2cf98ef70 Remove usages and hard deprecate Revision::newFromRow
Also updates CategoryMembershipChange to accept a RevisionRecord
instead of a Revision.

Bug: T246284
Change-Id: I30024b7278e108b0f4e20ef1eb44647916fad47c
2020-03-25 11:42:36 -07:00
DannyS712
cf2c2a0778 Tests: Replace ::doDeleteArticle with WikiPage::doDeleteArticleReal
Not including WikiPageDbTestBase, which is testing the method

Bug: T248000
Change-Id: I1848a79be9e25759654053e88ef956269342f588
2020-03-25 11:34:17 -07:00