Commit graph

5551 commits

Author SHA1 Message Date
Thiemo Kreuz d79dd00e01 Use READ_LATEST constant and fix a soft type hint
Change-Id: I2123c5efe01a5b42daeec9c7b0eefce089864657
2019-10-23 12:45:51 +02:00
Thiemo Kreuz 229c3d0fdd Remove non helpful (auto-generated) comments
None of these comments explains anything that wouldn't be obvious
from the code itself.

Change-Id: Ibcf50d401999ae76f315df2d2d27097a39f41bbd
2019-10-23 12:31:35 +02:00
Thiemo Kreuz bc3dabf828 Prefer strict assertSame() for all numeric assertions
assertEquals() does not compare the type. It can not only be a float,
it can even be a string. E.g. 9 and '9' are considered equal.

Worst case scenarios are:
* 0 is considered equal to any "falsy" value, including the empty
string.
* 1 is considered equal to true.

assertSame() does not have any of these confusing edge-cases.

Change-Id: Ib6af0fefbbd8856adcf27844bb8ddd8e33ed3f9d
2019-10-23 12:28:30 +02:00
Thiemo Kreuz 967a0b54e9 Use absolute class names in @covers tags
Not all tools require these to be absolute, full qualified class
names. But some do. This does make the code more compatible with all
kinds of tools.

Change-Id: Ie7f9d9469b7a48b2fe908d3428fca9ec0120f855
2019-10-23 12:23:09 +02:00
Max Semenik 94646b0de0 tests: Kill last use of deprecated getMock()
Change-Id: I6bb9fcce07389868544b25875d95a1af628a1136
2019-10-23 09:02:12 +00:00
Translation updater bot 79b82ea45a Localisation updates from https://translatewiki.net.
Change-Id: I3827a7bea3ad83d35b4f57a2123d44dda4582b62
2019-10-23 09:52:55 +02:00
Translation updater bot 7e245f13f2 Localisation updates from https://translatewiki.net.
Change-Id: I4c28b0aba7336e2973bebfa47e350551778c578e
2019-10-22 09:13:59 +02:00
Translation updater bot 0692bce2c7 Localisation updates from https://translatewiki.net.
Change-Id: Iae9bcdd94a749ecf15b09ee9ae1bd57cafd37c57
2019-10-21 09:58:58 +02:00
libraryupgrader b476ad7781 build: Updating grunt-stylelint to 0.11.1
Additional changes:
* Added .eslintcache to .gitignore.

Change-Id: I5e6a72e457fb656debdb721ed20b4d0efc5d4869
2019-10-21 03:06:43 +00:00
Marko Obrovac 6ae3efc1c3 SeenTime: Do not set the cache key to Unix epoch
Now that seen times are TTL'ed, there is little sense/incentive to set
them in the cache to the default value, since we assume the default
value if they're not in cache (which is being set here). Therefore,
setting them only increases the cache size without any gains.

Bug: T222851
Change-Id: I78a0045e4a53653196114da81c2d60328e78c269
2019-10-18 14:23:28 +02:00
Roan Kattouw ff165c0003 Make EchoSeenTime cache entries expire after 1 year
These entries weren't TTLed at all, and so we had millions of records
for inactive users that were being stored forever. If a user doesn't
view their notifications for a year, it's OK for their notifications
badge to go back to the unseen state until they click it.

(The fallback behavior on a cache miss is to act as if the seentime is
the UNIX epoch, which means that any unread notification they have is
more recent than it, and is considered unseen.)

Bug: T222851
Change-Id: I99230d2351b40751a3f2f5123c5f38693120259e
2019-10-18 12:05:52 +00:00
Roan Kattouw 79ee7582f2 Make EchoSeenTime cache type configurable
Defaults to MainStash, but can be configured to use a different cache
backend by setting $wgEchoSeenTimeCacheType to a string that keys into
$wgObjectCaches.

Bug: T222851
Change-Id: Ifb935cc8be4618f7794ee79a234fc66d5cc5728a
2019-10-18 11:32:03 +00:00
Translation updater bot a9dbe0f97b Localisation updates from https://translatewiki.net.
Change-Id: Ib4a6ecdbd6df298d11f758450e4eada47b08c934
2019-10-17 09:52:27 +02:00
Translation updater bot 3d7d1e99d2 Localisation updates from https://translatewiki.net.
Change-Id: I9a6b274f33dc66b9313ad82d8ded74e0659f1552
2019-10-16 20:39:00 +02:00
Zoranzoki21 5a05e94a1e Remove comment related to skins.minerva.scripts after removal of it in 1053997
Bug: T221007
Change-Id: I0ca3e195aa623cff7ef437dc177179dee13c7cd1
2019-10-16 10:30:57 +00:00
jenkins-bot c7215f9f5f Merge "No longer check for skins.minerva.scripts" 2019-10-16 10:22:27 +00:00
jdlrobson 10539971f1 No longer check for skins.minerva.scripts
Echo is now in complete control. Cleanup after ourselves.

