4 years agoregistration: Improve duplicate config setting exception
Kunal Mehta [Tue, 15 May 2018 17:26:43 +0000 (10:26 -0700)]
registration: Improve duplicate config setting exception

We don't keep track of what set a specific global, so at least mention
the name of the extension that is setting a duplicate for easier

Also, fix the case where if the first extension to be loaded was setting
a core setting, it would not throw an exception since config was being
processed before the rest of extension.json. Now we process config after
all core settings, going only before attributes.

Bug: T194319
Change-Id: I4fd96e7d167cf0652ee3e8e66167c86f2b91b992

4 years agoMerge "User: System block reasons shouldn't expand templates"
jenkins-bot [Tue, 15 May 2018 16:21:29 +0000 (16:21 +0000)]
Merge "User: System block reasons shouldn't expand templates"

4 years agoMerge "Add setting to control the creation of NullRevision on upload"
jenkins-bot [Tue, 15 May 2018 07:31:09 +0000 (07:31 +0000)]
Merge "Add setting to control the creation of NullRevision on upload"

4 years agoResolve used lazy options in ParserOptions::optionsHash()
Brad Jorsch [Mon, 26 Mar 2018 17:59:24 +0000 (13:59 -0400)]
Resolve used lazy options in ParserOptions::optionsHash()

If a lazy option is passed to ParserOptions::optionsHash(), we should
resolve the option so the hash can incorporate the proper value instead
of omitting it.

Also, completely unrelatedly, refactor the hook overriding in the unit
test because people won't stop whining about it in code review.

Change-Id: I2df78ed90875c229090b503b65f20fbbbba7f237

4 years agoAdd whether user is elevated to unsafe js load log
Brian Wolff [Tue, 15 May 2018 04:14:37 +0000 (04:14 +0000)]
Add whether user is elevated to unsafe js load log

To better triage the log entries.

Change-Id: Idf6d967d06b118ebd7b4d848e12bb36faf55a1b6

4 years agoMerge "Disallow loading JS/CSS/Json subpages from unregistered users and log"
jenkins-bot [Tue, 15 May 2018 01:08:20 +0000 (01:08 +0000)]
Merge "Disallow loading JS/CSS/Json subpages from unregistered users and log"

4 years agoMerge "Better logging for botpasswords"
jenkins-bot [Tue, 15 May 2018 00:59:09 +0000 (00:59 +0000)]
Merge "Better logging for botpasswords"

4 years agoDisallow loading JS/CSS/Json subpages from unregistered users and log
Brian Wolff [Tue, 15 May 2018 00:34:14 +0000 (00:34 +0000)]
Disallow loading JS/CSS/Json subpages from unregistered users and log

Loading JS from an unregistered user's JS subpage is a severe
security risk as someone could potentially register that account
and then modify the JS.

