23 months agoUpdate git submodules
Reedy [Fri, 11 Oct 2019 00:13:31 +0000 (01:13 +0100)]
Update git submodules

* Update vendor from branch 'REL1_34'
  to 4e1e1ae5f6f484aaa2713f7c9d60bd2887964fbf
  - Bump required PHP >= 7.2.9 to match core

    Change-Id: Ib0ec551c99530f5481b8c9b885b05743816253e8

23 months agoFollow-up Ifa346c8a92: LanguageNameUtils: CONSTRUCTOR_OTPIONS, not constructorOptions
James D. Forrester [Thu, 10 Oct 2019 23:56:18 +0000 (16:56 -0700)]
Follow-up Ifa346c8a92: LanguageNameUtils: CONSTRUCTOR_OTPIONS, not constructorOptions

Change-Id: I357dddf39834e9eed4b173245033d2f27edab329
(cherry picked from commit b83a3e3e3afaba41545abf1211e85558e81a3f9a)

23 months agoMerge "NameTableStore: ensure consistency upon rollback." into REL1_34
jenkins-bot [Thu, 10 Oct 2019 22:21:24 +0000 (22:21 +0000)]
Merge "NameTableStore: ensure consistency upon rollback." into REL1_34

23 months agoNameTableStore: ensure consistency upon rollback.
daniel [Tue, 4 Jun 2019 10:14:43 +0000 (12:14 +0200)]
NameTableStore: ensure consistency upon rollback.

This ensures consistent behavior when an ID for a name is first acquired
within a transaction that is rolled back. The documentation for acquireId
now reads:

@note If called within a transaction, there is a chance for the acquired ID to be lost
if the transaction is rolled back. A best effort is made to re-insert the mapping
after a rollback, and consistency of the cache with the database table is ensured
by re-loading the map after a failed transaction. However, there is no guarantee
that an ID returned by this method is valid outside the transaction in which it
was produced. This means that calling code should not retain the return value beyond
the scope of a transaction, but rather call acquireId() again after the transaction
is complete. In some rare cases, this may produce an ID different from the first call.

Bug: T224949
Change-Id: I6d05e4112a649675bfb9083cab2d1bbe394e65b3
(cherry picked from commit 135673b98eccc43528ce0dcc0ef61ed44b932471)

23 months agoobjectcache: Deprecate ObjectCache::getWANInstance
Timo Tijhof [Tue, 8 Oct 2019 21:17:22 +0000 (22:17 +0100)]
objectcache: Deprecate ObjectCache::getWANInstance

This is not used anywhere. Once removed we can remove a bunch
more protected/private methods in this class that are all only
here still due to this one public method.

It was obsolete when the creation of WANObjectCache was
moved to ServiceWiring. In theory multiple instances can be
created but in the future that should be done by either constructing
the WANObjectCache directly where needed, or by implementing
it as a custom service.

Also deprecate ObjectCache::newWANCacheFromParams. This should
have been `@internal`, but oh well. Deprecate as well since
only needed by getWANInstance(). No longer used internally
either as of I118b6f01e4940.

Change-Id: Icc500e76c860c35ff40fdee47142c63091829dfe
(cherry picked from commit b10b56dc6923062314f136945da255a24e52a585)

23 months agoSet minimum PHP version to 7.2.9
Reedy [Thu, 10 Oct 2019 20:25:58 +0000 (21:25 +0100)]
Set minimum PHP version to 7.2.9

Bug: T234766
Change-Id: I25206df6d7bc1587c3e18b1015603b3d264017f7

23 months agoMerge "composer: Correct PHP version requirement from 7.0 to 7.2 once CI lets us...
jenkins-bot [Thu, 10 Oct 2019 19:31:42 +0000 (19:31 +0000)]
Merge "composer: Correct PHP version requirement from 7.0 to 7.2 once CI lets us" into REL1_34

23 months agocomposer: Correct PHP version requirement from 7.0 to 7.2 once CI lets us
James D. Forrester [Wed, 2 Oct 2019 21:41:13 +0000 (14:41 -0700)]
composer: Correct PHP version requirement from 7.0 to 7.2 once CI lets us

Bug: T234767
Change-Id: I96ddb373bb89a8c7e3b0599bb7c7dc671e26e337
(cherry picked from commit 54cd4fcabad81f57049f959bde4774e3707cd7d0)

23 months agoobjectcache: Log debug message for backend of WANObjectCache
Timo Tijhof [Tue, 8 Oct 2019 21:34:17 +0000 (22:34 +0100)]
objectcache: Log debug message for backend of WANObjectCache

While at it, disuse the static newWANCacheFromParams function
which was only used by ServiceWiring (can now be deprecated,
but done separate for easier backporting).

Now that it is inlined, there is easy access to its logger.

Bug: T234361
Change-Id: I118b6f01e49405984310030d44ee319bb25bfcdb
(cherry picked from commit 3828558140eba4427d762937a2ea5ae352485d5f)

23 months agoUpdate git submodules
jenkins-bot [Wed, 9 Oct 2019 21:13:37 +0000 (21:13 +0000)]
Update git submodules

* Update extensions/OATHAuth from branch 'REL1_34'
  to 9b33403ce11c32eac998f58e28717676091947e6
  - Merge "Bump 0.4.3" into REL1_34
  - Bump 0.4.3

    Change-Id: Id6ea1e2e41d64ccdfb02b6b081595c0a2b490329

