Commit graph

7154 commits

Author SHA1 Message Date
jenkins-bot
55d3efdb7c Merge "Add a new UserNameUtils service" 2020-03-27 08:58:48 +00: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
jenkins-bot
bdd722e310 Merge "Remove compat code for pre-MCR schema." 2020-03-25 18:19:33 +00:00
jenkins-bot
82f7d81c66 Merge "WikiPage/Article split. Rely on Article inside Action" 2020-03-25 14:13:05 +00:00
ArtBaltai
07f57bd271 WikiPage/Article split. Rely on Article inside Action
This is a first step in the split. This keeps b/c for
constructing the Action with a WikiPage, but is deprecated.
Introduces article accessor to remove direct access to
Action::page property.
Action::page property is deprecated for direct access.
 Use Action::getArticle or Action::getWikiPage instead.

Bug: T239975
Change-Id: Ib8eb8a141b4b7cb72ff65afbcd17385fcc6b3b1c
2020-03-25 01:54:43 +03:00
Petr Pchelko
a749000d39 Deprecate Title and WikiPage getFirstRevision methods
They naturally belong in RevisionLookup. They return Revision,
so should be replaced anyway.

Bug: T246284
Change-Id: Ie5c478e4667ca0e773186b9cb8a319cd09145112
2020-03-24 11:56:08 -07:00
daniel
495323c063 Remove compat code for pre-MCR schema.
NOTE: This was manually tested to ensure it does not
break updates, see T242764.

Bug: T198557
Change-Id: I1d9f5465018bae10124514bc38169e23e0e613e6
2020-03-24 19:45:47 +01:00
jenkins-bot
e0c4e091b1 Merge "Hard deprecate Revision::newFromPageId" 2020-03-24 18:20:05 +00:00
MusikAnimal
e0414f962e ApiWatch: Add support for expiries
With this commit, the action=watch API accepts an 'expiry' parameter,
analagous to the expiry accepted by action=userrights, action=block,
etc.

Bug: T245078
Change-Id: If37a772253082529cb290027da87098c1e6bf98c
2020-03-24 11:51:01 -04:00
Thiemo Kreuz
1006aa41e6 Fix mismatching type hints in PHPDoc tags
This is a collection of random bits from my local stashes. This patch
intentionally only touches comments, no code.

Notably:
* Use more specific string[] instead of array, if possible.
* Some comments mention "or null", but miss to list the type.

Change-Id: I712b28964f125c8e3dcb4e3fb993757a09f96644
2020-03-24 09:59:02 +01:00
Timo Tijhof
a5e4174d82 TemplateParser: Refactor the two integration test classes
* There were two separate integration test suites, both testing
  the TemplateParser class. One extended MediaWikiTestCase, which is an
  alias for MediaWikiIntegrationTestCase. The other was extending
  MediaWikiIntegrationTestCase directly.

  I've merged these into the same file.

* Use an injected BagOStuff instance.

  This means we can inject a mock and more cleanly assert the
  subject class' observable behaviour and contract toward BagOStuff,
  without hardcoding any internal details of TemplateParser.

* Add coverage for getTemplate() not using the cache in any way
  when wgSecretKey is false.

Change-Id: Ic01f23b1d59c430ab6adf247e0244514b98e20b8
2020-03-23 21:54:47 +00:00
Brian Wolff
046f18ed1e Make MWException show up pretty even if $wgLang is a stub
$wgLang is usually going to be a stub, since its semi-deprecated
so more and more code-paths don't call it. I'm not exactly sure
what checking it was supposed to accomplish. Note that
MWExceptionRenderer has very similar logic that does not check
$wgLang

Bug: T246619
Change-Id: I101a60b6fb3bc2c1abfa16fd1784caab3f75a95b
2020-03-23 03:49:45 +00:00
jenkins-bot
1aeeb509ae Merge "Add support for watchlist expiries to WatchedItemQueryService::getWatchedItemsForUser()" 2020-03-20 19:35:46 +00:00
DannyS712
0f2d9ece21 Hard deprecate PageArchive::undelete
Bug: T247188
Change-Id: I2a33443fb0ef3e24381f7277ae56f30ca0ac8701
2020-03-20 18:02:26 +00:00
Daimona Eaytoy
c1d6e8b0b9 page: Remove the ArticleAfterFetchContentObject hook
Deprecated since 1.32, and no longer used anywhere.
It is referenced in ApprovedRevs, but conditional on a MW < 1.35
context only.


