3 years agoAdd 1.33.0 to HISTORY
Reedy [Tue, 2 Jul 2019 14:43:53 +0000 (15:43 +0100)]
Add 1.33.0 to HISTORY

Change-Id: I11cfe407745ef7a3f2b48dc78f62cd1657290522

3 years agoAdd 1.31.3/1.32.3 to HISTORY
Reedy [Tue, 2 Jul 2019 14:41:23 +0000 (15:41 +0100)]
Add 1.31.3/1.32.3 to HISTORY

Change-Id: Ie7ae1bda5ffc910954852eb412ed30cb56810cb5

3 years agospecials: Combine small miscellaneous 'mediawiki.special.*' modules
Timo Tijhof [Fri, 14 Jun 2019 17:30:28 +0000 (18:30 +0100)]
specials: Combine small miscellaneous 'mediawiki.special.*' modules

The format for this would be cleaner if T225842 were solved.

Bug: T193826
Bug: T219342
Change-Id: I9aaa52b567db254e1e79649b3b99260214da74b3

3 years agoType hint using interface
WMDE-Fisch [Tue, 2 Jul 2019 10:11:09 +0000 (12:11 +0200)]
Type hint using interface

Fixes phan errors in FileImporter

Change-Id: I4ea2d081062f5f509040c73ff5f59ee5ffd700ad

3 years agoMerge "Type hint against interface for LoadBalancer in MediaWikiServices"
jenkins-bot [Tue, 2 Jul 2019 01:08:10 +0000 (01:08 +0000)]
Merge "Type hint against interface for LoadBalancer in MediaWikiServices"

3 years agoMerge "Unit tests: Support unit tests in extensions and skins"
jenkins-bot [Mon, 1 Jul 2019 23:25:12 +0000 (23:25 +0000)]
Merge "Unit tests: Support unit tests in extensions and skins"

3 years agoMerge "Remove group validator from UnitTestCase"
jenkins-bot [Mon, 1 Jul 2019 23:06:57 +0000 (23:06 +0000)]
Merge "Remove group validator from UnitTestCase"

3 years agoMerge "GlobalFunctions: Tighten version number type for wfDeprecated()"
jenkins-bot [Mon, 1 Jul 2019 21:42:10 +0000 (21:42 +0000)]
Merge "GlobalFunctions: Tighten version number type for wfDeprecated()"

3 years agoMerge "ApiBase: Drop get(Examples|(Param)?Description(Message)?)\(\), deprecated...
jenkins-bot [Mon, 1 Jul 2019 21:34:31 +0000 (21:34 +0000)]
Merge "ApiBase: Drop get(Examples|(Param)?Description(Message)?)\(\), deprecated since 1.25 and 1.30"

3 years agoGlobalFunctions: Tighten version number type for wfDeprecated()
Derick Alangi [Wed, 15 May 2019 14:24:46 +0000 (15:24 +0100)]
GlobalFunctions: Tighten version number type for wfDeprecated()

To avoid cases like: facddc4 and Ifaf6ab0d36bc02bd170, make sure the
value of the mediawiki version  must be a string (e.g. '1.33') or a
boolean (e.g. `false`).

For some reason, typos can slip through for this value to be a float.
Let's safe guard for future cases like this.

Change-Id: I52bdf94c957bda67548a937d51649e925195f926

3 years agoApiBase: Drop get(Examples|(Param)?Description(Message)?)\(\), deprecated since 1...
James D. Forrester [Mon, 24 Jun 2019 23:43:59 +0000 (16:43 -0700)]
ApiBase: Drop get(Examples|(Param)?Description(Message)?)\(\), deprecated since 1.25 and 1.30

Change-Id: Ie62436692f39825237d36002aa01bedf1caa1fa3

3 years agoMerge "Title: ensure getBaseTitle and getRootTitle return valid Titles"
jenkins-bot [Mon, 1 Jul 2019 21:02:45 +0000 (21:02 +0000)]
Merge "Title: ensure getBaseTitle and getRootTitle return valid Titles"

3 years agoMerge "Pass column as string to IDatabase::selectField"
jenkins-bot [Mon, 1 Jul 2019 20:27:28 +0000 (20:27 +0000)]
Merge "Pass column as string to IDatabase::selectField"

3 years agoTitle: ensure getBaseTitle and getRootTitle return valid Titles
daniel [Fri, 14 Jun 2019 09:01:22 +0000 (11:01 +0200)]
Title: ensure getBaseTitle and getRootTitle return valid Titles

Since getBaseText() and getRootText() may return text with trailing
whitespace, getBaseTitle and getRootTitle must use makeTitleSafe instead
of makeTitle.