23 months agoUpdate git submodules
Dejan Savuljesku [Wed, 11 Sep 2019 08:29:43 +0000 (10:29 +0200)]
Update git submodules

* Update extensions/OATHAuth from branch 'REL1_34'
  to 8ba29f4a5c469245807ecba39504c9e9d5cc0570
  - Ask user to reauthenticate before changing 2FA method

    Re-auth period set to 60s

    Bug: T218211
    Change-Id: I17a84b8e60da2ada35c6b86cf6b66d75fb3f13fe

23 months agoMerge "Split some Language methods to LanguageNameUtils" into REL1_34
jenkins-bot [Wed, 9 Oct 2019 09:46:53 +0000 (09:46 +0000)]
Merge "Split some Language methods to LanguageNameUtils" into REL1_34

23 months agoServices: Convert MWLBFactory's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:33:31 +0000 (11:33 -0700)]
Services: Convert MWLBFactory's static to a const now HHVM is gone

Change-Id: I2b5c77c304e03af31bc3f15f2e3f6002ca2f2647
(cherry picked from commit 6898ba72325b2227d33d002d337474bd23e0bffb)

23 months agoSplit some Language methods to LanguageNameUtils
Aryeh Gregor [Thu, 2 May 2019 14:23:42 +0000 (17:23 +0300)]
Split some Language methods to LanguageNameUtils

These are static methods that have to do with processing language names
and codes. I didn't include fallback behavior, because that would mean a
circular dependency with LocalisationCache.

In the new class, I renamed AS_AUTONYMS to AUTONYMS, and added a class
constant DEFINED for 'mw' to match the existing SUPPORTED and ALL. I
also renamed fetchLanguageName(s) to getLanguageName(s).

There is 100% test coverage for the code in the new class.

This was previously committed as 2e52f48c2ed and reverted because it
depended on e4468a1d6b6, which had to be reverted for performance
issues. There should be no changes other than rebasing.

Bug: T201405
Change-Id: Ifa346c8a92bf1eb57dc5e79458b32b7b26f1ee8a
(cherry picked from commit 6d80b6c0827401cf8e41589bf134147bb0aa407f)

23 months agoHHVM removal: Deprecate and simplify wfIsHHVM()
James D. Forrester [Thu, 3 Oct 2019 18:03:46 +0000 (11:03 -0700)]
HHVM removal: Deprecate and simplify wfIsHHVM()

Change-Id: I81b15d3ae66f070a8a1286627973a339cc08e86b
(cherry picked from commit c00e7cd793c72875ed0cadd89aa48b033cca2571)

23 months agoAdd optional serialization_type and hmac_key param values to RESTBagOStuff
Bill Pirkle [Thu, 26 Sep 2019 17:59:15 +0000 (12:59 -0500)]
Add optional serialization_type and hmac_key param values to RESTBagOStuff

T233537 made RESTBagOStuff work with the Kask external session
storage service, but broke backward compatibility. Add optional
values to the RESTBagOStuff $params constructor parameter to
support communicating with Kask, and to allow using HMAC. The
new values are:
  serialization_type: legacy (default), PHP, or JSON
  hmac_key: HMAC key to use for protecting the serialized blob
If these new values are not specified, behavior remains
unchanged (PHP serialization with no HMAC protection).

Bug: T233963
Change-Id: Ia2625c04e08cfe9616569500f1d613be73c170a2
(cherry picked from commit 2ed69af15cb8971e35aafc2c08397ed38c480488)

23 months agoMerge "Disable flaky Selenium test" into REL1_34
jenkins-bot [Tue, 8 Oct 2019 21:11:31 +0000 (21:11 +0000)]
Merge "Disable flaky Selenium test" into REL1_34

23 months agoMerge "Services: Convert LocalisationCache's static to a const now HHVM is gone"...
jenkins-bot [Tue, 8 Oct 2019 21:10:44 +0000 (21:10 +0000)]
Merge "Services: Convert LocalisationCache's static to a const now HHVM is gone" into REL1_34

23 months agoMerge "Make LocalisationCache a service" into REL1_34
jenkins-bot [Tue, 8 Oct 2019 21:08:21 +0000 (21:08 +0000)]
Merge "Make LocalisationCache a service" into REL1_34

23 months agoMerge "Services: Convert DefaultPreferencesFactory's static to a const now HHVM is...
jenkins-bot [Tue, 8 Oct 2019 21:03:04 +0000 (21:03 +0000)]
Merge "Services: Convert DefaultPreferencesFactory's static to a const now HHVM is gone" into REL1_34

23 months agoDisable flaky Selenium test
Reedy [Tue, 8 Oct 2019 20:20:30 +0000 (21:20 +0100)]
Disable flaky Selenium test

Bug: T226144
Change-Id: Ib49898617ba419f709b249ae9a05d9cb7b8e4e9d

23 months agoServices: Convert DefaultPreferencesFactory's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:28:15 +0000 (11:28 -0700)]
Services: Convert DefaultPreferencesFactory's static to a const now HHVM is gone

Change-Id: If24c5f120cb96311b50750c5b3022664dc6b20e5
(cherry picked from commit 17f3f9cee31cd3aab4370808871309d9de5a87f9)

