Commit graph

95923 commits

Author SHA1 Message Date
DannyS712
b6c6c325f9 SpecialNewpages::revisionFromRcResult - return RevisionRecord
Make private to allow breaking change

Bug: T249393
Change-Id: I8341090b9224b8471bf81d8f9e1e7c9c0ef7f6f9
2020-04-27 21:30:44 +00:00
jenkins-bot
9a939d38d0 Merge "RevisionStore and PageUpdater: handle stale page ID" 2020-04-27 21:16:52 +00:00
jenkins-bot
d3d759cee4 Merge "Hard deprecate using Revision objects in ContentHandler::getUndoContent" 2020-04-27 21:10:37 +00:00
jenkins-bot
15a9533269 Merge "MergeHistory: Remove all uses of Revision objects" 2020-04-27 20:58:26 +00:00
jenkins-bot
c696170cbf Merge "Pass RevisionRecord to DifferenceEngine::getRevisionHeader" 2020-04-27 20:48:26 +00:00
jenkins-bot
89f14cf3e1 Merge "Hook interface doc comment followup" 2020-04-27 19:40:14 +00:00
C. Scott Ananian
efb5afe7eb Fix incorrect return type documentation for Parser::getRevisionUser()
Change-Id: I2ad51797d841e4cc2a433a27bbaa07b5a2f9a62c
2020-04-27 18:59:02 +00:00
DannyS712
dd8553d550 Pass RevisionRecord to DifferenceEngine::getRevisionHeader
Hard deprecate using Revision objects

Bug: T249561
Change-Id: Icf543635216ed06f3448a76faa97b459aa07f8e5
2020-04-27 18:51:05 +00:00
DannyS712
24de2ebf71 FeedUtils: Remove use of Revision objects
Bug: T250981
Bug: T249021
Change-Id: I0251865f6f1f5ab0627d5eac92d0e210284bc291
2020-04-27 18:46:13 +00:00
DannyS712
0aaeb85a20 SpecialComparePages: Remove use of Revision objects
Bug: T250981
Bug: T249021
Change-Id: Ida2cc7da29092a1fa534de5e7cabf475153e2ed1
2020-04-27 18:43:06 +00:00
jenkins-bot
819da314c6 Merge "Replace uses and hard deprecate Article::getRevisionFetched" 2020-04-27 18:33:39 +00:00
Ruben Barkow-Kuder
a79fbbca41 Add lazy loading on Mediawiki powered-by icon
This will not load the icon while it is offscreen, only when a user scrolls down, it is loaded

Bug: T251181
Change-Id: I1532fa9e85df21c9cc6a7aa8b41326af7a7ac4fd
2020-04-27 19:24:56 +01:00
jenkins-bot
5e732f662c Merge "deprecation: Remove DeprecationHelper::newArgumentWithDeprecation and change callers accordingly" 2020-04-27 17:57:36 +00:00
Peter Ovchyn
7d57b967b5 deprecation: Remove DeprecationHelper::newArgumentWithDeprecation and change callers accordingly
Bug: T245075
Change-Id: I0714b1c5d5a379cfe3ca473b72244d4d6bd1b7b8
2020-04-27 20:23:58 +03:00
DannyS712
5fae7fd767 SpecialUndelete: Make showDiff private, use RevisionRecord
Had no visibility defined; no deployed uses outside of the file:
https://codesearch.wmflabs.org/deployed/?q=-%3EshowDiff%5C(&i=nope&files=&repos=

Also removes use of Revision::getContentHandler.

