lhc/web/wiklou.git
7 years agoresourceloader: Use createLoaderURL() in getStartupModulesUrl()
Timo Tijhof [Wed, 7 Sep 2016 02:31:22 +0000 (19:31 -0700)]
resourceloader: Use createLoaderURL() in getStartupModulesUrl()

Avoid manually crafting a url. The packing logic and key sorting logic
is already in this method and keeps it central that way.

Test plan:
* Check output of /w/load.php?modules=startup&only=scripts.
  This is used to construct the url to 'jquery%2Cmediawiki'.
  No change in output.

Change-Id: I51ba51b6e74d78761108341c0ee318699ca7952f

7 years agoFix IDEA errors in JobRunner
Aaron Schulz [Tue, 6 Sep 2016 22:17:14 +0000 (15:17 -0700)]
Fix IDEA errors in JobRunner

Change-Id: I15939326afa80139a4d1000e43057b61cd374f18

7 years agoMerge "Disallow mismatched beginMasterChanges/commitMasterChanges"
jenkins-bot [Tue, 6 Sep 2016 21:55:23 +0000 (21:55 +0000)]
Merge "Disallow mismatched beginMasterChanges/commitMasterChanges"

7 years agoMerge "Rm unused 'remembermypassword' message, doc another"
jenkins-bot [Tue, 6 Sep 2016 21:20:32 +0000 (21:20 +0000)]
Merge "Rm unused 'remembermypassword' message, doc another"

7 years agoMerge "Turn off "reportDupes" in CachedBagOStuff"
jenkins-bot [Tue, 6 Sep 2016 21:03:27 +0000 (21:03 +0000)]
Merge "Turn off "reportDupes" in CachedBagOStuff"

7 years agoDefer publish of recent change for log entries
cenarium [Tue, 23 Feb 2016 02:16:42 +0000 (03:16 +0100)]
Defer publish of recent change for log entries

This defers the publish function of ManualLogEntry, which includes
saving the recent change to the db, notification of feeds, auto-patrol
and addition of change tags. This way, end users no longer have to wait
for those actions to conclude for the request to complete.

Bug: T127852
Change-Id: Ida86b7a7383d12695be28338c69b93e8e86d82c9

7 years agoTurn off "reportDupes" in CachedBagOStuff
Aaron Schulz [Tue, 6 Sep 2016 20:36:16 +0000 (13:36 -0700)]
Turn off "reportDupes" in CachedBagOStuff