Change-Id: I9a26c7a88f5e3ff19ec5b17b08a0d05c4f9e60ce
Depends-On: I9a6b06158d9083317aea46510c0c47980a25e50a
Bug: T221007
2019-10-16 09:27:24 +00:00
Kosta Harlan ccab496734 Remove PhanTypeMismatchArgument from call to appendContent
Breaking in
https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/16324/console

Change-Id: I9a6b06158d9083317aea46510c0c47980a25e50a
2019-10-16 10:53:12 +02:00
Translation updater bot 8370692e48 Localisation updates from https://translatewiki.net.
Change-Id: I5071cf40b05a347bd22dbed5dab2fabd1b240d56
2019-10-16 10:39:21 +02:00
jenkins-bot c5aa7514ab Merge "build: Upgrade mediawiki-codesniffer to v28.0.0" 2019-10-10 09:40:59 +00:00
James D. Forrester abaff73626 build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: Ib66b0ad1b3929bf7e49eb40a3d5463b0d8b2280b
2019-10-10 09:29:24 +00:00
Translation updater bot 75f111d83c Localisation updates from https://translatewiki.net.
Change-Id: I64eba53377480f1028685a20c40aee411593ce9b
2019-10-10 09:32:41 +02:00
jenkins-bot cd6a340ce8 Merge "Dormant mobile notifications overlay lives in Echo" 2019-10-09 19:50:57 +00:00
jdlrobson d3c0494a17 Dormant mobile notifications overlay lives in Echo
This code will be enabled when Iba1d7863171268066bf7597182c57a0a2041497f
relinquishes the responsibility for rendering the Echo notification badge
and wiring up of the related JS.

It makes 3 assumptions:
1) Minerva will expose a VERSION property on the skins.minerva.scripts module
to tell Echo it can begin control of the functionality
2) A new hook `SkinMinervaReplaceNotificationsBadge` will run on the server side
allowing Echo extension to render the Notifications badge in Minerva.
3) A new client side hook (echo.mobile) will fire whenever the Echo dialog is opened or
closed.

All code relating to Echo inside MobileFrontend and Minerva is
moved here.
CSS for the modules is kept in Minerva as skinStyles

This code remains dormant until Iba1d7863171268066bf7597182c57a0a2041497f lands.
It pre-registers a "to-be-created" hook SkinMinervaReplaceNotificationsBadge that
substitutes the Minerva badge.

It also watches the export value of skins.minerva.scripts for a VERSION value - when
this appears it will take the signal that it should manage the frontend code.