Change-Id: I415927f198473ae3e795fac8c4811690424f167a
2020-03-20 01:40:01 +00:00
Aaron Schulz
1238043eff Add MediaWikiIntegrationTestCase::assertArraySubmapSame()
Also fix PHPUnit 9 warning in PNGMetadataExtractorTest about $delta.

This should fix all of the integration test warning spam.

Bug: T244095
Change-Id: I0e2a76d5df2685ae5ad1498864e0b5f9db60c0cc
2020-03-19 15:53:59 -07:00
jenkins-bot
48a8867982 Merge "ExtensionRegistry: Avoid losing 'defines' when loading lazy-loaded attributes" 2020-03-19 17:20:05 +00:00
jenkins-bot
73f8aadb70 Merge "Make use of PageArchive::undeleteAsUser" 2020-03-19 14:49:00 +00:00
jenkins-bot
f39160300a Merge "Pass a user to WikiPage::doDeleteArticleReal, use new signature" 2020-03-19 14:42:51 +00:00
jenkins-bot
74d305e050 Merge "Revert "Revert "Default to qqx in SpecialPageExecutor""" 2020-03-19 12:48:41 +00:00
DannyS712
7380aba100 Pass a user to WikiPage::doDeleteArticleReal, use new signature
Don't need to worry about supporting prior versions, since its core

Bug: T247869
Change-Id: Iad9397327731817b8c276d0b9786c3bc5ecf6476
2020-03-19 00:54:29 +00:00
Petr Pchelko
618236d204 Hard deprecate Revision::newFromPageId
Bug: T246284
Depends-On: I955d9c3478eb5278bdc807d11aab04e8e051d22f
Change-Id: I01ac581234980c6e7dbf916558c231ab648cbbae
2020-03-18 17:18:58 -07:00
Petr Pchelko
f6f1c41992 Remove usages of deprecated Revision from MovePage
Still have to wrap into the Revision object for hooks.

Bug: T246284
Change-Id: I4a5fe41fe4ba42defab7ecefd942f13ec5711538
2020-03-18 16:46:05 -07:00
jenkins-bot
a9c6ee89b6 Merge "Hard deprecate Revision::getParentLengths" 2020-03-18 22:24:56 +00:00
jenkins-bot
c3e7919225 Merge "Remove sample REST API handler" 2020-03-18 21:35:51 +00:00
jenkins-bot
a527bf77f1 Merge "Support cookies in GuzzleHttpRequest" 2020-03-18 19:51:42 +00:00
Petr Pchelko
ebd35bdc85 Hard deprecate Revision::getParentLengths
As well hard-deprecate RevisionStore::listRevisionSizes.
It was marked as @deprecated, but the release for the
deprecation was not specified. Let's say it's 1.35.

Additionally, in order to avoid temporary code duplication,
listRevisionSizes now uses getRevisionSizes and ignores the
database object injected into it. This is ok since we're
hard-deprecating the method and all the usages have been
removed.

Bug: T246284
Change-Id: Ifad1c25a0af892b88fce492b2d34c8cf71279b70
2020-03-18 12:26:26 -07:00
Petr Pchelko
1e4beb3107 Hard deprecate Revision::newKnownCurrent
Bug: T246284
Change-Id: Iba93fdeb0a88e6fa4068f03367b23a1f670257c6
2020-03-18 11:52:44 -07:00
Edward Chernenko
116409e279 Support cookies in GuzzleHttpRequest
Currently GuzzleHttpRequest is not sending any cookies.
Furthermore, Guzzle expects its own format of CookieJar,
which is not compatible with CookieJar used by MediaWiki.

Solution is to add Guzzle Middleware that would obtain Cookie header
from MediaWiki CookieJar and add it to outgoing Guzzle requests.

Note: special handling of received cookies (Set-Cookie header
from the server) is unnecessary, this is not Guzzle-specific code
and is already done in MWHttpRequest::parseCookies().

Still, adding both a test of sending cookies and receiving cookies.

Bug: T245644
Change-Id: If69840e65d5671989cf15450964da3c691fd164a
2020-03-18 21:48:26 +03:00