Bug: T249561
Bug: T250981
Change-Id: Iaab55713eb616780c0b2b7429ad099b5d19fd73c
2020-04-27 17:06:16 +00:00
jenkins-bot
23ea146129 Merge "DifferenceEngine::getRevisionHeader - accept a RevisionRecord" 2020-04-27 16:51:53 +00:00
jenkins-bot
45527247d3 Merge "CategoryMembershipChangeTest: Remove use of Revision objects" 2020-04-27 16:50:23 +00:00
jenkins-bot
e2c95db9a0 Merge "Hard deprecate Revision::getNext" 2020-04-27 15:24:46 +00:00
jenkins-bot
d96f876a31 Merge "Hard deprecate Article methods proxying to WikiPage" 2020-04-27 13:44:55 +00:00
jenkins-bot
9ff388923d Merge "Change Moroccan Arabic (ary) to Arabic script" 2020-04-27 13:42:37 +00:00
jenkins-bot
88365cc38b Merge "rest: Replace backtick with double-quote in English messages for REST API" 2020-04-27 13:24:42 +00:00
jenkins-bot
6870c216e3 Merge "Add Amis (ami) to Names.php" 2020-04-27 08:41:16 +00:00
DannyS712
f456c7bfd5 Add ContribsPager::tryCreatingRevisionRecord
Soft deprecate ::tryToCreateValidRevision (to be hard deprecated once
MobileFrontend is updated)

In caller, replace use of Revision methods with corresponding
RevisionRecord calls.

Bug: T250431
Bug: T250580
Bug: T250980
Bug: T250579
Bug: T250714
Change-Id: Ic7be7d5cf5158482ee6fe08b179560460b6ccd32
2020-04-27 08:39:42 +00:00
Peter Ovchyn
76f881405d rest: Replace backtick with double-quote in English messages for REST API
Bug: T249827
Change-Id: I42a4db4e7a2d26e1cdabc80de04bbc8460daf512
2020-04-27 11:29:17 +03:00
jenkins-bot
8599c914bb Merge "Update linksearch-text i18n" 2020-04-27 07:50:54 +00:00
Translation updater bot
1925a193ce Localisation updates from https://translatewiki.net.
Change-Id: I22d4808c4db663626e68abd1167eef4ee80fee7c
2020-04-27 09:01:07 +02:00
DannyS712
232dc98d54 Hard deprecate Revision::getNext
Unused in deployed code, see codesearch:
https://codesearch.wmflabs.org/deployed/?q=-%3EgetNext%5C(%5C)&i=nope&files=%5C.php%24&repos=

Bug: T246284
Change-Id: Ic216093500418526029dde3a8ae4314b35361b13
2020-04-27 04:12:24 +00:00
jenkins-bot
33a2f3553d Merge "Remove password reset invalid email message" 2020-04-27 04:01:40 +00:00
DannyS712
511b528227 DifferenceEngine::getRevisionHeader - accept a RevisionRecord
Using Revision is not deprecated yet

Bug: T250608
Depends-On: Ic13220b3120dbecd83685ce3553c5b5a6c1e7fdd
Change-Id: I648cb62460f6ca20217a21c462e842d82ae06613
2020-04-26 23:41:47 +00:00
Derick A
02b5d008c5 xml: Move condition check of var before creating XmlSelect object
The `$selected` var could be null and in this case, return the default,
an empty string. The null check was after creating the XmlSelect
object which seemed out of place as after setting the variable to
the default, it's not used anywhere below.

Actually, the check should happen above and set it to it's default if
need be before creating the object below.

Change-Id: I6b69a7780c9f4a9ae283db8fa90b9cee76954d00
2020-04-27 00:37:31 +01:00
Max Semenik
73cfdfefa4 Add const visibility to includes/media
Change-Id: I80ec7aa44b1ea5e7b7d6193732b7da03d7f11960
2020-04-26 23:25:41 +00:00
DannyS712
625db9aca3 Hard deprecate using Revision objects in ContentHandler::getUndoContent
Bug: T250773
Change-Id: Id7a5f457637e1c8cf411a07c746004770507d6a7
2020-04-26 21:55:28 +00:00
Martin Urbanec
b6d5ad7112 DatabaseBlock's status variables should return bool
This happens because DatabaseBlock::initFromRow didn't
cast all database-loaded variables to boolean.