23 months agoServices: Convert LocalisationCache's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:25:30 +0000 (11:25 -0700)]
Services: Convert LocalisationCache's static to a const now HHVM is gone

Change-Id: If5c015debed7efc034613b976bc5292ac30036d7
(cherry picked from commit ebac0247cf38b45a253042be16998c7fffbffcbc)

23 months agoMake LocalisationCache a service
Aryeh Gregor [Wed, 1 May 2019 13:56:41 +0000 (16:56 +0300)]
Make LocalisationCache a service

This removes Language::$dataCache without deprecation, because 1) I
don't know of a way to properly simulate it in the new paradigm, and 2)
I found no direct access to the member outside of the Language and
LanguageTest classes.

An earlier version of this patch (e4468a1d6b6) had to be reverted
because of a massive slowdown on test runs. Based on some local testing,
this should fix the problem. Running all tests in languages is slowed
down by only around 20% instead of a factor of five, and memory usage is
actually reduced greatly (~350 MB -> ~200 MB). The slowdown is still not
great, but I assume it's par for the course for converting things to
services and is acceptable. If not, I can try to optimize further.

Bug: T231220
Bug: T231198
Bug: T231200
Bug: T201405
Change-Id: Ieadbd820379a006d8ad2d2e4a1e96241e172ec5a
(cherry picked from commit 043d88f680cf66c90e2bdf423187ff8b994b1d02)

23 months agoServices: Convert PasswordReset's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:26:17 +0000 (11:26 -0700)]
Services: Convert PasswordReset's static to a const now HHVM is gone

Change-Id: I77e0d9ce86cf96824eb672d0f35c32b5f4c484be
(cherry picked from commit 662b27776b0df77f31e9767bfbecd8bf0ca6ef93)

23 months agoServices: Convert BlobStoreFactory's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:27:22 +0000 (11:27 -0700)]
Services: Convert BlobStoreFactory's static to a const now HHVM is gone

Change-Id: Ia319c881f0457fde71e355eca4873ac157e605d3
(cherry picked from commit 4afe9030c2ff36811e5ff8260e9c401b6e047c01)

23 months agoOptionally require both username and email for password resets
Max Semenik [Sat, 14 Sep 2019 07:58:42 +0000 (00:58 -0700)]
Optionally require both username and email for password resets

Bug: T232694
Change-Id: I70ed25ea4f810bf642fcb3df6f9b2663732b5dcf
(cherry picked from commit 1de3611539dbef2df2b9c0a4632aecd066695990)

23 months agoMerge "Services: Convert BlockManager's static to a const now HHVM is gone" into...
jenkins-bot [Tue, 8 Oct 2019 20:18:20 +0000 (20:18 +0000)]
Merge "Services: Convert BlockManager's static to a const now HHVM is gone" into REL1_34

23 months agoServices: Convert BlockManager's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:24:22 +0000 (11:24 -0700)]
Services: Convert BlockManager's static to a const now HHVM is gone

Change-Id: I01d6e18fc30bd61ba7ea5ce1c7c646524579c4ba
(cherry picked from commit 40c35286cbf11a12c855eb9ffa722b867028564b)

23 months agoServices: Convert PermissionManager's static to a const now HHVM is gone
James D. Forrester [Tue, 8 Oct 2019 18:23:08 +0000 (11:23 -0700)]
Services: Convert PermissionManager's static to a const now HHVM is gone

Change-Id: Ib75b6f5d6b3e793ddbce42951693d8c99e6b7e57
(cherry picked from commit 9cba9f8567ade9a142a49a75b834d1b938c18336)

23 months agoInclude REL1_34 submodules and default settings
Dan Duvall [Mon, 7 Oct 2019 22:48:13 +0000 (15:48 -0700)]
Include REL1_34 submodules and default settings

Change-Id: If54420b942832cb3db5523de1ea52e9ab5d855e4

23 months agoMerge "Drop strings for wgExternalDiffEngine, deprecated in 1.27 and 1.32" into REL1_34
jenkins-bot [Mon, 7 Oct 2019 15:00:00 +0000 (15:00 +0000)]
Merge "Drop strings for wgExternalDiffEngine, deprecated in 1.27 and 1.32" into REL1_34

23 months agoMerge "Turn PasswordReset into a service" into REL1_34
jenkins-bot [Mon, 7 Oct 2019 14:44:24 +0000 (14:44 +0000)]
Merge "Turn PasswordReset into a service" into REL1_34

23 months agoDrop strings for wgExternalDiffEngine, deprecated in 1.27 and 1.32
James D. Forrester [Tue, 2 Jul 2019 21:41:41 +0000 (14:41 -0700)]
Drop strings for wgExternalDiffEngine, deprecated in 1.27 and 1.32

Also move the 'unit' test into integration, given it tests code
using globals.

Change-Id: Ie039cae9b5d2870c18a6deefec9a73de522dd847
(cherry picked from commit 5b3bbd5adea327912694745db9c53d5d39de3315)

23 months agoDrop HHVM support from MediaWiki
James D. Forrester [Wed, 2 Oct 2019 21:32:01 +0000 (14:32 -0700)]
Drop HHVM support from MediaWiki

This is just a first, top-level patch for documentation and the
PHPVersionCheck class itself. Much more clean-up to follow.