Bug: T194204
Change-Id: I741736e12b0ed49e95f22c869a2b53e2c97b31f0

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 14 May 2018 20:04:40 +0000 (22:04 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I0d75de10ff839f02973bf055e40d65ff7277c102

4 years agoConnectionManager: Require ILoadBalancer instead of LoadBalancer
Thiemo Kreuz [Mon, 14 May 2018 11:27:23 +0000 (13:27 +0200)]
ConnectionManager: Require ILoadBalancer instead of LoadBalancer

Since I4fdf7f7 more code stops returning the implementation, but only
returns the interface. This is a good, very welcome change. However,
ConnectionManager still requires the LoadBalancer implementation, for
no obvious reason. All code in this class works fine with the interface.

This is currently reported by Phan as a violation (and it actually is
one), e.g.:

Change-Id: I63cbb98fd277b0c64ab8b303888b9354c4be29e2

4 years agoMerge "Initial support for Content Security Policy, disabled by default"
jenkins-bot [Mon, 14 May 2018 04:17:15 +0000 (04:17 +0000)]
Merge "Initial support for Content Security Policy, disabled by default"

4 years agoInitial support for Content Security Policy, disabled by default
Brian Wolff [Mon, 29 Feb 2016 04:13:10 +0000 (23:13 -0500)]
Initial support for Content Security Policy, disabled by default

The primary goal here is a defense in depth measure to
stop an attacker who found a bug in the parser allowing
them to insert malicious attributes.

This wouldn't stop someone who could insert a full
script tag (since at current it can't distinguish between
malicious and legit user js). It also would not prevent
DOM-based or reflected XSS for anons, as the nonce value
is guessable for anons when receiving a response cached
by varnish. However, the limited protection of just stopping
stored XSS where the attacker only has control of attributes,
is still a big win in my opinion. (But it wouldn't prevent
someone who has that type of xss from abusing things like
data-ooui attribute).

This will likely break many gadgets. Its expected that any
sort of rollout on Wikimedia will be done very slowly, with
lots of testing and the report-only option to begin with.

This is behind feature flags that are off by default, so
merging this patch should not cause any change in default

This may break some extensions (The most obvious one
is charinsert (See fe648d41005), but will probably need
some testing in report-only mode to see if anything else breaks)

This uses the unsafe-eval option of CSP, in order to
support RL's local storage thingy. For better security,
we may want to remove some of the sillier uses of eval
(e.g. jquery.ui.datepicker.js).

For more info, see spec: https://www.w3.org/TR/CSP2/
Additionally see:

Bug: T135963
Change-Id: I80f6f469ba4c0b608385483457df96ccb7429ae5

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 13 May 2018 19:54:52 +0000 (21:54 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I2fe5d9477437629090322b4647bee405ed4ec9e5

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 12 May 2018 22:28:48 +0000 (00:28 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ibe96d7ea807526ab2df4dc6cad608016b432fe88

4 years agoUser: System block reasons shouldn't expand templates
Brad Jorsch [Sat, 12 May 2018 12:03:04 +0000 (08:03 -0400)]
User: System block reasons shouldn't expand templates

The block reasons for "system" blocks shouldn't expand wikitext
templates immediately. That should be left for the code parsing the
block reason for display.

This should only affect how these blocks are reported to API clients, as
when the block is displayed in the web UI it's passed through the parser
anyway. The main drawback, as far as the default messages go, is that
MediaWiki:sorbsreason won't have {{SITENAME}} expanded in
the API response anymore.

Bug: T191939
Change-Id: Ib2024721ea0e26358b9b50efdac16316d6d0f0b6

4 years agoMerge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
jenkins-bot [Sat, 12 May 2018 07:40:54 +0000 (07:40 +0000)]
Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"

4 years agoMerge "Allow 'all:' on all wikis in addition to 'searchall' translation"
jenkins-bot [Fri, 11 May 2018 22:05:22 +0000 (22:05 +0000)]
Merge "Allow 'all:' on all wikis in addition to 'searchall' translation"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 11 May 2018 19:59:40 +0000 (21:59 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I51c74d19d11c6eda9fbd78aa55eeba4b3e56f1c9

4 years agoresources: Give mediawiki.special.* files their own place in src/
Timo Tijhof [Thu, 10 May 2018 17:38:34 +0000 (18:38 +0100)]
resources: Give mediawiki.special.* files their own place in src/

Bug: T193826
Change-Id: Id25cd18079f48308f6ab42207445bbbd74ed5fda

4 years agoMerge "OOUI prefs: Use late static binding"
jenkins-bot [Fri, 11 May 2018 17:18:08 +0000 (17:18 +0000)]
Merge "OOUI prefs: Use late static binding"

4 years agoMerge "build: update to grunt-contrib-watch@1.0.1 to resolve a vulnerability"
jenkins-bot [Fri, 11 May 2018 16:07:33 +0000 (16:07 +0000)]
Merge "build: update to grunt-contrib-watch@1.0.1  to resolve a vulnerability"

4 years agoMerge "Remove 'patrol' from $wgActionFilteredLogs"
jenkins-bot [Fri, 11 May 2018 15:25:48 +0000 (15:25 +0000)]
Merge "Remove 'patrol' from $wgActionFilteredLogs"

4 years agobuild: update to grunt-contrib-watch@1.0.1 to resolve a vulnerability
Željko Filipin [Fri, 11 May 2018 14:30:32 +0000 (16:30 +0200)]
build: update to grunt-contrib-watch@1.0.1  to resolve a vulnerability

Recommended by `npm audit`.

Moves us from

21 vulnerabilities ... 12 Low | 5 Moderate | 4 High


20 vulnerabilities ... 11 Low | 5 Moderate | 4 High

Bug: T194280
Change-Id: I9d6d2fed4ca3d4c43d9b5085873210493081f7e0

4 years agoAllow 'all:' on all wikis in addition to 'searchall' translation
David Causse [Fri, 11 May 2018 13:04:49 +0000 (15:04 +0200)]
Allow 'all:' on all wikis in addition to 'searchall' translation

This allows to have a common syntax useable everywhere.

Bug: T165110
Change-Id: If71fe5df045fb754925946088f8f793197bc8301

4 years agoOOUI prefs: Use late static binding
Ed Sanders [Fri, 11 May 2018 08:55:59 +0000 (09:55 +0100)]
OOUI prefs: Use late static binding

Allow sub-classes to disable OOUI for now (e.g. GlobalPrefs).

Change-Id: Ic3ff878b5f0ba7ec4162fab09fe1b9e10a820095

4 years agoIcuCollation: Use codepoint as tiebreaker when getting first-letters
Bartosz Dziewoński [Tue, 8 May 2018 11:43:10 +0000 (13:43 +0200)]
IcuCollation: Use codepoint as tiebreaker when getting first-letters

This prevents unexpected cuneiform digits from acting as headings for
2 and 3 on category pages.

Bug: T187645
Change-Id: I0424a24769899cb23b28704f97e1002fa44999fd

4 years agoMerge "docs: Rename README to README.md"
jenkins-bot [Thu, 10 May 2018 23:18:46 +0000 (23:18 +0000)]
Merge "docs: Rename README to README.md"

4 years agoMerge "rdbms: use ILoadBalancer in more LBFactory comments"
jenkins-bot [Thu, 10 May 2018 22:26:06 +0000 (22:26 +0000)]
Merge "rdbms: use ILoadBalancer in more LBFactory comments"

4 years agoMerge "resourceloader: Remove use of $.isPlainObject() from mw.Map#set()"
jenkins-bot [Thu, 10 May 2018 20:23:43 +0000 (20:23 +0000)]
Merge "resourceloader: Remove use of $.isPlainObject() from mw.Map#set()"

4 years agoresourceloader: Remove use of $.isPlainObject() from mw.Map#set()
Timo Tijhof [Mon, 7 May 2018 22:34:20 +0000 (23:34 +0100)]
resourceloader: Remove use of $.isPlainObject() from mw.Map#set()

Look for typeof 'object' instead. The set() method has good test
coverage which uncovered a few cases that were previously only
working implicitly due to isPlainObject.

* Test case `mw.config.set( [], 'value' )`
  This is invalid because `key` must be a string. This was previously
  rejected because while array is an object, it isn't a plain object.
  This commit intends to remove this distinction and allow any object
  to be used with the set(Object) signature. However, we should still
  reject set(non-string, string) no matter what kind of object is passed.

  Changing from isPlainObject to 'is an object' made this case
  wrongly pass instead of fail (because arrays are objects). Fix that,
  as well as any other case of non-string as key, by making the code
  explicitly reject non-string keys when two arguments are given.

  Added test case for `mw.config.set( {}, value ) === false` that did
  not pass without the changes in src/.

* Missing `> 1` check in global #set(). The check for arguments.length
  was asserting truthiness (non-zero) rather than >1 (2 or more).
  This was causing things like `mw.config.set('key')` to throw
  "ReferenceError: value not defined" when the underlying mw.Map
  is global. The normal #set() method for maps other than mw.config,
  was already fine.

  Fixed a bug in mediawiki.language.init that was revealed by this.
  The bug was not happening previously because when an object
  was passed, the second parameter was ignored.

Bug: T192623
Change-Id: Ib53647b324fe3d31e3389ed9aa14a08280d9c830

4 years agoMerge "Localisation updates from https://translatewiki.net."
L10n-bot [Thu, 10 May 2018 20:03:34 +0000 (20:03 +0000)]
Merge "Localisation updates from https://translatewiki.net."

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 10 May 2018 20:03:24 +0000 (22:03 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I6b9a40e5d652ca8ff935546721309e07b2f7dd0b

4 years agoLogPager/LogEventsList: Correct docs about $pattern parameter
Bartosz Dziewoński [Mon, 7 May 2018 18:48:01 +0000 (20:48 +0200)]
LogPager/LogEventsList: Correct docs about $pattern parameter

$pattern is a boolean, it is documented as "Do a prefix search rather
than an exact title match". However, its type was incorrectly
documented to be a string, and the default value was '' instead of
false (which was harmless, as it is correctly treated as a boolean
value everywhere).

Change-Id: Id093d12891a231d5934f9908e619065afff7380e

4 years agoMerge "mediawiki.skinning: Only apply tright/tleft margins to frame/thumb"
jenkins-bot [Thu, 10 May 2018 19:34:14 +0000 (19:34 +0000)]
Merge "mediawiki.skinning: Only apply tright/tleft margins to frame/thumb"

4 years agoMerge "rdbms: fix callback stage errors in LBFactory::commitMasterChanges"
jenkins-bot [Thu, 10 May 2018 19:07:18 +0000 (19:07 +0000)]
Merge "rdbms: fix callback stage errors in LBFactory::commitMasterChanges"

4 years agomediawiki.skinning: Only apply tright/tleft margins to frame/thumb
Arlo Breault [Thu, 3 May 2018 17:07:39 +0000 (13:07 -0400)]
mediawiki.skinning: Only apply tright/tleft margins to frame/thumb

The other formats should correspond to the margins for

Bug: T193695
Change-Id: I19ff964bcac486e8d45e7deab40f9220295bf9f6

4 years agoMerge "build: Update Karma to v2.0.2"
jenkins-bot [Thu, 10 May 2018 18:28:49 +0000 (18:28 +0000)]
Merge "build: Update Karma to v2.0.2"

4 years agoMerge "Set the package type to 'mediawiki-core'"
jenkins-bot [Thu, 10 May 2018 16:48:11 +0000 (16:48 +0000)]
Merge "Set the package type to 'mediawiki-core'"

4 years agoBetter logging for botpasswords
Brian Wolff [Thu, 10 May 2018 01:52:18 +0000 (01:52 +0000)]
Better logging for botpasswords

As its an authentication action, its important to log when
somebody creates a new botpassword.

Bug: T194204
Change-Id: Ib8dc634b77ae9e42e3d225be1d56e6d04e9595b1

4 years agoMerge "Create update SPARQL for category changes"
jenkins-bot [Thu, 10 May 2018 15:59:02 +0000 (15:59 +0000)]
Merge "Create update SPARQL for category changes"

4 years agobuild: Update Karma to v2.0.2
Željko Filipin [Thu, 10 May 2018 15:04:32 +0000 (17:04 +0200)]
build: Update Karma to v2.0.2

The current version has a couple of dependencies with high severity

Bug: T194280
Change-Id: I3f9f36a6a5c2ba1716b91d14e59bc60f9e0ff513

4 years agodocs: Rename README to README.md
Timo Tijhof [Thu, 10 May 2018 14:56:39 +0000 (15:56 +0100)]
docs: Rename README to README.md

The only wikitext-speficic syntax in here is the title.

Renaming this to Markdown has various benefits:

* Makes the README render properly on Gitiles, Doxygen, and Diffusion.
  The current README is not renderable in Gitiles or Doxygen.

* More familiar to new contributors in open-source.

* Consistent with other documentation content we maintain within Git,
  including all PHP and JS documentation, which via JSDoc/JSDuck/Doxygen
  have all their descriptions parsed in Markdown.

* Rich previews and syntax highlighting in many text editors
  and Git viewers.

Change-Id: I5bade76528fa3d870334d960c39db009644bb58f

4 years agoMerge "build: Update Karma's qunit from 2.5.0 to 2.6.0"
jenkins-bot [Thu, 10 May 2018 14:36:33 +0000 (14:36 +0000)]
Merge "build: Update Karma's qunit from 2.5.0 to 2.6.0"

4 years agobuild: Update Karma's qunit from 2.5.0 to 2.6.0
Timo Tijhof [Thu, 10 May 2018 13:12:17 +0000 (14:12 +0100)]
build: Update Karma's qunit from 2.5.0 to 2.6.0

Follows-up 065b21b4bd which updated the copy of QUnit used
on Special:JavaScriptTest.

Change-Id: I24b17c9c266f58d48caa9c3392496c469b3ddba0

4 years agoFix a critical NPM package vulnerability
Željko Filipin [Thu, 10 May 2018 12:13:45 +0000 (14:13 +0200)]
Fix a critical NPM package vulnerability

NPM v6 audits packages during installation. This is the only critical vulnerability.

Bug: T194280
Change-Id: I5fe35067919ad67b9781701136e290eda17c3afa

4 years agordbms: fix callback stage errors in LBFactory::commitMasterChanges
Aaron Schulz [Thu, 10 May 2018 04:14:40 +0000 (21:14 -0700)]
rdbms: fix callback stage errors in LBFactory::commitMasterChanges

Just like 082ed053b6 fixed pre-commit callback errors when new instances
of LoadBalancer are made during that step, do the same for post-commit

Bug: T194308
Change-Id: Ie79e0f22b3aced425cf067d0df6b67e368223e6c

4 years agordbms: use ILoadBalancer in more LBFactory comments
Aaron Schulz [Thu, 10 May 2018 04:25:38 +0000 (21:25 -0700)]
rdbms: use ILoadBalancer in more LBFactory comments

Change-Id: I4fdf7f77df266e8a025930f01760b797c996bc69

4 years agomakeCollapsible: fix state of nested collapsibles
Derk-Jan Hartman [Tue, 8 May 2018 20:46:56 +0000 (22:46 +0200)]
makeCollapsible: fix state of nested collapsibles

When collapsing or expanding an element which has nested other
collapsibles, the labels of all nested toggles were updating to the
value of the parent, while their state was not.

Apply to the specific toggle only, just as the classes are applied to
just the specific toggle.

Bug: T168689
Change-Id: I1c3c29dc9ca4ccbf8da83796e56964a7a6d58a81

4 years agoMerge "resources: Move the remaining src/mediawiki/ files"
jenkins-bot [Wed, 9 May 2018 23:45:02 +0000 (23:45 +0000)]
Merge "resources: Move the remaining src/mediawiki/ files"

4 years agoresources: Move the remaining src/mediawiki/ files
Timo Tijhof [Wed, 9 May 2018 20:36:06 +0000 (21:36 +0100)]
resources: Move the remaining src/mediawiki/ files

Single-file modules to src/, the remaining as sub directories.

A few highlights:
* mediawiki.Upload.BookletLayout. (stylesheet: no image references)
* mediawiki.feedback - Also move the image to its own images/ subdir.
* mediawiki.searchSuggest. (stylesheet: no image references)
* mediawiki.toc. (stylesheet: no image references)

Also updated any other references to 'src/mediawiki/' that I could find
in core:
* Fixed references in docs/uidesign/*.html
* Remove redundant exclude from jsduck.json.

After this, there are 4 files remaining in src/mediawiki,
which are the 4 files used by the actual 'mediawiki' base module.

Bug: T193826
Change-Id: I8058652892a78b3f5976397bd850741dd5c92427

4 years agoMerge "rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()"
jenkins-bot [Wed, 9 May 2018 22:36:44 +0000 (22:36 +0000)]
Merge "rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()"

4 years agoskins: Update core skins to queue modules via getDefaultModules()
Timo Tijhof [Fri, 4 May 2018 00:23:39 +0000 (01:23 +0100)]
skins: Update core skins to queue modules via getDefaultModules()

Following I3404c1c2a7e, update the core skins to use
getDefaultModules() instead of the now-deprecated setupSkinUserCss().

Change-Id: I48b76938f46c1b6b683b618e7571e6fc6876cc52

4 years agoMerge "rdbms: fix LBFactory::commitAll() round handling"
jenkins-bot [Wed, 9 May 2018 22:07:46 +0000 (22:07 +0000)]
Merge "rdbms: fix LBFactory::commitAll() round handling"

4 years agordbms: fix LBFactory::commitAll() round handling
Aaron Schulz [Wed, 9 May 2018 21:44:34 +0000 (14:44 -0700)]
rdbms: fix LBFactory::commitAll() round handling

This avoids "Transaction round stage must be approved (not cursory)".

Bug: T194308
Change-Id: I9dbfe9cede02b1b1904c1d5e5a9802306c2492a2

4 years agoMerge "mediawiki.htmlform: Move files to their own module directory"
jenkins-bot [Wed, 9 May 2018 21:25:43 +0000 (21:25 +0000)]
Merge "mediawiki.htmlform: Move files to their own module directory"

4 years agordbms: rename onTransactionIdle() to onTransactionCommitOrIdle()
Aaron Schulz [Wed, 9 May 2018 02:28:39 +0000 (19:28 -0700)]
rdbms: rename onTransactionIdle() to onTransactionCommitOrIdle()

This is clearer and is consistent with onTransactionPreCommitOrIdle()

Change-Id: I3a34a0e9adea69ec55ed6ddfef47703e31e7c3b5

4 years agoMerge "Add default edit rate limit of 90 edits/minute for all users"
jenkins-bot [Wed, 9 May 2018 21:00:52 +0000 (21:00 +0000)]
Merge "Add default edit rate limit of 90 edits/minute for all users"

4 years agomediawiki.htmlform: Move files to their own module directory
Timo Tijhof [Wed, 9 May 2018 19:10:05 +0000 (20:10 +0100)]
mediawiki.htmlform: Move files to their own module directory

* mediawiki.htmlform.styles:
  - mediawiki/htmlform/styles.css
  - mediawiki/htmlform/images/*
    Only contains two images, only used by this module.

* mediawiki.htmlform.checker.js.

* mediawiki.htmlform.ooui: Only Element.js.

* mediawiki.htmlform.ooui.styles.less.

* mediawiki.htmlform: Other files from mediawiki/htmlform.

Bug: T193826
Change-Id: I5c057c758933e905d5c7940ade5bf43282088159

4 years agoAdd default edit rate limit of 90 edits/minute for all users
Brian Wolff [Wed, 9 May 2018 20:43:51 +0000 (20:43 +0000)]
Add default edit rate limit of 90 edits/minute for all users

Previously there was no rate limit at all if you were autoconfirmed.

This initial setting is set on the high end of things, we may
adjust later. See also T192668, T194204.

Change-Id: I7cb002900bae2da3f4f4758671186659c1720e1d

4 years agoRemove 'patrol' from $wgActionFilteredLogs
Amir Sarabadani [Tue, 8 May 2018 21:11:51 +0000 (23:11 +0200)]
Remove 'patrol' from $wgActionFilteredLogs

We disabled logging autopatrol actions and we are deleting them.
Thus having patrol subtypes filters in Special:Log doesn't make
sense anymore.

Bug: T194213
Change-Id: I421ee54040cd2b64e53f1e68016c74a163d89ed3

4 years agoMerge "Remove width restriction on gadget labels"
jenkins-bot [Wed, 9 May 2018 20:17:26 +0000 (20:17 +0000)]
Merge "Remove width restriction on gadget labels"

4 years agoMerge "mediawiki.page.gallery.styles: Move files to src/"
jenkins-bot [Wed, 9 May 2018 20:17:23 +0000 (20:17 +0000)]
Merge "mediawiki.page.gallery.styles: Move files to src/"

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Wed, 9 May 2018 20:16:02 +0000 (22:16 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I7ca3a4f519cab7221f8e37c50baf2f6e666fa70e

4 years agoMerge "resourceloader: Remove elaborate dom-based console shim"
jenkins-bot [Wed, 9 May 2018 20:00:14 +0000 (20:00 +0000)]
Merge "resourceloader: Remove elaborate dom-based console shim"

4 years agoRemove width restriction on gadget labels
Ed Sanders [Mon, 23 Apr 2018 19:14:31 +0000 (20:14 +0100)]
Remove width restriction on gadget labels

Bug: T181733
Change-Id: Ia4bb7f49f89dbd62a21dd125e6a209a4f176844d

4 years agomediawiki.page.gallery.styles: Move files to src/
Timo Tijhof [Wed, 9 May 2018 19:18:28 +0000 (20:18 +0100)]
mediawiki.page.gallery.styles: Move files to src/

The two CSS files belonging to this module are the last ones
remaining in src/mediawiki/page. Move them to their own directory
in src/ instead. The stylesheets don't reference any images.

Bug: T193826
Change-Id: Ic07bbd5b60668a437177b389aa8fee861eb11892

4 years agoresources: Move more various single-file mediawiki.* modules to src/
Timo Tijhof [Wed, 9 May 2018 17:40:57 +0000 (18:40 +0100)]
resources: Move more various single-file mediawiki.* modules to src/

* Reduce clutter in src/mediawiki/.
* Make these files and modules easier to discover and associate.

Follows-up I677edac3b5e, which only moved simple cases where no
related modules existed.

This commit also moves files for modules that have some related
multi-file modules. As well as files that previously did not
strictly have their path match directly to their module name.

For example:
- 'mediawiki.checkboxtoggle.css' to 'mediawiki.checkboxtoggle.styles.css',
  because its module name is 'mediawiki.checkboxtoggle.styles'.
- 'mediawiki/page/gallery-slideshow.js' to 'mediawiki.page.gallery.slideshow.js',
  because its module name uses a dot, not a dash.
- 'mediawiki/page/watch.js' to 'mediawiki.page.watch.ajax.js',
  because its module name also includes 'ajax'. This also makes it matches
  the way "mediawiki.page.patrol.ajax" files were already named.

Ideas for later:
- Consider merging 'mediawiki.ForeignApi' and 'mediawiki.ForeignApi.core.'.
- Consider merging 'mediawiki.page.ready' and 'mediawiki.page.startup'.

Bug: T193826
Change-Id: I9564b05df305b7d217c9a03b80ce92476279e5c8

4 years agoMerge "resources: Move various single-file mediawiki.* modules to src/"
jenkins-bot [Wed, 9 May 2018 19:13:55 +0000 (19:13 +0000)]
Merge "resources: Move various single-file mediawiki.* modules to src/"

4 years agoMerge "build: Convert jsduck.json whitelist to blacklist"
jenkins-bot [Wed, 9 May 2018 19:13:51 +0000 (19:13 +0000)]
Merge "build: Convert jsduck.json whitelist to blacklist"

4 years agoMerge "Introduce change_tag_def table"
jenkins-bot [Wed, 9 May 2018 18:52:42 +0000 (18:52 +0000)]
Merge "Introduce change_tag_def table"

4 years agoresources: Move various single-file mediawiki.* modules to src/
Timo Tijhof [Wed, 9 May 2018 17:40:57 +0000 (18:40 +0100)]
resources: Move various single-file mediawiki.* modules to src/

This moves all files belonging to a 'mediawiki.*' module containing
only a single JavaScript file with no references to other files.

* Reduce clutter in src/mediawiki/.
* Make these files and modules easier to discover and associate.

Bug: T193826
Change-Id: I677edac3b5e9d02208c87164382c97035409df63

4 years agobuild: Convert jsduck.json whitelist to blacklist
Timo Tijhof [Wed, 9 May 2018 17:55:20 +0000 (18:55 +0100)]
build: Convert jsduck.json whitelist to blacklist

This will make it a lot easier to move files from src/mediawiki/
to src/ without having to enumerate each file because previously
it was included by "src/mediawiki" entirely, but we can't include
"src/" entirely because of the implicitly excluded files.

Bug: T193826
Change-Id: Ib1b1a2e851d2cb8f1426a0d16343adcd6344a14f

4 years agoMerge "mediawiki.notification: Move files to their own directory"
jenkins-bot [Wed, 9 May 2018 18:14:07 +0000 (18:14 +0000)]
Merge "mediawiki.notification: Move files to their own directory"

4 years agoMerge "Don't initialize MediaWikiServices before extensions have been loaded"
jenkins-bot [Wed, 9 May 2018 18:14:03 +0000 (18:14 +0000)]
Merge "Don't initialize MediaWikiServices before extensions have been loaded"

4 years agoMerge "Update OOUI to v0.27.0"
jenkins-bot [Wed, 9 May 2018 18:14:00 +0000 (18:14 +0000)]
Merge "Update OOUI to v0.27.0"

4 years agoMerge "jquery.tablesorter: Move files to their own directory"
jenkins-bot [Wed, 9 May 2018 17:42:41 +0000 (17:42 +0000)]
Merge "jquery.tablesorter: Move files to their own directory"

4 years agoMerge "mediawiki.messagePoster: Move WikitextMessagePoster.js to its own directory"
jenkins-bot [Wed, 9 May 2018 17:42:38 +0000 (17:42 +0000)]
Merge "mediawiki.messagePoster: Move WikitextMessagePoster.js to its own directory"

4 years agoresourceloader: Remove elaborate dom-based console shim
Timo Tijhof [Wed, 9 May 2018 17:27:44 +0000 (18:27 +0100)]
resourceloader: Remove elaborate dom-based console shim

This was a hack loosely inspired by Firebug Lite, that essentially
created a footer toolbar like the one from "mediawiki.debug", and
write console messages to it, if the browser doesn't have a console

We don't currently support any browsers in JS-mode that don't have
a console feature of some kind.

I'm keeping the file for now, because it is still useful for
mw.log (not to be confused with mw.log.warn or mw.log.error) to
not do anything in production mode by default. This because there
can be significant overhead from writing to real console object,
regardless of the fact that it isn't visible in browsers by default.

Test Plan:
* Both before and after this commit,
  - On a normal page view, `mw.log("msg")` does nothing when run
    from the browser console.
  - On a page with ?debug=true, `mw.log("msg")` acts
    like `console.log("msg")` would.

Bug: T192623
Change-Id: Ifc8dd91f473c9235e1d4e27c202c97802530a272

4 years agomediawiki.notification: Move files to their own directory
Timo Tijhof [Wed, 9 May 2018 17:01:59 +0000 (18:01 +0100)]
mediawiki.notification: Move files to their own directory

* Reduce clutter in src/mediawiki/.
* Make it easier to see from the repo structure which files
  belong to this module, and which files not. For example,
  'mediawiki.notification.convertmessagebox' and 'mediawiki.notify' are
  logically related, but not actually part of this 4-file module.

Bug: T193826
Change-Id: I274323dffa8af1d046beb21d88f633f432a6ebbc

4 years agoMerge "Add equals() to UserIdentity"
jenkins-bot [Wed, 9 May 2018 17:28:00 +0000 (17:28 +0000)]
Merge "Add equals() to UserIdentity"

4 years agoUpdate OOUI to v0.27.0
Volker E [Wed, 9 May 2018 01:38:43 +0000 (18:38 -0700)]
Update OOUI to v0.27.0

Release notes:

Depends-on: I40dc6a2441fcd37e785f11b7a5e2f5da932e94df
Change-Id: I2acf232fd172d176b305d65d88db5b7bbfe34b88

4 years agojquery.tablesorter: Move files to their own directory
Timo Tijhof [Wed, 9 May 2018 17:12:15 +0000 (18:12 +0100)]
jquery.tablesorter: Move files to their own directory

* Reduce clutter in src/jquery/.
* Make it easier to see which files belong to which module, especially
  src/jquery/images/ which was confusingly shared between multiple modules.
  This also helps emphasize that while jquery.tablesorter.less is included,
  jquery.tablesorter.styles.less is not.

Also follows-up 8cdfcc5fd, which placed its style-module definition among
the 'mediawiki.*' modules instead of near the 'jquery.*' modules.

Change-Id: Ib639de5df323a36982ecdd89158a939beaaa2dd3

4 years agomediawiki.messagePoster: Move WikitextMessagePoster.js to its own directory
Timo Tijhof [Fri, 4 May 2018 02:12:18 +0000 (03:12 +0100)]
mediawiki.messagePoster: Move WikitextMessagePoster.js to its own directory

It was currently in the directory for 'mediawiki.messagePoster', but this
file actually belongs to a different module.

Bug: T193826
Change-Id: Ia51d2a373173c1bc7fe78196dbef89089c51ac86

4 years agoMerge "resourceloader: Remove AJAX call from addScript() in mediawiki.js"
jenkins-bot [Wed, 9 May 2018 16:50:55 +0000 (16:50 +0000)]
Merge "resourceloader: Remove AJAX call from addScript() in mediawiki.js"

4 years agoAdd setting to control the creation of NullRevision on upload
WMDE-Fisch [Mon, 7 May 2018 13:41:53 +0000 (15:41 +0200)]
Add setting to control the creation of NullRevision on upload

When uploading multiple file revisions with fitting text revisions to
core the UploadRevisionImporter will create a unwanted NullRevision on
the file page.

This NullRevision originates from LocalFile:upload() and is added there
in recordUpload2 as part of the normal upload process. There it is meant
to leave a hint on the text revision history.

This whole area is in need of heavy refactoring. But since the issue is
blocking the current implementation of the FileImporter extension, a
parameter is added to control the creation of that NullRevision.

Bug: T193621
Change-Id: I57c947eb63a7627ab1eec850cdf5e076f5f62df5

4 years agoselenium: Initial version of wdio-mediawiki package
Timo Tijhof [Wed, 2 May 2018 17:48:24 +0000 (18:48 +0100)]
selenium: Initial version of wdio-mediawiki package

This is new package will be reusable by other repositories for
their browser tests, without having to reference the internal
selenium/pageobjects/ directory from MediaWiki core.

In addition to not requiring direct imports, it will also avoid
problems in the future by allowing the package to be versioned
and iterated upon without forcing an atomic global upgrade
(or broken master builds), everytime we change something.

See wdio-mediawiki/README for details.

Within MediaWiki core itself, the package is used using the
'file' specifier in its package.json, so that we always test
and develop using its working copy, which makes drafting and
testing changes easier.

Also misc changes to make wdio.conf easier to understand.

Bug: T193088
Change-Id: I547a7899e7a97693a93567dd763784e637433d55

4 years agoselenium: Create local ./log directory if needed
Timo Tijhof [Wed, 2 May 2018 22:47:16 +0000 (23:47 +0100)]
selenium: Create local ./log directory if needed

Without this, the tests sometimes fail like this:

> Error: ENOENT: no such file or directory, open './log/should-be-creatable.png'
>   at screenshot() - saveScreenshot.js:52:17
>   at saveScreenshot("./log/should-be-creatable.png")

This seems to race with the junit plugin, which uses mkdirp to
create it if missing, but the screenshot handling is separate
from that. WebdriverIO's own screenshot handling also does this
so it makes sense for ours to do that, too.

I considered trying to re-use WebdriverIO's save mechanism,
directly but it's not publicly exposed and only used for the
crash scenario, so for now we'll have to keep our own.

* Add to gitignore.

* Update default to use __dirname instead of './' because the
  latter will somtimes be mediawiki/ and sometimes be selenium/
  depending on whether you run all tests or some tests.

* Remove trailing slash from default logPath, and instead add the
  slash in filePath.
  - The LOG_DIR used by Jenkins doesn't end in a slash either
    (currently not failing because we no longer use that job,
    and let quibble run the tests instead, which doesn't set
    the LOG_DIR).
  - The WDIO docs and example also use screenshotPath without
    trailing slash.
  - Without this, setting LOG_DIR=/tmp/something results in
    filenames like /tmp/somethingexample.png.

Bug: T193088
Change-Id: I6550f9315bae89f96a791f7ae8cc2fbec5ee8dd5

4 years agoMerge "[MCR] Introduce RevisionSlotsUpdate."
jenkins-bot [Wed, 9 May 2018 13:27:08 +0000 (13:27 +0000)]
Merge "[MCR] Introduce RevisionSlotsUpdate."

4 years agoMerge "search: Add result ranking in MySQL"
jenkins-bot [Wed, 9 May 2018 12:01:56 +0000 (12:01 +0000)]
Merge "search: Add result ranking in MySQL"

4 years agoNames.php: Add missing LTR markers after closing parentheses
Fomafix [Wed, 21 Mar 2018 19:11:05 +0000 (20:11 +0100)]
Names.php: Add missing LTR markers after closing parentheses

Currently some language autonyms with parentheses have misaligned
parentheses on RTL environment on some browser. To reproduce open
Google Chrome is affected. Mozilla Firefox is not affected.

This changes fixes this problem like at the other autonyms with

Change-Id: Ie01116821b067017434681ea995e97ada8ff0a6d

4 years agoMerge "Change language name of ko-kp to 조선말"
jenkins-bot [Wed, 9 May 2018 04:36:45 +0000 (04:36 +0000)]
Merge "Change language name of ko-kp to 조선말"

4 years agoresourceloader: Remove AJAX call from addScript() in mediawiki.js
Aaron Schulz [Tue, 8 May 2018 21:58:01 +0000 (14:58 -0700)]
resourceloader: Remove AJAX call from addScript() in mediawiki.js

Bug: T192623
Change-Id: If38376cb987c273b9991129df8f9a2ae04cfa4ed

4 years agoresourceloader: Move always() call to addScript() in mediawiki.js
Aaron Schulz [Tue, 8 May 2018 21:39:29 +0000 (14:39 -0700)]
resourceloader: Move always() call to addScript() in mediawiki.js

Bug: T192623
Change-Id: Ic0134baf0b501354c8713c7dad6a2e5b7f185793

4 years agoMerge "resourceloader: Avoid jQuery usage in queueModuleScript"
jenkins-bot [Tue, 8 May 2018 21:42:44 +0000 (21:42 +0000)]
Merge "resourceloader: Avoid jQuery usage in queueModuleScript"

4 years agoMerge "Preserve 'ooui' query string when overriding"
jenkins-bot [Tue, 8 May 2018 21:38:59 +0000 (21:38 +0000)]
Merge "Preserve 'ooui' query string when overriding"

4 years agoMerge "Special:Preferences: Create flag to enable OOjs UI"
jenkins-bot [Tue, 8 May 2018 21:32:01 +0000 (21:32 +0000)]
Merge "Special:Preferences: Create flag to enable OOjs UI"

4 years agoresourceloader: Avoid jQuery usage in queueModuleScript
Aaron Schulz [Tue, 8 May 2018 10:44:33 +0000 (03:44 -0700)]
resourceloader: Avoid jQuery usage in queueModuleScript

Bug: T192623
Change-Id: I46db7883c309cdec3722dd2d6169cf239bb113fb

4 years agoPreserve 'ooui' query string when overriding
Ed Sanders [Thu, 3 May 2018 13:17:41 +0000 (14:17 +0100)]
Preserve 'ooui' query string when overriding

Change-Id: I32df23b427f18e6275beaa6cc10cd58dc3b6eb36

4 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 8 May 2018 19:58:14 +0000 (21:58 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I9929e2ade53186340619aeceece3e1eed6166985

4 years agoMerge "BotPasswords: Indicate when a password needs reset"
jenkins-bot [Tue, 8 May 2018 19:26:04 +0000 (19:26 +0000)]
Merge "BotPasswords: Indicate when a password needs reset"