Bug: T225585
Change-Id: Id92df552f05e6a9ed7c9259a8779fa94c3587a3e

3 years agoUnit tests: Support unit tests in extensions and skins
Kosta Harlan [Mon, 1 Jul 2019 19:33:54 +0000 (15:33 -0400)]
Unit tests: Support unit tests in extensions and skins

For now only extensions with skin/extension.json which follow PSR-4 are

DefaultSettings is loaded in bootstrap to work around errors when unit tests are
run followed by integration tests (e.g. `vendor/bin/phpunit`)


 - composer phpunit:unit will run all unit tests in core and any tests in
   `{extensions/skins}/tests/phpunit/unit` which also extend
   MediaWikiUnitTestCase, and which have an extension.json file
- Pass a specific directory to only run unit tests for a particular extension,
   e.g. `composer phpunit:unit -- extensions/GrowthExperiments`

Bug: T226911
Change-Id: I237a9f82e4d1b05cf2f08b3e4bb7ffcd8d47111c

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 1 Jul 2019 19:58:20 +0000 (21:58 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I4c609d902775f74131d2dc16ac0aef3bc418c140

3 years agoMerge "RCFilters: Reduce startup overhead from 'config.json' computation"
jenkins-bot [Mon, 1 Jul 2019 19:52:30 +0000 (19:52 +0000)]
Merge "RCFilters: Reduce startup overhead from 'config.json' computation"

3 years agoDrop APIEditBeforeSave hook
RazeSoldier [Sun, 30 Jun 2019 18:56:29 +0000 (02:56 +0800)]
Drop APIEditBeforeSave hook

Removed the source code and the test code.

Bug: T220656
Change-Id: I3674da6d9c33c08ec2f1774cb793b3a952480571

3 years agoMerge "htmlform: Reveal method getOOUI() is called from when spitting deprecation...
jenkins-bot [Mon, 1 Jul 2019 18:40:36 +0000 (18:40 +0000)]
Merge "htmlform: Reveal method getOOUI() is called from when spitting deprecation notice"

3 years agoRemove group validator from UnitTestCase
Kosta Harlan [Mon, 1 Jul 2019 15:42:21 +0000 (11:42 -0400)]
Remove group validator from UnitTestCase

Whether a unit test has `@group Database` is irrelevant, since it will simply
not work if it relies on database access.

Change-Id: Ibe01d4912160ae44ca86ef6f7c3946501a8c067e

3 years agoDrop the check for existences of LocalSettings.php in MediaWikiIntegrationTestCase
Amir Sarabadani [Mon, 1 Jul 2019 15:15:35 +0000 (17:15 +0200)]
Drop the check for existences of LocalSettings.php in MediaWikiIntegrationTestCase

This is not needed and we should let testers run integration tests without
the need to define LocalSettings.php

This reverts small part of Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76

Bug: T226977
Change-Id: Ia36d22217f94e019bb5945705243bd0daace72e0

3 years agoMerge "Mention relevant tasks in comment (follow-up to c8733333)"
jenkins-bot [Mon, 1 Jul 2019 13:36:35 +0000 (13:36 +0000)]
Merge "Mention relevant tasks in comment (follow-up to c8733333)"

3 years agoMerge "Check for valid user info before calling Linker::userLink() in Linker::revUser...
jenkins-bot [Mon, 1 Jul 2019 13:04:04 +0000 (13:04 +0000)]
Merge "Check for valid user info before calling Linker::userLink() in Linker::revUserTools()"

3 years agoMention relevant tasks in comment (follow-up to c8733333)
Thalia [Mon, 1 Jul 2019 11:53:16 +0000 (12:53 +0100)]
Mention relevant tasks in comment (follow-up to c8733333)

Change-Id: I25a8c018c879dd13967cd67fd51eae9768e3aa4b

3 years agoMerge "Defer cookie block checks to resolve a circular dependency"
jenkins-bot [Mon, 1 Jul 2019 11:09:45 +0000 (11:09 +0000)]
Merge "Defer cookie block checks to resolve a circular dependency"

3 years agoMerge "Rest API: urldecode path parameters"
jenkins-bot [Mon, 1 Jul 2019 01:37:41 +0000 (01:37 +0000)]
Merge "Rest API: urldecode path parameters"

3 years agoMerge "Fix SQLite patch-(page|template)links-fix-pk.sql column order"
jenkins-bot [Sun, 30 Jun 2019 22:41:09 +0000 (22:41 +0000)]
Merge "Fix SQLite patch-(page|template)links-fix-pk.sql column order"

3 years agoMerge "Mail: Add visibility for some methods without method visibility"
jenkins-bot [Sun, 30 Jun 2019 20:42:47 +0000 (20:42 +0000)]
Merge "Mail: Add visibility for some methods without method visibility"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 30 Jun 2019 19:59:17 +0000 (21:59 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I4ac7bf4bbcd320d208b9cc576cd699fcbf2cc8a4

3 years agoFix SQLite patch-(page|template)links-fix-pk.sql column order
Reedy [Sun, 30 Jun 2019 16:47:53 +0000 (17:47 +0100)]
Fix SQLite patch-(page|template)links-fix-pk.sql column order

Bug: T202211
Change-Id: Ife673b88c23acdc1bfc04630715d18243471035f

3 years agoMerge "Avoid :checkbox Sizzle selector"
jenkins-bot [Sun, 30 Jun 2019 15:43:33 +0000 (15:43 +0000)]
Merge "Avoid :checkbox Sizzle selector"

3 years agoMail: Add visibility for some methods without method visibility
Derick Alangi [Wed, 26 Jun 2019 10:11:33 +0000 (11:11 +0100)]
Mail: Add visibility for some methods without method visibility

Carefully, I checked usage of these methods in our code bases and
added the best possible visibilities to them. Not sure if I missed
something but let me know if I did.

Used private & public where suitable for the various methods. As for
__toString(), this is a magic method, so should be public per PHP docs.

Change-Id: Ie0987f4a984cac2f5eb1d9e21a305ad9467a8eb2

3 years agoMove trivially compatible tests to the unit tests suite
Máté Szabó [Sun, 30 Jun 2019 13:23:53 +0000 (15:23 +0200)]
Move trivially compatible tests to the unit tests suite

This changeset resumes work on T89432 and related tickets
by porting an initial set of tests to the new unit test suite
separated out in I69b92db3e70093570e05cc0a64c7780a278b321a.
The tests were only ported if they worked immediately without
requiring any changes other than changing the test case class
to MediaWikiUnitTestCase and moving the test to the new suite.
If a test failed for any reason (even trivial misconfiguration),
it was NOT ported.

With this change, the unit tests suite now consits of a total
of 455 tests. As before, you can run these tests via the following
$ composer phpunit:unit

Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: Ibb8175981092d7f41864e641cc3c118af70a5c76

3 years agoPass column as string to IDatabase::selectField
Umherirrender [Sat, 29 Jun 2019 22:01:21 +0000 (00:01 +0200)]
Pass column as string to IDatabase::selectField

To match documentation

Change-Id: I7ee69fcd90ba1cba947ca2ef205f350dc456a2c7

3 years agoMerge "Hard deprecrate Language::viewPrevNext()"
jenkins-bot [Sat, 29 Jun 2019 21:38:00 +0000 (21:38 +0000)]
Merge "Hard deprecrate Language::viewPrevNext()"

3 years agoOmit argument when have no attributs on Xml::label
Umherirrender [Sat, 29 Jun 2019 15:26:03 +0000 (17:26 +0200)]
Omit argument when have no attributs on Xml::label

Change-Id: Ia5090985b619e872afd05eff09256c27ce3a01c9

3 years agoHard deprecrate Language::viewPrevNext()
Clara Andrew-Wani [Sat, 29 Jun 2019 15:09:46 +0000 (11:09 -0400)]
Hard deprecrate Language::viewPrevNext()

Bug: T207977
Change-Id: I800689b04868d144f086913df9cd6b27dd74aa81

3 years agoRCFilters: Reduce startup overhead from 'config.json' computation
Timo Tijhof [Thu, 13 Jun 2019 20:23:28 +0000 (21:23 +0100)]
RCFilters: Reduce startup overhead from 'config.json' computation

Follows-up 9ba1d8f526e1. Use the new 'versionCallback' to only perform
the minimum amount of work needed to detect changes, without fully
transforming the data for delivery.

Factor out message parsing into a separate step in the tag list code,
and use the messages' raw contents for the versionCallback.

Stop using WANCache for the tag list, since it's now cached by
ResourceLoader, and only regenerated when needed.

Also refactor the ChangeTags functions around tag description messages a
bit, so that we can more easily get the message keys that are going to
be used.

Bug: T201574
Bug: T223260
Change-Id: I02082aeb289ce4156170b14b8840f6d92cbadb57

3 years agohtmlform: Reveal method getOOUI() is called from when spitting deprecation notice
Derick Alangi [Thu, 13 Jun 2019 10:59:01 +0000 (11:59 +0100)]
htmlform: Reveal method getOOUI() is called from when spitting deprecation notice

Bug: T225683
Change-Id: I654b2d165feeb77394c214ae29bfaa7a9694b46d

3 years agoMerge "Re-apply: Factors out permissions check from User into PermissionManager service"
jenkins-bot [Fri, 28 Jun 2019 23:44:38 +0000 (23:44 +0000)]
Merge "Re-apply: Factors out permissions check from User into PermissionManager service"

3 years agoMerge "Make ExternalStore wrap ExternalStoreFactory and create access class"
jenkins-bot [Fri, 28 Jun 2019 23:12:08 +0000 (23:12 +0000)]
Merge "Make ExternalStore wrap ExternalStoreFactory and create access class"

3 years agoMerge "revision: rename various $wikiId fields/parameters to $dbDomain"
jenkins-bot [Fri, 28 Jun 2019 23:10:36 +0000 (23:10 +0000)]
Merge "revision: rename various $wikiId fields/parameters to $dbDomain"

3 years agoMerge "filebackend: avoid bogus SwiftFileBackend log warnings due to HTTP 202 responses"
jenkins-bot [Fri, 28 Jun 2019 23:09:39 +0000 (23:09 +0000)]
Merge "filebackend: avoid bogus SwiftFileBackend log warnings due to HTTP 202 responses"

3 years agoMerge "rdbms: clean up LBFactory domain splitting code and remove redundant comments"
jenkins-bot [Fri, 28 Jun 2019 22:29:29 +0000 (22:29 +0000)]
Merge "rdbms: clean up LBFactory domain splitting code and remove redundant comments"

3 years agoMerge "rdbms: implement IDatabase::serverIsReadOnly() for sqlite/mssql"
jenkins-bot [Fri, 28 Jun 2019 22:18:33 +0000 (22:18 +0000)]
Merge "rdbms: implement IDatabase::serverIsReadOnly() for sqlite/mssql"

3 years agoMerge "rdbms: update return type comments for ConnectionManager to IDatabase"
jenkins-bot [Fri, 28 Jun 2019 22:16:45 +0000 (22:16 +0000)]
Merge "rdbms: update return type comments for ConnectionManager to IDatabase"

3 years agoMerge "rdbms: combine trxLevel and trxShortId fields in Database"
jenkins-bot [Fri, 28 Jun 2019 22:16:27 +0000 (22:16 +0000)]
Merge "rdbms: combine trxLevel and trxShortId fields in Database"

3 years agoMerge "rdbms: make FakeResultWrapper use get_object_vars() again"
jenkins-bot [Fri, 28 Jun 2019 22:07:23 +0000 (22:07 +0000)]
Merge "rdbms: make FakeResultWrapper use get_object_vars() again"

3 years agoMerge "DateTimeInputWidget: Avoid :input Sizzle selector"
jenkins-bot [Fri, 28 Jun 2019 22:06:41 +0000 (22:06 +0000)]
Merge "DateTimeInputWidget: Avoid :input Sizzle selector"

3 years agoMerge "rdbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad()"
jenkins-bot [Fri, 28 Jun 2019 21:56:43 +0000 (21:56 +0000)]
Merge "rdbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad()"

3 years agordbms: combine trxLevel and trxShortId fields in Database
Aaron Schulz [Thu, 13 Jun 2019 15:25:40 +0000 (16:25 +0100)]
rdbms: combine trxLevel and trxShortId fields in Database

This avoids having to keep multiple fields in sync

Change-Id: If96267afe56a9b9cd660bab333e7667e4d8dc3d4

3 years agoMake ExternalStore wrap ExternalStoreFactory and create access class
Aaron Schulz [Tue, 27 Feb 2018 06:24:46 +0000 (22:24 -0800)]
Make ExternalStore wrap ExternalStoreFactory and create access class

* Inject settings and global instances as dependencies to the
  ExternalStoreMedium instances. This includes the local wiki
  domain, so that wfWikiId() calls are not scattered around.
* Create ExternalStoreAccess service for read/write logic.
* Deprecate the ExternalStore wrapper methods.
* Add some exception cases for bogus store URLs are used instead
  of just giving PHP warnings and failing later.
* Make moveToExternal.php require the type/protocol to decide
  which ExternalStoreMedium to use instead of assuming "DB".
* Convert logging calls to use LoggerInterface.

Change-Id: I40c3b5534fc8a31116c4c5eb64ee6e4903a6197a

3 years agorevision: rename various $wikiId fields/parameters to $dbDomain
Aaron Schulz [Thu, 27 Jun 2019 01:33:18 +0000 (18:33 -0700)]
revision: rename various $wikiId fields/parameters to $dbDomain

These fields are passed to methods like LoadBalancer::getConnection() and are
already expected to be DB domains. Update various comments as well.

Fix a few minor IDEA warnings.

Change-Id: I7cf76700690aec449872a80d30b5ba540d2bf315

3 years agordbms: clean up LBFactory domain splitting code and remove redundant comments
Aaron Schulz [Fri, 28 Jun 2019 20:38:37 +0000 (13:38 -0700)]
rdbms: clean up LBFactory domain splitting code and remove redundant comments

Change-Id: I43812537e52b7a815e918512e2585e4858c06888

3 years agoAvoid :checkbox Sizzle selector
Ed Sanders [Fri, 28 Jun 2019 20:58:29 +0000 (21:58 +0100)]
Avoid :checkbox Sizzle selector

Just use [type="checkbox"] for better performance.

Change-Id: I41e57873c4598ff3af6e70f913297c6b2d368f69

3 years agoDateTimeInputWidget: Avoid :input Sizzle selector
Ed Sanders [Fri, 28 Jun 2019 20:46:11 +0000 (21:46 +0100)]
DateTimeInputWidget: Avoid :input Sizzle selector

This widget only creates <input> tags so just
search by name.

Change-Id: I170f67127453f979a0bbdd45f0487a5d350a4d5a

3 years agofilebackend: avoid bogus SwiftFileBackend log warnings due to HTTP 202 responses
Aaron Schulz [Fri, 28 Jun 2019 20:28:49 +0000 (13:28 -0700)]
filebackend: avoid bogus SwiftFileBackend log warnings due to HTTP 202 responses

Change-Id: I12897bd2e29f18bbdce9a54a18415e83acc31365

3 years agordbms: make FakeResultWrapper use get_object_vars() again
Aaron Schulz [Fri, 28 Jun 2019 20:22:11 +0000 (13:22 -0700)]
rdbms: make FakeResultWrapper use get_object_vars() again

get_object_vars() avoids a bug in older PHP versions where
string digit fields end up as string digit array keys instead
of proper integers, which can cause errors on access.

Follow up to d9f688698ce0

Change-Id: Ic93231e4a7244f49149ce9ed35fbcb1e04ac4065

3 years agordbms: update return type comments for ConnectionManager to IDatabase
Aaron Schulz [Fri, 28 Jun 2019 20:20:04 +0000 (13:20 -0700)]
rdbms: update return type comments for ConnectionManager to IDatabase

Change-Id: I0ed1fc7b2c22192d80b99df54444a904c1778d05

3 years agoRe-apply: Factors out permissions check from User into PermissionManager service
Vedmaka [Tue, 9 Apr 2019 06:58:04 +0000 (09:58 +0300)]
Re-apply: Factors out permissions check from User into PermissionManager service

Was reverted by I549810a4cd2e424cc4a438887d2f24614a24cc00 due to

Original change by  Vedmaka Wakalaka was

Original commit message:

The following methods should are factored out of the User class into PermissionManager,
leaving only deprecated stubs:

- User::isAllowed -> PermissionManager::userHasRight
- User::getRights -> PermissionManager::getUserPermissions
- User::groupHasPermission -> PermissionManager::groupHasPermission
- User::getGroupPermissions -> PermissionManager::getGroupPermissions
 -User::getGroupsWithPermission -> PermissionManager::getGroupsWithPermission
- User::groupHasPermission -> PermissionManager::groupHasPermission
- User::isEveryoneAllowed -> PermissionManager::isEveryoneAllowed
- User::getAllRights -> PermissionManager::getAllPermissions

Depends-On: I7909e9bd6bbfbd708c0a00b861a9b22a38c6665d

Bug: T218558
Bug: T223294
Change-Id: I8899240378f636ea70f447616710516c0a3c5c31

3 years agoMerge "Define unit and integration test suites"
jenkins-bot [Fri, 28 Jun 2019 20:10:10 +0000 (20:10 +0000)]
Merge "Define unit and integration test suites"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 28 Jun 2019 20:05:01 +0000 (22:05 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7711c0df21663fad4d5e5cc1c9fb7f0bb5c81a64

3 years agoMerge "Avoid Sizzle's :first/:last selectors. Use $.first()/$.last()"
jenkins-bot [Fri, 28 Jun 2019 19:22:26 +0000 (19:22 +0000)]
Merge "Avoid Sizzle's :first/:last selectors. Use $.first()/$.last()"

3 years agoMerge "makeCollapsible: Avoid Sizzle selectors"
jenkins-bot [Fri, 28 Jun 2019 19:22:19 +0000 (19:22 +0000)]
Merge "makeCollapsible: Avoid Sizzle selectors"

3 years agoMerge "TOC: Avoid Sizzle selectors"
jenkins-bot [Fri, 28 Jun 2019 19:22:13 +0000 (19:22 +0000)]
Merge "TOC: Avoid Sizzle selectors"

3 years agoMerge "TableSorter: Avoid Sizzle selectors"
jenkins-bot [Fri, 28 Jun 2019 19:20:07 +0000 (19:20 +0000)]
Merge "TableSorter: Avoid Sizzle selectors"

3 years agoMerge "OutputPage: Change outdated comment to point to mediawiki.org page."
jenkins-bot [Fri, 28 Jun 2019 16:52:00 +0000 (16:52 +0000)]
Merge "OutputPage: Change outdated comment to point to mediawiki.org page."

3 years agoOutputPage: Change outdated comment to point to mediawiki.org page.
mvolz [Fri, 28 Jun 2019 14:54:40 +0000 (15:54 +0100)]
OutputPage: Change outdated comment to point to mediawiki.org page.

Comment had outdated TODO for documentation
which has since been created.

Change-Id: Id0df26c979a6d1bad84e456a923721688d51617f

3 years agoMerge "Change Special:Mute link on email footer to be in plain text"
jenkins-bot [Fri, 28 Jun 2019 16:32:54 +0000 (16:32 +0000)]
Merge "Change Special:Mute link on email footer to be in plain text"

3 years agoDefine unit and integration test suites
Kosta Harlan [Wed, 26 Jun 2019 02:33:14 +0000 (22:33 -0400)]
Define unit and integration test suites

Following discussion in Ibb8175981092d7f41864e641cc3c118af70a5c76, this patch
proposes to further reduce the scope of what unit tests may access, by removing
the loading of DefaultSettings and GlobalFunctions.php. This also has the
implied effect of disabling the storage backend, as well as the global service

MediaWikiTestCase is renamed to MediaWikiIntegrationTestCase so it's scope and
purpose is more clear. Whether we still need to keep `@group Database`
annotation around is debatable, as it's unclear to me what the performance costs
are of implying database access for all tests which extend IntegrationTestCase.
As far as I can tell, `@group Database` is primarily used in CI to run faster
tests before slower ones, and with the new UnitTestCase the annotation seems

To run all testsuites, use `composer phpunit`. Other composer scripts:

- `composer phpunit:unit` to run unit tests
- `composer phpunit:integration` to run integration tests
- `composer phpunit:coverage` to generate code coverage reports from unit
   tests (requires XDebug).

Note that you can pass arguments to composer scripts with `--`, e.g. `composer
phpunit:integration --exclude-group Dump`.

Other changes:

- Rename bootstrap.php to bootstrap.maintenance.php so it's clear it's part of
  the legacy PHPUnit-as-maintenance-class setup
- Create new bootstrap.php which loads the minimal configuration necessary for
  the tests, and do additional setup in the run() method of the unit/integration
test case classes
- Move the unit-tests.xml file to phpunit.xml.dist in preparation for this being
  the default test configuration

For a follow-up patch:

- Find unit/integration tests for extensions/skins
- Migrate other test suites from suite.xml
- Support running all tests via vendor/bin/phpunit

Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76

3 years agoMerge "Remove ApiQueryImageInfo::(getProperties|getPropertyDescriptions)"
jenkins-bot [Fri, 28 Jun 2019 16:07:32 +0000 (16:07 +0000)]
Merge "Remove ApiQueryImageInfo::(getProperties|getPropertyDescriptions)"

3 years agoMerge "Reset services after setting group permissions in tests"
jenkins-bot [Fri, 28 Jun 2019 15:42:41 +0000 (15:42 +0000)]
Merge "Reset services after setting group permissions in tests"

3 years agoChange Special:Mute link on email footer to be in plain text
Dayllan Maza [Wed, 26 Jun 2019 19:55:11 +0000 (15:55 -0400)]
Change Special:Mute link on email footer to be in plain text

Emails from Special:EmailUser are in plain text. The old link was
an html tag and it was not being displayed properly.

Bug: T218265
Change-Id: Id5f3b8e3a549c06010e41b5a6f10eb46c5d00a40

3 years agoRemove ApiQueryImageInfo::(getProperties|getPropertyDescriptions)
Reedy [Fri, 28 Jun 2019 13:39:21 +0000 (14:39 +0100)]
Remove ApiQueryImageInfo::(getProperties|getPropertyDescriptions)

I'm guessing they should've been removed in another commit...

Change-Id: Ic54de7101f0a9194000a875ef0050201387c057f

3 years agoReset services after setting group permissions in tests
daniel [Thu, 30 May 2019 10:53:52 +0000 (12:53 +0200)]
Reset services after setting group permissions in tests

MediaWikiTestCase::setGroupPermissions must reset the service container
after modifying group permissions, so the changed permissions are sure
to take effect even once we start to manage them in a service instance.

Bug: T224607
Change-Id: I38b61612723c9a812ce562179c51eb6c3c416cac

3 years agoType hint against interface for LoadBalancer in MediaWikiServices
Amir Sarabadani [Thu, 27 Jun 2019 21:04:47 +0000 (23:04 +0200)]
Type hint against interface for LoadBalancer in MediaWikiServices

This decouples MediaWikiServices from big class of LoadBalancer

Change-Id: Ic55aa8ae81d6fc8a973c4810d12667ca7673c5b1

3 years agoDefer cookie block checks to resolve a circular dependency
Max Semenik [Wed, 26 Jun 2019 06:00:07 +0000 (23:00 -0700)]
Defer cookie block checks to resolve a circular dependency

User needs to load user preferences to get preferred language, which
calls User::load() which calls User::loadFromSession().

User::loadFromSession() tries to load blocks which might use messages
which need user language which calls User::load() because the previous
call to it haven't completed yet...

We have a protection against infinite recursion to prevent this from
completely crashing MW, however this patch fixes the main issue: loading
too much stuff when a User is initialized.

Bug: T180050
Change-Id: I63af6d2239b36124d5ed382b8d2aab82c8d54d69

3 years agoMerge "Add schema version param for API export."
jenkins-bot [Fri, 28 Jun 2019 04:26:04 +0000 (04:26 +0000)]
Merge "Add schema version param for API export."

3 years agoMerge "Add support for xml dump schema 0.11"
jenkins-bot [Fri, 28 Jun 2019 04:23:58 +0000 (04:23 +0000)]
Merge "Add support for xml dump schema 0.11"

3 years agoMerge "Join slot and content tables when dumping XML"
jenkins-bot [Fri, 28 Jun 2019 04:20:16 +0000 (04:20 +0000)]
Merge "Join slot and content tables when dumping XML"

3 years agordbms: Add callback for atomic section cancellation
Brad Jorsch [Tue, 4 Jun 2019 18:43:18 +0000 (14:43 -0400)]
rdbms: Add callback for atomic section cancellation

The callback will be called immediately when the section is cancelled,
whether that occurs directly, or via cancelling of an outer section, or
via rollback of the entire transaction.

Change-Id: Id05296948b52b95544547bd38c4387496b6c83b9

3 years agordbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad()
Aaron Schulz [Mon, 24 Jun 2019 20:45:01 +0000 (13:45 -0700)]
rdbms: deprecate LoadBalancer::haveIndex() and LoadBalancer::isNonZeroLoad()

This methods are not used anywhere and have no known use case.

Change-Id: I213d7b9cfacb5a966fe5ce9c7b377e1d4eb2cec9

3 years agoMerge "Tablesorter: Use localeCompare"
jenkins-bot [Fri, 28 Jun 2019 02:54:17 +0000 (02:54 +0000)]
Merge "Tablesorter: Use localeCompare"

3 years agordbms: implement IDatabase::serverIsReadOnly() for sqlite/mssql
Aaron Schulz [Fri, 28 Jun 2019 02:30:40 +0000 (19:30 -0700)]
rdbms: implement IDatabase::serverIsReadOnly() for sqlite/mssql

Change-Id: I661fcca7eb3af20201aaa6e742c5149f63dbe7d3

3 years agoMerge "storage: rename various $wikiId fields/parameters to $dbDomain"
jenkins-bot [Fri, 28 Jun 2019 01:09:10 +0000 (01:09 +0000)]
Merge "storage: rename various $wikiId fields/parameters to $dbDomain"

3 years agoMerge "rdbms: make connection counting logic in LoadBalancer less stateful"
jenkins-bot [Fri, 28 Jun 2019 01:08:00 +0000 (01:08 +0000)]
Merge "rdbms: make connection counting logic in LoadBalancer less stateful"

3 years agostorage: rename various $wikiId fields/parameters to $dbDomain
Aaron Schulz [Thu, 27 Jun 2019 01:32:34 +0000 (18:32 -0700)]
storage: rename various $wikiId fields/parameters to $dbDomain

These fields are passed to methods like LoadBalancer::getConnection() and are
already expected to be DB domains. Update various comments as well.

Fix a few minor IDEA warnings.

Change-Id: If480cc4d7d4a3c2d176ab346e6307e80cd2540c5

3 years agoAdd schema version param for API export.
daniel [Mon, 17 Dec 2018 21:21:34 +0000 (22:21 +0100)]
Add schema version param for API export.

Bug: T174031
Change-Id: I991809acf08563ffb71305d1df682d9e45b34831

3 years agoAdd support for xml dump schema 0.11
daniel [Fri, 5 Oct 2018 08:36:37 +0000 (10:36 +0200)]
Add support for xml dump schema 0.11

Bug: T174031
Change-Id: I2717019ea7efe36694bd2b2fba4dc2952a987cfc

3 years agoMerge "MediaWiki\Block namespace minor tweaks"
jenkins-bot [Thu, 27 Jun 2019 21:17:38 +0000 (21:17 +0000)]
Merge "MediaWiki\Block namespace minor tweaks"

3 years agoMerge "Update OOUI to v0.33.0"
jenkins-bot [Thu, 27 Jun 2019 21:03:45 +0000 (21:03 +0000)]
Merge "Update OOUI to v0.33.0"

3 years agoMediaWiki\Block namespace minor tweaks
Max Semenik [Thu, 27 Jun 2019 20:42:54 +0000 (13:42 -0700)]
MediaWiki\Block namespace minor tweaks

* Visibility
* Parameter type hints and docs
* Minor doc fixes

Change-Id: I46d4b99e18cffdf8323fb01b7ed30f3eda2906d1

3 years agoJoin slot and content tables when dumping XML
daniel [Sun, 19 May 2019 08:48:10 +0000 (10:48 +0200)]
Join slot and content tables when dumping XML

This introduces a way to construct a RevisionRecord based on a
known set of SlotRecords. To allow this to be used consistently
with the legacy revision schema, some tweaks had to be made
to getSlotsQueryInfo().

Bug: T220493
Change-Id: I5ea972bb07ca1cfb3a2ad8ef120aef77e460745c

3 years agoMerge "Skin: Hard deprecate escapeSearchLink()"
jenkins-bot [Thu, 27 Jun 2019 19:28:37 +0000 (19:28 +0000)]
Merge "Skin: Hard deprecate escapeSearchLink()"

3 years agoMerge "rdbms: remove $opened field from Database for simplicity"
jenkins-bot [Thu, 27 Jun 2019 17:47:16 +0000 (17:47 +0000)]
Merge "rdbms: remove $opened field from Database for simplicity"

3 years agoMerge "OutputPage::addScriptFile: Drop silencing invalid paths, deprecated in 1.24"
jenkins-bot [Thu, 27 Jun 2019 17:47:08 +0000 (17:47 +0000)]
Merge "OutputPage::addScriptFile: Drop silencing invalid paths, deprecated in 1.24"

3 years agordbms: remove $opened field from Database for simplicity
Aaron Schulz [Thu, 13 Jun 2019 12:46:03 +0000 (13:46 +0100)]
rdbms: remove $opened field from Database for simplicity

This avoids having two similar fields that have to stay
in sync. Clean up the related error handling for connections.
If a connection handle is unusable, like when essential SET
queries fail, then destroy it.

* Avoid use of transactions in DatabasePostgres::determineCoreSchema.
* Make sure all subclasses log on connection failure.
* Add schema sanity checks to mysql/sqlite classes.
* Add IDatabase::QUERY_NO_RETRY flag to simplify reasoning about
  queries that already run on open() to begin with.
* Remove unused return value of Database::open.
* Remove deprecated Database::reportConnectionError method.

Change-Id: I97beba7ead1523085bda8784234d00c69ef1accc

3 years agoSkin: Hard deprecate escapeSearchLink()
Fomafix [Tue, 21 May 2019 08:18:25 +0000 (10:18 +0200)]
Skin: Hard deprecate escapeSearchLink()

Use getSearchLink() instead of escapeSearchLink() in SkinTemplate for
'searchaction'. The skins do the HTML escaping of 'searchaction'

Depends-On: I6493cec99e22f2c56a081f1fc4d96ebc584915de
Depends-On: I268b412d84ba73d6fdae633a343c45865cb8b07b
Change-Id: I32f51a048b7a95e3697eaf18f2bd2f9a3b96065f

3 years agoOutputPage::addScriptFile: Drop silencing invalid paths, deprecated in 1.24
James D. Forrester [Mon, 24 Jun 2019 23:16:58 +0000 (16:16 -0700)]
OutputPage::addScriptFile: Drop silencing invalid paths, deprecated in 1.24

Change-Id: Ia65c70366ab67324ef2a02f9b0e81a6fb7a081cb

3 years agoselenium: Skip flaky rollback test
Kosta Harlan [Thu, 27 Jun 2019 16:06:05 +0000 (12:06 -0400)]
selenium: Skip flaky rollback test

Bug: T219440
Change-Id: I2199b7e7d4f7ba98a80ddfc568cf9957eba36182