Bug: T251048
Change-Id: I0c328b7d06fd911d67a9744253e005902a6aa136
2020-04-26 20:09:40 +02:00
jenkins-bot
8658f91d16 Merge "Add notification type success to mw.notify" 2020-04-26 09:57:40 +00:00
Thalia
bc513dd0ad HistoryPager: Sort results by timestamp and revision ID
Bug: T251044
Change-Id: I2480fb0acad44f9326814eea7865b5e288a2bb49
2020-04-25 22:17:25 +01:00
jenkins-bot
08df51ddac Merge "title: Remove broken handling of language variant in getCdnUrls()" 2020-04-24 20:50:20 +00:00
Thalia
64ab963c51 SpecialBlockTest: Increase coverage of SpecialBlock::processForm
Bug: T250989
Change-Id: I9562b4f303cc339d7b2afa8c9783add57af34e4d
2020-04-24 19:48:28 +01:00
RhinosF1
899959d1bb Update linksearch-text i18n
The instructions regarding requiring a TLD are no longer valid. '*' can be used by itself.

Bug: T241958
Change-Id: Iadc3c09bb2db330950f27ee12fc36585c18f71d1
2020-04-24 17:29:22 +00:00
Translation updater bot
5fc0ab4a2c Localisation updates from https://translatewiki.net.
Change-Id: I7f34f51e3a3220aa2982118036c8fc1f41fd9069
2020-04-24 08:21:03 +02:00
DannyS712
c2339e03fd CategoryMembershipChangeTest: Remove use of Revision objects
Bug: T250980
Change-Id: Id949cb53df37693b20fab767a83021da38ce5986
2020-04-24 04:36:51 +00:00
DannyS712
ca8aa4d6b2 Replace uses and hard deprecate Article::getRevisionFetched
Returns a Revision object; only deployed uses are in core
Make fetchRevisionRecord public as the replacement
Also removes a use of Revision::getContentHandler

Bug: T249393
Bug: T250981
Change-Id: Ib8f399e451c3a9b942001b48ea9a138f405c894c
2020-04-24 04:01:32 +00:00
DannyS712
c20306e64c MergeHistory: Remove all uses of Revision objects
Bug: T246284
Change-Id: Ia978f72221385a8793d5ed4df7ecdcd98f56fc36
2020-04-23 18:25:22 -07:00
DannyS712
8dc1fb70a1 Article::setOldSubtitle - reduce use of Revision objects
Article::$mRevision is a Revision, and will need to be dealt with at
some point, but for now just use Revision::getRevisionRecord if relying
on $mRevision, and use RevisionLookup::getRevisionById instead of
calling Revision::newFromId when not relying on $mRevision

Bug: T250579
Bug: T249021
Change-Id: I6d831a932cb10d2d3400bd4c2735049dbda6997a
2020-04-24 00:39:18 +00:00
ArtBaltai
b32787cba2 Hard deprecate Article methods proxying to WikiPage
Hard deprecate and rewrite call of proxy methods
Deprecate Article::$mContext. It should become private

Bug: T239975
Change-Id: I92018a02b00fdc0b6cd90dfc77ad27782322f344
2020-04-24 01:02:16 +03:00
Timo Tijhof
eabf8afbd8 mediawiki.jqueryMsg: Refactor test suite to not make any API requests
This test was an awful, awful, mess. (And I take full responsibility.)
Changing the global user language mid-way into execution is in no way
supported by ResourceLoader and this test was going through great
lengths to fool mw.loader about what's really going on.

Basically, all we're doing is get a list of instructions on what tests
to run, get comparison values based how the PHP side proceses these
(for parity comparison), and then run the assertions.

The mw.language singleton already has support for multiple languages,
and mediawiki.jqueryMsg already supports injecting data and constructing
new instances for each test case. Make use of that :)