Bug: T192166
Change-Id: I50f5adc8d5fff604a14c8a889a31d3b92cc568c5
(cherry picked from commit ed8e9397adf9477c381f3880276a2e0917087a7b)

23 months agoTurn PasswordReset into a service
Max Semenik [Tue, 10 Sep 2019 02:49:12 +0000 (19:49 -0700)]
Turn PasswordReset into a service

My team has plans to work in this area, better make it more testable.

Bug: T232694
Change-Id: I200874ec10db69378ada1743b2a7953b3fa01e3e
(cherry picked from commit 631f56c5766f582f21dd35eff0376b14692aa145)

23 months agoinstaller: Fix warningBox arguments in WebInstallerRestart
Daimona Eaytoy [Sun, 6 Oct 2019 18:11:05 +0000 (20:11 +0200)]
installer: Fix warningBox arguments in WebInstallerRestart

Found in Idde7a766bb0d084d6b67bb0c940d7ad704847ad2.

Change-Id: Ia576f6c39098a58f57ad422d548d0236a3e59cce

23 months agoMerge "tests: Fix broken assertion in ApiQueryAllPagesTest"
jenkins-bot [Tue, 1 Oct 2019 13:31:19 +0000 (13:31 +0000)]
Merge "tests: Fix broken assertion in ApiQueryAllPagesTest"

23 months agoMerge "selenium: Replace ES5 one-var assignments with const/let per line"
jenkins-bot [Tue, 1 Oct 2019 08:34:10 +0000 (08:34 +0000)]
Merge "selenium: Replace ES5 one-var assignments with const/let per line"