Change-Id: I79148be842a940c92e555e10b24c32cdf7609539

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Tue, 6 Sep 2016 20:09:23 +0000 (22:09 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I53d6598a7fdfc5af3b1afd61c182dc0e6491808d

7 years agoMerge "Add API warnings when upload is same as older versions"
jenkins-bot [Tue, 6 Sep 2016 18:55:02 +0000 (18:55 +0000)]
Merge "Add API warnings when upload is same as older versions"

7 years agoMerge "Fix default handling in LoadBalancer::getRandomNonLagged()"
jenkins-bot [Tue, 6 Sep 2016 18:46:41 +0000 (18:46 +0000)]
Merge "Fix default handling in LoadBalancer::getRandomNonLagged()"

7 years agoAdd API warnings when upload is same as older versions
Matthias Mullie [Wed, 24 Aug 2016 07:29:24 +0000 (09:29 +0200)]
Add API warnings when upload is same as older versions

Bug: T141822
Change-Id: I115d84d865c59200dbb60bd962c093185c9afafe

7 years agoMerge "Fix spelling"
jenkins-bot [Tue, 6 Sep 2016 18:24:29 +0000 (18:24 +0000)]
Merge "Fix spelling"

7 years agoMerge "Turn off duplicate key gets for ReplicatedBagOStuff"
jenkins-bot [Tue, 6 Sep 2016 18:18:07 +0000 (18:18 +0000)]
Merge "Turn off duplicate key gets for ReplicatedBagOStuff"

7 years agoFix spelling
Adam Roses Wight [Tue, 6 Sep 2016 16:49:35 +0000 (09:49 -0700)]
Fix spelling

However... this comment might be irrelevant.  The code is actually joining 8
random 1-byte integers together (all produced by the same algorithm).  We're
clearly attempting to make a number with 64 bits of entropy, and the comment
is quite oblique about that fact.

Change-Id: I59ac0c208bdb9d7f427fea4f205ee7293a710ca8

7 years agoMerge "Rename mediawiki.action.history.diff to mediawiki.diff.styles"
jenkins-bot [Tue, 6 Sep 2016 15:56:17 +0000 (15:56 +0000)]
Merge "Rename mediawiki.action.history.diff to mediawiki.diff.styles"

7 years agoDisallow mismatched beginMasterChanges/commitMasterChanges
Aaron Schulz [Mon, 29 Aug 2016 21:35:56 +0000 (14:35 -0700)]
Disallow mismatched beginMasterChanges/commitMasterChanges

Change-Id: I76a8424e94370dc3776fdac1e974bf61fa69f071

7 years agoRename mediawiki.action.history.diff to mediawiki.diff.styles
Leszek Manicki [Wed, 31 Aug 2016 08:14:48 +0000 (10:14 +0200)]
Rename mediawiki.action.history.diff to mediawiki.diff.styles

Diff is not shown on action=history, so the name was not valid.
This module contains only styles, so let's make it explicit in its name too.

mediawiki.action.history.diff module is temporarily left for
backwards compatibility. It should be removed when no longer used.

This also renames docs/uidesign/mediawiki.action.history.diff.html
to docs/uidesign/mediawiki.diff.html.

Change-Id: I7ecc08417c5f1870ed6f2ca139fd953d68f6ec8e

7 years agoMerge "Make deferred updates fully own their transaction rounds"
jenkins-bot [Tue, 6 Sep 2016 06:19:32 +0000 (06:19 +0000)]
Merge "Make deferred updates fully own their transaction rounds"

7 years agoMerge "Make Maintenance::commitTransaction() avoid using deprecated method"
jenkins-bot [Tue, 6 Sep 2016 06:16:42 +0000 (06:16 +0000)]
Merge "Make Maintenance::commitTransaction() avoid using deprecated method"

7 years agoRenamed some variables from "slave" to "replica"
Aaron Schulz [Tue, 6 Sep 2016 00:09:08 +0000 (17:09 -0700)]
Renamed some variables from "slave" to "replica"

Change-Id: I455278294cd7ea344d14a76ac5957ece2e07fbf3

7 years agoMore replication var cleanups in /maintenance
Aaron Schulz [Tue, 6 Sep 2016 01:30:36 +0000 (18:30 -0700)]
More replication var cleanups in /maintenance

* Fix option check in sql.php
* Rename RecompressTracked vars and avoid deprecated
  method calls

Change-Id: Ie04f6e841d68d69c9243a185de1bd13a612b2070

7 years agoRename DB_SLAVE constant to DB_REPLICA
Aaron Schulz [Mon, 5 Sep 2016 19:55:19 +0000 (12:55 -0700)]
Rename DB_SLAVE constant to DB_REPLICA

This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849

7 years agoMake Maintenance::commitTransaction() avoid using deprecated method
Aaron Schulz [Tue, 6 Sep 2016 01:46:11 +0000 (18:46 -0700)]
Make Maintenance::commitTransaction() avoid using deprecated method

Change-Id: I0bbbdf492265f05ede4864aca0b4df15c3e83754

7 years agoMerge "Renamed "slave" internal LB/DB info field to "replica""
jenkins-bot [Tue, 6 Sep 2016 01:12:59 +0000 (01:12 +0000)]
Merge "Renamed "slave" internal LB/DB info field to "replica""

7 years agoMerge "Change "slave" => "replica DB" in /maintenance"
jenkins-bot [Tue, 6 Sep 2016 01:05:50 +0000 (01:05 +0000)]
Merge "Change "slave" => "replica DB" in /maintenance"

7 years agoChange "slave" => "replica DB" in /maintenance
Aaron Schulz [Mon, 5 Sep 2016 20:14:41 +0000 (13:14 -0700)]
Change "slave" => "replica DB" in /maintenance

Change-Id: Ibd3d617901130378a935402326cd4eefbb382c9e

7 years agoMerge "Change "slave" => "replica DB" in /includes"
jenkins-bot [Mon, 5 Sep 2016 23:47:08 +0000 (23:47 +0000)]
Merge "Change "slave" => "replica DB" in /includes"

7 years agoTurn off duplicate key gets for ReplicatedBagOStuff
Aaron Schulz [Mon, 5 Sep 2016 21:23:41 +0000 (14:23 -0700)]
Turn off duplicate key gets for ReplicatedBagOStuff

This is used as the main stash by default, which is not a
performance cache but a stash for ephemeral values typically.

Change-Id: Ie3740c0387f36a3f9b2d8d7d3b4e04ee9238ab1a

7 years agoChange "slave" => "replica DB" in /includes
Aaron Schulz [Mon, 5 Sep 2016 20:21:26 +0000 (13:21 -0700)]
Change "slave" => "replica DB" in /includes

Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9

7 years agoMerge "Renamed load balancer replica DB functions for consistency"
jenkins-bot [Mon, 5 Sep 2016 20:24:09 +0000 (20:24 +0000)]
Merge "Renamed load balancer replica DB functions for consistency"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 5 Sep 2016 20:02:17 +0000 (22:02 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Id463a0ad9b2690bdcbd598605ec4b1a8e031ac48

7 years agoRenamed load balancer replica DB functions for consistency
Aaron Schulz [Mon, 5 Sep 2016 19:42:17 +0000 (12:42 -0700)]
Renamed load balancer replica DB functions for consistency

Change-Id: Iec51366d383822d2afbd3fae285e251b78b0cdc7

7 years agoRenamed "slave" internal LB/DB info field to "replica"
Aaron Schulz [Mon, 5 Sep 2016 19:19:00 +0000 (12:19 -0700)]
Renamed "slave" internal LB/DB info field to "replica"

Change-Id: I46379013ddbdfdf03dbae0c6071e3dc0d960332d

7 years agoMerge "Rename some variables in DatabaseMysqlBase"
jenkins-bot [Mon, 5 Sep 2016 19:04:53 +0000 (19:04 +0000)]
Merge "Rename some variables in DatabaseMysqlBase"

7 years agoMerge "Remove unused DB position values in LoadBalancer"
jenkins-bot [Mon, 5 Sep 2016 19:01:08 +0000 (19:01 +0000)]
Merge "Remove unused DB position values in LoadBalancer"

7 years agoFix default handling in LoadBalancer::getRandomNonLagged()
Aaron Schulz [Mon, 5 Sep 2016 18:49:36 +0000 (11:49 -0700)]
Fix default handling in LoadBalancer::getRandomNonLagged()

* Previously, setting "max lag" greater than MAX_LAG had no effect.
  Although that only affects really large (11+ seconds) values for
  a production setup, it could be useful for testing.
* Also make it so INF works, which disables auto read-only mode
  altogether. This is useful for testing bugs with REPEATABLE-READ
  and replica DB usage. Setting $wgDBServers two have two entries
  to the same single DB makes LB treat it like a cluster, thus
  DB_SLAVE uses a second connection (and snapshot). Using the INF
  "max lag" value avoids read-only mode in this testing setup.

Change-Id: I4c17fe8f812307e90bcc24820f57c6a1257e9ad0

7 years agoMerge "resourceloader: Make cache-eval in mw.loader.work asynchronous"
jenkins-bot [Mon, 5 Sep 2016 12:10:24 +0000 (12:10 +0000)]
Merge "resourceloader: Make cache-eval in mw.loader.work asynchronous"

7 years agoMerge "Make statsd sampling rates configurable"
jenkins-bot [Mon, 5 Sep 2016 08:52:54 +0000 (08:52 +0000)]
Merge "Make statsd sampling rates configurable"

7 years agoMerge "Rename some DB/LB variables to be more consistent"
jenkins-bot [Mon, 5 Sep 2016 08:24:20 +0000 (08:24 +0000)]
Merge "Rename some DB/LB variables to be more consistent"

7 years agoMerge "Fix IDEA error in prepareQuickTemplate() call"
jenkins-bot [Mon, 5 Sep 2016 08:20:31 +0000 (08:20 +0000)]
Merge "Fix IDEA error in prepareQuickTemplate() call"

7 years agoMerge "Clean array() syntax in docs, part V"
jenkins-bot [Mon, 5 Sep 2016 08:17:33 +0000 (08:17 +0000)]
Merge "Clean array() syntax in docs, part V"

7 years agoMerge "Typo in a test: '+' instead of '.' to concatenate strings"
jenkins-bot [Mon, 5 Sep 2016 06:14:45 +0000 (06:14 +0000)]
Merge "Typo in a test: '+' instead of '.' to concatenate strings"

7 years agoCache revision lookups done by Parser
Aaron Schulz [Fri, 2 Sep 2016 07:30:26 +0000 (00:30 -0700)]
Cache revision lookups done by Parser

Inverse flame graphs shows revision lookups as one of the
big three queries (Revision, LinkCache, getTitleInfo of
ResourceLoaderWikiModule).

This works via a new Revision::newKnownCurrent() method
needs both page/rev ID from the DB (to avoid invalidation)
and fetches the user name and rev_deleted if needed (again
to avoid invalidation). Parser does not care about fields
anyway in the template path.

Also improved cross-wiki support a bit, and fixed up some
docs and IDEA errors.

Change-Id: Icad602dba5de18c7758b77fd23b0a450ff21d09f

7 years agoClean array() syntax in docs, part V
Amir Sarabadani [Sun, 4 Sep 2016 22:14:26 +0000 (02:44 +0430)]
Clean array() syntax in docs, part V

Change-Id: Ic65b7b2f1c2396246a3825c8d06d42bd6d06c37e

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 4 Sep 2016 19:56:54 +0000 (21:56 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib2530497c22f021d77f3838f9b1b6d3043cc51bc

7 years agoAdded a Database::buildStringCast and use on int/string join
umherirrender [Sat, 25 Jun 2016 20:24:42 +0000 (22:24 +0200)]
Added a Database::buildStringCast and use on int/string join

The database specific sql is untested, but sql is taken from docs

mssql - knows about impilict casts -
https://technet.microsoft.com/en-us/library/ms191530(v=sql.105).aspx
mysql - knows about impilict casts
oracle - https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj33562.html
postgresql -
https://www.postgresql.org/docs/9.2/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS
sqlite - http://www.sqlite.org/lang_expr.html

Bug: T69065
Change-Id: I3a83276dc65aae58124460af1810d37dff52e943

7 years agoMerge "RevertAction: Prevent file revert if current version is identical"
jenkins-bot [Sat, 3 Sep 2016 23:08:37 +0000 (23:08 +0000)]
Merge "RevertAction: Prevent file revert if current version is identical"

7 years agoRename some variables in DatabaseMysqlBase
Aaron Schulz [Sat, 3 Sep 2016 22:06:59 +0000 (15:06 -0700)]
Rename some variables in DatabaseMysqlBase

Positions may be MariaDB GTIDs, which can even be kept in sync
in master/master Galera setups.

See https://mariadb.com/kb/en/mariadb/gtid/

Change-Id: I3dc80ae099d0849e57a7278d662317da362ff8fc

7 years agoRemove unused DB position values in LoadBalancer
Aaron Schulz [Sat, 3 Sep 2016 21:58:38 +0000 (14:58 -0700)]
Remove unused DB position values in LoadBalancer

Also fixed IDEA error about useless $conn declaration.

Change-Id: I73572cb201e44db45fbe9bdb8e06bff4b50cecb2

7 years agoRename some DB/LB variables to be more consistent
Aaron Schulz [Sat, 3 Sep 2016 21:55:39 +0000 (14:55 -0700)]
Rename some DB/LB variables to be more consistent

Change-Id: I21de9c972402144159b7b2fc824533f8cefb03e7

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 3 Sep 2016 21:50:07 +0000 (23:50 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib9a3add2d9502cfa52a9a464b92c21633028cca0

7 years agoMerge "Make replication DB-related comments/messages more uniform"
jenkins-bot [Sat, 3 Sep 2016 21:34:11 +0000 (21:34 +0000)]
Merge "Make replication DB-related comments/messages more uniform"

7 years agoMerge "OutputPage: Ensure setupSkinUserCss() always applies to headElement()"
jenkins-bot [Sat, 3 Sep 2016 18:54:57 +0000 (18:54 +0000)]
Merge "OutputPage: Ensure setupSkinUserCss() always applies to headElement()"

7 years agoFix IDEA error in prepareQuickTemplate() call
Aaron Schulz [Sat, 3 Sep 2016 18:45:54 +0000 (11:45 -0700)]
Fix IDEA error in prepareQuickTemplate() call

Change-Id: I5ee3424c55a499296bfd417ed1eda49a06d2c3f9

7 years agoOutputPage: Ensure setupSkinUserCss() always applies to headElement()
Timo Tijhof [Tue, 30 Aug 2016 23:36:28 +0000 (16:36 -0700)]
OutputPage: Ensure setupSkinUserCss() always applies to headElement()

Follows-up 80e5b160e0, which had to move this call out of the
headElement() and buildCssLinks() methods as it was no longer
allowed to modify the module queue after it was created.

It was moved to OutputPage::output(), right before Skin::outputPage()
is called, which ends up calling headElement().

The point in time was effectively unchanged for page views.

However for the caller in ApiParse() this meant setupSkinUserCss()
no longer got called at all as it never calls output(), but instead
calls headElement() directly.

Move it to getRlClient(), which is where we set all other
OutputPage-specific things relating to module loading already.

* For page views this has no impact.
* For ApiParse it means headElement(), which calls getRlClient(),
  will once again include skin stylesheets.

Bug: T144301
Change-Id: I5fd4a27fb2d70b98ce9161dc050788d8ac364110

7 years agoTypo in a test: '+' instead of '.' to concatenate strings
Seb35 [Sat, 3 Sep 2016 14:29:13 +0000 (16:29 +0200)]
Typo in a test: '+' instead of '.' to concatenate strings

I found it by executing tests with PHP 7.1.0RC1, but even
if PHP 7.1.0 is still a RC, this is a typo in PHP language.

Change-Id: Ia97f881f8c80a23c51512189d9ca5a012612c532

7 years agoMake replication DB-related comments/messages more uniform
Aaron Schulz [Sat, 3 Sep 2016 14:13:47 +0000 (07:13 -0700)]
Make replication DB-related comments/messages more uniform

Change-Id: If04254aad085c05d2a6b6588b4c9b55a1736110d

7 years agoMake deferred updates fully own their transaction rounds
Aaron Schulz [Sat, 3 Sep 2016 13:44:31 +0000 (06:44 -0700)]
Make deferred updates fully own their transaction rounds

This will matter when commitMasterChanges() enforcement is tighter.
For now, any thing can still call that method anytime.

Change-Id: I0b08e9e9118a6c6118c117e3856d0a8e0ca3d457

7 years agoMerge "resourceloader: Shorten cache expiry if 'version' query doesn't match"
jenkins-bot [Fri, 2 Sep 2016 23:56:26 +0000 (23:56 +0000)]
Merge "resourceloader: Shorten cache expiry if 'version' query doesn't match"

7 years agoresourceloader: Shorten cache expiry if 'version' query doesn't match
Timo Tijhof [Fri, 2 Sep 2016 22:44:59 +0000 (15:44 -0700)]
resourceloader: Shorten cache expiry if 'version' query doesn't match

Versioned load.php requests (load.php?modules=..&version=..) are highly
cacheable due to being versioned. When a module changes, the startup module
delivers new metadata to the client which naturally results in a cache miss
by producing a different url.

However, during upgrades and other deployments it was possible for a
multi-server installation to pollute edge caches with outdated content
in the following scenario:

* Deployment starts for an upgrade from version A to version B.
* Server 1 (on version B) gets a request for the startup manifest.
  Client receives new manifest with version B information
  and makes a versioned request for version B.
* Server 2 (still on version A) responds to this request with the
  version it has (which is version A).
* Edge cache will store version A under the new url for version B.

This commit changes the last point by setting a low max-age when a request
has a 'version' hash mismatch.

Test plan:
* Look for a request in your browser like:
 '/load.php?..modules=jquery%2Cmediawiki..&version=..'
* Verify it has a high Cache-Control max-age.
* Manipulate the 'version' parameter and verify it gets a low max-age.

Bug: T117587
Change-Id: Iba89c09b7b71d9fd2a8ff3ebe2618e26ea9daddf

7 years agoUse WAN cache adaptiveTTL() method in FileBackendStore
Aaron Schulz [Fri, 2 Sep 2016 22:59:52 +0000 (15:59 -0700)]
Use WAN cache adaptiveTTL() method in FileBackendStore

Change-Id: I2e8b4e85b12c8892e8640abc63ee13b4b170645d

7 years agoMerge "Fix deletion handling of rev_deleted"
jenkins-bot [Fri, 2 Sep 2016 22:12:32 +0000 (22:12 +0000)]
Merge "Fix deletion handling of rev_deleted"

7 years agoMerge "Convert Revision::fetchFromConds() to using more modern selectRow()"
jenkins-bot [Fri, 2 Sep 2016 22:10:17 +0000 (22:10 +0000)]
Merge "Convert Revision::fetchFromConds() to using more modern selectRow()"

7 years agoFix deletion handling of rev_deleted
Aaron Schulz [Thu, 1 Sep 2016 12:42:01 +0000 (05:42 -0700)]
Fix deletion handling of rev_deleted

When the suppress button was not used, and some live
revisions had rev_deleted set, the query would try to
write the literal string "rev_deleted" as rev_deleted,
which was not noticed in default non-strict MySQL and
was casted to 0.

Follow-up to 673371e2c7

Bug: T144484
Change-Id: If3a74de13ea841d9d94ae05532cc8dadb0e40867

7 years agoConvert Revision::fetchFromConds() to using more modern selectRow()
Aaron Schulz [Fri, 2 Sep 2016 13:46:56 +0000 (06:46 -0700)]
Convert Revision::fetchFromConds() to using more modern selectRow()

Change-Id: Icb3fa46beb7f49a43ffa40eb8f505a3717cd730b

7 years agoMerge "Rename CSS files for printing to a consistent file name"
jenkins-bot [Fri, 2 Sep 2016 21:02:13 +0000 (21:02 +0000)]
Merge "Rename CSS files for printing to a consistent file name"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 2 Sep 2016 20:15:53 +0000 (22:15 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I22dc4d60a502074f810a7ef5b704dd7bda05801f

7 years agoMerge "mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error...
jenkins-bot [Fri, 2 Sep 2016 19:59:58 +0000 (19:59 +0000)]
Merge "mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages"

7 years agoMerge "Add flushReplicaSnapshots() method for just clearing snapshots"
jenkins-bot [Fri, 2 Sep 2016 18:27:22 +0000 (18:27 +0000)]
Merge "Add flushReplicaSnapshots() method for just clearing snapshots"

7 years agoDon't mention $wgUser, it's ugly and it messes my grep-fu
Chad Horohoe [Fri, 2 Sep 2016 18:15:02 +0000 (11:15 -0700)]
Don't mention $wgUser, it's ugly and it messes my grep-fu

Change-Id: Ic2b181a9f22f172aa8845a2e13bafa6142469ec4

7 years agoAdd flushReplicaSnapshots() method for just clearing snapshots
Aaron Schulz [Fri, 2 Sep 2016 18:06:56 +0000 (11:06 -0700)]
Add flushReplicaSnapshots() method for just clearing snapshots

This is better than having to use the less safe commitAll(),
which also checks and commits masters with writes.

Change-Id: I01c95f1ebae6927ed5acf0c23dd19b5c2413f661

7 years agoMerge "Remove spammy reuseConnection() wfDebug() call"
jenkins-bot [Fri, 2 Sep 2016 18:00:26 +0000 (18:00 +0000)]
Merge "Remove spammy reuseConnection() wfDebug() call"

7 years agoMerge "Clean up user handling in UploadStash"
jenkins-bot [Fri, 2 Sep 2016 17:48:28 +0000 (17:48 +0000)]
Merge "Clean up user handling in UploadStash"

7 years agoClean up user handling in UploadStash
Chad Horohoe [Fri, 2 Sep 2016 17:18:12 +0000 (10:18 -0700)]
Clean up user handling in UploadStash

- User parameter is now *required*, remove $wgUser fallback
- We don't actually need the object after construction, don't store it

Change-Id: Id0cc859b70e5d0608ffbfa591bce6a1feb7cc3be

7 years agoMerge "Let a few unit tests actually be unit tests"
jenkins-bot [Fri, 2 Sep 2016 17:40:33 +0000 (17:40 +0000)]
Merge "Let a few unit tests actually be unit tests"

7 years agoLet a few unit tests actually be unit tests
Chad Horohoe [Fri, 2 Sep 2016 17:16:06 +0000 (10:16 -0700)]
Let a few unit tests actually be unit tests

MediaWikiTestCase is a terrible terrible thing with dumb overhead

Change-Id: I2a73a0f2819ed7e73b57642b7969036c2db2c991

7 years agoMerge "Make insertSelect() do two separate queries in non-CLI mode"
jenkins-bot [Fri, 2 Sep 2016 17:08:38 +0000 (17:08 +0000)]
Merge "Make insertSelect() do two separate queries in non-CLI mode"

7 years agoMerge "Replace DataUpdate::doUpdates() callers in maintenance/"
jenkins-bot [Fri, 2 Sep 2016 16:56:19 +0000 (16:56 +0000)]
Merge "Replace DataUpdate::doUpdates() callers in maintenance/"

7 years agoRename CSS files for printing to a consistent file name
Fomafix [Fri, 2 Sep 2016 15:08:39 +0000 (17:08 +0200)]
Rename CSS files for printing to a consistent file name

Change-Id: I868ecee47ed224ec05b41361727c2c67aebc474d

7 years agoRemove spammy reuseConnection() wfDebug() call
Aaron Schulz [Fri, 2 Sep 2016 15:36:08 +0000 (08:36 -0700)]
Remove spammy reuseConnection() wfDebug() call

This does not convey anything helpful and spam up debug
comment and jenkins logs

Change-Id: I7d20d061db28da3ba268255ecd71687a1eefb835

7 years agoSpecial:MovePage: Use LinkBatch when constructing subpages
Glaisher [Sun, 14 Aug 2016 06:32:00 +0000 (11:32 +0500)]
Special:MovePage: Use LinkBatch when constructing subpages

Should help with T141029 and other cases, in general.

Bug: T141029
Change-Id: Iacda5acb0c569aa85eb328144c0af8d2cd07f126

7 years agoRevertAction: Prevent file revert if current version is identical
Bartosz Dziewoński [Thu, 1 Sep 2016 21:49:19 +0000 (23:49 +0200)]
RevertAction: Prevent file revert if current version is identical

There are several reasons for this:

* The file thumbnail shown on the main file page is cached by the
  browser, as images tend to be. This often confuses users into
  thinking their revert did not work, and into attempting it again.
  Recent examples:
  * https://commons.wikimedia.org/wiki/Commons:Village_pump/Archive/2016/07#Wrong_SVG_rendering_on_File:DuckDuckGo_logo_and_wordmark.svg
  * https://commons.wikimedia.org/w/index.php?title=Commons:Upload_help&oldid=205348523#Reversion_is_not_working_for_me.
  Ideally we'd prevent the caching, but preventing repeated reverts
  should also work.

* Refreshing the success page causes the revert to be attempted again
  (T53383). The usual solution to this is the Post/Redirect/Get
  pattern, but we want to show a success message so that would require
  some more changes (something similar to the post-edit notification).

* It can serve as a "revert conflict" detection mechanism, crude but
  better than none.

In the unlikely case that uploading an identical older version of
the file is necessary, it can still be done using Special:Upload.

Bug: T53383
Change-Id: I37e04a536c5c2fc6cdbe59f6f598bb0c7f25d7a7

7 years agoLogPager: Use normalized value for log_user_text in query condition
Glaisher [Sat, 13 Aug 2016 12:02:03 +0000 (17:02 +0500)]
LogPager: Use normalized value for log_user_text in query condition

Bug: T142755
Change-Id: Ia08be456cafa2133e5ea0e521161d6939e839fb2

7 years agoMerge "Make DeferredUpdates able to run DataUpdates"
jenkins-bot [Fri, 2 Sep 2016 04:48:35 +0000 (04:48 +0000)]
Merge "Make DeferredUpdates able to run DataUpdates"

7 years agoMerge "ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for...
jenkins-bot [Fri, 2 Sep 2016 04:43:41 +0000 (04:43 +0000)]
Merge "ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files"

7 years agoReplace DataUpdate::doUpdates() callers in maintenance/
Aaron Schulz [Fri, 2 Sep 2016 04:30:34 +0000 (21:30 -0700)]
Replace DataUpdate::doUpdates() callers in maintenance/

Change-Id: I51df9f419d6ea1e822fd0eef8c5dc4c43f9855e1

7 years agoMake DeferredUpdates able to run DataUpdates
Aaron Schulz [Sun, 28 Aug 2016 16:23:52 +0000 (09:23 -0700)]
Make DeferredUpdates able to run DataUpdates

* Also make ErrorPageError exceptions display themselves
  in PRESEND mode. Before they were always suppressed.
* Make DataUpdate::runUpdates() simply wrap
  DeferredUpdates::execute().
* Remove unused installDBListener() method, which was
  basically moved to Maintenance.
* Enable DBO_TRX for DeferredUpdates::execute() in CLI mode
* Also perform sub-DeferrableUpdate jobs right after their
  parent for better transaction locality.
* Made rollbackMasterChangesAndLog() clear all master
  transactions/rounds, even if there are no changes yet.
  This keeps the state cleaner for continuing.
* For sanity, avoid calling acquirePageLock() in link updates
  unless the transaction ticket is set. These locks are
  already redundant and weaker in range than the locks the
  Job classes that run them get. This helps guard against
  DBTransactionError.
* Renamed $type to $stage to be more clear about the order.

Change-Id: I1e90b56cc80041d70fb9158ac4f027285ad0f2c9

7 years agoMove run-on-add logic in DeferredUpdates to addUpdate()
Aaron Schulz [Thu, 1 Sep 2016 17:03:31 +0000 (10:03 -0700)]
Move run-on-add logic in DeferredUpdates to addUpdate()

Change-Id: I1b3ec21e07549f7250fa497f352fe1c131ddc88a

7 years agoRemove $recursionGuard var from tryOpportunisticExecute()
Aaron Schulz [Thu, 1 Sep 2016 17:01:25 +0000 (10:01 -0700)]
Remove $recursionGuard var from tryOpportunisticExecute()

Aside from there being no idle callback setting here, the
old addUpdate() code that runs updates allows nesting updates.
Make this support that for a few transitional commits. It will
be changed later to simply order the sub-updates after their
parent updates, keeping both outer scope for all updates and
locality of related updates.

Change-Id: I0ad4e9713a7893b981b7bb013e9db803eed663b2

7 years agoSet "run when DBs idle" DeferredUpdates logic in Maintenance
Aaron Schulz [Thu, 1 Sep 2016 16:43:01 +0000 (09:43 -0700)]
Set "run when DBs idle" DeferredUpdates logic in Maintenance

* This is a more robust version of the one inside
  DeferredUpdates (checking all DBs), which will be
  replaced in a later commit.
* Make sure the listener is restored when the LB gets
  torn down in tests. Also, it should respect the
  $wgCommandLineMode value as tests can change it.

Change-Id: I1e3faa5a058df44e2d27ab5ac185930867eb68ac

7 years agoRemove unused custom transaction logic from DataUpdate
Aaron Schulz [Thu, 1 Sep 2016 00:03:39 +0000 (17:03 -0700)]
Remove unused custom transaction logic from DataUpdate

Change-Id: Ife65e4e90a35395e87f4f487f1cb871b67d92aa1

7 years agoSet some missing INTERNAL DB transaction flags and add wfWarn() calls
Aaron Schulz [Thu, 1 Sep 2016 12:10:48 +0000 (05:10 -0700)]
Set some missing INTERNAL DB transaction flags and add wfWarn() calls

Make TRANSACTION_INTERNAL set mTrxAutomatic rather that
having callers have to do that individually.

The warnings should actually make tests fail with backtraces,
rather than often just having wrong things happen later.

Change-Id: Ic247a7b42a686f170f7abe6ec584459f3db4ed69

7 years agoImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files
Bartosz Dziewoński [Thu, 1 Sep 2016 20:59:55 +0000 (22:59 +0200)]
ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files

The action=revert page does not use this parameter at all. (It displays
a form with an entirely different token.) I think this has not been
needed since cf6dd13faca23af5b6e3188445b84e05d620d499 (r91284).

Change-Id: Ice5ecd2606a94a70321ede5304fee77fb1fb06c1

7 years agoMerge "objectcache: allow for callbacks to mask SYNC_WRITE latency"
jenkins-bot [Thu, 1 Sep 2016 21:38:21 +0000 (21:38 +0000)]
Merge "objectcache: allow for callbacks to mask SYNC_WRITE latency"

7 years agoobjectcache: allow for callbacks to mask SYNC_WRITE latency
Aaron Schulz [Mon, 29 Aug 2016 17:00:05 +0000 (10:00 -0700)]
objectcache: allow for callbacks to mask SYNC_WRITE latency

Change-Id: I908222ad3788ebe330aa58831cda139da32becd8

7 years agoMerge "Register a default value for the timecorrection preference"
jenkins-bot [Thu, 1 Sep 2016 20:33:50 +0000 (20:33 +0000)]
Merge "Register a default value for the timecorrection preference"

7 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Thu, 1 Sep 2016 20:08:52 +0000 (22:08 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Ib4393e8374d2b6596a461934e7a5a0f15a88e292

7 years agoMerge "Remove SourceIndexField FLAG_SOURCE_DATA"
jenkins-bot [Thu, 1 Sep 2016 18:59:55 +0000 (18:59 +0000)]
Merge "Remove SourceIndexField FLAG_SOURCE_DATA"

7 years agoRemove SourceIndexField FLAG_SOURCE_DATA
dcausse [Thu, 1 Sep 2016 15:00:59 +0000 (17:00 +0200)]
Remove SourceIndexField FLAG_SOURCE_DATA

Change-Id: I080f06a5a09f2d67a153b491555d0dbf65c626d0

7 years agoMerge "Add DEFAULTSORT to search index field data"
jenkins-bot [Thu, 1 Sep 2016 14:51:41 +0000 (14:51 +0000)]
Merge "Add DEFAULTSORT to search index field data"