Instead of calling ResourceLoaderLanguageDataModule::getData by
trying to hot load the same module repeatedly from load.php,
just export this data using 'packageFiles'.

The mediawiki.jqueryMsg QUnit suite previously took 4s to run locally
and now only 0.1s (145ms). This is not only significant for this
particular module, but also for QUnit in general as Headless Chrome
only took about 7s to run all of MediaWiki core's test suites prior
to this change, which is now down to ~3s. (MacBook Pro)

For WMF CI:

* Before (master commit):
  - mediawiki.jqueryMsg.test: ~2.1s (2135ms)
  - MediaWiki core total: ~4.8s
* After (this patch):
  - mediawiki.jqueryMsg.test: ~0.015s (15ms)
  - MediaWiki core total: ~3.6s

Bug: T250045
Bug: T225730
Change-Id: I5f1067feb0a43d63bfc5e7fff5110285a5e433c8
2020-04-23 21:59:50 +01:00
Timo Tijhof
9232f729b4 qunit: Disable mw.loader.store server-side instead of client-side
== What

This feature is disabled initially because we want to be able to
test it. When mw.loader's own tests are testing mw.loader.store,
they are mocking setTimeout and mw.requestIdleCallback, so that
they can then make mw.loader.store schedule its "flush" callback
and via the mock timer control when it executes and then assert
its result.

== The Bad

Previously an inline JS hack was concatenated right after startup.js,
and that seems like it should be early enough to prevent anything
from initialising mw.loader.store and scheduling a real 2s flush timer.

There is no obvious sign here that the startup module response would
request or implement a module (which could inititialise mw.loader.store).
However, there is.

== …, the Ugly

The startup response contains RLQ processing (which is empty in
the standalone test runner, so no worries here) and a call to
mw.loader.load for RLPAGEMODULES. The RLPAGEMODULES list is empty,
but it does still make a call to mw.loader.load(). And that
expands the empty array to include jquery+mediawiki.base and thus
makes a proper module request, which then initialises mw.loader.store
and schedules its 2s flush timeout.

This hasn't caused failing tests in CI so far, because there are
generally at least 2 seconds of unrelated tests that run first.
So by the time mw.loader's test suite comes around, it has
been disabled and the previous flush has already completed.

== … and the Good

Change I5f1067feb0a43d makes the 'mediawiki.jqueryMsg' test suite
super fast (previously took 2+ seconds, longer than any other test).

This exposes the fact that mw.loader.store was in fact not
actually properly disabled from the get go, and so tests would
be failing.

Bug: T250045
Change-Id: I38c3ad2a9a5813215dbb210bddafcc3cdd70295d
2020-04-23 20:52:57 +00:00
Timo Tijhof
41f7ae2db2 qunit: Remove dead code from SpecialJavaScriptTest
* Remove calls to setHeaders(), disallowUserJs().
  These never do anything because the 10 lines of standalone HTML
  page outputs don't consult OutputPage or Skin.

  The exception was the 404 handler for if you visited
  Special:JavaScriptTest/bogus, where there is nothing to protect,
  not to mention that the page is disabled by default and in any
  production environment anyhow.

* Inline the 404 handler logic.

* Update the outdated documentation for exportQUnit().

Bug: T250045
Change-Id: I2b9d712f439b270ae998e994113b7f3cd8601abf
2020-04-23 21:48:42 +01:00
Timo Tijhof
707af79317 qunit: Remove div#mw-javascripttest-summary from SpecialJavaScriptTest
The intro text visually renders the same without it. The parsed
message already has its own block (a paragraph).

This div is a left-over from when the test runner was a skinned
page, and we had some CSS to style it in a fancy way. All that
was removed many years a go in favour of the 10-line standalone
HTML testrunner we have today.

Bug: T250045
Change-Id: Iffcca90857cf8e5df09a9287ab22fad109df7b79
2020-04-23 20:48:15 +00:00
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