23 months agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 1 Oct 2019 06:24:41 +0000 (08:24 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I8c399d24532a18870561e054cca2d9651e0908ec

23 months agoselenium: Replace ES5 one-var assignments with const/let per line
Timo Tijhof [Tue, 1 Oct 2019 01:36:15 +0000 (02:36 +0100)]
selenium: Replace ES5 one-var assignments with const/let per line

The one-var rule only applies to 'var' where it matters that we
don't let the engine implicitly hoist variables leading to
confusing code that may be unsafe to refactor in a straight-forward

This doesn't apply to ES6 const and let. While I updated the
rule in 1955a8aa5 to allow ES6, I did not enforce it. Fixed now.
When assigning a value, each assignment should be its own
statement (disallow awkward comma separated assignments).
When not assigning a value, and the lines are next to each other,
they should be in one statement. This makes sense for this small
directory and might make sense to propose for the wikimedia preset
at some point.

Note that the rule I added was not required to make the build
pass. The changes I made are allowed by default by the wikimedia
preset for es6+. The rule I added disallows the previous way.

Change-Id: I26cda095a8a4589084e36273038877f2dd1fc50b

23 months agoAvoid dynamic call to static method in ResourceLoaderModule::buildContent()
Aaron Schulz [Mon, 30 Sep 2019 23:08:05 +0000 (16:08 -0700)]
Avoid dynamic call to static method in ResourceLoaderModule::buildContent()

Change-Id: I4e3d944b6468ad2f4bfc39532498d8ca38617689

23 months agoMerge "Selenium: Hide VE welcome and beta dialogs"
jenkins-bot [Mon, 30 Sep 2019 20:30:42 +0000 (20:30 +0000)]
Merge "Selenium: Hide VE welcome and beta dialogs"

23 months agoSelenium: Hide VE welcome and beta dialogs
Kosta Harlan [Mon, 30 Sep 2019 19:07:57 +0000 (21:07 +0200)]
Selenium: Hide VE welcome and beta dialogs

Remove uses of setLocalStorage (incompatible with chromedriver >= 75)
and also requires slightly fewer requests since BlankPage.open()
doesn't need to be invoked.

Bug: T234002
Change-Id: I4cfb4fe17a3c99bfcb7ff39ac6db60f5c5e8a687

23 months agoMerge "RevisionStore::newRevisionFromBatch should use Title::newFromRow"
jenkins-bot [Mon, 30 Sep 2019 19:47:47 +0000 (19:47 +0000)]
Merge "RevisionStore::newRevisionFromBatch should use Title::newFromRow"

23 months agoMerge "Parser: Add Title type hints"
jenkins-bot [Mon, 30 Sep 2019 19:47:40 +0000 (19:47 +0000)]
Merge "Parser: Add Title type hints"

23 months agoMerge "filebackend: Convert trigger_error to PSR log warning"
jenkins-bot [Mon, 30 Sep 2019 19:23:38 +0000 (19:23 +0000)]
Merge "filebackend: Convert trigger_error to PSR log warning"

23 months agoMerge "selenium: Fix inefficient use of MWBot in specs/page.js"
jenkins-bot [Mon, 30 Sep 2019 18:57:01 +0000 (18:57 +0000)]
Merge "selenium: Fix inefficient use of MWBot in specs/page.js"

23 months agoMerge "selenium: Use async-await for wdio-mediawiki/Api internals"
jenkins-bot [Mon, 30 Sep 2019 18:56:52 +0000 (18:56 +0000)]
Merge "selenium: Use async-await for wdio-mediawiki/Api internals"

23 months agoRevisionStore::newRevisionFromBatch should use Title::newFromRow
Petr Pchelko [Wed, 25 Sep 2019 20:17:38 +0000 (13:17 -0700)]
RevisionStore::newRevisionFromBatch should use Title::newFromRow

If the rows were obtained using RevisionStore::getQueryInfo with
'page' flags, the revision row already contains the fields needed
to construct the Title without an additional database query.

Change-Id: Ie36c85871a8996a5706c80d286854a9c8363905f

23 months agoMerge "selenium: Remove "RunJobs" wait from specialrecentchanges test"
jenkins-bot [Mon, 30 Sep 2019 18:34:21 +0000 (18:34 +0000)]
Merge "selenium: Remove "RunJobs" wait from specialrecentchanges test"

23 months agoMerge "selenium: Remove deprecated legacy methods"
jenkins-bot [Mon, 30 Sep 2019 18:11:33 +0000 (18:11 +0000)]
Merge "selenium: Remove deprecated legacy methods"

23 months agoMerge "selenium: Upgrade from webdriver v4 to v5"
jenkins-bot [Mon, 30 Sep 2019 18:09:50 +0000 (18:09 +0000)]
Merge "selenium: Upgrade from webdriver v4 to v5"

23 months agoMerge "RevisionStore: Introduce getContentBlobsForBatch"
jenkins-bot [Mon, 30 Sep 2019 17:46:08 +0000 (17:46 +0000)]
Merge "RevisionStore: Introduce getContentBlobsForBatch"

23 months agoMerge "tests: Replace assertions on count() == 0 with strict === []"
jenkins-bot [Mon, 30 Sep 2019 17:43:35 +0000 (17:43 +0000)]
Merge "tests: Replace assertions on count() == 0 with strict === []"

23 months agoMerge "Split down patch-actor-table.sql"
jenkins-bot [Mon, 30 Sep 2019 17:40:25 +0000 (17:40 +0000)]
Merge "Split down patch-actor-table.sql"

23 months agoSplit down patch-actor-table.sql
Reedy [Sat, 28 Sep 2019 14:48:19 +0000 (15:48 +0100)]
Split down patch-actor-table.sql

Bug: T227662
Change-Id: I024ff1d6f4c2726242138ba7e7f19480d9d2b948

23 months agoMerge "maintenance: Enable gzip in router.php for static files"
jenkins-bot [Mon, 30 Sep 2019 14:38:53 +0000 (14:38 +0000)]
Merge "maintenance: Enable gzip in router.php for static files"

23 months agotests: Fix broken assertion in ApiQueryAllPagesTest
Thiemo Kreuz [Mon, 30 Sep 2019 14:22:54 +0000 (16:22 +0200)]
tests: Fix broken assertion in ApiQueryAllPagesTest

The description had two errors:

* It talked about the presence of a specific value, but all it did
was checking a count.

* It was talking about the value *not* being there.

I just removed it. The possible error message from PHPUnit should be
good enough.

Change-Id: I7ea85dd37db8969bdd120f9600eeb6145e42eb1e

23 months agotests: Replace assertions on count() == 0 with strict === []
Thiemo Kreuz [Mon, 30 Sep 2019 14:20:34 +0000 (16:20 +0200)]
tests: Replace assertions on count() == 0 with strict === []

The benefit of using count() is that the test would still succeed if
the return vfalue is not an array, but an iterable object. It seems
this is not needed.

Change-Id: I23529f6990aebe0cce86e236a21820fe74993204

23 months agoMerge "selenium: Restore sauce user/key configuration for wdio"
jenkins-bot [Mon, 30 Sep 2019 14:11:52 +0000 (14:11 +0000)]
Merge "selenium: Restore sauce user/key configuration for wdio"

23 months agoselenium: Fix inefficient use of MWBot in specs/page.js
Timo Tijhof [Sun, 29 Sep 2019 03:24:47 +0000 (04:24 +0100)]
selenium: Fix inefficient use of MWBot in specs/page.js

This test previously took 4 minutes to run locally and ended up
running the MWBot.login process 9 times.

After this, the specs/page tests only log-in once.

Bug: T234002
Change-Id: I374620a01f49d4da559070d0982bdbe4c1269e2e

23 months agoselenium: Use async-await for wdio-mediawiki/Api internals
Timo Tijhof [Sun, 29 Sep 2019 02:37:09 +0000 (03:37 +0100)]
selenium: Use async-await for wdio-mediawiki/Api internals

Bug: T234002
Change-Id: Ie4ad5248f832dd57f35710e0e9a91250e061b0bb

23 months agomaintenance: Enable gzip in router.php for static files
Timo Tijhof [Thu, 26 Sep 2019 21:57:50 +0000 (22:57 +0100)]
maintenance: Enable gzip in router.php for static files

Bug: T233992
Change-Id: Ie401180ac968210c9f923ad920bf15955c8551d7

23 months agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 30 Sep 2019 06:31:33 +0000 (08:31 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I2ff71393f57b3c397dae4e63d9607dcd1807343e

23 months agoMerge "resourceloader: Hard deprecate ResourceLoader::getLessVars"
jenkins-bot [Mon, 30 Sep 2019 00:34:28 +0000 (00:34 +0000)]
Merge "resourceloader: Hard deprecate ResourceLoader::getLessVars"

23 months agoresourceloader: Hard deprecate ResourceLoader::getLessVars
Fomafix [Sun, 29 Sep 2019 09:02:32 +0000 (11:02 +0200)]
resourceloader: Hard deprecate ResourceLoader::getLessVars

ResourceLoader::getLessVars is already deprecated since MW 1.32.

Change-Id: If2fbe7828d8cde73575c0306486835fa1ea06b84

23 months agoMerge "Added option to specify "Various authors" as author in extension credits using...
jenkins-bot [Sun, 29 Sep 2019 21:16:23 +0000 (21:16 +0000)]
Merge "Added option to specify "Various authors" as author in extension credits using "..." as the _only_ author name"

23 months agoExpand testDoQuickOperations() tests for FileBackend
Aaron Schulz [Wed, 18 Sep 2019 09:52:38 +0000 (02:52 -0700)]
Expand testDoQuickOperations() tests for FileBackend

Change-Id: I0633f13f07b5a3234b9bbae4840b064972f68fd9

23 months agoAdded option to specify "Various authors" as author in extension credits using "...
Jack Phoenix [Sun, 15 Sep 2019 20:34:27 +0000 (23:34 +0300)]
Added option to specify "Various authors" as author in extension credits using "..." as the _only_ author name

If the "author" array contains more than one entry and "..." is one of the entries in the array, "..." will be parsed as "others" (version-poweredby-others i18n message) like previously.

Change-Id: Ibebd3c38a674abd9f066b38e92c7f712f7b3ba8d

23 months agoselenium: Remove "RunJobs" wait from specialrecentchanges test
Timo Tijhof [Sun, 29 Sep 2019 01:32:47 +0000 (02:32 +0100)]
selenium: Remove "RunJobs" wait from specialrecentchanges test

This test was consistently reaching the RunJobs timeout of
10 tries and then giving up. This happens in CI, where it wasted
about ~ 5 seconds, and locally where it takes about 30s for mw.

Like so:
> RunJobs through requests to the main page (run 1).
> RunJobs detected 12 more queued job(s).
> RunJobs through requests to the main page (run 2).
> RunJobs detected 12 more queued job(s).

Etc, until it reaches run 10 and gives up. This also suggests
the whole thing isn't wokring, but that's a separate matter.

First and foremost, RecentChange objects are saved from a PRESEND
deferred update, which means it does not require a job queue wait
in order to appear on Special:RecentChanges.

This was added in e908d347ef2 (T199446) "to keep the number of
unrun jobs low". The idea being that this test makes an edit via
the API, which means it creates jobs without running them. On
the other hand, there's also lots of test steps that view pages
but don't create jobs, which would make this optimisation premature.
If and when we do encounter a test failing due to a job backlog,
I'm confident we can find a better solution at that time.

Bug: T234002
Bug: T225730
Bug: T199446
Change-Id: I9ef8c5b65d4b636572569912f04f48ed40aa0564

23 months agoselenium: Remove deprecated legacy methods
Timo Tijhof [Sun, 29 Sep 2019 01:59:56 +0000 (02:59 +0100)]
selenium: Remove deprecated legacy methods

These are from 2018, prior to introducing wdio-mediawiki in
commit 16a4d9da7bb81. Some extensions referenced these pageobjects
files through escalating "../../" references.

None of these are seen in Codesearch anymore, as well as no
references to these deprecated methods by other means.

Change-Id: Idbc373f13f9767cecd6404922b5c9773d796dda5

23 months agoselenium: Upgrade from webdriver v4 to v5
Timo Tijhof [Fri, 27 Sep 2019 03:08:00 +0000 (04:08 +0100)]
selenium: Upgrade from webdriver v4 to v5

* Options no longer needed or no longer exist in wdio v5:
  - coloredLogs: Now always on. The underlying 'chalk' library can still
    be influenced via the FORCE_COLOR environment variable.
  - screenshotPath: Removed. Was already disabled in our config.
  - deprecationWarnings: Meh.
  - 'sync: true' – On by default when `@wdio/sync` is installed.
    The wdio v5 config generator doesn't recommend setting manually.

* The selenium.sh script was removed. It existed to start and stop
  chromedriver for local use by developers. This is now done by
  the wdio-chromedriver-service. In WMF CI, Quibble starts its own
  chromedriver (as optimisation, reused across gated repos),
  which is why the 'selenium-test' entry points remains and skips

* The wdio-mediawiki package now requires wdio v5 and Node 10.
  This doesn't affect extension repos because versions are pinned.
  Upgrade may happen at the earliest convenience.

* Several WDIO methods changed names or signature. Full list at:
  - browser.element() is now browser.findElement() with "$()" as alias.
  - browser.localStorage replaced by browser.setLocalStorage.
  - browser.deleteCookie() requires `name` param. To delete all at once,
    there is a new method browser.deleteAllCookies().
  - Commands that return data no longer wrapped in `{ value: … }`.
    Values are now returned directly.
  - Custom config keys are now under browser.config instead of browser.options.
    Renamed our username/password keys to be mw-prefixed, to avoid clashes
    and reduce confusion with similar config keys.
  - browser.click(selector) and browser.getText(selector) no longer exist.
    Use $(selector).click() or .getText() instead.

* Fix "no such alert" warning from specs/page.js by removing the apparently
  redundant code.

Bug: T234002
Bug: T213268
Change-Id: I908997569ca8457997af30cb29e98ac41fae3b64

23 months agoselenium: Restore sauce user/key configuration for wdio
Timo Tijhof [Fri, 27 Sep 2019 22:09:59 +0000 (23:09 +0100)]
selenium: Restore sauce user/key configuration for wdio

I removed these in e78484109ae7 because they seemed redundant
given that the library used by wdio-sauce-service already reads
these when present. However, our current version of this package
clobbers this unconditionally with config.user/config.key, thus
not letting it reach that default.

Also add sauceConnect:true which means developers can run
localhost tests against sauce labs if they so choose.

Change-Id: I8d31a23374b2b9b6cd6f1405c7a2f1001da08f1a

23 months agoMerge "resourceloader: Add version to ResourceLoaderImage urls for long-cache"
jenkins-bot [Sat, 28 Sep 2019 20:20:32 +0000 (20:20 +0000)]
Merge "resourceloader: Add version to ResourceLoaderImage urls for long-cache"

23 months agoMerge "resourceloader: Simplify makeLoaderStateScript and makeLoaderSourcesScript"
jenkins-bot [Sat, 28 Sep 2019 20:02:18 +0000 (20:02 +0000)]
Merge "resourceloader: Simplify makeLoaderStateScript and makeLoaderSourcesScript"

23 months agoMerge "resourceloader: Remove support for $context === null in getContentObj"
jenkins-bot [Sat, 28 Sep 2019 20:00:24 +0000 (20:00 +0000)]
Merge "resourceloader: Remove support for $context === null in getContentObj"

23 months agoStringUtils: Clarify that isValidRegex is for PCRE regexps
Daimona Eaytoy [Thu, 19 Sep 2019 09:55:19 +0000 (11:55 +0200)]
StringUtils: Clarify that isValidRegex is for PCRE regexps

As suggested in c14571ba26e (I257a096319f1e).

Change-Id: Ia91d037f2f4bf8a1bad4eac65fecb1d3e2679d2d

23 months agoresourceloader: Simplify makeLoaderStateScript and makeLoaderSourcesScript
Fomafix [Sat, 28 Sep 2019 11:32:29 +0000 (13:32 +0200)]
resourceloader: Simplify makeLoaderStateScript and makeLoaderSourcesScript

The signatures without array are not used anymore.

Change-Id: Ice6a09ff6cba0c605ed1c89a25fd8e02af041b05

23 months agoMerge "docs: Fix typo on Doxygen main page"
jenkins-bot [Sat, 28 Sep 2019 12:24:40 +0000 (12:24 +0000)]
Merge "docs: Fix typo on Doxygen main page"

23 months agoFix double dot in filename
Reedy [Fri, 27 Sep 2019 16:22:11 +0000 (17:22 +0100)]
Fix double dot in filename

Follows-Up: I7617616df57f7468d06e9b52426b6851bfef0e7d
Change-Id: Ia8be2fd6a13d095e27a6489b0126763573dd6194

23 months agoMerge "resourceloader: Add $modules parameter to makeVersionQuery()"
jenkins-bot [Sat, 28 Sep 2019 01:26:59 +0000 (01:26 +0000)]
Merge "resourceloader: Add $modules parameter to makeVersionQuery()"

23 months agoresourceloader: Add version to ResourceLoaderImage urls for long-cache
Timo Tijhof [Thu, 26 Sep 2019 16:26:52 +0000 (17:26 +0100)]
resourceloader: Add version to ResourceLoaderImage urls for long-cache

The code previously here did not work well as it merely forwarded the
hash from the current web request. This had numerous issues:

1. It was often null because requests for stylesheets do not cary
   a version hash.
2. When requested by JavaScript, the version hash would be a
   combination-hash of many unrelated modules, thus when requested as
   part of different batches, it would produce different urls which
   is not ideal.

The impact of this is minimal currently because we basically never use
these urls, as SVGs are almost always embedded instead of ref'ed by url.
PNG urls are only generated for non-JS modules and then only used in older
browsers not supporting SVG. And, even after all that, for the edge case
of an SVG being ref'ed by url, they would be stored in LocalStorage by
mw.loader with the name+version of the module the image belonged to, not
the version hash of the batch request it came with.

Which means that, yes, localstorage key for "somemodule+someversion" would
have different values for different users, based on which batch the value
came with, because the image urls were using the version hash of the batch
request from ResourceLoaderContext. This is weird, but didn't cause bugs
or inefficiencies because the user would never be exposed to the other
possible urls for that image because we always check LocalStorage first.
It did cause fragmentation server-side in Varnish, though.

This is all fixed now by always including a version, and setting it to
the version of the module. This means there is no more Varnish fragmentation
for these. And it means that browsers are now allowed to cache the images
served from these urls for 30+ days (immutable) instead of only 5min,
which is what happened when they didn't have a version parameter (or set to

Bug: T233343
Change-Id: I4af7fda03698ed4c288d154e7787fb2f3cbbe6c5

23 months agoMerge "Mark mediawiki.page.watch.ajax as targetable to mobile"
Jdlrobson [Fri, 27 Sep 2019 23:03:21 +0000 (23:03 +0000)]
Merge "Mark mediawiki.page.watch.ajax as targetable to mobile"

23 months agoMerge "tests: Replace PHPUnit's loose assertEquals(null) with assertNull()"
jenkins-bot [Fri, 27 Sep 2019 22:43:09 +0000 (22:43 +0000)]
Merge "tests: Replace PHPUnit's loose assertEquals(null) with assertNull()"

23 months agoMerge "build: Lower default Karma logLevel during local development"
jenkins-bot [Fri, 27 Sep 2019 22:23:51 +0000 (22:23 +0000)]
Merge "build: Lower default Karma logLevel during local development"

23 months agoMark mediawiki.page.watch.ajax as targetable to mobile
jdlrobson [Thu, 26 Sep 2019 15:56:58 +0000 (08:56 -0700)]
Mark mediawiki.page.watch.ajax as targetable to mobile

This is explicitly disabled by Minerva so this should have
no impact other than allow the loading of this module on

Change-Id: Ib73fb995f5ccb16d99b505abad2466187c3dc5a5

23 months agoMerge "Remove tests that were skipped for MCR-enabled schema"
jenkins-bot [Fri, 27 Sep 2019 21:34:39 +0000 (21:34 +0000)]
Merge "Remove tests that were skipped for MCR-enabled schema"

23 months agoMerge ".pipeline/config.yaml: rename dev stage to publish"
jenkins-bot [Fri, 27 Sep 2019 20:58:32 +0000 (20:58 +0000)]
Merge ".pipeline/config.yaml: rename dev stage to publish"

23 months agoMerge "resourceloader: Add $context to static functions in ResourceLoader"
jenkins-bot [Fri, 27 Sep 2019 20:48:15 +0000 (20:48 +0000)]
Merge "resourceloader: Add $context to static functions in ResourceLoader"

23 months agoMerge "resourceloader: Add type hints for type ResourceLoaderContext"
jenkins-bot [Fri, 27 Sep 2019 20:22:10 +0000 (20:22 +0000)]
Merge "resourceloader: Add type hints for type ResourceLoaderContext"

23 months agoRemove tests that were skipped for MCR-enabled schema
Petr Pchelko [Fri, 27 Sep 2019 19:05:42 +0000 (12:05 -0700)]
Remove tests that were skipped for MCR-enabled schema

Pre-MCR schema is no longer supported, thus we don't need
the tests that are skipped for MCR-enabled schema.

Bug: T214308
Change-Id: I2d78ec668fde1e49710c54be8ab72c474f30f6b8

23 months agotests: Replace PHPUnit's loose assertEquals(null) with assertNull()
Thiemo Kreuz [Tue, 17 Sep 2019 14:03:28 +0000 (16:03 +0200)]
tests: Replace PHPUnit's loose assertEquals(null) with assertNull()

assertEquals( null, … ) still succeeds when the actual value is 0, false,
an empty string, even an empty array. All these should be reported as a
failure, I would argue.

Note this patch previously also touched assertSame( null ). I reverted
these. The only benefit would have been consistency within this codebase,
but there is no strict reason to prefer one over the other. assertNull()
and assertSame( null ) are functionally identical.

Change-Id: I92102e833a8bc6af90b9516826abf111e2b79aac

23 months agoMerge "Fix permission check on protection log"
jenkins-bot [Fri, 27 Sep 2019 18:38:16 +0000 (18:38 +0000)]
Merge "Fix permission check on protection log"

23 months agoMerge "Remove Revision::getRevisionText and gated pre-MCR schema access"
jenkins-bot [Fri, 27 Sep 2019 18:38:09 +0000 (18:38 +0000)]
Merge "Remove Revision::getRevisionText and gated pre-MCR schema access"

23 months agoMerge "rdbms: Remove obsolete comment in LoadBalancerSingle"
jenkins-bot [Fri, 27 Sep 2019 18:35:44 +0000 (18:35 +0000)]
Merge "rdbms: Remove obsolete comment in LoadBalancerSingle"

23 months agoRevisionStore: Introduce getContentBlobsForBatch
daniel [Thu, 26 Sep 2019 12:23:40 +0000 (14:23 +0200)]
RevisionStore: Introduce getContentBlobsForBatch

getContentBlobsForBatch provides a more low level interface than
newRevisionsFromBatch, allowing bulk access to serialized content
without the need to instantiate Title, RevisionRecord, RevisionSlots,
SlotRecord, and Content objects.

Bug: T228675
Bug: T234034
Change-Id: I8481ad211e2d9f11bc10ea10c16e78b74538d95b

23 months agoMerge "Force usage of MCR aware database schema"
jenkins-bot [Fri, 27 Sep 2019 17:52:33 +0000 (17:52 +0000)]
Merge "Force usage of MCR aware database schema"

23 months ago.pipeline/config.yaml: rename dev stage to publish
Brennen Bearnes [Fri, 27 Sep 2019 17:43:52 +0000 (11:43 -0600)]
.pipeline/config.yaml: rename dev stage to publish

This should align with the "publish" pipeline defined in

Bug: T218360
Change-Id: Iba27755416843dd547ac1889d932a3b5ea9d1fd2

23 months agoFix permission check on protection log
Ammar [Fri, 27 Sep 2019 13:39:15 +0000 (14:39 +0100)]
Fix permission check on protection log

*I2341e6f inverted the permission check, such that now the link is only shown to unprivileged users

Bug: T234017
Change-Id: I0977f1ab1a72840303aeca2367a30546d83117d4