In the new system the mobile specific code is limited to the mobile version of
Minerva. The desktop version of Echo loads on Minerva desktop - presenting an
opportunity in future to consolidate both implementations to use the same component.
The mobile version of Vector and Timeless for example will load the mobile overlay
(with existing styling issues that we don't need to worry about right now given
we don't officially support skins other than Minerva as mobile)

Testers:
* Check require( 'ext.echo.mobile' )(); inside initMobile
inside ext.echo.init does not fire until
Iba1d7863171268066bf7597182c57a0a2041497f is checked out.

Depends-On:  I1a66939d2b596094b419de40b370e79f09c85581
Bug: T221007
Change-Id: I09c27a084100b223662f84de6cbe01bebe1fe774
2019-10-09 12:36:11 -07:00
Translation updater bot 42a70f1814 Localisation updates from https://translatewiki.net.
Change-Id: I97cdc0ec3553cf1845fa0a2bbadd96724d03eafc
2019-10-08 09:32:51 +02:00
Max Semenik 7e9e549743 Use PHPUnit 6 class names
Bug: T192167
Change-Id: Id309ad5933371dd835ec431ded80f650e228099c
2019-10-06 15:23:15 -07:00
Max Semenik 031e6d37bf Drop old PHPUnit rudiments
Change-Id: I0a69ee7826227ee195415e43dc688f76602ed02b
2019-10-04 20:54:45 -07:00
Translation updater bot 1901505cc3 Localisation updates from https://translatewiki.net.
Change-Id: I89787320646c88e2ffb5f30cdc5ae4f61ddc1d7f
2019-10-04 09:29:03 +02:00
Volker E dce5173703 Remove IE 6 & 7 hacks
Bug: T234582
Change-Id: I5208a57ab3b1b95e97ca8a0d3d9c1df6c57ebc3b
2019-10-03 19:05:38 -07:00
Translation updater bot 259b0b936c Localisation updates from https://translatewiki.net.
Change-Id: Iaa8196c03cff776ed995983991b660072346e979
2019-10-02 09:21:01 +02:00
Translation updater bot 39c7cc6f7b Localisation updates from https://translatewiki.net.
Change-Id: Ic4b7055d78a2922fea3601112306261d8c65515b
2019-09-30 09:18:58 +02:00
Roan Kattouw 83f8949dc5 Stop exporting wgWikiId, use wgWikiID from core
Update usages of the variable for the capitalization difference.

Depends-On: I4d289267991f1f9a8e0710ec6ee5a2131306c510
Change-Id: Ie49e898b33765aa0723501be8c0c30622e7cbd2f
2019-09-25 18:14:40 +00:00
Translation updater bot d67cda9fdd Localisation updates from https://translatewiki.net.
Change-Id: I03b3301b4b5de5ed8c947a02a30f51a4724c567c
2019-09-25 09:23:11 +02:00
Translation updater bot c4b5994a91 Localisation updates from https://translatewiki.net.
Change-Id: If0a5128dcae2af1d2e73bee2f90dae76fe4c1cd6
2019-09-24 09:57:04 +02:00
Translation updater bot e94b40f88c Localisation updates from https://translatewiki.net.
Change-Id: Iea3c3bf88f677bb0158bfdd04586b569986b2baa
2019-09-23 09:25:21 +02:00
Translation updater bot 9efd56a0ac Localisation updates from https://translatewiki.net.
Change-Id: I5760c255259477dc34b0f0d8bc1ec568ffe59e19
2019-09-20 11:42:24 +02:00
Translation updater bot eaa719b629 Localisation updates from https://translatewiki.net.
Change-Id: I54df48b68d4e37f7d5a7a3edb9d26bf52a0fc300
2019-09-19 09:57:50 +02:00
Translation updater bot 00820d22bb Localisation updates from https://translatewiki.net.
Change-Id: Ide9755d9e3426b75edd4a716428a330ec13b4dc2
2019-09-17 09:07:26 +02:00
Translation updater bot 8030ef4f4b Localisation updates from https://translatewiki.net.
Change-Id: I7827b48ca229c899d8cf10e17e47aa56a2107e94
2019-09-16 09:55:02 +02:00
mainframe98 b942fa3c65 Inject PermissionManager into Userrightspage in tests
With I40fc8a709de96aceee14a10c973cd5b0a9a6f063 UserrightsPage
now requires the PermissionManager service to be injected.

Change-Id: Ibf3728c1e143787fb35b88ad8a8d5aabc8fadcb8
2019-09-13 18:24:52 +02:00
Translation updater bot 5595257b44 Localisation updates from https://translatewiki.net.
Change-Id: I4c4f216a61942e7461fc67842e047e2fca72678d
2019-09-13 10:17:54 +02:00
Translation updater bot da1a6097d2 Localisation updates from https://translatewiki.net.
Change-Id: I552fa0cbc9a75a19e25782c0242f3886f4a5c874
2019-09-12 10:00:37 +02:00
Translation updater bot 634515077c Localisation updates from https://translatewiki.net.
Change-Id: Ifbc3cb603b01f9b8a7edf45bd99aecfedeb3e690
2019-09-10 09:37:14 +02:00
Translation updater bot 0740de0605 Localisation updates from https://translatewiki.net.
Change-Id: Id01a5f6bb03641191590ff399c08785959477fdb
2019-09-09 09:26:07 +02:00
Translation updater bot 472612c741 Localisation updates from https://translatewiki.net.
Change-Id: I6337ce9767502b3ef4bc1a8ca243850c5185dd8f
2019-09-04 10:12:50 +02:00
Translation updater bot 396ad579ce Localisation updates from https://translatewiki.net.
Change-Id: I164d4dfd1396e51619c36759a86d8bc9ee79adc7
2019-09-03 10:27:26 +02:00
Translation updater bot ec0ad22ec3 Localisation updates from https://translatewiki.net.
Change-Id: I8a8c4b66b0d8cdf8c2ee1c7002a1b2b6af633ef4
2019-09-02 10:19:10 +02:00
Translation updater bot c63816675e Localisation updates from https://translatewiki.net.
Change-Id: I06821c2c4fe8c9f86f87136d6665ba91744af25c
2019-08-31 15:56:57 +02:00
Kosta Harlan 15d36ccae5 Remove global usage in UserNotificationGateway
As noted in Ic22075bb5e, UserNotificationGatewayTest relies on the presence of
globals. When Ic22075bb5e is merged, UserNotificationGatewayTest will fail in
CI. This patch injects the configuration object into UserNotificationGateway.

Change-Id: I9c15a588a76a41a3ebfb59dac7f0761f756008ff
2019-08-30 22:58:41 +02:00
Translation updater bot db352b6d86 Localisation updates from https://translatewiki.net.
Change-Id: I47c43ffd79dc53ff85cefd00cfa65b57eb1fa151
2019-08-30 10:03:07 +02:00