[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs firstboot.sh: Add instance hostname to /etc/hosts

2016-09-16 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311212

Change subject: labs firstboot.sh: Add instance hostname to /etc/hosts
..

labs firstboot.sh: Add instance hostname to /etc/hosts

Bug: T120830
Change-Id: I9cb20eff91682e5fc3a4029ce8eda33f41b82c49
---
M modules/labs_bootstrapvz/files/firstboot.sh
M modules/labs_vmbuilder/files/firstboot.sh
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/12/311212/1

diff --git a/modules/labs_bootstrapvz/files/firstboot.sh 
b/modules/labs_bootstrapvz/files/firstboot.sh
index f11a2e7..5d86d25 100644
--- a/modules/labs_bootstrapvz/files/firstboot.sh
+++ b/modules/labs_bootstrapvz/files/firstboot.sh
@@ -141,6 +141,8 @@
 options timeout:5 ndots:2
 EOF
 
+echo "$ip  $hostname $fqdn" >> /etc/hosts
+
 # This is only needed when running bootstrap-vz on
 # a puppetmaster::self instance, and even then
 # it isn't perfect
diff --git a/modules/labs_vmbuilder/files/firstboot.sh 
b/modules/labs_vmbuilder/files/firstboot.sh
index 79ad558..e110c01 100644
--- a/modules/labs_vmbuilder/files/firstboot.sh
+++ b/modules/labs_vmbuilder/files/firstboot.sh
@@ -83,6 +83,8 @@
 options timeout:5 ndots:2
 EOF
 
+echo "$ip  $hostname $fqdn" >> /etc/hosts
+
 /etc/init.d/nslcd restart
 /etc/init.d/nscd restart
 dpkg-reconfigure -fnoninteractive -pcritical openssh-server

-- 
To view, visit https://gerrit.wikimedia.org/r/311212
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cb20eff91682e5fc3a4029ce8eda33f41b82c49
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Attempt to fix salt key monitoring sudo rule

2016-09-16 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311211

Change subject: Attempt to fix salt key monitoring sudo rule
..

Attempt to fix salt key monitoring sudo rule

The script doesn't attempt to re-run itself with sudo, it runs 
`/usr/bin/salt-key -l un`

Bug: T144801
Change-Id: Ib594b0284029172f30929461ac45f12e5f7756ee
---
M modules/salt/manifests/monitoring.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/11/311211/1

diff --git a/modules/salt/manifests/monitoring.pp 
b/modules/salt/manifests/monitoring.pp
index b9dde9b..208e377 100644
--- a/modules/salt/manifests/monitoring.pp
+++ b/modules/salt/manifests/monitoring.pp
@@ -13,7 +13,7 @@
 
 sudo::user { 'nagios_unaccepted_keys':
 user   => 'nagios',
-privileges => ["ALL = NOPASSWD: ${check_unaccepted_keys}"],
+privileges => ["ALL = NOPASSWD: /usr/bin/salt-key -l un"],
 }
 
 nrpe::monitor_service { 'salt_unaccepted_keys':

-- 
To view, visit https://gerrit.wikimedia.org/r/311211
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib594b0284029172f30929461ac45f12e5f7756ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: openstack nova network: update private_ips of instances

2016-09-16 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311210

Change subject: openstack nova network: update private_ips of instances
..

openstack nova network: update private_ips of instances

Get rid of the 'udplog' deployment-tin one as this instance has no public IP or
udplog instance - I think it's predecessor, deployment-bastion, probably did,
and that may have run udp2log...?

To be honest, I question whether we need to keep these entries around at all or
if we should delete them they've been broken so long.

Also comment labs instance IPs around the repository with the instance names.

Change-Id: Ia3b05dffce0e4a593b97c6c7508c0bcee7735973
---
M hieradata/labs.yaml
M hieradata/labs/deployment-prep/common.yaml
M modules/openstack/manifests/nova/network.pp
3 files changed, 8 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/10/311210/1

diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index a14f351..bcb9c3a 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -115,7 +115,7 @@
 hosts:
   "%{::fqdn}": 1
 
-nrpe::allowed_hosts: '10.68.16.195'
+nrpe::allowed_hosts: '10.68.16.195' # icinga
 
 ssh::server::disable_agent_forwarding: false
 puppetmaster: "labs-puppetmaster-eqiad.wikimedia.org"
diff --git a/hieradata/labs/deployment-prep/common.yaml 
b/hieradata/labs/deployment-prep/common.yaml
index ad1ee64..0458a1e 100644
--- a/hieradata/labs/deployment-prep/common.yaml
+++ b/hieradata/labs/deployment-prep/common.yaml
@@ -101,8 +101,8 @@
 cassandra::target_version: '2.2'
 cassandra::metrics::graphite_host: labmon1001.eqiad.wmnet
 restbase::seeds:
-  - 10.68.16.128
-  - 10.68.17.189
+  - 10.68.16.128 # deployment-restbase01
+  - 10.68.17.189 # deployment-restbase02
 # used for rate limiting
 restbase::hosts:
   - deployment-restbase01.deployment-prep.eqiad.wmflabs
@@ -159,7 +159,7 @@
 "role::logging::mediawiki::log_directory": /data/project/logs
 "role::mediawiki::webserver::pool": one-pool-to-rule-them-all
 "beta::syncsiteresources::user": www-data
-"role::url_downloader::url_downloader_ip": 10.68.16.135
+"role::url_downloader::url_downloader_ip": 10.68.16.135 # 
deployment-urldownloader
 "zotero::http_proxy": 
deployment-urldownloader.deployment-prep.eqiad.wmflabs:8080
 "trebuchet::deployment_server": deployment-tin.deployment-prep.eqiad.wmflabs
 "scap::deployment_server": deployment-tin.deployment-prep.eqiad.wmflabs
@@ -203,10 +203,10 @@
 role::logstash::statsd_host: labmon1001.eqiad.wmnet
 "mediawiki::redis_servers::eqiad":
   shard01:
-host: 10.68.16.177
+host: 10.68.16.177 # deployment-redis01
 port: 6379
   shard02:
-host: 10.68.16.231
+host: 10.68.16.231 # deployment-redis02
 port: 6379
 nfs_mounts:
   project: false
diff --git a/modules/openstack/manifests/nova/network.pp 
b/modules/openstack/manifests/nova/network.pp
index cced6b4..72aeacb 100644
--- a/modules/openstack/manifests/nova/network.pp
+++ b/modules/openstack/manifests/nova/network.pp
@@ -29,13 +29,10 @@
 'relic' => {public_ip  => '208.80.155.197',
 private_ip => '10.68.16.162' },
 'tools-webproxy'=> {public_ip  => '208.80.155.131',
-private_ip => '10.68.17.139' },
-'udplog'=> {public_ip  => '208.80.155.191',
-private_ip => '10.68.17.240' },
-
+private_ip => '10.68.21.49' },
 # A wide variety of hosts are reachable via a public web proxy.
 'labs_shared_proxy' => {public_ip  => '208.80.155.156',
-private_ip => '10.68.16.65'},
+private_ip => '10.68.21.68'},
 }
 
 $dnsconfig = hiera_hash('labsdnsconfig', {})

-- 
To view, visit https://gerrit.wikimedia.org/r/311210
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3b05dffce0e4a593b97c6c7508c0bcee7735973
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics...source[master]: Add singleton capactiy to UAParser

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add singleton capactiy to UAParser
..


Add singleton capactiy to UAParser

Being a singleton is the easiest way for UAParser to be usable by Spark.
Others involves serialization issues that are way harder to solve.

Bug: T121550
Change-Id: I7c1f2711bc56fb3a12f15c13b08840556ba03139
---
M 
refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/UAParser.java
1 file changed, 19 insertions(+), 4 deletions(-)

Approvals:
  Ottomata: Looks good to me, but someone else must approve
  Nuria: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/UAParser.java
 
b/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/UAParser.java
index 1ea7707..a26eb6b 100644
--- 
a/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/UAParser.java
+++ 
b/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/UAParser.java
@@ -31,10 +31,24 @@
 
 public static final String NA = "-";
 
-static final Logger LOG = Logger.getLogger(UAParser.class.getName());
+private static final Logger LOG = 
Logger.getLogger(UAParser.class.getName());
 
-private CachingParser cachingParser;
-private Map result = new HashMap();
+private static CachingParser cachingParser;
+
+/*
+ * Meta-methods to enable eager instantiation in a singleton-based way.
+ * in non-Java terms: you get to only create one class instance, and only
+ * when you need it, instead of always having everything (static/eager 
instantiation)
+ * or always generating everything anew (!singletons). So we have:
+ * (1) an instance;
+ * (2) an empty constructor (to avoid people just calling the constructor);
+ * (3) an actual getInstance method to allow for instantiation.
+ */
+private static final UAParser instance = new UAParser();
+
+public static UAParser getInstance(){
+return instance;
+}
 
 /**
  * Function replacing null/empty string with the NA one.
@@ -70,7 +84,8 @@
  * os_family, os_major, os_minor, wmf_app_version keys and associated 
values.
  */
 public Map getUAMap(String uaString) {
-result.clear();
+// Presetting map size to correct number of slots
+Map result = new HashMap<>(8);
 
 UserAgent browser = null;
 Device device = null;

-- 
To view, visit https://gerrit.wikimedia.org/r/311127
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7c1f2711bc56fb3a12f15c13b08840556ba03139
Gerrit-PatchSet: 1
Gerrit-Project: analytics/refinery/source
Gerrit-Branch: master
Gerrit-Owner: Joal 
Gerrit-Reviewer: Nuria 
Gerrit-Reviewer: Ottomata 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: PrefixSearch: Implement searching in multiple namespaces

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: PrefixSearch: Implement searching in multiple namespaces
..


PrefixSearch: Implement searching in multiple namespaces

I thought there was just an issue with capitalization, but in fact the
code explicitly only searched one namespace anyway. Fixed that while
taking capitalization differences in namespaces into account.

This by extend also brings support for multiple namespaces to the
opensearch API.

Follows-up I3487bb69.

Bug: T67752
Bug: T32323
Change-Id: I4bec7b5548fc27ac51a1b4d4961c3bbc31eb7337
---
M includes/PrefixSearch.php
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/PrefixSearchTest.php
3 files changed, 141 insertions(+), 53 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PrefixSearch.php b/includes/PrefixSearch.php
index 49e596d..98bc885 100644
--- a/includes/PrefixSearch.php
+++ b/includes/PrefixSearch.php
@@ -57,33 +57,53 @@
if ( $search == '' ) {
return []; // Return empty result
}
-   $namespaces = $this->validateNamespaces( $namespaces );
 
-   // Find a Title which is not an interwiki and is in NS_MAIN
-   $title = Title::newFromText( $search );
-   if ( $title && !$title->isExternal() ) {
-   $ns = [ $title->getNamespace() ];
-   $search = $title->getText();
-   if ( $ns[0] == NS_MAIN ) {
-   $ns = $namespaces; // no explicit prefix, use 
default namespaces
-   Hooks::run( 'PrefixSearchExtractNamespace', [ 
&$ns, &$search ] );
-   }
-   return $this->searchBackend( $ns, $search, $limit, 
$offset );
-   }
-
-   // Is this a namespace prefix?
-   $title = Title::newFromText( $search . 'Dummy' );
-   if ( $title && $title->getText() == 'Dummy'
-   && $title->getNamespace() != NS_MAIN
-   && !$title->isExternal() )
-   {
-   $namespaces = [ $title->getNamespace() ];
-   $search = '';
+   $hasNamespace = $this->extractNamespace( $search );
+   if ( $hasNamespace ) {
+   list( $namespace, $search ) = $hasNamespace;
+   $namespaces = [ $namespace ];
} else {
+   $namespaces = $this->validateNamespaces( $namespaces );
Hooks::run( 'PrefixSearchExtractNamespace', [ 
&$namespaces, &$search ] );
}
 
return $this->searchBackend( $namespaces, $search, $limit, 
$offset );
+   }
+
+   /**
+* Figure out if given input contains an explicit namespace.
+*
+* @param string $input
+* @return false|array Array of namespace and remaining text, or false 
if no namespace given.
+*/
+   protected function extractNamespace( $input ) {
+   if ( strpos( $input, ':' ) === false ) {
+   return false;
+   }
+
+   // Namespace prefix only
+   $title = Title::newFromText( $input . 'Dummy' );
+   if (
+   $title &&
+   $title->getText() === 'Dummy' &&
+   !$title->inNamespace( NS_MAIN ) &&
+   !$title->isExternal()
+   ) {
+   return [ $title->getNamespace(), '' ];
+   }
+
+   // Namespace prefix with additional input
+   $title = Title::newFromText( $input );
+   if (
+   $title &&
+   !$title->inNamespace( NS_MAIN ) &&
+   !$title->isExternal()
+   ) {
+   // getText provides correct capitalization
+   return [ $title->getNamespace(), $title->getText() ];
+   }
+
+   return false;
}
 
/**
@@ -254,43 +274,60 @@
 * be automatically capitalized by Title::secureAndSpit()
 * later on depending on $wgCapitalLinks)
 *
-* @param array $namespaces Namespaces to search in
+* @param array|null $namespaces Namespaces to search in
 * @param string $search Term
 * @param int $limit Max number of items to return
 * @param int $offset Number of items to skip
-* @return array Array of Title objects
+* @return Title[] Array of Title objects
 */
public function defaultSearchBackend( $namespaces, $search, $limit, 
$offset ) {
-   $ns = array_shift( $namespaces ); // support only one namespace
-   if ( is_null( $ns ) || 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Bump batch size for WDQS updater to 500

2016-09-16 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311209

Change subject: Bump batch size for WDQS updater to 500
..

Bump batch size for WDQS updater to 500

Change-Id: I4d73f081a27c53508e89f05eb18bfa2748172b0a
---
M hieradata/role/common/wdqs.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/09/311209/1

diff --git a/hieradata/role/common/wdqs.yaml b/hieradata/role/common/wdqs.yaml
index 9905afc..3e9e5d0 100644
--- a/hieradata/role/common/wdqs.yaml
+++ b/hieradata/role/common/wdqs.yaml
@@ -1,5 +1,5 @@
 wdqs::gui::log_aggregator:  'logstash1001.eqiad.wmnet:10514'
-wdqs::updater::options: '-n wdq'
+wdqs::updater::options: '-n wdq -- -b 500'
 wdqs::service::config_file: /etc/wdqs/RWStore.properties
 admin::groups:
   - wdqs-admins

-- 
To view, visit https://gerrit.wikimedia.org/r/311209
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d73f081a27c53508e89f05eb18bfa2748172b0a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid using bogus empty database names in queries

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311208

Change subject: Avoid using bogus empty database names in queries
..

Avoid using bogus empty database names in queries

Fixes regression from 32c7a9bf46b8ba8d81

Change-Id: I029ad785afd6a2ba4589a24a813d4b348b708112
---
M includes/db/Database.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/311208/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 3d9b41a..b4a39f9 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1924,7 +1924,7 @@
}
 
# Quote $database and merge it with the table name if needed
-   if ( $database !== null ) {
+   if ( strlen( $database ) ) {
if ( $format == 'quoted' && !$this->isQuotedIdentifier( 
$database ) ) {
$database = $this->addIdentifierQuotes( 
$database );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/311208
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I029ad785afd6a2ba4589a24a813d4b348b708112
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix type doc in StatusValue

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix type doc in StatusValue
..


Fix type doc in StatusValue

Change-Id: Ib0a3282083b2fd08ea76022b74b21b55da9b8a46
---
M includes/libs/StatusValue.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/StatusValue.php b/includes/libs/StatusValue.php
index 1d23f9d..baa4e22 100644
--- a/includes/libs/StatusValue.php
+++ b/includes/libs/StatusValue.php
@@ -246,8 +246,8 @@
 * Note, due to the lack of tools for comparing IStatusMessage objects, 
this
 * function will not work when using such an object as the search 
parameter.
 *
-* @param IStatusMessage|string $source Message key or object to search 
for
-* @param IStatusMessage|string $dest Replacement message key or object
+* @param MessageSpecifier|string $source Message key or object to 
search for
+* @param MessageSpecifier|string $dest Replacement message key or 
object
 * @return bool Return true if the replacement was done, false 
otherwise.
 */
public function replaceMessage( $source, $dest ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/311204
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0a3282083b2fd08ea76022b74b21b55da9b8a46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make LoadBalancer domain handling more robust

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make LoadBalancer domain handling more robust
..


Make LoadBalancer domain handling more robust

* Cleanup setDomainPrefix() methods to handle existing LBs/DBs.
* This also makes it set just the prefix as the prefix rather
  than as the whole domain.
* Fix regression from 789a54a5f1 where "read" mode of
  tablePrefix()/dbSchema() still set the field.
* Make getConnectionRef() always have the domain set.
* Add a check in openConnection() for explicit local
  connections, treating $domain as false and avoiding
  openForeignConnection().

Bug: T145840
Change-Id: Idf392bd9992a215c4fa3bddf275562f3916596aa
---
M includes/db/CloneDatabase.php
M includes/db/Database.php
M includes/libs/rdbms/lbfactory/LBFactory.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
M tests/phpunit/includes/db/DatabaseTest.php
5 files changed, 53 insertions(+), 21 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php
index ee82bdf..2af742e 100644
--- a/includes/db/CloneDatabase.php
+++ b/includes/db/CloneDatabase.php
@@ -132,12 +132,6 @@
 
$lbFactory = wfGetLBFactory();
$lbFactory->setDomainPrefix( $prefix );
-   $lbFactory->forEachLB( function( LoadBalancer $lb ) use ( 
$prefix ) {
-   $lb->setDomainPrefix( $prefix );
-   $lb->forEachOpenConnection( function ( IDatabase $db ) 
use ( $prefix ) {
-   $db->tablePrefix( $prefix );
-   } );
-   } );
$wgDBprefix = $prefix;
}
 }
diff --git a/includes/db/Database.php b/includes/db/Database.php
index e908824..3d9b41a 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -93,9 +93,9 @@
protected $mTrxEndCallbacksSuppressed = false;
 
/** @var string */
-   protected $mTablePrefix;
+   protected $mTablePrefix = '';
/** @var string */
-   protected $mSchema;
+   protected $mSchema = '';
/** @var integer */
protected $mFlags;
/** @var array */
@@ -367,7 +367,7 @@
$p['variables'] = isset( $p['variables'] ) ? 
$p['variables'] : [];
$p['tablePrefix'] = isset( $p['tablePrefix'] ) ? 
$p['tablePrefix'] : '';
if ( !isset( $p['schema'] ) ) {
-   $p['schema'] = isset( $defaultSchemas[$dbType] 
) ? $defaultSchemas[$dbType] : null;
+   $p['schema'] = isset( $defaultSchemas[$dbType] 
) ? $defaultSchemas[$dbType] : '';
}
$p['foreign'] = isset( $p['foreign'] ) ? $p['foreign'] 
: false;
 
@@ -466,14 +466,18 @@
 
public function tablePrefix( $prefix = null ) {
$old = $this->mTablePrefix;
-   $this->mTablePrefix = $prefix;
+   if ( $prefix !== null ) {
+   $this->mTablePrefix = $prefix;
+   }
 
return $old;
}
 
public function dbSchema( $schema = null ) {
$old = $this->mSchema;
-   $this->mSchema = $schema;
+   if ( $schema !== null ) {
+   $this->mSchema = $schema;
+   }
 
return $old;
}
@@ -699,7 +703,7 @@
}
 
public function getWikiID() {
-   if ( $this->mTablePrefix ) {
+   if ( $this->mTablePrefix != '' ) {
return "{$this->mDBname}-{$this->mTablePrefix}";
} else {
return $this->mDBname;
@@ -1884,7 +1888,7 @@
# In dbs that support it, $database may actually be the 
schema
# but that doesn't affect any of the functionality here
$prefix = '';
-   $schema = null;
+   $schema = '';
} else {
list( $table ) = $dbDetails;
if ( isset( $this->tableAliases[$table] ) ) {
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index b6f3317..e011ff0 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -633,15 +633,18 @@
}
 
/**
-* Define a new local domain (for testing)
+* Set a new table prefix for the existing local domain ID for testing
 *
-* Caller should make sure no local connection are open to the old 
local domain
-*
-* @param string $domain
+* @param string $prefix
 * @since 1.28
 */
-   public function setDomainPrefix( $domain ) {
-   

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: (attempt to) make NWE work with SET

2016-09-16 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311207

Change subject: (attempt to) make NWE work with SET
..

(attempt to) make NWE work with SET

Ugh.

Bug: T143578
Change-Id: I71e08508eb0914be9d624202b13a4369df512b80
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 33 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/07/311207/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 6bf9527..e7a207e 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -764,7 +764,8 @@
var showWikitextWelcome = true,
isLoggedIn = !mw.user.isAnon(),
prefSaysShowWelcome = isLoggedIn && 
!mw.user.options.get( 'visualeditor-hidebetawelcome' ),
-   urlSaysHideWelcome = 'hidewelcomedialog' in new mw.Uri( 
location.href ).query;
+   urlSaysHideWelcome = 'hidewelcomedialog' in new mw.Uri( 
location.href ).query,
+   action = 'edit';
 
if ( uri.query.action === 'edit' && $( '#wpTextbox1' ).length ) 
{
initialWikitext = $( '#wpTextbox1' ).textSelection( 
'getContents' );
@@ -784,7 +785,7 @@
// TODO: other params too? See identical list 
in VisualEditor.hooks.php)
) {
if (
-   // … if on a ?veaction=edit page
+   // … if on a ?veaction=edit/editsource 
page
( isViewPage && uri.query.veaction in 
editModes ) ||
// … or if on ?action=edit in single 
edit mode and the user wants it
(
@@ -802,8 +803,19 @@

mw.config.get( 'wgAction' ) !== 'submit'
) ||
(
+   
tabPreference === 'prefer-wte' &&
+   
conf.enableWikitext &&
+   
mw.user.options.get( 'visualeditor-newwikitext' )
+   ) ||
+   (

tabPreference === 'remember-last' &&
-   
getLastEditor() !== 'wikitext'
+   
(
+   
getLastEditor() !== 'wikitext' ||
+   
(
+   
conf.enableWikitext &&
+   
mw.user.options.get( 'visualeditor-newwikitext' )
+   
)
+   
)
)
)
)
@@ -815,7 +827,24 @@
type: uri.query.vesection === 
undefined ? 'page' : 'section',
mechanism: 'url'
} );
-   activateTarget( editModes[ 
uri.query.veaction ] );
+   if ( isViewPage && uri.query.veaction 
in editModes ) {
+   activateTarget( editModes[ 
uri.query.veaction ] );
+   } else {
+   if (
+   conf.enableWikitext &&
+   mw.user.options.get( 
'visualeditor-newwikitext' ) &&
+   (
+

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add config for units on Wikidata

2016-09-16 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311206

Change subject: Add config for units on Wikidata
..

Add config for units on Wikidata

Change-Id: Ia3a8e8a64eff0a1a377b1789170c71e1d15cb62a
---
M wmf-config/Wikibase-production.php
A wmf-config/unitConfig.json
2 files changed, 759 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/06/311206/1

diff --git a/wmf-config/Wikibase-production.php 
b/wmf-config/Wikibase-production.php
index 497d168..f082eb6 100644
--- a/wmf-config/Wikibase-production.php
+++ b/wmf-config/Wikibase-production.php
@@ -88,6 +88,13 @@
$wgWBClientSettings['repoConceptBaseUri'] = 
'http://www.wikidata.org/entity/';
$wgArticlePlaceholderImageProperty = 'P18';
}
+   
+   if ( $wgDBname === 'wikidatawiki' ) {
+   $wgWBRepoSettings['unitStorage'] = [
+   'class' => '\\Wikibase\\Lib\\JsonUnitStorage', 
+   'args' => [ __DIR__ . '/unitConfig.json']
+   ];
+   }
 
$wgWBClientSettings['badgeClassNames'] = [
'Q17437796' => 'badge-featuredarticle',
diff --git a/wmf-config/unitConfig.json b/wmf-config/unitConfig.json
new file mode 100644
index 000..68cc809
--- /dev/null
+++ b/wmf-config/unitConfig.json
@@ -0,0 +1,752 @@
+{
+"Q613726": {
+"factor": "10",
+"unit": "Q11570",
+"label": "yottagram",
+"siLabel": "kilogram"
+},
+"Q177974": {
+"factor": "101325",
+"unit": "Q44395",
+"label": "atmosphere",
+"siLabel": "pascal"
+},
+"Q211256": {
+"factor": "0.44704",
+"unit": "Q182429",
+"label": "miles per hour",
+"siLabel": "metre per second"
+},
+"Q2483628": {
+"factor": "0.01",
+"unit": "Q11574",
+"label": "attosecond",
+"siLabel": "second"
+},
+"Q26162541": {
+"factor": "1",
+"unit": "Q26162541",
+"label": "square meter per second",
+"siLabel": "square meter per second"
+},
+"Q26162545": {
+"factor": "1",
+"unit": "Q26162545",
+"label": "square centimetre per second",
+"siLabel": "square centimetre per second"
+},
+"Q844211": {
+"factor": "1",
+"unit": "Q844211",
+"label": "kilogram per cubic metre",
+"siLabel": "kilogram per cubic metre"
+},
+"Q180154": {
+"factor": "0.278",
+"unit": "Q182429",
+"label": "kilometre per hour",
+"siLabel": "metre per second"
+},
+"Q182429": {
+"factor": "1",
+"unit": "Q182429",
+"label": "metre per second",
+"siLabel": "metre per second"
+},
+"Q21064807": {
+"factor": "1000",
+"unit": "Q44395",
+"label": "kilopascal",
+"siLabel": "pascal"
+},
+"Q215571": {
+"factor": "1",
+"unit": "Q215571",
+"label": "newton metre",
+"siLabel": "newton metre"
+},
+"Q6859652": {
+"factor": "133.322387415",
+"unit": "Q44395",
+"label": "millimeter of mercury",
+"siLabel": "pascal"
+},
+"Q13147228": {
+"factor": "1",
+"unit": "Q13147228",
+"label": "gram per cubic centimetre",
+"siLabel": "gram per cubic centimetre"
+},
+"Q6982035": {
+"factor": "100",
+"unit": "Q25236",
+"label": "megawatt",
+"siLabel": "watt"
+},
+"Q13035094": {
+"factor": "1",
+"unit": "Q13035094",
+"label": "joule per mole",
+"siLabel": "joule per mole"
+},
+"Q3320608": {
+"factor": "1000",
+"unit": "Q25236",
+"label": "kilowatt",
+"siLabel": "watt"
+},
+"Q4243638": {
+"factor": "10",
+"unit": "Q25517",
+"label": "cubic kilometre",
+"siLabel": "cubic metre"
+},
+"Q185648": {
+"factor": "133.322387415",
+"unit": "Q44395",
+"label": "torr",
+"siLabel": "pascal"
+},
+"Q128822": {
+"factor": "0.51",
+"unit": "Q182429",
+"label": "knot",
+"siLabel": "metre per second"
+},
+"Q2489298": {
+"factor": "1",
+"unit": "Q2489298",
+"label": "square centimetre",
+"siLabel": "square centimetre"
+},
+"Q100995": {
+"factor": "0.45359237",
+"unit": "Q11570",
+"label": "pound",
+"siLabel": "kilogram"
+},
+"Q857027": {
+"factor": "0.09290304",
+"unit": "Q25343",
+"label": "square foot",
+"siLabel": "square metre"
+},
+"Q218593": {
+"factor": "0.0254",
+"unit": "Q11573",
+ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Rename domain => localDomain in LBFactory for consistency

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Rename domain => localDomain in LBFactory for consistency
..


Rename domain => localDomain in LBFactory for consistency

Change-Id: I2fb66f98dddb4acc38958a7b8beec002970d43f7
---
M includes/db/loadbalancer/LBFactoryMW.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/db/loadbalancer/LBFactoryMW.php 
b/includes/db/loadbalancer/LBFactoryMW.php
index 33c48a5..2fb48c7 100644
--- a/includes/db/loadbalancer/LBFactoryMW.php
+++ b/includes/db/loadbalancer/LBFactoryMW.php
@@ -40,7 +40,7 @@
global $wgCommandLineMode;
 
$defaults = [
-   'domain' => wfWikiID(),
+   'localDomain' => wfWikiID(),
'hostname' => wfHostname(),
'trxProfiler' => 
Profiler::instance()->getTransactionProfiler(),
'replLogger' => LoggerFactory::getInstance( 
'DBReplication' ),
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index 107a7e2..b6f3317 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -50,7 +50,7 @@
protected $wanCache;
 
/** @var string Local domain */
-   protected $domain;
+   protected $localDomain;
/** @var string Local hostname of the app server */
protected $hostname;
/** @var mixed */
@@ -79,7 +79,7 @@
 * @param array $conf
 */
public function __construct( array $conf ) {
-   $this->domain = isset( $conf['domain'] ) ? $conf['domain'] : '';
+   $this->localDomain = isset( $conf['localDomain'] ) ? 
$conf['localDomain'] : '';
 
if ( isset( $conf['readOnlyReason'] ) && is_string( 
$conf['readOnlyReason'] ) ) {
$this->readOnlyReason = $conf['readOnlyReason'];
@@ -608,7 +608,7 @@
 */
final protected function baseLoadBalancerParams() {
return [
-   'localDomain' => $this->domain,
+   'localDomain' => $this->localDomain,
'readOnlyReason' => $this->readOnlyReason,
'srvCache' => $this->srvCache,
'wanCache' => $this->wanCache,
@@ -641,7 +641,7 @@
 * @since 1.28
 */
public function setDomainPrefix( $domain ) {
-   $this->domain = $domain;
+   $this->localDomain = $domain;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/311169
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fb66f98dddb4acc38958a7b8beec002970d43f7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt/icinga: fix permissions to run plugin script

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: salt/icinga: fix permissions to run plugin script
..


salt/icinga: fix permissions to run plugin script

Change-Id: I4718170cf687ed9f1410e6cde0417eca3802148f
---
M modules/salt/manifests/monitoring.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/salt/manifests/monitoring.pp 
b/modules/salt/manifests/monitoring.pp
index c2974e1..b9dde9b 100644
--- a/modules/salt/manifests/monitoring.pp
+++ b/modules/salt/manifests/monitoring.pp
@@ -5,7 +5,7 @@
 
 file { $check_unaccepted_keys:
 ensure => present,
-mode   => '0550',
+mode   => '0555',
 owner  => 'root',
 group  => 'root',
 source => 'puppet:///modules/salt/check_unaccepted_keys',

-- 
To view, visit https://gerrit.wikimedia.org/r/311205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4718170cf687ed9f1410e6cde0417eca3802148f
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt/icinga: fix permissions to run plugin script

2016-09-16 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311205

Change subject: salt/icinga: fix permissions to run plugin script
..

salt/icinga: fix permissions to run plugin script

Change-Id: I4718170cf687ed9f1410e6cde0417eca3802148f
---
M modules/salt/manifests/monitoring.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/05/311205/1

diff --git a/modules/salt/manifests/monitoring.pp 
b/modules/salt/manifests/monitoring.pp
index c2974e1..b9dde9b 100644
--- a/modules/salt/manifests/monitoring.pp
+++ b/modules/salt/manifests/monitoring.pp
@@ -5,7 +5,7 @@
 
 file { $check_unaccepted_keys:
 ensure => present,
-mode   => '0550',
+mode   => '0555',
 owner  => 'root',
 group  => 'root',
 source => 'puppet:///modules/salt/check_unaccepted_keys',

-- 
To view, visit https://gerrit.wikimedia.org/r/311205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4718170cf687ed9f1410e6cde0417eca3802148f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt: add Icinga plugin to check for unaccepted keys

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: salt: add Icinga plugin to check for unaccepted keys
..


salt: add Icinga plugin to check for unaccepted keys

Add an Icinga plugin script to check for unaccepted
salt keys and install it on the master via the salt module.

Needs sudo to run salt-key. Fails if it can't get the key list,
otherwise counts them and alerts if >= 1.

Bug: T144801
Change-Id: If15055ca58673b12dfa0f64f214fece7335d1085
---
A modules/salt/files/check_unaccepted_keys
M modules/salt/manifests/master.pp
A modules/salt/manifests/monitoring.pp
3 files changed, 52 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/salt/files/check_unaccepted_keys 
b/modules/salt/files/check_unaccepted_keys
new file mode 100755
index 000..bcc1520
--- /dev/null
+++ b/modules/salt/files/check_unaccepted_keys
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Icinga plugin to check for unaccepted salt keys (T144801)
+# Daniel Zahn - Wikimedia Foundation Inc.
+
+key_list=$(sudo /usr/bin/salt-key -l un)
+
+if ! echo $key_list | grep -q Unaccepted ; then
+echo "UNKNOWN - failed to get key list"
+exit 3
+fi
+
+num_keys=$(echo $key_list | grep -v Unaccepted | wc -l)
+
+# echo $key_list
+# echo "There are ${num_keys} unaccepted keys"
+
+if [[ $num_keys -gt 0 ]] ; then
+echo "CRITICAL - ${num_keys} unaccepted salt keys"
+exit 2
+elif [[ $num_keys -eq 0 ]] ; then
+echo "OK - No unaccepted salt keys"
+exit 0
+fi
+
+echo "UNKOWN - check plugin script"
+exit 3
+
diff --git a/modules/salt/manifests/master.pp b/modules/salt/manifests/master.pp
index c3d0e25..ed85cbc 100644
--- a/modules/salt/manifests/master.pp
+++ b/modules/salt/manifests/master.pp
@@ -90,4 +90,5 @@
 }
 
 include salt::orchestration
+include salt::monitoring
 }
diff --git a/modules/salt/manifests/monitoring.pp 
b/modules/salt/manifests/monitoring.pp
new file mode 100644
index 000..c2974e1
--- /dev/null
+++ b/modules/salt/manifests/monitoring.pp
@@ -0,0 +1,24 @@
+# Let Icinga check for unaccepted salt keys (T144801)
+class salt::monitoring() {
+
+$check_unaccepted_keys = 
'/usr/local/lib/nagios/plugins/check_unaccepted_keys'
+
+file { $check_unaccepted_keys:
+ensure => present,
+mode   => '0550',
+owner  => 'root',
+group  => 'root',
+source => 'puppet:///modules/salt/check_unaccepted_keys',
+}
+
+sudo::user { 'nagios_unaccepted_keys':
+user   => 'nagios',
+privileges => ["ALL = NOPASSWD: ${check_unaccepted_keys}"],
+}
+
+nrpe::monitor_service { 'salt_unaccepted_keys':
+description  => 'unaccepted salt keys',
+nrpe_command => $check_unaccepted_keys,
+}
+
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/311079
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If15055ca58673b12dfa0f64f214fece7335d1085
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix type doc in StatusValue

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311204

Change subject: Fix type doc in StatusValue
..

Fix type doc in StatusValue

Change-Id: Ib0a3282083b2fd08ea76022b74b21b55da9b8a46
---
M includes/libs/StatusValue.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/311204/1

diff --git a/includes/libs/StatusValue.php b/includes/libs/StatusValue.php
index 1d23f9d..baa4e22 100644
--- a/includes/libs/StatusValue.php
+++ b/includes/libs/StatusValue.php
@@ -246,8 +246,8 @@
 * Note, due to the lack of tools for comparing IStatusMessage objects, 
this
 * function will not work when using such an object as the search 
parameter.
 *
-* @param IStatusMessage|string $source Message key or object to search 
for
-* @param IStatusMessage|string $dest Replacement message key or object
+* @param MessageSpecifier|string $source Message key or object to 
search for
+* @param MessageSpecifier|string $dest Replacement message key or 
object
 * @return bool Return true if the replacement was done, false 
otherwise.
 */
public function replaceMessage( $source, $dest ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/311204
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0a3282083b2fd08ea76022b74b21b55da9b8a46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] Make Status extend StatusValue and start FileBackend u...

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311203

Change subject: [WIP] Make Status extend StatusValue and start FileBackend 
update
..

[WIP] Make Status extend StatusValue and start FileBackend update

* This avoids code duplication.
* Callers can safely start type-hinting StatusValue as well.
* The docs and type-hints in /filebackend are updated as an example.
* A migration pattern is to inject a StatusValue wrapper
  into the backend and use it on all returned statuses, so MediaWiki
  will still get Status for message methods.

Change-Id: Iff9255f34870ea6b0c4b91f6ddc69eea95186aba
---
M includes/Status.php
M includes/filebackend/FSFileBackend.php
M includes/filebackend/FileBackend.php
M includes/filebackend/FileBackendMultiWrite.php
M includes/filebackend/FileBackendStore.php
M includes/filebackend/FileOp.php
M includes/filebackend/FileOpBatch.php
M includes/filebackend/MemoryFileBackend.php
M includes/filebackend/SwiftFileBackend.php
M includes/filebackend/filejournal/DBFileJournal.php
M includes/filebackend/filejournal/FileJournal.php
M includes/filebackend/lockmanager/FSLockManager.php
M includes/filebackend/lockmanager/LockManager.php
M includes/filebackend/lockmanager/MemcLockManager.php
M includes/filebackend/lockmanager/MySqlLockManager.php
M includes/filebackend/lockmanager/PostgreSqlLockManager.php
M includes/filebackend/lockmanager/QuorumLockManager.php
M includes/filebackend/lockmanager/ScopedLock.php
18 files changed, 305 insertions(+), 452 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/311203/1

diff --git a/includes/Status.php b/includes/Status.php
index e578873..760ab17 100644
--- a/includes/Status.php
+++ b/includes/Status.php
@@ -37,10 +37,7 @@
  * developer of the calling code is reminded that the function can fail, and
  * so that a lack of error-handling will be explicit.
  */
-class Status {
-   /** @var StatusValue */
-   protected $sv;
-
+class Status extends StatusValue {
/** @var mixed */
public $value;
/** @var array Map of (key => bool) to indicate success of each part of 
batch operations */
@@ -57,12 +54,12 @@
 * @param StatusValue $sv [optional]
 */
public function __construct( StatusValue $sv = null ) {
-   $this->sv = ( $sv === null ) ? new StatusValue() : $sv;
-   // B/C field aliases
-   $this->value =& $this->sv->value;
-   $this->successCount =& $this->sv->successCount;
-   $this->failCount =& $this->sv->failCount;
-   $this->success =& $this->sv->success;
+   if ( $sv ) {
+   $this->value =& $sv->value;
+   $this->successCount =& $sv->successCount;
+   $this->failCount =& $sv->failCount;
+   $this->success =& $sv->success;
+   }
}
 
/**
@@ -81,95 +78,12 @@
}
 
/**
-* Factory function for fatal errors
-*
-* @param string|Message $message Message name or object
-* @return Status
-*/
-   public static function newFatal( $message /*, parameters...*/ ) {
-   return new self( call_user_func_array(
-   [ 'StatusValue', 'newFatal' ], func_get_args()
-   ) );
-   }
-
-   /**
-* Factory function for good results
-*
-* @param mixed $value
-* @return Status
-*/
-   public static function newGood( $value = null ) {
-   $sv = new StatusValue();
-   $sv->value = $value;
-
-   return new self( $sv );
-   }
-
-   /**
-* Change operation result
-*
-* @param bool $ok Whether the operation completed
-* @param mixed $value
-*/
-   public function setResult( $ok, $value = null ) {
-   $this->sv->setResult( $ok, $value );
-   }
-
-   /**
 * Returns the wrapped StatusValue object
 * @return StatusValue
 * @since 1.27
 */
public function getStatusValue() {
-   return $this->sv;
-   }
-
-   /**
-* Returns whether the operation completed and didn't have any error or
-* warnings
-*
-* @return bool
-*/
-   public function isGood() {
-   return $this->sv->isGood();
-   }
-
-   /**
-* Returns whether the operation completed
-*
-* @return bool
-*/
-   public function isOK() {
-   return $this->sv->isOK();
-   }
-
-   /**
-* Add a new warning
-*
-* @param string|Message $message Message name or object
-*/
-   public function warning( $message /*, parameters... */ ) {
-   call_user_func_array( [ $this->sv, 'warning' ], 

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Fixup some docblocks

2016-09-16 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311202

Change subject: Fixup some docblocks
..

Fixup some docblocks

array() -> []

Minor trivial cleanup

Change-Id: I95735f928d3e5d6ac9d2a10d92b40ed01cf2737c
---
M OATHAuth.alias.php
M OATHAuth.hooks.legacy.php
M OATHAuth.hooks.php
M OATHAuthKey.php
M OATHAuthUtils.php
M OATHUser.php
M OATHUserRepository.php
M auth/TOTPAuthenticationRequest.php
M auth/TOTPSecondaryAuthenticationProvider.php
M modules/jquery.qrcode.js
M special/ProxySpecialPage.php
M special/SpecialOATHDisable.php
M special/SpecialOATHEnable.php
M special/SpecialOATHLogin.php
14 files changed, 113 insertions(+), 107 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/02/311202/1

diff --git a/OATHAuth.alias.php b/OATHAuth.alias.php
index e454fd8..4de0434 100644
--- a/OATHAuth.alias.php
+++ b/OATHAuth.alias.php
@@ -7,39 +7,39 @@
  */
 // @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
-$specialPageAliases['en'] = array(
-   'OATH' => array( 'OATH', 'OATHAuth' ),
-);
+$specialPageAliases['en'] = [
+   'OATH' => [ 'OATH', 'OATHAuth' ],
+];
 
 /** Arabic (العربية) */
-$specialPageAliases['ar'] = array(
-   'OATH' => array( 'أواث', 'أواث_أوث' ),
-);
+$specialPageAliases['ar'] = [
+   'OATH' => [ 'أواث', 'أواث_أوث' ],
+];
 
 /** Egyptian Arabic (مصرى) */
-$specialPageAliases['arz'] = array(
-   'OATH' => array( 'اواث', 'اواث_اوث' ),
-);
+$specialPageAliases['arz'] = [
+   'OATH' => [ 'اواث', 'اواث_اوث' ],
+];
 
 /** Northern Luri (لۊری شومالی) */
-$specialPageAliases['lrc'] = array(
-   'OATH' => array( 'قأسأم' ),
-);
+$specialPageAliases['lrc'] = [
+   'OATH' => [ 'قأسأم' ],
+];
 
 /** Urdu (اردو) */
-$specialPageAliases['ur'] = array(
-   'OATH' => array( 'حلف_نامہ' ),
-);
+$specialPageAliases['ur'] = [
+   'OATH' => [ 'حلف_نامہ' ],
+];
 
 /** Simplified Chinese (中文(简体)‎) */
-$specialPageAliases['zh-hans'] = array(
-   'OATH' => array( 'OATH验证' ),
-);
+$specialPageAliases['zh-hans'] = [
+   'OATH' => [ 'OATH验证' ],
+];
 
 /** Traditional Chinese (中文(繁體)‎) */
-$specialPageAliases['zh-hant'] = array(
-   'OATH' => array( 'OATH_認證' ),
-);
\ No newline at end of file
+$specialPageAliases['zh-hant'] = [
+   'OATH' => [ 'OATH_認證' ],
+];
\ No newline at end of file
diff --git a/OATHAuth.hooks.legacy.php b/OATHAuth.hooks.legacy.php
index dbe0a9f..d62b3ec 100644
--- a/OATHAuth.hooks.legacy.php
+++ b/OATHAuth.hooks.legacy.php
@@ -10,7 +10,7 @@
 * @return bool
 */
static function ChangePasswordForm( &$extraFields ) {
-   $tokenField = array( 'wpOATHToken', 'oathauth-token', 
'password', '' );
+   $tokenField = [ 'wpOATHToken', 'oathauth-token', 'password', '' 
];
array_push( $extraFields, $tokenField );
 
return true;
diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index d500a6e..4812e45 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -2,8 +2,6 @@
 
 use MediaWiki\Auth\AuthenticationRequest;
 use MediaWiki\Auth\AuthManager;
-use MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider;
-use MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider;
 
 /**
  * Hooks for Extension:OATHAuth
@@ -119,18 +117,17 @@
$title = SpecialPage::getTitleFor( 'OATH' );
$msg = $oathUser->getKey() !== null ? 'oathauth-disable' : 
'oathauth-enable';
 
-   $preferences[$msg] = array(
+   $preferences[$msg] = [
'type' => 'info',
'raw' => 'true',
'default' => Linker::link(
$title,
wfMessage( $msg )->escaped(),
-   array(),
-   array( 'returnto' => SpecialPage::getTitleFor( 
'Preferences' )->getPrefixedText() )
+   [],
+   [ 'returnto' => SpecialPage::getTitleFor( 
'Preferences' )->getPrefixedText() ]
),
'label-message' => 'oathauth-prefs-label',
-   'section' => 'personal/info',
-   );
+   'section' => 'personal/info', ];
 
return true;
}
@@ -145,7 +142,7 @@
case 'mysql':
case 'sqlite':
$updater->addExtensionTable( 'oathauth_users', 
"$base/sql/mysql/tables.sql" );
-   $updater->addExtensionUpdate( array( array( 
__CLASS__, 'schemaUpdateOldUsersFromInstaller' ) ) );
+   $updater->addExtensionUpdate( [ [ __CLASS__, 
'schemaUpdateOldUsersFromInstaller' ] ] );

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Suppress unserialize errors

2016-09-16 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311201

Change subject: Suppress unserialize errors
..

Suppress unserialize errors

Bug: T130740
Change-Id: I20b076b7f3ce15d31a21f8935b74f9121f70c5a3
---
M OATHAuth.hooks.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/01/311201/1

diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index d500a6e..ca82423 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -186,7 +186,9 @@
);
 
foreach ( $res as $row ) {
+   MediaWiki\suppressWarnings();
$scratchTokens = unserialize( base64_decode( 
$row->scratch_tokens ) );
+   MediaWiki\restoreWarnings();
if ( $scratchTokens ) {
$db->update(
'oathauth_users',

-- 
To view, visit https://gerrit.wikimedia.org/r/311201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20b076b7f3ce15d31a21f8935b74f9121f70c5a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: We need a master to do write actions...

2016-09-16 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311200

Change subject: We need a master to do write actions...
..

We need a master to do write actions...

Change-Id: I618d371cdf76d96370c65975db702ed2fef0579c
---
M maintenance/update_scratch_token_format.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/00/311200/1

diff --git a/maintenance/update_scratch_token_format.php 
b/maintenance/update_scratch_token_format.php
index 1f35319..5457f5e 100644
--- a/maintenance/update_scratch_token_format.php
+++ b/maintenance/update_scratch_token_format.php
@@ -42,8 +42,8 @@
}
 
public function execute() {
-   $dbr = wfGetDB( DB_SLAVE );
-   if ( !OATHAuthHooks::schemaUpdateOldUsers( $dbr ) ) {
+   $dbw = $this->getDB( DB_MASTER );
+   if ( !OATHAuthHooks::schemaUpdateOldUsers( $dbw ) ) {
$this->error( "Failed to update scratch_token rows.\n", 
1);
}
$this->output( "Done.\n" );

-- 
To view, visit https://gerrit.wikimedia.org/r/311200
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I618d371cdf76d96370c65975db702ed2fef0579c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Memoize isWideScreen()

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Memoize isWideScreen()
..


Memoize isWideScreen()

It is called multiple times, and each call triggers a reflow.

Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
---
M resources/mobile.browser/browser.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mobile.browser/browser.js 
b/resources/mobile.browser/browser.js
index 1da3cce..b6ec417 100644
--- a/resources/mobile.browser/browser.js
+++ b/resources/mobile.browser/browser.js
@@ -108,11 +108,11 @@
 * @method
 * @return {Boolean}
 */
-   isWideScreen: function () {
+   isWideScreen: memoize( function () {
var val = parseInt( mw.config.get( 
'wgMFDeviceWidthTablet' ), 10 );
// Check portrait and landscape mode to be consistent
return window.innerWidth >= val || window.innerHeight 
>= val;
-   },
+   } ),
/**
 * Checks browser support for a given CSS property
 * @param {String} [property] the name of the property being 
tested

-- 
To view, visit https://gerrit.wikimedia.org/r/311199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Memoize isWideScreen()

2016-09-16 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311199

Change subject: Memoize isWideScreen()
..

Memoize isWideScreen()

It is called multiple times, and each call triggers a reflow.

Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
---
M resources/mobile.browser/browser.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/99/311199/1

diff --git a/resources/mobile.browser/browser.js 
b/resources/mobile.browser/browser.js
index 1da3cce..b6ec417 100644
--- a/resources/mobile.browser/browser.js
+++ b/resources/mobile.browser/browser.js
@@ -108,11 +108,11 @@
 * @method
 * @return {Boolean}
 */
-   isWideScreen: function () {
+   isWideScreen: memoize( function () {
var val = parseInt( mw.config.get( 
'wgMFDeviceWidthTablet' ), 10 );
// Check portrait and landscape mode to be consistent
return window.innerWidth >= val || window.innerHeight 
>= val;
-   },
+   } ),
/**
 * Checks browser support for a given CSS property
 * @param {String} [property] the name of the property being 
tested

-- 
To view, visit https://gerrit.wikimedia.org/r/311199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Remove primary link from the bundle of page linked notification

2016-09-16 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311198

Change subject: Remove primary link from the bundle of page linked notification
..

Remove primary link from the bundle of page linked notification

Bug: T145902
Change-Id: I456bf76a7bd531ffcad5462708f37cd54d8af99d
---
M includes/formatters/PageLinkedPresentationModel.php
1 file changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/98/311198/1

diff --git a/includes/formatters/PageLinkedPresentationModel.php 
b/includes/formatters/PageLinkedPresentationModel.php
index df9d757..bf7f73d 100644
--- a/includes/formatters/PageLinkedPresentationModel.php
+++ b/includes/formatters/PageLinkedPresentationModel.php
@@ -22,10 +22,14 @@
}
 
public function getPrimaryLink() {
-   return array(
-   'url' => $this->getPageFrom()->getFullURL(),
-   'label' => $this->msg( 
'notification-link-text-view-page' )->text(),
-   );
+   if ( $this->isBundled() ) {
+   return false;
+   } else {
+   return array(
+   'url' => $this->getPageFrom()->getFullURL(),
+   'label' => $this->msg( 
'notification-link-text-view-page' )->text(),
+   );
+   }
}
 
public function getSecondaryLinks() {

-- 
To view, visit https://gerrit.wikimedia.org/r/311198
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I456bf76a7bd531ffcad5462708f37cd54d8af99d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Blacklist minerva from showing Related Articles in the footer

2016-09-16 Thread Bmansurov (Code Review)
Bmansurov has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311197

Change subject: Blacklist minerva from showing Related Articles in the footer
..

Blacklist minerva from showing Related Articles in the footer

See I1663ab25083d9d907f288e60d506831bebb67945.

Bug: T144912
Change-Id: Ie4ac3c11e81eeea9f5b4a7161a64477cb5d60f07
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/97/311197/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 636022c..053d4b8 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2790,6 +2790,7 @@
 
if ( $wmgRelatedArticlesShowInFooter ) {
wfLoadExtension( 'Cards' );
+   $wgRelatedArticlesFooterBlacklistedSkins = 
$wmgRelatedArticlesFooterBlacklistedSkins;
$wgRelatedArticlesShowInSidebar = false;
$wgRelatedArticlesShowInFooter = true;
$wgRelatedArticlesLoggingSamplingRate = 0.01;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 127b806..0418aa9 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -16101,6 +16101,10 @@
'frwikinews' => true, // T143480
 ],
 
+'wmgRelatedArticlesFooterBlacklistedSkins' => [
+   'default' => [ 'minerva' ]
+],
+
 'wmgUseRelatedSites' => [
'default' => false,
'wikivoyage' => true,

-- 
To view, visit https://gerrit.wikimedia.org/r/311197
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4ac3c11e81eeea9f5b4a7161a64477cb5d60f07
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Bmansurov 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Minor refactoring of CLI part

2016-09-16 Thread Seb35 (Code Review)
Seb35 has submitted this change and it was merged.

Change subject: Minor refactoring of CLI part
..


Minor refactoring of CLI part

Code:
* Create an abstract class AbstractMediaWikiFarmScript containing 
general-purpose
  methods and a real class MediaWikiFarmScript directly used by 
'bin/mwscript.php';
  the abstract class will be useful for another script in development about 
handling
  Composer-installed extensions

Bugs:
* Scripts in composer.json was in wrong (old) directory 'scripts'

Change-Id: I50e475b249a74b976b226215e652ab6552742244
---
M bin/mwscript.php
M composer.json
M phpcs.xml
R src/AbstractMediaWikiFarmScript.php
A src/MediaWikiFarmScript.php
R tests/phpunit/MediaWikiFarmScriptTest.php
6 files changed, 240 insertions(+), 117 deletions(-)

Approvals:
  Seb35: Verified; Looks good to me, approved



diff --git a/bin/mwscript.php b/bin/mwscript.php
index c1952f3..0cc21ee 100644
--- a/bin/mwscript.php
+++ b/bin/mwscript.php
@@ -1,6 +1,6 @@
 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
@@ -14,7 +14,7 @@
 }
 
 # Load classes
-require_once dirname( dirname( __FILE__ ) ) . '/src/Script.php';
+require_once dirname( dirname( __FILE__ ) ) . '/src/MediaWikiFarmScript.php';
 
 # Prepare environment
 $wgMediaWikiFarmScript = new MediaWikiFarmScript( $argc, $argv );
diff --git a/composer.json b/composer.json
index 8feeb8e..7eb1384 100644
--- a/composer.json
+++ b/composer.json
@@ -22,9 +22,14 @@
"mediawiki/mediawiki-codesniffer": "*"
},
"scripts": {
-   "validate-schema": "php ./scripts/validate-schema.php",
-   "phpdoc": "./vendor/bin/phpdoc -d src,scripts -e php,php.txt -t 
./docs/code",
-   "parallel-lint": "./vendor/bin/parallel-lint --exclude vendor 
.",
-   "phpcs": "phpcs -p -s"
+   "validate-schema": "php ./bin/validate-schema.php",
+   "lint": "parallel-lint --exclude vendor .",
+   "phpcs": "phpcs -p -s",
+   "phpdoc": "phpdoc -d bin,src -t ./docs/code",
+   "test": [
+   "composer lint",
+   "composer phpcs",
+   "composer phpdoc"
+   ]
}
 }
diff --git a/phpcs.xml b/phpcs.xml
index c52652f..6224889 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -23,6 +23,11 @@



+   
+   
+   
+   
+   


tests/perfs/results
diff --git a/src/Script.php b/src/AbstractMediaWikiFarmScript.php
similarity index 61%
rename from src/Script.php
rename to src/AbstractMediaWikiFarmScript.php
index 17774c5..1c0e972 100644
--- a/src/Script.php
+++ b/src/AbstractMediaWikiFarmScript.php
@@ -7,13 +7,17 @@
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
 
+// @codeCoverageIgnoreStart
+require_once dirname( __FILE__ ) . '/MediaWikiFarm.php';
+// @codeCoverageIgnoreEnd
+
 /**
  * This class contains the major part of the script utility, mainly in the 
main() method.
  * Using a class instead of a raw script it better for testability purposes 
and to use
  * less global variables (in fact none; the only global variable written are 
for
  * compatibility purposes, e.g. PHPUnit expects $_SERVER['argv']).
  */
-class MediaWikiFarmScript {
+abstract class AbstractMediaWikiFarmScript {
 
/** @var int Number of input arguments. */
public $argc = 0;
@@ -21,11 +25,14 @@
/** @var string[] Input arguments. */
public $argv = array();
 
+   /** @var string Short usage, displayed on request or error. */
+   public $shortUsage = '';
+
+   /** @var string Long usage, displayed on request. */
+   public $longUsage = '';
+
/** @var string Host name. */
public $host = '';
-
-   /** @var string Script name. */
-   public $script = '';
 
/** @var int Status. */
public $status = 0;
@@ -35,7 +42,7 @@
 *
 * @param int $argc Number of input arguments.
 * @param string[] $argv Input arguments.
-* @return MediaWikiFarmScript
+* @return AbstractMediaWikiFarmScript
 */
function __construct( $argc, $argv ) {
 
@@ -97,47 +104,26 @@
}
 
/**
-* Display help and return success or error.
+* Display help.
 *
-* @mediawikifarm-const
-* @mediawikifarm-idempotent
-*
-* @param bool $error Return an error code?
-* @return void
+* @param bool $long Show extended usage.
+* @return void.
 */
-   function usage( $error = true ) {
-
-   $fullPath = realpath( $this->argv[0] );
+   function usage( $long = false ) {
 
# Minimal help, be it an error or not
-   echo <

[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Minor refactoring of CLI part

2016-09-16 Thread Seb35 (Code Review)
Seb35 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311196

Change subject: Minor refactoring of CLI part
..

Minor refactoring of CLI part

Code:
* Create an abstract class AbstractMediaWikiFarmScript containing 
general-purpose
  methods and a real class MediaWikiFarmScript directly used by 
'bin/mwscript.php';
  the abstract class will be useful for another script in development about 
handling
  Composer-installed extensions

Bugs:
* Scripts in composer.json was in wrong (old) directory 'scripts'

Change-Id: I50e475b249a74b976b226215e652ab6552742244
---
M bin/mwscript.php
M composer.json
M phpcs.xml
R src/AbstractMediaWikiFarmScript.php
A src/MediaWikiFarmScript.php
R tests/phpunit/MediaWikiFarmScriptTest.php
6 files changed, 240 insertions(+), 117 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/96/311196/1

diff --git a/bin/mwscript.php b/bin/mwscript.php
index c1952f3..0cc21ee 100644
--- a/bin/mwscript.php
+++ b/bin/mwscript.php
@@ -1,6 +1,6 @@
 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
@@ -14,7 +14,7 @@
 }
 
 # Load classes
-require_once dirname( dirname( __FILE__ ) ) . '/src/Script.php';
+require_once dirname( dirname( __FILE__ ) ) . '/src/MediaWikiFarmScript.php';
 
 # Prepare environment
 $wgMediaWikiFarmScript = new MediaWikiFarmScript( $argc, $argv );
diff --git a/composer.json b/composer.json
index 8feeb8e..7eb1384 100644
--- a/composer.json
+++ b/composer.json
@@ -22,9 +22,14 @@
"mediawiki/mediawiki-codesniffer": "*"
},
"scripts": {
-   "validate-schema": "php ./scripts/validate-schema.php",
-   "phpdoc": "./vendor/bin/phpdoc -d src,scripts -e php,php.txt -t 
./docs/code",
-   "parallel-lint": "./vendor/bin/parallel-lint --exclude vendor 
.",
-   "phpcs": "phpcs -p -s"
+   "validate-schema": "php ./bin/validate-schema.php",
+   "lint": "parallel-lint --exclude vendor .",
+   "phpcs": "phpcs -p -s",
+   "phpdoc": "phpdoc -d bin,src -t ./docs/code",
+   "test": [
+   "composer lint",
+   "composer phpcs",
+   "composer phpdoc"
+   ]
}
 }
diff --git a/phpcs.xml b/phpcs.xml
index c52652f..6224889 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -23,6 +23,11 @@



+   
+   
+   
+   
+   


tests/perfs/results
diff --git a/src/Script.php b/src/AbstractMediaWikiFarmScript.php
similarity index 61%
rename from src/Script.php
rename to src/AbstractMediaWikiFarmScript.php
index 17774c5..1c0e972 100644
--- a/src/Script.php
+++ b/src/AbstractMediaWikiFarmScript.php
@@ -7,13 +7,17 @@
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  */
 
+// @codeCoverageIgnoreStart
+require_once dirname( __FILE__ ) . '/MediaWikiFarm.php';
+// @codeCoverageIgnoreEnd
+
 /**
  * This class contains the major part of the script utility, mainly in the 
main() method.
  * Using a class instead of a raw script it better for testability purposes 
and to use
  * less global variables (in fact none; the only global variable written are 
for
  * compatibility purposes, e.g. PHPUnit expects $_SERVER['argv']).
  */
-class MediaWikiFarmScript {
+abstract class AbstractMediaWikiFarmScript {
 
/** @var int Number of input arguments. */
public $argc = 0;
@@ -21,11 +25,14 @@
/** @var string[] Input arguments. */
public $argv = array();
 
+   /** @var string Short usage, displayed on request or error. */
+   public $shortUsage = '';
+
+   /** @var string Long usage, displayed on request. */
+   public $longUsage = '';
+
/** @var string Host name. */
public $host = '';
-
-   /** @var string Script name. */
-   public $script = '';
 
/** @var int Status. */
public $status = 0;
@@ -35,7 +42,7 @@
 *
 * @param int $argc Number of input arguments.
 * @param string[] $argv Input arguments.
-* @return MediaWikiFarmScript
+* @return AbstractMediaWikiFarmScript
 */
function __construct( $argc, $argv ) {
 
@@ -97,47 +104,26 @@
}
 
/**
-* Display help and return success or error.
+* Display help.
 *
-* @mediawikifarm-const
-* @mediawikifarm-idempotent
-*
-* @param bool $error Return an error code?
-* @return void
+* @param bool $long Show extended usage.
+* @return void.
 */
-   function usage( $error = true ) {
-
-   $fullPath = realpath( $this->argv[0] );
+   function usage( $long = false ) {
 
# Minimal help, be it 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Beta: Allow displaying Related Articles in the footer

2016-09-16 Thread Bmansurov (Code Review)
Bmansurov has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311195

Change subject: Beta: Allow displaying Related Articles in the footer
..

Beta: Allow displaying Related Articles in the footer

Even if 'minerva' is blacklisted, show Related Articles in the footer.

Bug: T144912
Change-Id: I366c8656a0f14a7069053b2e6199caac20471ea4
---
M includes/MobileFrontend.hooks.php
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/95/311195/1

diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 56700d0..0c82c8a 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -148,13 +148,28 @@
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateOutputPageBeforeExec
 *
 * Adds a link to view the current page in 'mobile view' to the desktop 
footer.
+* Also enables Related Articles in the footer in the beta mode.
 *
 * @param SkinTemplate $skin
 * @param QuickTemplate $tpl
 * @return bool
 */
public static function onSkinTemplateOutputPageBeforeExec( &$skin, 
&$tpl ) {
+   global $wgRelatedArticlesFooterBlacklistedSkins, 
$wgRelatedArticlesShowInFooter;
+
MobileFrontendSkinHooks::prepareFooter( $skin, $tpl );
+
+   // Configure related articles to be shown in the footer for the 
beta mode
+   if (
+   ExtensionRegistry::getInstance()->isLoaded( 
'RelatedArticles' ) &&
+   MobileContext::singleton()->isBetaGroupMember()
+   ) {
+   $wgRelatedArticlesShowInFooter = true;
+   if ( in_array( 'minerva', 
$wgRelatedArticlesFooterBlacklistedSkins ?: [] ) ) {
+   unset( 
$wgRelatedArticlesFooterBlacklistedSkins[ 'minerva' ] );
+   }
+   }
+
return true;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/311195
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I366c8656a0f14a7069053b2e6199caac20471ea4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Move LoadExtensionSchemaUpdates to hooks file

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move LoadExtensionSchemaUpdates to hooks file
..


Move LoadExtensionSchemaUpdates to hooks file

Change-Id: I2dc1acaad6fe38d714a2a6aeeb6d9d442456921b
---
M PageTriage.hooks.php
M PageTriage.php
2 files changed, 21 insertions(+), 21 deletions(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 28d7339..a84e86b 100755
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -728,4 +728,24 @@
 
return true;
}
+
+   /**
+* @param $updater DatabaseUpdater
+* @return bool
+*/
+   public static function onLoadExtensionSchemaUpdates( $updater = null ) {
+   $base = __DIR__ . "/sql";
+   // tables
+   $updater->addExtensionTable( 'pagetriage_tags', $base . 
'/PageTriageTags.sql' );
+   $updater->addExtensionTable( 'pagetriage_page_tags', $base . 
'/PageTriagePageTags.sql' );
+   $updater->addExtensionTable( 'pagetriage_page', $base . 
'/PageTriagePage.sql' );
+   $updater->addExtensionTable( 'pagetriage_log', $base . 
'/PageTriageLog.sql' );
+   // patches
+   $updater->addExtensionIndex(
+   'pagetriage_page',
+   'ptrp_reviewed_updated',
+   $base . '/PageTriagePagePatch.sql'
+   );
+   return true;
+   }
 }
diff --git a/PageTriage.php b/PageTriage.php
index b62184a..f490b87 100644
--- a/PageTriage.php
+++ b/PageTriage.php
@@ -164,7 +164,7 @@
 $wgAPIModules['pagetriagetagging'] = 'ApiPageTriageTagging';
 
 // hooks
-$wgHooks['LoadExtensionSchemaUpdates'][] = 'efPageTriageSchemaUpdates';
+$wgHooks['LoadExtensionSchemaUpdates'][] = 
'PageTriageHooks::onLoadExtensionSchemaUpdates';
 $wgHooks['SpecialMovepageAfterMove'][] = 
'PageTriageHooks::onSpecialMovepageAfterMove';
 $wgHooks['NewRevisionFromEditComplete'][] = 
'PageTriageHooks::onNewRevisionFromEditComplete';
 $wgHooks['ArticleInsertComplete'][] = 
'PageTriageHooks::onArticleInsertComplete';
@@ -190,26 +190,6 @@
 $wgLogActionsHandlers['pagetriage-curation/tag'] = 'PageTriageLogFormatter';
 $wgLogActionsHandlers['pagetriage-curation/delete'] = 'PageTriageLogFormatter';
 $wgLogActionsHandlers['pagetriage-deletion/delete'] = 'PageTriageLogFormatter';
-
-/**
- * @param $updater DatabaseUpdater
- * @return bool
- */
-function efPageTriageSchemaUpdates( $updater = null ) {
-   $base = __DIR__ . "/sql";
-   // tables
-   $updater->addExtensionTable( 'pagetriage_tags', $base . 
'/PageTriageTags.sql' );
-   $updater->addExtensionTable( 'pagetriage_page_tags', $base . 
'/PageTriagePageTags.sql' );
-   $updater->addExtensionTable( 'pagetriage_page', $base . 
'/PageTriagePage.sql' );
-   $updater->addExtensionTable( 'pagetriage_log', $base . 
'/PageTriageLog.sql' );
-   // patches
-   $updater->addExtensionIndex(
-   'pagetriage_page',
-   'ptrp_reviewed_updated',
-   $base . '/PageTriagePagePatch.sql'
-   );
-   return true;
-}
 
 /**
  * UnitTestsList hook handler - adds unit test files to the unit tester

-- 
To view, visit https://gerrit.wikimedia.org/r/311187
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dc1acaad6fe38d714a2a6aeeb6d9d442456921b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: BSApiWikiPageTasks: improve error handling on empty title ob...

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: BSApiWikiPageTasks: improve error handling on empty title object
..


BSApiWikiPageTasks: improve error handling on empty title object

Change-Id: I0cb41b6626fc07d7467af2cc7875e61e8a0fe3c4
---
M includes/api/BSApiWikiPageTasks.php
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Mglaser: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/BSApiWikiPageTasks.php 
b/includes/api/BSApiWikiPageTasks.php
index 0d96a6f..39a5bf3 100644
--- a/includes/api/BSApiWikiPageTasks.php
+++ b/includes/api/BSApiWikiPageTasks.php
@@ -51,6 +51,10 @@
 
$oTitle = Title::newFromID( $oTaskData->page_id );
if ( $oTitle instanceof Title === false ) {
+   $oTitle = Title::newFromText( $oTaskData->page_title );
+   }
+
+   if ( $oTitle instanceof Title === false ) {
$oResponse->message = wfMessage( 
'bs-wikipage-tasks-error-page-not-valid' )->plain();
return $oResponse;
}
@@ -86,7 +90,12 @@
 
$oWikiPage = WikiPage::factory( $oTitle );
if ( $oWikiPage->getContentModel() === CONTENT_MODEL_WIKITEXT ){
-   $sText = $oWikiPage->getContent()->getNativeData();
+   $oContent = $oWikiPage->getContent();
+   $sText = '';
+   if( $oContent instanceof Content ) {
+   $sText = $oContent->getNativeData();
+   }
+
}
else {
$oResponse->message = wfMessage( 
'bs-wikipage-tasks-error-contentmodel' )->plain();

-- 
To view, visit https://gerrit.wikimedia.org/r/311143
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cb41b6626fc07d7467af2cc7875e61e8a0fe3c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Ljonka 
Gerrit-Reviewer: Dvogel hallowelt 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
Gerrit-Reviewer: Robert Vogel 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Bump versionCode

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Bump versionCode
..


Bump versionCode

Change-Id: Ia4ef9dde2ae0226aeb57ac9da871092318de5bd4
---
M app/build.gradle
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Niedzielski: Looks good to me, approved



diff --git a/app/build.gradle b/app/build.gradle
index b7445c1..3646fa7 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -54,7 +54,7 @@
 applicationId 'org.wikipedia'
 minSdkVersion 15
 targetSdkVersion 23
-versionCode 154
+versionCode 155
 testApplicationId 'org.wikipedia.test'
 testInstrumentationRunner 'org.wikipedia.test.AndroidTestRunner'
 vectorDrawables.useSupportLibrary = true

-- 
To view, visit https://gerrit.wikimedia.org/r/311193
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4ef9dde2ae0226aeb57ac9da871092318de5bd4
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: archiva: Fix it not being a autoload module

2016-09-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311194

Change subject: archiva: Fix it not being a autoload module
..

archiva: Fix it not being a autoload module

Change-Id: I7e4ca6e0c67b6659e38f4e85a4f9e2083f8ac135
---
R modules/role/manifests/archiva/archiva.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/94/311194/1

diff --git a/manifests/role/archiva.pp 
b/modules/role/manifests/archiva/archiva.pp
similarity index 96%
rename from manifests/role/archiva.pp
rename to modules/role/manifests/archiva/archiva.pp
index 4cdd1ca..f136f64 100644
--- a/manifests/role/archiva.pp
+++ b/modules/role/manifests/archiva/archiva.pp
@@ -4,7 +4,7 @@
 # sets up a cron job to symlink .jar files to
 # a git-fat store.
 #
-class role::archiva {
+class role::archiva::archiva {
 system::role { 'role::archiva': description => 'Apache Archiva Host' }
 
 include base::firewall

-- 
To view, visit https://gerrit.wikimedia.org/r/311194
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e4ca6e0c67b6659e38f4e85a4f9e2083f8ac135
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Bump versionCode

2016-09-16 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311193

Change subject: Bump versionCode
..

Bump versionCode

Change-Id: Ia4ef9dde2ae0226aeb57ac9da871092318de5bd4
---
M app/build.gradle
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/93/311193/1

diff --git a/app/build.gradle b/app/build.gradle
index b7445c1..3646fa7 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -54,7 +54,7 @@
 applicationId 'org.wikipedia'
 minSdkVersion 15
 targetSdkVersion 23
-versionCode 154
+versionCode 155
 testApplicationId 'org.wikipedia.test'
 testInstrumentationRunner 'org.wikipedia.test.AndroidTestRunner'
 vectorDrawables.useSupportLibrary = true

-- 
To view, visit https://gerrit.wikimedia.org/r/311193
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4ef9dde2ae0226aeb57ac9da871092318de5bd4
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] oojs/ui[master]: MediaWiki theme: Refactor z-index inside ButtonSelectWidget/...

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: MediaWiki theme: Refactor z-index inside 
ButtonSelectWidget/ButtonGroupWidget
..


MediaWiki theme: Refactor z-index inside ButtonSelectWidget/ButtonGroupWidget

* Remove z-index properties from ButtonElement, causes T145311.
* Create stacking context at .oo-ui-buttonSelectWidget and
  .oo-ui-buttonGroupWidget, so that we can fiddle with z-index
  for all ButtonElements inside them without causing T145311.
* Fiddle with z-index so that the fancy collapsing borders
  for the buttons inside the group display appropriately. The rules
  added here essentially mean that when borders
  of two neighbouring buttons "collapse", we prefer to keep the border of
  the active button, then focussed, then hovered, then everything
  else, then disabled.

Bug: T145311
Change-Id: If2f84721d4820d7ae73506f63e522b309e02b4f1
---
M src/styles/elements/ButtonElement.less
M src/themes/mediawiki/elements.less
M src/themes/mediawiki/widgets.less
3 files changed, 40 insertions(+), 12 deletions(-)

Approvals:
  Esanders: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/styles/elements/ButtonElement.less 
b/src/styles/elements/ButtonElement.less
index 269dafe..4ec67f3 100644
--- a/src/styles/elements/ButtonElement.less
+++ b/src/styles/elements/ButtonElement.less
@@ -24,14 +24,6 @@
cursor: default;
}
 
-   &.oo-ui-widget-enabled > .oo-ui-buttonElement-button {
-   &:hover,
-   &:active,
-   &:focus {
-   z-index: 2;
-   }
-   }
-
&.oo-ui-indicatorElement > .oo-ui-buttonElement-button > 
.oo-ui-indicatorElement-indicator,
&.oo-ui-iconElement > .oo-ui-buttonElement-button > 
.oo-ui-iconElement-icon,
&.oo-ui-labelElement > .oo-ui-buttonElement-button > 
.oo-ui-labelElement-label {
diff --git a/src/themes/mediawiki/elements.less 
b/src/themes/mediawiki/elements.less
index 91804b1..bb950c3 100644
--- a/src/themes/mediawiki/elements.less
+++ b/src/themes/mediawiki/elements.less
@@ -243,7 +243,6 @@
background-color: @color-progressive-active;
color: @color-default-light;
border-color: @border-color-input-binary-active;
-   z-index: 3;
 
&:focus {
border-color: @color-progressive-focus;
diff --git a/src/themes/mediawiki/widgets.less 
b/src/themes/mediawiki/widgets.less
index 80d3a92..f44df9b 100644
--- a/src/themes/mediawiki/widgets.less
+++ b/src/themes/mediawiki/widgets.less
@@ -27,8 +27,11 @@
display: inline-block;
white-space: nowrap;
border-radius: @border-radius-default;
-
.oo-ui-inline-spacing( 0.5em );
+   // Create a stacking context, so that we can use `z-index` below 
without leaking out
+   z-index: 0;
+   position: relative;
+
.oo-ui-buttonElement {
.oo-ui-inline-spacing( 0 );
}
@@ -51,11 +54,25 @@
}
}
 
+   // Give hovered/focussed/active buttons higher `z-index`, so that 
borders display right.
+   // Identical to .theme-oo-ui-buttonSelectWidget, except for the 
`:focus` selector.
&.oo-ui-widget-enabled {
.oo-ui-buttonElement {
-   .oo-ui-buttonElement-button:focus {
-   border-color: @border-color-default-focus;
+   &.oo-ui-widget-enabled > 
.oo-ui-buttonElement-button:hover,
+   &.oo-ui-widget-enabled > 
.oo-ui-buttonElement-button:active {
+   z-index: 1;
+   }
+
+   &.oo-ui-widget-enabled > 
.oo-ui-buttonElement-button:focus {
+   z-index: 2;
+   }
+
+   &.oo-ui-buttonElement-active > 
.oo-ui-buttonElement-button {
z-index: 3;
+   }
+
+   &.oo-ui-widget-disabled > .oo-ui-buttonElement-button {
+   z-index: -1;
}
}
}
@@ -1327,6 +1344,9 @@
 .theme-oo-ui-buttonSelectWidget () {
border-radius: @border-radius-default;
.oo-ui-inline-spacing( 0.5em );
+   // Create a stacking context, so that we can use `z-index` below 
without leaking out
+   z-index: 0;
+   position: relative;
 
&:focus {
outline: 0;
@@ -1360,6 +1380,23 @@
}
}
}
+
+   // Give hovered/focussed/active buttons higher `z-index`, so 
that borders display right.
+   // Identical to .theme-oo-ui-buttonGroupWidget, except we don't 
need `:focus` selector.

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Use newInstance() pattern for SearchFragment

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use newInstance() pattern for SearchFragment
..


Use newInstance() pattern for SearchFragment

Changes:

• Use newInstance() pattern for SearchFrament. The SearchFragment is no
  longer inflated from XML which has a different lifecycle and is less
  flexible.

• Side effect fix for the Fragment state bug, T145698.

• Remove needless FrameLayout with SearchFragment from fragment_main. No
  other changes intended.

Unintentional changes in behavior and notes:

• The animation to dismiss the search fragment is too quick. An Activity
  (SearchActivity) or Fragment transition should probably be used.

• The query from the previous search is not preserved in the query box
  after dismissing the SearchFragment. This could be added back in but
  seems simpler to keep out for now.

• Searching from m.wikipedia.org is broken but this isn't a regression.

• Tapping a search result from m.wikipedia.org and then tapping the back
  arrow is broken but this isn't a regression.

• The callback structure is weak but this isn't really a regression. A
  future patch should make a SearchActivity and use that.

• There's some similar code in PageActivity and MainFragment that could
  be consolidate with a little work. It seems preferable to make
  SearchActivity in a future patch and just delete this code instead.

• The query is unconditionally trimmed in MainFrament and PageActivity.
  This seems desirable and a future patch may place this trim in
  SearchFragment.newInstance().

Bug: T145698
Bug: T145693
Change-Id: If89136d33827bef75b58795b26641c1628948a3e
---
M app/src/main/java/org/wikipedia/MainFragment.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
M app/src/main/java/org/wikipedia/search/SearchFragment.java
M app/src/main/java/org/wikipedia/search/SearchResultsFragment.java
M app/src/main/res/layout/activity_page.xml
M app/src/main/res/layout/fragment_main.xml
6 files changed, 210 insertions(+), 188 deletions(-)

Approvals:
  Dbrant: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/MainFragment.java 
b/app/src/main/java/org/wikipedia/MainFragment.java
index d9da094..73e486d 100644
--- a/app/src/main/java/org/wikipedia/MainFragment.java
+++ b/app/src/main/java/org/wikipedia/MainFragment.java
@@ -18,6 +18,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 
+import org.apache.commons.lang3.StringUtils;
 import org.wikipedia.activity.FragmentUtil;
 import org.wikipedia.analytics.GalleryFunnel;
 import org.wikipedia.analytics.IntentFunnel;
@@ -29,8 +30,8 @@
 import org.wikipedia.history.HistoryFragment;
 import org.wikipedia.login.LoginActivity;
 import org.wikipedia.navtab.NavTab;
-import org.wikipedia.nearby.NearbyFragment;
 import org.wikipedia.navtab.NavTabFragmentPagerAdapter;
+import org.wikipedia.nearby.NearbyFragment;
 import org.wikipedia.news.NewsActivity;
 import org.wikipedia.page.ExclusiveBottomSheetPresenter;
 import org.wikipedia.page.PageActivity;
@@ -67,7 +68,6 @@
 @BindView(R.id.fragment_main_view_pager) ViewPager viewPager;
 @BindView(R.id.view_nav_view_pager_tab_layout) TabLayout tabLayout;
 private Unbinder unbinder;
-private SearchFragment searchFragment;
 private ExclusiveBottomSheetPresenter bottomSheetPresenter;
 
 // The permissions request API doesn't take a callback, so in the event we 
have to
@@ -99,8 +99,6 @@
 tabLayout.setupWithViewPager(viewPager);
 
 bottomSheetPresenter = new 
ExclusiveBottomSheetPresenter(getChildFragmentManager());
-searchFragment = (SearchFragment) 
getChildFragmentManager().findFragmentById(R.id.search_fragment);
-searchFragment.setStatusBarVisible(false);
 
 if (savedInstanceState == null) {
 handleIntent(getActivity().getIntent());
@@ -128,7 +126,7 @@
 && resultCode == Activity.RESULT_OK && data != null
 && 
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS) != null) {
 String searchQuery = 
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS).get(0);
-openSearchFromIntent(searchQuery, SearchInvokeSource.VOICE);
+openSearchFragment(SearchInvokeSource.VOICE, searchQuery);
 } else if (requestCode == Constants.ACTIVITY_REQUEST_GALLERY
 && resultCode == 
GalleryActivity.ACTIVITY_RESULT_FILEPAGE_SELECT) {
 startActivity(data);
@@ -174,17 +172,17 @@
 if (Intent.ACTION_SEND.equals(intent.getAction())
 && Constants.PLAIN_TEXT_MIME_TYPE.equals(intent.getType())) {
 funnel.logShareIntent();
-openSearchFromIntent(intent.getStringExtra(Intent.EXTRA_TEXT),
-SearchInvokeSource.INTENT_SHARE);
+openSearchFragment(SearchInvokeSource.INTENT_SHARE,
+

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Upgrade to Spoon v1.7.0

2016-09-16 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311192

Change subject: Upgrade to Spoon v1.7.0
..

Upgrade to Spoon v1.7.0

https://github.com/square/spoon/blob/master/CHANGELOG.md#version-154-2016-05-31
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-155-2016-06-15
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-156-2016-06-15
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-157-2016-06-29
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-160-2016-07-11
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-161-2016-07-13
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-162-2016-07-26
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-163-2016-08-08
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-164-2016-08-09
https://github.com/square/spoon/blob/master/CHANGELOG.md#version-170-2016-09-12

Change-Id: Iba1f67192510c15c76a5e76be7744d9ead9e9d25
---
M app/build.gradle
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/92/311192/1

diff --git a/app/build.gradle b/app/build.gradle
index b7445c1..9729591 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -217,7 +217,7 @@
 androidTestCompile "com.android.support.test:rules:$testingSupportVersion" 
// JUnit Rules
 androidTestCompile 
"com.android.support.test:runner:$testingSupportVersion" // Android JUnit Runner
 androidTestCompile 
"com.android.support.test.espresso:espresso-core:$espressoVersion"
-androidTestCompile 'com.squareup.spoon:spoon-client:1.5.3'
+androidTestCompile 'com.squareup.spoon:spoon-client:1.7.0'
 }
 
 private setSigningConfigKey(config, Properties props) {

-- 
To view, visit https://gerrit.wikimedia.org/r/311192
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba1f67192510c15c76a5e76be7744d9ead9e9d25
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: [WIP] Scrolling header at the top of Feed.

2016-09-16 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311189

Change subject: [WIP] Scrolling header at the top of Feed.
..

[WIP] Scrolling header at the top of Feed.

Change-Id: I6a8fb2b061909075fb477bcf7315bc775cd6d09a
---
M app/src/main/java/org/wikipedia/feed/FeedFragment.java
M app/src/main/res/layout/fragment_feed.xml
M app/src/main/res/values/dimens.xml
3 files changed, 24 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/89/311189/1

diff --git a/app/src/main/java/org/wikipedia/feed/FeedFragment.java 
b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
index 3195a70..a76981d 100644
--- a/app/src/main/java/org/wikipedia/feed/FeedFragment.java
+++ b/app/src/main/java/org/wikipedia/feed/FeedFragment.java
@@ -49,6 +49,7 @@
 public class FeedFragment extends Fragment implements BackPressedHandler {
 @BindView(R.id.feed_swipe_refresh_layout) SwipeRefreshLayout 
swipeRefreshLayout;
 @BindView(R.id.fragment_feed_feed) FeedView feedView;
+@BindView(R.id.fragment_feed_header) View feedHeader;
 private Unbinder unbinder;
 private WikipediaApp app;
 private FeedCoordinator coordinator;
@@ -287,6 +288,11 @@
 @Override
 public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
 super.onScrolled(recyclerView, dx, dy);
+int yOffset = feedView.computeVerticalScrollOffset();
+if (yOffset <= feedHeader.getHeight()
+&& feedHeader.getTranslationY() > -feedHeader.getHeight()) 
{
+feedHeader.setTranslationY(-yOffset);
+}
 boolean shouldShowSearchIcon = 
feedView.getFirstVisibleItemPosition() != 0;
 if (shouldShowSearchIcon != searchIconVisible) {
 searchIconVisible = shouldShowSearchIcon;
diff --git a/app/src/main/res/layout/fragment_feed.xml 
b/app/src/main/res/layout/fragment_feed.xml
index 3216b66..02cdbc5 100644
--- a/app/src/main/res/layout/fragment_feed.xml
+++ b/app/src/main/res/layout/fragment_feed.xml
@@ -7,11 +7,23 @@
 android:layout_height="match_parent"
 android:background="?attr/feed_window_background_color">
 
-
+android:layout_height="match_parent">
+
+
+
+
+
+
 
 
diff --git a/app/src/main/res/values/dimens.xml 
b/app/src/main/res/values/dimens.xml
index 5043a7a..9f4d194 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -92,7 +92,7 @@
 160dp
 84dp
 320dp
-10dp
+120dp
 5dp
 7dp
 16dp

-- 
To view, visit https://gerrit.wikimedia.org/r/311189
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a8fb2b061909075fb477bcf7315bc775cd6d09a
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set some database logging groups to log

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Set some database logging groups to log
..


Set some database logging groups to log

Change-Id: I38a5c5acbed05aea3a576274579175afbaf52428
---
M wmf-config/InitialiseSettings.php
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 43df19b..127b806 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4597,6 +4597,9 @@
'MessageCacheError' => 'debug',
'LocalFile' => 'debug',
'DBTransaction' => 'debug',
+   'DBReplication' => 'warning',
+   'DBConnection' => 'error',
+   'DBQuery' => 'warning'
],
 
'+private' => [

-- 
To view, visit https://gerrit.wikimedia.org/r/310159
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I38a5c5acbed05aea3a576274579175afbaf52428
Gerrit-PatchSet: 5
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Register WikiLove parts of 'ext.pageTriage.views.toolbar' co...

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Register WikiLove parts of 'ext.pageTriage.views.toolbar' 
conditionally
..


Register WikiLove parts of 'ext.pageTriage.views.toolbar' conditionally

Register JS and CSS conditionally, only if WikiLove is present.

This ensures that there will never be missing messages registered,
and also fixes a CI error (though for CI we should load WikiLove
anyway).

Bug: T145798
Change-Id: I7c5ee1127963108e97298cc46d59fbac82514f10
---
M PageTriage.hooks.php
M PageTriage.php
2 files changed, 150 insertions(+), 131 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 6e30285..28d7339 100755
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -467,10 +467,12 @@
$wgTalkPageNoteTemplate;
 
// check if WikiLove is enabled
-   if ( !class_exists( 'ApiWikiLove' ) ) {
-   if ( array_key_exists( 'wikiLove', 
$wgPageTriageCurationModules ) ) {
-   unset( $wgPageTriageCurationModules['wikiLove'] 
);
-   }
+   if ( ExtensionRegistry::getInstance()->isLoaded( 'WikiLove' ) ) 
{
+   $wgPageTriageCurationModules['wikiLove'] = [
+   // depends on WikiLove extension
+   'helplink' => 
'//en.wikipedia.org/wiki/Wikipedia:Page_Curation/Help#WikiLove',
+   'namespace' => [ NS_MAIN, NS_USER ],
+   ];
}
 
$vars['wgPageTriageCurationModules'] = 
$wgPageTriageCurationModules;
@@ -480,6 +482,149 @@
}
 
/**
+* Register modules that depend on other state
+*
+* @param ResourceLoader &$resourceLoader
+* @return bool true
+*/
+   public static function onResourceLoaderRegisterModules( 
&$resourceLoader ) {
+   $template = [
+   'localBasePath' => __DIR__. '/modules',
+   'remoteExtPath' => 'PageTriage/modules'
+   ];
+
+   $module = $template + [
+   'dependencies' => [
+   'mediawiki.jqueryMsg',
+   'ext.pageTriage.models',
+   'ext.pageTriage.util',
+   'jquery.badge',
+   'jquery.ui.button',
+   'jquery.ui.draggable',
+   'jquery.spinner',
+   'jquery.client',
+   'ext.pageTriage.externalTagsOptions',
+   'ext.pageTriage.externalDeletionTagsOptions'
+   ],
+   'scripts' => [
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.toolView.js', // abstract class 
first
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.articleInfo.js', // article 
metadata
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.minimize.js', // minimize
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.tags.js', // tagging
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.mark.js', // mark as reviewed
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.next.js', // next article
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.delete.js', // mark for deletion
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.toolbarView.js', // overall 
toolbar view last
+   'external/jquery.effects.core.js',
+   'external/jquery.effects.squish.js',
+   ],
+   'styles' => [
+   'ext.pageTriage.css', // stuff that's shared 
across all views
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.toolbarView.css',
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.toolView.css',
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.articleInfo.css',
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.mark.css',
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.tags.css',
+   
'ext.pageTriage.views.toolbar/ext.pageTriage.delete.css'
+   ],
+   'messages' => [
+   'pagetriage-creation-dateformat',
+   'pagetriage-user-creation-dateformat',
+   'pagetriage-mark-as-reviewed',
+

[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Move LoadExtensionSchemaUpdates to hooks file

2016-09-16 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311187

Change subject: Move LoadExtensionSchemaUpdates to hooks file
..

Move LoadExtensionSchemaUpdates to hooks file

Change-Id: I2dc1acaad6fe38d714a2a6aeeb6d9d442456921b
---
M PageTriage.hooks.php
M PageTriage.php
2 files changed, 21 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/87/311187/1

diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 6e30285..3a38cbf 100755
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -583,4 +583,24 @@
 
return true;
}
+
+   /**
+* @param $updater DatabaseUpdater
+* @return bool
+*/
+   public static function onLoadExtensionSchemaUpdates( $updater = null ) {
+   $base = __DIR__ . "/sql";
+   // tables
+   $updater->addExtensionTable( 'pagetriage_tags', $base . 
'/PageTriageTags.sql' );
+   $updater->addExtensionTable( 'pagetriage_page_tags', $base . 
'/PageTriagePageTags.sql' );
+   $updater->addExtensionTable( 'pagetriage_page', $base . 
'/PageTriagePage.sql' );
+   $updater->addExtensionTable( 'pagetriage_log', $base . 
'/PageTriageLog.sql' );
+   // patches
+   $updater->addExtensionIndex(
+   'pagetriage_page',
+   'ptrp_reviewed_updated',
+   $base . '/PageTriagePagePatch.sql'
+   );
+   return true;
+   }
 }
diff --git a/PageTriage.php b/PageTriage.php
index 8197504..a6bb83d 100644
--- a/PageTriage.php
+++ b/PageTriage.php
@@ -169,7 +169,7 @@
 $wgAPIModules['pagetriagetagging'] = 'ApiPageTriageTagging';
 
 // hooks
-$wgHooks['LoadExtensionSchemaUpdates'][] = 'efPageTriageSchemaUpdates';
+$wgHooks['LoadExtensionSchemaUpdates'][] = 
'PageTriageHooks::onLoadExtensionSchemaUpdates';
 $wgHooks['SpecialMovepageAfterMove'][] = 
'PageTriageHooks::onSpecialMovepageAfterMove';
 $wgHooks['NewRevisionFromEditComplete'][] = 
'PageTriageHooks::onNewRevisionFromEditComplete';
 $wgHooks['ArticleInsertComplete'][] = 
'PageTriageHooks::onArticleInsertComplete';
@@ -194,26 +194,6 @@
 $wgLogActionsHandlers['pagetriage-curation/tag'] = 'PageTriageLogFormatter';
 $wgLogActionsHandlers['pagetriage-curation/delete'] = 'PageTriageLogFormatter';
 $wgLogActionsHandlers['pagetriage-deletion/delete'] = 'PageTriageLogFormatter';
-
-/**
- * @param $updater DatabaseUpdater
- * @return bool
- */
-function efPageTriageSchemaUpdates( $updater = null ) {
-   $base = __DIR__ . "/sql";
-   // tables
-   $updater->addExtensionTable( 'pagetriage_tags', $base . 
'/PageTriageTags.sql' );
-   $updater->addExtensionTable( 'pagetriage_page_tags', $base . 
'/PageTriagePageTags.sql' );
-   $updater->addExtensionTable( 'pagetriage_page', $base . 
'/PageTriagePage.sql' );
-   $updater->addExtensionTable( 'pagetriage_log', $base . 
'/PageTriageLog.sql' );
-   // patches
-   $updater->addExtensionIndex(
-   'pagetriage_page',
-   'ptrp_reviewed_updated',
-   $base . '/PageTriagePagePatch.sql'
-   );
-   return true;
-}
 
 /**
  * UnitTestsList hook handler - adds unit test files to the unit tester

-- 
To view, visit https://gerrit.wikimedia.org/r/311187
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dc1acaad6fe38d714a2a6aeeb6d9d442456921b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Reedy 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Convert PageTriage to extension registration

2016-09-16 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311186

Change subject: Convert PageTriage to extension registration
..

Convert PageTriage to extension registration

Bug: T87875
Change-Id: I63346f46164a32e6750d8b97681ae369b25ff066
---
M PageTriage.hooks.php
M PageTriage.php
A extension.json
3 files changed, 1,005 insertions(+), 804 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/86/311186/1

diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 6e30285..3a38cbf 100755
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -583,4 +583,24 @@
 
return true;
}
+
+   /**
+* @param $updater DatabaseUpdater
+* @return bool
+*/
+   public static function onLoadExtensionSchemaUpdates( $updater = null ) {
+   $base = __DIR__ . "/sql";
+   // tables
+   $updater->addExtensionTable( 'pagetriage_tags', $base . 
'/PageTriageTags.sql' );
+   $updater->addExtensionTable( 'pagetriage_page_tags', $base . 
'/PageTriagePageTags.sql' );
+   $updater->addExtensionTable( 'pagetriage_page', $base . 
'/PageTriagePage.sql' );
+   $updater->addExtensionTable( 'pagetriage_log', $base . 
'/PageTriageLog.sql' );
+   // patches
+   $updater->addExtensionIndex(
+   'pagetriage_page',
+   'ptrp_reviewed_updated',
+   $base . '/PageTriagePagePatch.sql'
+   );
+   return true;
+   }
 }
diff --git a/PageTriage.php b/PageTriage.php
index 8197504..b37664c 100644
--- a/PageTriage.php
+++ b/PageTriage.php
@@ -1,807 +1,14 @@
 http://www.mediawiki.org/wiki/Extension:PageTriage
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * This program is distributed WITHOUT ANY WARRANTY.
- */
-
-/**
- * This file loads everything needed for the PageTriage extension to function.
- *
- * @file
- * @ingroup Extensions
- * @author Ryan Kaldari
- * @license MIT License
- */
-
-// Alert the user that this is not a valid entry point to MediaWiki if they 
try to access the
-// special pages file directly.
-if ( !defined( 'MEDIAWIKI' ) ) {
-   echo << __FILE__,
-   'name' => 'PageTriage',
-   'version' => '0.2.1',
-   'url' => 'https://www.mediawiki.org/wiki/Extension:PageTriage',
-   'author' => [
-   'Ryan Kaldari',
-   'Benny Situ',
-   'Ian Baker',
-   'Andrew Garrett',
-   ],
-   'descriptionmsg' => 'pagetriage-desc',
-   'license-name' => 'MIT',
-];
-
-// Begin configuration variables
-// Maximum number of articles for the API to retrieve at once
-$wgPageTriagePagesPerRequest = 20;
-// Whether or not to use infinite scrolling in the page list
-$wgPageTriageInfiniteScrolling = true;
-// Whether or not the top nav bar should float
-$wgPageTriageStickyControlNav = true;
-// Whether or not the bottom nav bar should float
-$wgPageTriageStickyStatsNav = true;
-// 1 day - How long after visiting Special:NewPagesFeed do we show review 
links on articles
-$wgPageTriageMarkPatrolledLinkExpiry = 3600 * 24;
-// Pages containing templates defined in this title would not be indexed.
-$wgPageTriageNoIndexTemplates = 'No_index_templates';
-$wgPageTriageLearnMoreUrl = 
'//en.wikipedia.org/wiki/Wikipedia:Page_Curation/Help';
-$wgPageTriageProjectLink = 'Wikipedia:Page Curation';
-$wgPageTriageFeedbackUrl = 
'//en.wikipedia.org/wiki/Wikipedia_talk:Page_Curation';
-// enable the curation toolbar?
-$wgPageTriageEnableCurationToolbar = true;
-$wgPageTriageCurationModules = [
-   'articleInfo' => [
-   'helplink' => 
'//en.wikipedia.org/wiki/Wikipedia:Page_Curation/Help#PageInfo',
-   'namespace' => [ NS_MAIN, NS_USER ],
-   ],
-   'wikiLove' => [
-   // depends on WikiLove extension
-   'helplink' => 
'//en.wikipedia.org/wiki/Wikipedia:Page_Curation/Help#WikiLove',
-   'namespace' => [ NS_MAIN, NS_USER ],
-   ],
-   'mark' => [
-   'helplink' => 
'//en.wikipedia.org/wiki/Wikipedia:Page_Curation/Help#MarkReviewed',
-   'namespace' => [ NS_MAIN, NS_USER ],
-   'note' => [ NS_MAIN ],
-   ],
-   'tags' => [
-   'helplink' => 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid MWDebug/wfLogDBError usage in DatabaseBase

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311185

Change subject: Avoid MWDebug/wfLogDBError usage in DatabaseBase
..

Avoid MWDebug/wfLogDBError usage in DatabaseBase

Change-Id: I64895d3f5b9a000d8186ab6a6ffb4b76a7e9ff40
---
M includes/db/Database.php
M includes/db/DatabaseMysqlBase.php
M includes/db/loadbalancer/LBFactoryMW.php
M includes/debug/logger/LegacyLogger.php
4 files changed, 31 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/85/311185/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index e908824..d236700 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -998,7 +998,7 @@
$this->trxProfiler->recordQueryCompletion(
$queryProf, $startTime, $isWrite, $this->affectedRows()
);
-   MWDebug::query( $sql, $fname, $isMaster, $queryRuntime );
+   $this->queryLogger->debug( $commentedSql );
 
return $ret;
}
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index f8737a8..aaa4f74 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -126,7 +126,7 @@
if ( !$error ) {
$error = $this->lastError();
}
-   wfLogDBError(
+   $this->queryLogger->error(
"Error connecting to {db_server}: {error}",
$this->getLogContext( [
'method' => __METHOD__,
@@ -145,7 +145,7 @@
$success = $this->selectDB( $dbName );
MediaWiki\restoreWarnings();
if ( !$success ) {
-   wfLogDBError(
+   $this->queryLogger->error(
"Error selecting database {db_name} on 
server {db_server}",
$this->getLogContext( [
'method' => __METHOD__,
@@ -183,7 +183,7 @@
// Use doQuery() to avoid opening implicit transactions 
(DBO_TRX)
$success = $this->doQuery( 'SET ' . implode( ', ', $set 
) );
if ( !$success ) {
-   wfLogDBError(
+   $this->queryLogger->error(
'Error setting MySQL variables on 
server {db_server} (check $wgSQLMode)',
$this->getLogContext( [
'method' => __METHOD__,
@@ -657,7 +657,7 @@
// Standard method: use master server ID (works with 
stock pt-heartbeat)
$masterInfo = $this->getMasterServerInfo();
if ( !$masterInfo ) {
-   wfLogDBError(
+   $this->queryLogger->error(
"Unable to query master of {db_server} 
for server ID",
$this->getLogContext( [
'method' => __METHOD__
@@ -680,7 +680,7 @@
return max( $nowUnix - $timeUnix, 0.0 );
}
 
-   wfLogDBError(
+   $this->queryLogger->error(
"Unable to find pt-heartbeat row for {db_server}",
$this->getLogContext( [
'method' => __METHOD__
diff --git a/includes/db/loadbalancer/LBFactoryMW.php 
b/includes/db/loadbalancer/LBFactoryMW.php
index 33c48a5..8eee1df 100644
--- a/includes/db/loadbalancer/LBFactoryMW.php
+++ b/includes/db/loadbalancer/LBFactoryMW.php
@@ -44,8 +44,8 @@
'hostname' => wfHostname(),
'trxProfiler' => 
Profiler::instance()->getTransactionProfiler(),
'replLogger' => LoggerFactory::getInstance( 
'DBReplication' ),
-   'queryLogger' => LoggerFactory::getInstance( 
'wfLogDBError' ),
-   'connLogger' => LoggerFactory::getInstance( 
'wfLogDBError' ),
+   'queryLogger' => LoggerFactory::getInstance( 'DBQuery' 
),
+   'connLogger' => LoggerFactory::getInstance( 
'DBConnection' ),
'perfLogger' => LoggerFactory::getInstance( 
'DBPerformance' ),
'errorLogger' => [ MWExceptionHandler::class, 
'logException' ]
];
diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index 526b4ab..c1ce6bf 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Use Foundation color as app-wide accent color.

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use Foundation color as app-wide accent color.
..


Use Foundation color as app-wide accent color.

This sets Foundation Blue as the "accent color" for the app's theme. This
means a couple things:

- Components that have a color to them (e.g. ProgressBar, Switch, etc)
  will automatically inherit their color from this setting. We no longer
  need to set the color on a per-component basis (like we were doing with
  ProgressBars)
- We will now finally "own" the accent color in the components that our
  app uses, and be able to apply our brand to them.

Change-Id: I8cce0ecc20542f15c466e136d479ebef9ec95bbb
---
M app/src/main/res/layout/activity_page.xml
M app/src/main/res/layout/view_card_progress.xml
M app/src/main/res/values/styles.xml
M app/src/main/res/values/styles_dark.xml
M app/src/main/res/values/styles_light.xml
5 files changed, 15 insertions(+), 25 deletions(-)

Approvals:
  BearND: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Niedzielski: Looks good to me, approved



diff --git a/app/src/main/res/layout/activity_page.xml 
b/app/src/main/res/layout/activity_page.xml
index bff83b4..208735e 100644
--- a/app/src/main/res/layout/activity_page.xml
+++ b/app/src/main/res/layout/activity_page.xml
@@ -63,7 +63,7 @@
 android:layout_marginTop="-7dp"
 android:layout_gravity="top"
 android:max="1"
-style="@style/ProgressBarHorizontal" />
+style="@style/Widget.AppCompat.ProgressBar.Horizontal" />
 
 
 
diff --git a/app/src/main/res/layout/view_card_progress.xml 
b/app/src/main/res/layout/view_card_progress.xml
index 2ddf65f..61a6d38 100644
--- a/app/src/main/res/layout/view_card_progress.xml
+++ b/app/src/main/res/layout/view_card_progress.xml
@@ -7,7 +7,6 @@
 
+android:layout_gravity="center"/>
 
 
diff --git a/app/src/main/res/values/styles.xml 
b/app/src/main/res/values/styles.xml
index 3210030..60d1851 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -25,14 +25,12 @@
 
 
 
-@android:color/white
 @android:color/white
 @color/actionbar_highlight
 @color/actionbar_highlight
 
 
 
-@color/actionbar_background
 @color/actionbar_background
 ?attr/homeAsUpIndicator
 4dp
@@ -45,13 +43,11 @@
 
 
 
-@android:color/white
 @android:color/white
 
 
 
 @color/actionbar_background
-@color/actionbar_background
 @color/actionbar_background
 @style/AppTheme.ActionModeTitleStyle
 @style/AppTheme.ActionModeSubtitleStyle
@@ -243,20 +239,6 @@
 center
 @drawable/ic_image_gray_24dp
 center
-
-
-
-@color/foundation_blue
-src_in
-@color/foundation_blue
-src_in
-
-
-
-@color/foundation_blue
-src_in
-@color/foundation_blue
-src_in
 
 
 
\ No newline at end of file
diff --git a/app/src/main/res/values/styles_dark.xml 
b/app/src/main/res/values/styles_dark.xml
index 05a9060..640fef1 100644
--- a/app/src/main/res/values/styles_dark.xml
+++ b/app/src/main/res/values/styles_dark.xml
@@ -21,11 +21,11 @@
 @style/AppTheme.ToolbarTheme
 @style/AppTheme.ToolbarStyle
 @style/AppTheme.ActionModeStyle
-@style/AppTheme.ActionModeStyle
-@style/AppTheme.SearchViewEditTextStyle
 @color/background_floating_material_dark
 @style/AppTheme.SearchViewEditTextStyle
 @style/Theme.Dark.PopupMenuStyle
+

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Revert "Live hack to dump configuration"

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Live hack to dump configuration"
..


Revert "Live hack to dump configuration"

This reverts commit af19422065c08669269179019fea1e7c208d8a7e.

Change-Id: I815c71ae0f95006966b67ee238542d7a518c3cc4
---
M Core/Listeners/ListenerBase.php
1 file changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Core/Listeners/ListenerBase.php b/Core/Listeners/ListenerBase.php
index 6eb3de5..98a95e9 100644
--- a/Core/Listeners/ListenerBase.php
+++ b/Core/Listeners/ListenerBase.php
@@ -25,8 +25,6 @@
 
public function __construct() {
$this->c = Context::get()->getConfiguration();
-// Livehack: Dump configuration
-Logger::info( json_encode( $this->c->val( 'data-store/verified' ) ) );
$this->inflightStore = $this->c->object( 'data-store/inflight' 
);
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/311045
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I815c71ae0f95006966b67ee238542d7a518c3cc4
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Don't be fooled by CVV="0"

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't be fooled by CVV="0"
..


Don't be fooled by CVV="0"

Bug: T145846
Change-Id: I96292dd7369b0c0fb88777c18cdd9618ec8fd02a
---
M globalcollect_gateway/globalcollect.adapter.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/globalcollect_gateway/globalcollect.adapter.php 
b/globalcollect_gateway/globalcollect.adapter.php
index 6d389c5..abc5d9d 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -652,7 +652,7 @@
$status_result = $this->do_transaction( 
'GET_ORDERSTATUS' );
$validationAction = $this->getValidationAction();
$cvv_result = $this->getData_Unstaged_Escaped( 
'cvv_result' );
-   $gotCVV = !empty( $cvv_result );
+   $gotCVV = strlen( $cvv_result ) > 0;
// TODO: This logging is redundant with the response 
from GET_ORDERSTATUS.
$logmsg = 'CVV Result: ' . 
$this->getData_Unstaged_Escaped( 'cvv_result' );
$logmsg .= ', AVS Result: ' . 
$this->getData_Unstaged_Escaped( 'avs_result' );

-- 
To view, visit https://gerrit.wikimedia.org/r/311098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I96292dd7369b0c0fb88777c18cdd9618ec8fd02a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Cache the project panel tab

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Puppet Panel:  Cache the project panel tab
..


Puppet Panel:  Cache the project panel tab

Without this we load it twice sometimes

Change-Id: I1c3b556ba03bee681222081d77d85748d7d9a4cc
---
M modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
1 file changed, 10 insertions(+), 8 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py 
b/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
index b28fdfc..97cca49 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
@@ -51,11 +51,13 @@
 page_title = _("Project Puppet")
 
 def get_tabs(self, request, *args, **kwargs):
-tenant_id = self.request.user.tenant_id
-caption = _("These puppet settings will affect all VMs"
-" in the %s project.") % tenant_id
-return self.tab_group_class(request,
-prefix='_',
-caption=caption,
-tenant_id=tenant_id,
-**kwargs)
+if self._tab_group is None:
+tenant_id = self.request.user.tenant_id
+caption = _("These puppet settings will affect all VMs"
+" in the %s project.") % tenant_id
+self._tab_group = self.tab_group_class(request,
+   prefix='_',
+   caption=caption,
+   tenant_id=tenant_id,
+   **kwargs)
+return self._tab_group

-- 
To view, visit https://gerrit.wikimedia.org/r/311183
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c3b556ba03bee681222081d77d85748d7d9a4cc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: Remove PHP entry points

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove PHP entry points
..


Remove PHP entry points

Bug: T140852
Depends-On: Ia8b9081894613e00b3cc4dcc5d190097ed3e4dee
Change-Id: I95ee2688a63e1f82f662e304c284126ea13fca58
---
D WikimediaLicenseTexts.php
D WikimediaMessages.php
2 files changed, 0 insertions(+), 38 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/WikimediaLicenseTexts.php b/WikimediaLicenseTexts.php
deleted file mode 100644
index e3bc76c..000
--- a/WikimediaLicenseTexts.php
+++ /dev/null
@@ -1,3 +0,0 @@
-https://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
- */
-
-if ( function_exists( 'wfLoadExtension' ) ) {
-   wfLoadExtension( 'WikimediaMessages' );
-
-   // Keep i18n globals so mergeMessageFileList.php doesn't break
-   $wgMessagesDirs['WikimediaContactPageMessages'] = __DIR__ . 
'/i18n/contactpage';
-   $wgMessagesDirs['WikimediaMessages'] = __DIR__ . '/i18n/wikimedia';
-   $wgMessagesDirs['WikimediaTemporaryMessages'] = __DIR__ . 
'/i18n/temporary';
-   $wgMessagesDirs['WikimediaOverrideMessages'] = __DIR__ . 
'/i18n/wikimediaoverrides';
-   $wgMessagesDirs['WikimediaLocalizedProjectNames'] = __DIR__ . 
'/i18n/wikimediaprojectnames';
-   $wgMessagesDirs['WikimediaInterwikiSearchResults'] = __DIR__ . 
'/i18n/wikimediainterwikisearchresults';
-
-   // Messages which are not translated at translatewiki.net at the 
request of the Wikimedia Foundation
-   $wgMessagesDirs['WikimediaOverrideMessagesNoTranslate'] = __DIR__ . 
'/i18n/wikimediaoverridesnotranslate';
-
-   /* wfWarn(
-   'Deprecated PHP entry point used for WikimediaMessages 
extension. Please use wfLoadExtension '.
-   'instead, see 
https://www.mediawiki.org/wiki/Extension_registration for more details.'
-   ); */
-
-   return true;
-} else {
-   die( 'This version of the WikimediaMessages extension requires 
MediaWiki 1.25+' );
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/303011
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I95ee2688a63e1f82f662e304c284126ea13fca58
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Cache the project panel tab

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311183

Change subject: Puppet Panel:  Cache the project panel tab
..

Puppet Panel:  Cache the project panel tab

Without this we load it twice sometimes

Change-Id: I1c3b556ba03bee681222081d77d85748d7d9a4cc
---
M modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/83/311183/1

diff --git a/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py 
b/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
index b28fdfc..97cca49 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
@@ -51,11 +51,13 @@
 page_title = _("Project Puppet")
 
 def get_tabs(self, request, *args, **kwargs):
-tenant_id = self.request.user.tenant_id
-caption = _("These puppet settings will affect all VMs"
-" in the %s project.") % tenant_id
-return self.tab_group_class(request,
-prefix='_',
-caption=caption,
-tenant_id=tenant_id,
-**kwargs)
+if self._tab_group is None:
+tenant_id = self.request.user.tenant_id
+caption = _("These puppet settings will affect all VMs"
+" in the %s project.") % tenant_id
+self._tab_group = self.tab_group_class(request,
+   prefix='_',
+   caption=caption,
+   tenant_id=tenant_id,
+   **kwargs)
+return self._tab_group

-- 
To view, visit https://gerrit.wikimedia.org/r/311183
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c3b556ba03bee681222081d77d85748d7d9a4cc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: Remove wikimedialicensetexts-desc, no longer needed

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove wikimedialicensetexts-desc, no longer needed
..


Remove wikimedialicensetexts-desc, no longer needed

Change-Id: I3e89c01f7201aa0c1cc289e74703460ea71f12b3
---
M i18n/licensetexts/en.json
M i18n/licensetexts/qqq.json
2 files changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/licensetexts/en.json b/i18n/licensetexts/en.json
index 78f3e57..b8d9c4b 100644
--- a/i18n/licensetexts/en.json
+++ b/i18n/licensetexts/en.json
@@ -4,7 +4,6 @@
"Reedy"
]
},
-   "wikimedialicensetexts-desc": "Wikimedia license messages",
"wm-license-attribution-with-author-text": "The copyright holder of 
this file, $1, allows anyone to use it '''for any purpose, provided that''' the 
copyright holder is properly attributed. Redistribution, derivative work, 
commercial use, and all other use is permitted.",
"wm-license-attribution-without-author-text": "The copyright holder of 
this file allows anyone to use it '''for any purpose, provided that''' the 
copyright holder is properly attributed. Redistribution, derivative work, 
commercial use, and all other use is permitted.",
"wm-license-artwork-artist": "Artist",
diff --git a/i18n/licensetexts/qqq.json b/i18n/licensetexts/qqq.json
index fd261e2..4a9158a 100644
--- a/i18n/licensetexts/qqq.json
+++ b/i18n/licensetexts/qqq.json
@@ -25,7 +25,6 @@
"Macofe"
]
},
-   "wikimedialicensetexts-desc": "{{desc|name=Wikimedia License 
Texts|url=https://www.mediawiki.org/wiki/Extension:WikimediaMessages}};,
"wm-license-attribution-with-author-text": "This message will be used 
at [[Commons:Template:Attribution]] when an author is set.\n\nParameters:\n* $1 
- the copyright holder\nSee also:\n* 
{{msg-mw|Wm-license-attribution-without-author-text}}",
"wm-license-attribution-without-author-text": "This message will be 
used at [[Commons:Template:Attribution]] when no author is set.\n\nSee also:\n* 
{{msg-mw|Wm-license-attribution-with-author-text}}",
"wm-license-artwork-artist": "Label \"Artist\" at 
[[Commons:Template:Artwork]].\n{{Identical|Artist}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/304612
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e89c01f7201aa0c1cc289e74703460ea71f12b3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Load CentralNotice via wfLoadExtension

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Load CentralNotice via wfLoadExtension
..


Load CentralNotice via wfLoadExtension

Bug: T140852
Change-Id: I7e65eb75a5267b168416770f854b9cca9005da94
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
M wmf-config/extension-list
3 files changed, 4 insertions(+), 8 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index b7287bc..636022c 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1586,7 +1586,7 @@
 
 // Banner notice system
 if ( $wmgUseCentralNotice ) {
-   include "$IP/extensions/CentralNotice/CentralNotice.php";
+   wfLoadExtension( 'CentralNotice' );
 
// for DNS prefetching
$wgCentralHost = "//{$wmfHostnames['meta']}";
@@ -1608,15 +1608,11 @@
// Allow only these domains to access CentralNotice data through the 
reporter
$wgNoticeReporterDomains = 'https://donate.wikimedia.org';
 
-   $wgNoticeProject = $wmgNoticeProject;
-
$wgCentralDBname = 'metawiki';
if ( $wmfRealm == 'production' && $wgDBname == 'testwiki' ) {
# test.wikipedia.org has its own central database:
$wgCentralDBname = 'testwiki';
}
-
-   $wgCentralNoticeLoader = $wmgCentralNoticeLoader;
 
$wgNoticeInfrastructure = false;
if ( $wgDBname == 'metawiki' ) {
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 7812a4b..43df19b 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4375,12 +4375,12 @@
'votewiki' => false, // T61702
 ],
 
-'wmgCentralNoticeLoader' => [
+'wgCentralNoticeLoader' => [
'default' => true, // *gulp* -- bv 2008-11-03
 ],
 
 // For CentralNotice project pickers
-'wmgNoticeProject' => [
+'wgNoticeProject' => [
'advisorywiki' => 'wikimedia',
'default' => '$site',
'commonswiki' => 'commons',
diff --git a/wmf-config/extension-list b/wmf-config/extension-list
index 444f3cc..37ca054 100644
--- a/wmf-config/extension-list
+++ b/wmf-config/extension-list
@@ -10,7 +10,7 @@
 $IP/extensions/Cards/extension.json
 $IP/extensions/CategoryTree/extension.json
 $IP/extensions/CentralAuth/extension.json
-$IP/extensions/CentralNotice/CentralNotice.php
+$IP/extensions/CentralNotice/extension.json
 $IP/extensions/CharInsert/extension.json
 $IP/extensions/CheckUser/extension.json
 $IP/extensions/CirrusSearch/CirrusSearch.php

-- 
To view, visit https://gerrit.wikimedia.org/r/304126
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e65eb75a5267b168416770f854b9cca9005da94
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Only require_once JsonConfig.php in one place

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Only require_once JsonConfig.php in one place
..


Only require_once JsonConfig.php in one place

Change-Id: I5207886db3a9efd0f5ae79611bc7d39e745f56c2
---
M wmf-config/CommonSettings.php
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index c2c2ad9..b7287bc 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -3001,8 +3001,11 @@
$wgAbuseFilterIsCentral = ( $wgDBname == $wgAbuseFilterCentralDB );
 }
 
-if ( $wmgZeroPortal ) {
+if ( $wmgZeroPortal || $wmgUseGraph ) {
require_once( "$IP/extensions/JsonConfig/JsonConfig.php" );
+}
+
+if ( $wmgZeroPortal ) {
require_once( "$IP/extensions/ZeroBanner/ZeroBanner.php" );
require_once( "$IP/extensions/ZeroPortal/ZeroPortal.php" );
 
@@ -3052,7 +3055,6 @@
 }
 
 if ( $wmgUseGraph ) {
-   require_once( "$IP/extensions/JsonConfig/JsonConfig.php" );
wfLoadExtension( 'Graph' );
 
//  THIS LIST MUST MATCH puppet/hieradata/role/common/scb.yaml 

-- 
To view, visit https://gerrit.wikimedia.org/r/304617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5207886db3a9efd0f5ae79611bc7d39e745f56c2
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: 2 more to extension.json in extension-list

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: 2 more to extension.json in extension-list
..


2 more to extension.json in extension-list

Bug: T139800
Change-Id: I214218d726e0e7a15b028d4f87b3dde966a5eb85
---
M wmf-config/extension-list
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/extension-list b/wmf-config/extension-list
index 42a3a0e..444f3cc 100644
--- a/wmf-config/extension-list
+++ b/wmf-config/extension-list
@@ -47,7 +47,7 @@
 $IP/extensions/FundraisingTranslateWorkflow/extension.json
 $IP/extensions/Gadgets/extension.json
 $IP/extensions/GeoCrumbs/extension.json
-$IP/extensions/GeoData/GeoData.php
+$IP/extensions/GeoData/extension.json
 $IP/extensions/GettingStarted/extension.json
 $IP/extensions/GlobalBlocking/extension.json
 $IP/extensions/GlobalCssJs/extension.json
@@ -63,7 +63,7 @@
 $IP/extensions/intersection/extension.json
 $IP/extensions/Interwiki/extension.json
 $IP/extensions/Josa/extension.json
-$IP/extensions/JsonConfig/JsonConfig.php
+$IP/extensions/JsonConfig/extension.json
 $IP/extensions/Kartographer/extension.json
 $IP/extensions/LabeledSectionTransclusion/extension.json
 $IP/extensions/LandingCheck/extension.json

-- 
To view, visit https://gerrit.wikimedia.org/r/308577
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I214218d726e0e7a15b028d4f87b3dde966a5eb85
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Retrofit LoginTask

2016-09-16 Thread BearND (Code Review)
BearND has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311182

Change subject: Retrofit LoginTask
..

Retrofit LoginTask

It seems easier to chain request implemented using Retrofit than the traditional
java-mwapi requests. In the future we want to chain yet another request, in
addition to the two we have already. One to get the login token.
The 2nd one for the actual login request.

This patch replaces the LoginTask with a Retrofit2 LoginClient.
The test changes from LoginTaskTest to LoginClientTest.

Change-Id: I6d9818c92bfd834adf966a6c5808b7c0a236235d
---
R app/src/androidTest/java/org/wikipedia/test/LoginClientTest.java
M app/src/main/java/org/wikipedia/editing/EditSectionActivity.java
M app/src/main/java/org/wikipedia/login/LoginActivity.java
A app/src/main/java/org/wikipedia/login/LoginClient.java
M app/src/main/java/org/wikipedia/util/ThrowableUtil.java
5 files changed, 316 insertions(+), 77 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/82/311182/1

diff --git a/app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java 
b/app/src/androidTest/java/org/wikipedia/test/LoginClientTest.java
similarity index 62%
rename from app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java
rename to app/src/androidTest/java/org/wikipedia/test/LoginClientTest.java
index 32d3197..f130b2b 100644
--- a/app/src/androidTest/java/org/wikipedia/test/LoginTaskTest.java
+++ b/app/src/androidTest/java/org/wikipedia/test/LoginClientTest.java
@@ -1,47 +1,60 @@
 package org.wikipedia.test;
 
+import org.wikipedia.Site;
+import org.wikipedia.WikipediaApp;
+import org.wikipedia.editing.EditTokenStorage;
+import org.wikipedia.login.LoginClient;
+import org.wikipedia.login.LoginResult;
+import org.wikipedia.login.User;
+import org.wikipedia.testlib.TestLatch;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import android.support.annotation.NonNull;
 import android.support.annotation.StringRes;
 import android.support.test.InstrumentationRegistry;
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mediawiki.api.json.Api;
-import org.wikipedia.Site;
-import org.wikipedia.WikipediaApp;
-import org.wikipedia.editing.EditTokenStorage;
-import org.wikipedia.login.LoginResult;
-import org.wikipedia.login.LoginTask;
-import org.wikipedia.testlib.TestLatch;
-
+import static android.support.test.InstrumentationRegistry.getInstrumentation;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
-import static android.support.test.InstrumentationRegistry.getInstrumentation;
 
 @SmallTest
 @RunWith(AndroidJUnit4.class)
-public class LoginTaskTest {
+public class LoginClientTest {
 private static final String TEST_WIKI = "test.wikipedia.org";
 private static final String USERNAME = getString(R.string.test_username);
 private static final String PASSWORD = getString(R.string.test_password);
 private final TestLatch completionLatch = new TestLatch();
+
+@Before
+public void setUp() throws Exception {
+User.disableStorage(); // don't change the app login from this test
+}
 
 @Test
 public void testLogin() {
 InstrumentationRegistry.getInstrumentation().runOnMainSync(new 
Runnable() {
 @Override
 public void run() {
-new LoginTask(new Api(TEST_WIKI), USERNAME, PASSWORD) {
-@Override
-public void onFinish(LoginResult result) {
-super.onFinish(result);
-completionLatch.countDown();
-assertThat(result.getStatus(), equalTo("PASS"));
-
WikipediaApp.getInstance().getEditTokenStorage().get(new Site(TEST_WIKI), 
callback);
-}
-}.execute();
+new LoginClient().request(new Site(TEST_WIKI), USERNAME, 
PASSWORD,
+new LoginClient.LoginCallback() {
+@Override
+public void success(@NonNull LoginResult result) {
+completionLatch.countDown();
+assertThat(result.getStatus(), 
equalTo("PASS"));
+
WikipediaApp.getInstance().getEditTokenStorage().get(new Site(TEST_WIKI), 
callback);
+}
+
+@Override
+public void error(@NonNull Throwable caught) {
+assertThat("login failed!", false);
+}
+});
 }
 });
 completionLatch.await();
diff 

[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Import templates from English Wikipedia

2016-09-16 Thread Mattflaschen (Code Review)
Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311178

Change subject: Import templates from English Wikipedia
..

Import templates from English Wikipedia

This will make testing easier (they should also be auto-imported
via MediaWiki-Vagrant later), and is useful to show required changes
to the templates connected to code changes.

The new templates can then be imported back to production after
testing.

Bug: T145891
Change-Id: I09604ed1fe75ad213ed8a6c30e21db9dd0979a13
---
A CC-BY-SA-3.0.txt
A NewPagesFeed_Templates.xml
M README
3 files changed, 6,560 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/78/311178/1


-- 
To view, visit https://gerrit.wikimedia.org/r/311178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09604ed1fe75ad213ed8a6c30e21db9dd0979a13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Move 'site' and 'user' logic to makeModuleRe...

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: resourceloader: Move 'site' and 'user' logic to 
makeModuleResponse
..


resourceloader: Move 'site' and 'user' logic to makeModuleResponse

* Keep this out of makeLoaderImplementScript() to keep it more generic
  and to simplify future refactoring.

* Remove now-broken test case that asserted that the output varies
  by global debug mode.

* Make the test responsible for wrapping in XmlJsCode. Previously
  this magically happened because the module name was "user" in the
  last test case.

* Make makeLoaderImplementScript protected. It's not used anywhere
  outside ResourceLoader and we should keep it that way.

Test plan:
* Verify output unchanged:
  - load.php?modules=user=scripts=Admin (raw code)
  - load.php?modules=user=Admin (implement with unwrapped string)
  - load.php?modules=jquery.client (implement with closure)

Change-Id: I527d01926fb6e4ce68c931695d830cdb9ceb608c
---
M includes/resourceloader/ResourceLoader.php
M resources/src/mediawiki/mediawiki.js
M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
3 files changed, 35 insertions(+), 34 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/resourceloader/ResourceLoader.php 
b/includes/resourceloader/ResourceLoader.php
index 97a86c3..34a0a99 100644
--- a/includes/resourceloader/ResourceLoader.php
+++ b/includes/resourceloader/ResourceLoader.php
@@ -1031,9 +1031,23 @@
$strContent = isset( 
$styles['css'] ) ? implode( '', $styles['css'] ) : '';
break;
default:
+   $scripts = isset( 
$content['scripts'] ) ? $content['scripts'] : '';
+   if ( is_string( $scripts ) ) {
+   if ( $name === 'site' 
|| $name === 'user' ) {
+   // Legacy 
scripts that run in the global scope without a closure.
+   // 
mw.loader.implement will use globalEval if scripts is a string.
+   // Minify 
manually here, because general response minification is
+   // not 
effective due it being a string literal, not a function.
+   if ( 
!ResourceLoader::inDebugMode() ) {
+   
$scripts = self::filter( 'minify-js', $scripts ); // T107377
+   }
+   } else {
+   $scripts = new 
XmlJsCode( $scripts );
+   }
+   }
$strContent = 
self::makeLoaderImplementScript(
$name,
-   isset( 
$content['scripts'] ) ? $content['scripts'] : '',
+   $scripts,
isset( 
$content['styles'] ) ? $content['styles'] : [],
isset( 
$content['messagesBlob'] ) ? new XmlJsCode( $content['messagesBlob'] ) : [],
isset( 
$content['templates'] ) ? $content['templates'] : []
@@ -1112,7 +1126,8 @@
 * Return JS code that calls mw.loader.implement with given module 
properties.
 *
 * @param string $name Module name
-* @param mixed $scripts List of URLs to JavaScript files or String of 
JavaScript code
+* @param XmlJsCode|array|string $scripts Code as XmlJsCode (to be 
wrapped in a closure),
+*  list of URLs to JavaScript files, or a string of JavaScript for 
`$.globalEval`.
 * @param mixed $styles Array of CSS strings keyed by media type, or an 
array of lists of URLs
 *   to CSS files keyed by media type
 * @param mixed $messages List of messages associated with this module. 
May either be an
@@ -1123,22 +1138,13 @@
 * @throws MWException
 * @return string
 */
-   public static function makeLoaderImplementScript(
+   protected static function makeLoaderImplementScript(
$name, $scripts, $styles, $messages, $templates
) {
-   if ( is_string( $scripts ) ) {
-   // Site and user module are a 

[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Don't crash when a revision is not found

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Don't crash when a revision is not found
..


Don't crash when a revision is not found

In some cases (to be discovered), the recent changes
or watchlist page crashes with "Revision not found in revisionCache".

This change logs a warning and returns false for that specific
revision instead of throwing an exception. It's only a bandaid
until we fix the problem and will allow us to collect more
information if we're not able to fix it now.

Bug: T145125
Change-Id: I74de54336aec8f9c6d709d60ca4c6f655bb5d46d
---
M includes/Formatter/ChangesListQuery.php
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Formatter/ChangesListQuery.php 
b/includes/Formatter/ChangesListQuery.php
index b55cf56..9e7c006 100644
--- a/includes/Formatter/ChangesListQuery.php
+++ b/includes/Formatter/ChangesListQuery.php
@@ -8,6 +8,7 @@
 use Flow\FlowActions;
 use Flow\Model\UUID;
 use Flow\Repository\TreeRepository;
+use MediaWiki\Logger\LoggerFactory;
 use RecentChange;
 
 class ChangesListQuery extends AbstractQuery {
@@ -152,7 +153,14 @@
 
$alpha = UUID::create( $changeData['revision'] 
)->getAlphadecimal();
if ( !isset( $this->revisionCache[$alpha] ) ) {
-   throw new FlowException( "Revision not found in 
revisionCache: $alpha" );
+   LoggerFactory::getInstance( 'Flow' )->error(
+   'Revision not found in revisionCache: {alpha}',
+   array(
+   'alpha' => $alpha,
+   'rcParams' => $rcParams,
+   )
+   );
+   return false;
}
$revision = $this->revisionCache[$alpha];
 

-- 
To view, visit https://gerrit.wikimedia.org/r/310961
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I74de54336aec8f9c6d709d60ca4c6f655bb5d46d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...FundraisingEmailUnsubscribe[master]: Fix mixed spaces and tabs

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix mixed spaces and tabs
..


Fix mixed spaces and tabs

Change-Id: Ib1c511e5a5aa85b981e7f7ec1c3c599fce4f85ab
---
M composer.json
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index f53413b..a336037 100644
--- a/composer.json
+++ b/composer.json
@@ -6,8 +6,8 @@
"irc": "irc://irc.freenode.net/wikimedia-fundraising"
},
"require": {
-"coderkungfu/php-queue": "dev-master",
-"predis/predis": "^1.1",
+   "coderkungfu/php-queue": "dev-master",
+   "predis/predis": "^1.1",
"twig/twig": "^1.24",
"stomp-php/stomp-php": "^2.2"
},

-- 
To view, visit https://gerrit.wikimedia.org/r/30
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1c511e5a5aa85b981e7f7ec1c3c599fce4f85ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FundraisingEmailUnsubscribe
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CookieWarning[refs/meta/config]: Add extension-CookiePolicy and ShoutWiki as maintainers

2016-09-16 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has submitted this change and it was merged.

Change subject: Add extension-CookiePolicy and ShoutWiki as maintainers
..


Add extension-CookiePolicy and ShoutWiki as maintainers

Bug: T145782
Change-Id: I6f574ea69500078a4edd1bdabbb06f0070f583fa
---
M groups
M project.config
2 files changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Paladox: Looks good to me, but someone else must approve
  Florianschmidtwelzow: Verified; Looks good to me, approved



diff --git a/groups b/groups
index c9f6bdc..1809015 100644
--- a/groups
+++ b/groups
@@ -1,3 +1,5 @@
 # UUID Group Name
 #
+6e9f0b70387cfae8504cef2ddedc237e87d7027f   extension-CookiePolicy
 710e81f2864d5280f211e11de995fd1e754f0f4e   extension-CookieWarning
+e840de91aa21e5e32768f44e776c43d4fc1ca729   ShoutWiki
diff --git a/project.config b/project.config
index ce63efc..cb6aa08 100644
--- a/project.config
+++ b/project.config
@@ -7,4 +7,6 @@
 [submit]
mergeContent = true
 [access "refs/*"]
+   owner = group ShoutWiki
+   owner = group extension-CookiePolicy
owner = group extension-CookieWarning

-- 
To view, visit https://gerrit.wikimedia.org/r/310823
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6f574ea69500078a4edd1bdabbb06f0070f583fa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CookieWarning
Gerrit-Branch: refs/meta/config
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Paladox 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CookieWarning[master]: WIP: Add option to limit the cookie warning to specific regions

2016-09-16 Thread Florianschmidtwelzow (Code Review)
Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311175

Change subject: WIP: Add option to limit the cookie warning to specific regions
..

WIP: Add option to limit the cookie warning to specific regions

With this change, CookieWarning gets two new ways to limit the warning
bar to users of specific (configurable) regions. Based on the geo location
service (which can be configured, too, defaults to freegeoip.net), the
extension will try to get the region of the user (based on the IP address)
and checks it against the configured regions.

With the configuration variable $wgCookieWarningGeoIPLookup, the wiki sysadmin
can configure, if the lookup should be done with PHP (the timeout for the
request is hardcoded to 2 sedonds max), which will save the paylod sent to
the user, or with JavaScript, which will be asynchronous.

Deactivating this feature is easily done by simply setting the configured 
regions
to false, instead of an object.

Bug: T145780
Change-Id: I4d9371b8608ef270c11c42bdb3a773675977ab3a
---
M extension.json
M includes/CookieWarning.hooks.php
A includes/GeoLocation.php
A resources/ext.CookieWarning.geolocation/cookiePolicy.js
A resources/ext.CookieWarning.geolocation/styles.css
5 files changed, 300 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CookieWarning 
refs/changes/75/311175/1

diff --git a/extension.json b/extension.json
index 722db7f..9a2cfa7 100644
--- a/extension.json
+++ b/extension.json
@@ -22,11 +22,65 @@
],
"GetPreferences": [
"CookieWarningHooks::onGetPreferences"
+   ],
+   "ResourceLoaderGetConfigVars": [
+   "CookieWarningHooks::onResourceLoaderGetConfigVars"
]
},
"config": {
"CookieWarningEnabled": false,
-   "CookieWarningMoreUrl": ""
+   "CookieWarningMoreUrl": "",
+   "CookieWarningGeoIPServiceURL": "//freegeoip.net/json/",
+   "CookieWarningGeoIPLookup": "php",
+   "CookieWarningForCountryCodes": {
+   "EU": "Europe",
+   "AD": "Andorra",
+   "AL": "Albania",
+   "AT": "Austria",
+   "BA": "Bosnia and Herzegovina",
+   "BE": "Belgium",
+   "BG": "Bulgaria",
+   "BY": "Belarus",
+   "CH": "Switzerland",
+   "CS": "Serbia and Montenegro",
+   "CZ": "Czech Republic",
+   "DE": "Germany",
+   "DK": "Denmark",
+   "EE": "Estonia",
+   "ES": "Spain",
+   "FI": "Finland",
+   "FO": "Faroe Islands",
+   "FR": "France",
+   "FX": "France, Metropolitan",
+   "GB": "United Kingdom",
+   "GI": "Gibraltar",
+   "GR": "Greece",
+   "HR": "Croatia",
+   "HU": "Hungary",
+   "IE": "Ireland",
+   "IS": "Iceland",
+   "IT": "Italy",
+   "LI": "Liechtenstein",
+   "LT": "Lithuania",
+   "LU": "Luxembourg",
+   "LV": "Latvia",
+   "MC": "Monaco",
+   "MD": "Moldova, Republic of",
+   "MK": "Macedonia",
+   "MT": "Malta",
+   "NL": "Netherlands",
+   "NO": "Norway",
+   "PL": "Poland",
+   "PT": "Portugal",
+   "RO": "Romania",
+   "SE": "Sweden",
+   "SI": "Slovenia",
+   "SJ": "Svalbard and Jan Mayen",
+   "SK": "Slovakia",
+   "SM": "San Marino",
+   "UA": "Ukraine",
+   "VA": "Holy See (Vatican City State)"
+   }
},
"ResourceModules": {
"ext.CookieWarning": {
@@ -47,6 +101,22 @@
"mobile",
"desktop"
]
+   },
+   "ext.CookieWarning.geolocation": {
+   "scripts": 
"resources/ext.CookieWarning.geolocation/cookiePolicy.js",
+   "dependencies": "ext.CookieWarning",
+   "targets": [
+   "mobile",
+   "desktop"
+   ]
+   },
+   "ext.CookieWarning.geolocation.styles": {
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid triggering SiteConfiguration lookup in JobQueueGroup::...

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Avoid triggering SiteConfiguration lookup in 
JobQueueGroup::push()
..


Avoid triggering SiteConfiguration lookup in JobQueueGroup::push()

Just use $wgJobTypesExcludedFromDefaultQueue directly

Bug: T145819
Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index de5f410..71d68d9 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -120,6 +120,8 @@
 * @return void
 */
public function push( $jobs ) {
+   global $wgJobTypesExcludedFromDefaultQueue;
+
$jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
if ( !count( $jobs ) ) {
return;
@@ -149,7 +151,7 @@
'true',
15
);
-   if ( array_intersect( array_keys( $jobsByType ), 
$this->getDefaultQueueTypes() ) ) {
+   if ( array_diff( array_keys( $jobsByType ), 
$wgJobTypesExcludedFromDefaultQueue ) ) {
$cache->set(
$cache->makeGlobalKey( 'jobqueue', $this->wiki, 
'hasjobs', self::TYPE_DEFAULT ),
'true',

-- 
To view, visit https://gerrit.wikimedia.org/r/311168
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.19]: Avoid triggering SiteConfiguration lookup in JobQueueGroup::...

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Avoid triggering SiteConfiguration lookup in 
JobQueueGroup::push()
..


Avoid triggering SiteConfiguration lookup in JobQueueGroup::push()

Just use $wgJobTypesExcludedFromDefaultQueue directly

Bug: T145819
Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index de5f410..71d68d9 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -120,6 +120,8 @@
 * @return void
 */
public function push( $jobs ) {
+   global $wgJobTypesExcludedFromDefaultQueue;
+
$jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
if ( !count( $jobs ) ) {
return;
@@ -149,7 +151,7 @@
'true',
15
);
-   if ( array_intersect( array_keys( $jobsByType ), 
$this->getDefaultQueueTypes() ) ) {
+   if ( array_diff( array_keys( $jobsByType ), 
$wgJobTypesExcludedFromDefaultQueue ) ) {
$cache->set(
$cache->makeGlobalKey( 'jobqueue', $this->wiki, 
'hasjobs', self::TYPE_DEFAULT ),
'true',

-- 
To view, visit https://gerrit.wikimedia.org/r/311172
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.19
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...FundraisingEmailUnsubscribe[master]: Add tests for thank you unsubscribe

2016-09-16 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311174

Change subject: Add tests for thank you unsubscribe
..

Add tests for thank you unsubscribe

Move queue instantiation into a helper class so tests see the same
instance. Add a hooks class to require composer autoload regardless
of entry point.

Bug: T145419
Change-Id: I1c357794fc857c3ee32ba1e4c1c61f6c44aa8c39
---
A FundraisingEmailUnsubscribeHooks.php
M SpecialFundraiserUnsubscribe.php
M extension.json
A includes/FundraiserEmailQueue.php
M methods/FundraiserUnsubscribeThankYou.php
A tests/phpunit/UnsubscribeThankYouTest.php
6 files changed, 102 insertions(+), 15 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FundraisingEmailUnsubscribe
 refs/changes/74/311174/1

diff --git a/FundraisingEmailUnsubscribeHooks.php 
b/FundraisingEmailUnsubscribeHooks.php
new file mode 100644
index 000..ee1d6bc
--- /dev/null
+++ b/FundraisingEmailUnsubscribeHooks.php
@@ -0,0 +1,9 @@
+https://www.mediawiki.org/wiki/Extension:FundraiserUnsubscribe;,
"descriptionmsg": "fundraiserunsubscribe-desc",
"type": "specialpage",
+   "callback": "FundraisingEmailUnsubscribeHooks::onRegistration",
"SpecialPages": {
"FundraiserUnsubscribe": "SpecialFundraiserUnsubscribe"
},
@@ -16,8 +17,10 @@
]
},
"AutoloadClasses": {
+   "FundraisingEmailUnsubscribeHooks": 
"FundraisingEmailUnsubscribeHooks.php",
"SpecialFundraiserUnsubscribe": 
"SpecialFundraiserUnsubscribe.php",
"Logger": "includes/Logger.php",
+   "FundraiserEmailQueue": "includes/FundraiserEmailQueue.php",
"MediaWikiTwig": "includes/MediaWikiTwig.php",
"MediaWikiTwigCallbacks": "includes/MediaWikiTwig.php",
"XmlTransactionProcessor": 
"includes/XmlTransactionProcessor.php",
diff --git a/includes/FundraiserEmailQueue.php 
b/includes/FundraiserEmailQueue.php
new file mode 100644
index 000..545c1c6
--- /dev/null
+++ b/includes/FundraiserEmailQueue.php
@@ -0,0 +1,29 @@
+ $email,
'contribution-id' => $contribId
);
+
// Send to the queue
Logger::log( 'Placing message in queue for email ' . 
json_encode( $email ) );
-
-   if ( empty( 
$wgFundraisingEmailUnsubscribeQueueParameters['queue'] ) ) {
-   $wgFundraisingEmailUnsubscribeQueueParameters['queue'] 
= 'unsubscribe';
-   }
-   $queue = new $wgFundraisingEmailUnsubscribeQueueClass(
-   $wgFundraisingEmailUnsubscribeQueueParameters
-   );
-   // Throws exception if it is unsuccessful
-   $queue->push( $message );
+   FundraiserEmailQueue::get()->push( $message );
 
// Clean up and return
Logger::popLabel();
diff --git a/tests/phpunit/UnsubscribeThankYouTest.php 
b/tests/phpunit/UnsubscribeThankYouTest.php
new file mode 100644
index 000..518b092
--- /dev/null
+++ b/tests/phpunit/UnsubscribeThankYouTest.php
@@ -0,0 +1,59 @@
+setMwGlobals( array(
+   'wgFundraisingEmailUnsubscribeQueueClass' => 
'\PHPQueue\Backend\PDO',
+   'wgFundraisingEmailUnsubscribeQueueParameters' => array(
+   'connection_string' => 'sqlite::memory:',
+   ),
+   'wgFundraisingEmailUnsubscribeHashSecretKey' => 
'Red/Fl4nn3l/#',
+   ) );
+   $this->unsubscriber = new FundraiserUnsubscribeThankYou();
+   }
+
+   public function testValidateBadHash() {
+   $result = $this->unsubscriber->validateRequest( array(
+   'email' => 'peste...@example.com',
+   'contribution-id' => '98765432',
+   'hash' => 'a76f8eg86b87eg109c0d983d6a0e9a6d827e79c7',
+   ) );
+   $this->assertFalse( $result, 'Bogus hash considered valid' );
+   }
+
+   public function testValidateGoodHash() {
+   $result = $this->unsubscriber->validateRequest( array(
+   'email' => 'peste...@example.com',
+   'contribution-id' => '98765432',
+   'hash' => '87b7b93fffbe72b61261e59941e3b6628b0e5689',
+   ) );
+   $this->assertTrue( $result, 'Good hash considered invalid' );
+   }
+
+   public function testSendMessage() {
+   $id = mt_rand();
+   $this->unsubscriber->unsubscribe(
+   $id, 'unsubscribe', array(
+   'email' => 'do...@example.com',
+   'contribution-id' => '123456'
+   )
+   );
+   $queue = FundraiserEmailQueue::get();
+ 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: WIP/EXPERIMENTAL Make ve.dm.VisualDiff

2016-09-16 Thread Tchanders (Code Review)
Tchanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311173

Change subject: WIP/EXPERIMENTAL Make ve.dm.VisualDiff
..

WIP/EXPERIMENTAL Make ve.dm.VisualDiff

A ve.dm.VisualDiff gets everything that is needed to build a
visualisation of the diff:
- a mapping of old nodes to their analogous new nodes (changed
or unchanged)
- the moves that map a changed old node to its analogous new
node
- a list of removed nodes
- a list of inserted nodes
NB Nodes are ordered, so it is also possible to infer moves.

Next steps: build something basic for visualising the diff in
VE UI - to be adapted according to collaboration with design.

Change-Id: I23295efd75e9e37b273b99a361ded99a98217295
---
M demos/ve/desktop.html
M demos/ve/ve.demo.SurfaceContainer.js
A lib/diff-match-patch/diff_match_patch_uncompressed.js
M lib/treeDiffer/diff.differ.js
M src/dm/lineardata/ve.dm.ElementLinearData.js
M src/dm/ve.dm.Document.js
A src/dm/ve.dm.VisualDiff.js
7 files changed, 2,702 insertions(+), 101 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/73/311173/1

diff --git a/demos/ve/desktop.html b/demos/ve/desktop.html
index f51a8cb..5053c34 100644
--- a/demos/ve/desktop.html
+++ b/demos/ve/desktop.html
@@ -88,10 +88,38 @@


 
+   
+   .diff-div {
+   border: 1px solid;
+   }
+   .diff-insert {
+   border: 1px solid green;
+   }
+   .diff-remove {
+   border: 1px solid red;
+   }
+   .diff-change {
+   border: 1px solid blue;
+   }
+   .diff-move-up {
+   border-top: 1px dashed;
+   }
+   .diff-move-down {
+   border-bottom: 1px dashed;
+   }
+   del {
+ color: red;
+   }
+   ins{
+   color: green;
+   }
+   
+




+   Diff goes here

 

@@ -150,6 +178,9 @@



+
+   
+   
 


@@ -295,6 +326,7 @@



+   



diff --git a/demos/ve/ve.demo.SurfaceContainer.js 
b/demos/ve/ve.demo.SurfaceContainer.js
index b622783..e82872d 100644
--- a/demos/ve/ve.demo.SurfaceContainer.js
+++ b/demos/ve/ve.demo.SurfaceContainer.js
@@ -88,83 +88,12 @@
console.log( diff.sort( sortChangeBase ) );
} );
treeDiffButton.on( 'click', function () {
-   var diff, differ, root1, root2, tree1, tree2;
-   diff = window.diff;
+   var oldDoc = ve.init.target.oldDoc,
+   newDoc = ve.init.target.surface.model.documentModel,
+   visualDiff = new ve.dm.VisualDiff( oldDoc, newDoc );
 
-   // Wraps each node of a tree in a treeNode
-   function wrapNodes( parentNode ) {
-   var i, ilen, childNode;
+   console.log( visualDiff.getDiff() );
 
-   if ( parentNode.node.children ) {
-   for ( i = 0, ilen = 
parentNode.node.children.length; i < ilen; i++ ) {
-
-   // Wrap this node
-   childNode = new diff.treeNode( 
parentNode.node.children[ i ] );
-   parentNode.addChild( childNode );
-
-   // Wrap this node's children
-   wrapNodes( childNode );
-
-   }
-   }
-
-   }
-
-   // Logs descriptions of the minimum diff transactions
-   function logTransactionDescriptions( transactions ) {
-   var i, ilen = transactions.length;
-
-   // Log number of transactions
-   console.log( ilen + ' transaction(s)' );
-
-   // Log type of transactions
-   for ( i = 0; i < ilen; i++ ) {
-   if ( transactions[i][0] === null ) {
-   console.log( 'insert', 
tree2.orderedNodes[ transactions[ i ][ 1 ] ] );
-   } else if ( transactions[ i ][ 1 ] === null ) {
-   console.log( 'remove', 
tree1.orderedNodes[ transactions[ i ][ 0 ] ] );
-   } else {
-   console.log(
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.19]: Avoid triggering SiteConfiguration lookup in JobQueueGroup::...

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311172

Change subject: Avoid triggering SiteConfiguration lookup in 
JobQueueGroup::push()
..

Avoid triggering SiteConfiguration lookup in JobQueueGroup::push()

Just use $wgJobTypesExcludedFromDefaultQueue directly

Bug: T145819
Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/311172/1

diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index de5f410..71d68d9 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -120,6 +120,8 @@
 * @return void
 */
public function push( $jobs ) {
+   global $wgJobTypesExcludedFromDefaultQueue;
+
$jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
if ( !count( $jobs ) ) {
return;
@@ -149,7 +151,7 @@
'true',
15
);
-   if ( array_intersect( array_keys( $jobsByType ), 
$this->getDefaultQueueTypes() ) ) {
+   if ( array_diff( array_keys( $jobsByType ), 
$wgJobTypesExcludedFromDefaultQueue ) ) {
$cache->set(
$cache->makeGlobalKey( 'jobqueue', $this->wiki, 
'hasjobs', self::TYPE_DEFAULT ),
'true',

-- 
To view, visit https://gerrit.wikimedia.org/r/311172
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.19
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update Alphos' blog URL for fr.planet

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: Update Alphos' blog URL for fr.planet
..


Update Alphos' blog URL for fr.planet

Feed URL had an extraneous /wordpress.

Initially requested on Freenode #wikidata-fr.

The site editor has been notified of the opportunity to switch to HTTPS
and will consider to use Let's encrypt in a near term.

Change-Id: I74d2a6f204ec5266172a0f98136af5daca11ce2c
---
M modules/planet/templates/feeds/fr_config.erb
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Dzahn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/planet/templates/feeds/fr_config.erb 
b/modules/planet/templates/feeds/fr_config.erb
index 3e516ee..dab24ee 100644
--- a/modules/planet/templates/feeds/fr_config.erb
+++ b/modules/planet/templates/feeds/fr_config.erb
@@ -116,7 +116,7 @@
 [https://daindwarf.wordpress.com/category/wikipedia/feed/atom/]
 name=DainDwarf
 
-[http://wordpress.alphos.fr/wordpress/cat/wikimedia/feed/]
+[http://wordpress.alphos.fr/cat/wikimedia/feed/]
 name=Alphos
 
 [https://alphakilobit.wordpress.com/category/wikimedia/feed/atom/]

-- 
To view, visit https://gerrit.wikimedia.org/r/311171
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I74d2a6f204ec5266172a0f98136af5daca11ce2c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dereckson 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update Alphos' blog URL for fr.planet

2016-09-16 Thread Dereckson (Code Review)
Dereckson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311171

Change subject: Update Alphos' blog URL for fr.planet
..

Update Alphos' blog URL for fr.planet

Feed URL had an extraneous /wordpress.

Initially requested on Freenode #wikidata-fr.

The site editor has been notified of the opportunity to switch to HTTPS
and will consider to use Let's encrypt in a near term.

Change-Id: I74d2a6f204ec5266172a0f98136af5daca11ce2c
---
M modules/planet/templates/feeds/fr_config.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/71/311171/1

diff --git a/modules/planet/templates/feeds/fr_config.erb 
b/modules/planet/templates/feeds/fr_config.erb
index 3e516ee..dab24ee 100644
--- a/modules/planet/templates/feeds/fr_config.erb
+++ b/modules/planet/templates/feeds/fr_config.erb
@@ -116,7 +116,7 @@
 [https://daindwarf.wordpress.com/category/wikipedia/feed/atom/]
 name=DainDwarf
 
-[http://wordpress.alphos.fr/wordpress/cat/wikimedia/feed/]
+[http://wordpress.alphos.fr/cat/wikimedia/feed/]
 name=Alphos
 
 [https://alphakilobit.wordpress.com/category/wikimedia/feed/atom/]

-- 
To view, visit https://gerrit.wikimedia.org/r/311171
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74d2a6f204ec5266172a0f98136af5daca11ce2c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dereckson 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Rename domain => localDomain in LBFactory for consistency

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311169

Change subject: Rename domain => localDomain in LBFactory for consistency
..

Rename domain => localDomain in LBFactory for consistency

Change-Id: I2fb66f98dddb4acc38958a7b8beec002970d43f7
---
M includes/db/loadbalancer/LBFactoryMW.php
M includes/libs/rdbms/lbfactory/LBFactory.php
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/311169/1

diff --git a/includes/db/loadbalancer/LBFactoryMW.php 
b/includes/db/loadbalancer/LBFactoryMW.php
index 33c48a5..2fb48c7 100644
--- a/includes/db/loadbalancer/LBFactoryMW.php
+++ b/includes/db/loadbalancer/LBFactoryMW.php
@@ -40,7 +40,7 @@
global $wgCommandLineMode;
 
$defaults = [
-   'domain' => wfWikiID(),
+   'localDomain' => wfWikiID(),
'hostname' => wfHostname(),
'trxProfiler' => 
Profiler::instance()->getTransactionProfiler(),
'replLogger' => LoggerFactory::getInstance( 
'DBReplication' ),
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index 107a7e2..b6f3317 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -50,7 +50,7 @@
protected $wanCache;
 
/** @var string Local domain */
-   protected $domain;
+   protected $localDomain;
/** @var string Local hostname of the app server */
protected $hostname;
/** @var mixed */
@@ -79,7 +79,7 @@
 * @param array $conf
 */
public function __construct( array $conf ) {
-   $this->domain = isset( $conf['domain'] ) ? $conf['domain'] : '';
+   $this->localDomain = isset( $conf['localDomain'] ) ? 
$conf['localDomain'] : '';
 
if ( isset( $conf['readOnlyReason'] ) && is_string( 
$conf['readOnlyReason'] ) ) {
$this->readOnlyReason = $conf['readOnlyReason'];
@@ -608,7 +608,7 @@
 */
final protected function baseLoadBalancerParams() {
return [
-   'localDomain' => $this->domain,
+   'localDomain' => $this->localDomain,
'readOnlyReason' => $this->readOnlyReason,
'srvCache' => $this->srvCache,
'wanCache' => $this->wanCache,
@@ -641,7 +641,7 @@
 * @since 1.28
 */
public function setDomainPrefix( $domain ) {
-   $this->domain = $domain;
+   $this->localDomain = $domain;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/311169
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fb66f98dddb4acc38958a7b8beec002970d43f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Cleanup setDomainPrefix() methods to handle existing LBs/DBs

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311170

Change subject: Cleanup setDomainPrefix() methods to handle existing LBs/DBs
..

Cleanup setDomainPrefix() methods to handle existing LBs/DBs

Change-Id: Ifa1efc3f7097fb1b8ab7d49fa18f10d76cd1641e
---
M includes/db/CloneDatabase.php
M includes/libs/rdbms/lbfactory/LBFactory.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
3 files changed, 13 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/311170/1

diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php
index ee82bdf..2af742e 100644
--- a/includes/db/CloneDatabase.php
+++ b/includes/db/CloneDatabase.php
@@ -132,12 +132,6 @@
 
$lbFactory = wfGetLBFactory();
$lbFactory->setDomainPrefix( $prefix );
-   $lbFactory->forEachLB( function( LoadBalancer $lb ) use ( 
$prefix ) {
-   $lb->setDomainPrefix( $prefix );
-   $lb->forEachOpenConnection( function ( IDatabase $db ) 
use ( $prefix ) {
-   $db->tablePrefix( $prefix );
-   } );
-   } );
$wgDBprefix = $prefix;
}
 }
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index b6f3317..e011ff0 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -633,15 +633,18 @@
}
 
/**
-* Define a new local domain (for testing)
+* Set a new table prefix for the existing local domain ID for testing
 *
-* Caller should make sure no local connection are open to the old 
local domain
-*
-* @param string $domain
+* @param string $prefix
 * @since 1.28
 */
-   public function setDomainPrefix( $domain ) {
-   $this->localDomain = $domain;
+   public function setDomainPrefix( $prefix ) {
+   list( $dbName, ) = explode( '-', $this->localDomain, 2 );
+   $this->localDomain = "{$dbName}-{$prefix}";
+
+   $this->forEachLB( function( LoadBalancer $lb ) use ( $prefix ) {
+   $lb->setDomainPrefix( $prefix );
+   } );
}
 
/**
diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index db69de1..8943ae6 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -1607,7 +1607,10 @@
 */
public function setDomainPrefix( $prefix ) {
list( $dbName, ) = explode( '-', $this->localDomain, 2 );
-
$this->localDomain = "{$dbName}-{$prefix}";
+
+   $this->forEachOpenConnection( function ( IDatabase $db ) use ( 
$prefix ) {
+   $db->tablePrefix( $prefix );
+   } );
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/311170
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa1efc3f7097fb1b8ab7d49fa18f10d76cd1641e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Introduce Special:EntityUsage/Q#

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Introduce Special:EntityUsage/Q#
..


Introduce Special:EntityUsage/Q#

Bug: T144923
Change-Id: Ib93d0b5aa6e9326e9845ba08ce0528fbbb36076b
---
M client/WikibaseClient.hooks.php
M client/WikibaseClient.i18n.alias.php
M client/WikibaseClient.php
M client/i18n/en.json
M client/i18n/qqq.json
A client/includes/Specials/SpecialEntityUsage.php
A client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
7 files changed, 317 insertions(+), 0 deletions(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 3e74593..476e209 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -27,6 +27,7 @@
 use Wikibase\Client\RecentChanges\ExternalChangeFactory;
 use Wikibase\Client\Specials\SpecialPagesWithBadges;
 use Wikibase\Client\Specials\SpecialUnconnectedPages;
+use Wikibase\Client\Specials\SpecialEntityUsage;
 use Wikibase\Client\WikibaseClient;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Lib\AutoCommentFormatter;
@@ -473,6 +474,7 @@
public static function onwgQueryPages( &$queryPages ) {
$queryPages[] = array( SpecialUnconnectedPages::class, 
'UnconnectedPages' );
$queryPages[] = array( SpecialPagesWithBadges::class, 
'PagesWithBadges' );
+   $queryPages[] = array( SpecialEntityUsage::class, 'EntityUsage' 
);
return true;
}
 
diff --git a/client/WikibaseClient.i18n.alias.php 
b/client/WikibaseClient.i18n.alias.php
index 9feeb67..893baf6 100644
--- a/client/WikibaseClient.i18n.alias.php
+++ b/client/WikibaseClient.i18n.alias.php
@@ -14,6 +14,7 @@
 
 /** English (English) */
 $specialPageAliases['en'] = array(
+   'EntityUsage' => array( 'EntityUsage', 'EntityUsageData' ),
'PagesWithBadges' => array( 'PagesWithBadges', 'QueryBadges' ),
'UnconnectedPages' => array( 'UnconnectedPages', 'WithoutConnection', 
'WithoutSitelinks' ),
 );
diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index dab1b05..a29f57e 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -208,6 +208,7 @@
// Special page registration
$wgSpecialPages['UnconnectedPages'] = 
'Wikibase\Client\Specials\SpecialUnconnectedPages';
$wgSpecialPages['PagesWithBadges'] = 
'Wikibase\Client\Specials\SpecialPagesWithBadges';
+   $wgSpecialPages['EntityUsage'] = 
'Wikibase\Client\Specials\SpecialEntityUsage';
$wgHooks['wgQueryPages'][] = 'Wikibase\ClientHooks::onwgQueryPages';
 
// Resource loader modules
diff --git a/client/i18n/en.json b/client/i18n/en.json
index bb20403..d806555 100644
--- a/client/i18n/en.json
+++ b/client/i18n/en.json
@@ -82,6 +82,12 @@
"wikibase-pageswithbadges-legend": "List of pages with a given badge",
"wikibase-pageswithbadges-badge": "Badge:",
"wikibase-pageswithbadges-submit": "Show pages",
+   "entityusage": "Entity Usage",
+   "entityusage-summary": "This page lists pages that use the given entity 
(e.g. Q42). The list is sorted by descending page ID, so that newer pages are 
listed first.",
+   "wikibase-entityusage-invalid-id": "$1 is not a valid item ID",
+   "wikibase-entityusage-legend": "List of pages that use a given entity",
+   "wikibase-entityusage-entity": "Entity:",
+   "wikibase-entityusage-submit": "Show pages",
"wikibase-pageinfo-entity-id": "{{WBREPONAME}} item ID",
"wikibase-pageinfo-entity-id-none": "None",
"wikibase-pageinfo-entity-usage": "{{WBREPONAME}} entities used in this 
page",
diff --git a/client/i18n/qqq.json b/client/i18n/qqq.json
index d93e514..917c245 100644
--- a/client/i18n/qqq.json
+++ b/client/i18n/qqq.json
@@ -93,6 +93,12 @@
"wikibase-pageswithbadges-legend": "Legend for the PagesWithBadges 
special page",
"wikibase-pageswithbadges-badge": "Label for the input field to select 
the badge to filter by.\n{{Identical|Badge}}",
"wikibase-pageswithbadges-submit": "Label for the button that activates 
the action",
+   "entityusage": "{{doc-special|EntityUsage}}",
+   "entityusage-summary": "Introductory text used on Special:EntityUsage.",
+   "wikibase-entityusage-invalid-id": "Error message when an invalid id is 
passed to the special page. Parameters:\n* $1 - the invalid ID",
+   "wikibase-entityusage-legend": "Legend for the EntityUsage special 
page",
+   "wikibase-entityusage-entity": "Label for the input field to select the 
entity to show.",
+   "wikibase-entityusage-submit": "Label for the button that activates the 
action",
"wikibase-pageinfo-entity-id": "A link to the corresponding Wikibase 
Item",
"wikibase-pageinfo-entity-id-none": "The page is not linked with a 
wikibase 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Actually populate the prefix panel with prefi...

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Puppet Panel:  Actually populate the prefix panel with prefixes.
..


Puppet Panel:  Actually populate the prefix panel with prefixes.

Bug: T91990
Change-Id: I1a22aa6cad93da0bfe3c4f41748fd0a7566a1f61
---
M modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py
M modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py
M modules/openstack/files/liberty/horizon/puppettab/puppet_config.py
M modules/openstack/files/liberty/horizon/puppettab/tab.py
M 
modules/openstack/files/liberty/horizon/puppettab/templates/puppet/plus_tab.html
5 files changed, 73 insertions(+), 43 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py 
b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py
index f4fdc4f..73b1776 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py
@@ -14,11 +14,15 @@
 #under the License.
 
 import logging
+import re
 
 from django import template
 from django.template.loader import render_to_string
 from django.utils.translation import ugettext_lazy as _
 
+from wikimediapuppettab.puppet_config import puppet_config
+
+from horizon import exceptions
 from horizon import tabs
 
 logging.basicConfig()
@@ -39,12 +43,22 @@
 super(PlusTab, self).__init__(*args, **kwargs)
 
 def render(self):
-LOG.warning("rendering, and logging is working")
 context = template.RequestContext(self.request)
 context['prefix_name'] = self.prefix_name
 return render_to_string(self.get_template_name(self.request),
 self.data, context_instance=context)
 
 def post(self, request, *args, **kwargs):
-LOG.warning("We've got POST!")
+
+pattern = re.compile("^[A-Za-z][A-Za-z0-9_-]*$")
+if not pattern.match(request.POST["prefix_name"]):
+raise exceptions.BadRequest('Prefix must begin with a '
+'letter and contain only letters, '
+'numbers, _ or -.')
+
 self.prefix_name = request.POST["prefix_name"]
+
+# set an empty role list for this prefix, to force a
+#  record creation on the back end.
+config = puppet_config(self.prefix_name, self.tenant_id)
+config.set_role_list([])
diff --git 
a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py 
b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py
index 4bb05b4..eb4e7dc 100644
--- 
a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py
+++ 
b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py
@@ -24,6 +24,7 @@
 
 from wikimediapuppettab.tab import PuppetTab
 from wikimediapuppettab.prefixpanel.plustab import PlusTab
+from wikimediapuppettab.puppet_config import puppet_config
 
 logging.basicConfig()
 LOG = logging.getLogger(__name__)
@@ -32,9 +33,6 @@
 class PrefixPuppetPanel(horizon.Panel):
 name = _("Prefix Puppet")
 slug = "prefixpuppet"
-
-def handle(self, request, data):
-LOG.warning('PrefixPuppetPanel is handling')
 
 
 class PrefixTabs(tabs.TabGroup):
@@ -47,42 +45,44 @@
 self.request = request
 self.kwargs = kwargs
 self._data = None
-tab_instances = []
+self.request = request
 
-tenant_id = self.request.user.tenant_id
-
-# demo #1
-prefix = 'prefixone'
-tab_instances.append(("puppet-%s" % prefix,
-  PuppetTab(self,
-request,
-prefix=prefix,
-tenant_id=tenant_id)))
-# demo #2
-prefix = 'prefixtwo'
-tab_instances.append(("puppet-%s" % prefix,
-  PuppetTab(self,
-request,
-prefix=prefix,
-tenant_id=tenant_id)))
-# + tab
-tab_instances.append(('puppetprefixplus',
-  PlusTab(self, request, tenant_id=tenant_id)))
-
-self._tabs = OrderedDict(tab_instances)
+self.tenant_id = self.request.user.tenant_id
+self._tabs = OrderedDict(self.get_dynamic_tab_list())
 if self.sticky:
 self.attrs['data-sticky-tabs'] = 'sticky'
 if not self._set_active_tab():
 self.tabs_not_available()
 
-def handle(self, request, data):
-LOG.warning('PrefixTabs is handling')
+def get_dynamic_tab_list(self):
+prefixlist = 

[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Numbers shown in poll statistics should be localized

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Numbers shown in poll statistics should be localized
..


Numbers shown in poll statistics should be localized

Bug: T145542

Change-Id: I371ac0f6d8c4e7ad39573ea497804714336c164c
---
M includes/pages/ListPage.php
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/pages/ListPage.php b/includes/pages/ListPage.php
index 44b9ed8..94ec292 100644
--- a/includes/pages/ListPage.php
+++ b/includes/pages/ListPage.php
@@ -79,9 +79,10 @@
$struck_votes = $res->result->num_rows;
 
$out->addHTML('' .
-   $this->msg( 'securepoll-voter-stats', $distinct_voters 
) .
+   $this->msg( 'securepoll-voter-stats')->numParams( 
$distinct_voters ) .
'' .
-   $this->msg( 'securepoll-vote-stats', $all_votes, 
$not_current_votes, $struck_votes ) .
+   $this->msg( 'securepoll-vote-stats')
+   ->numParams( $all_votes, $not_current_votes, 
$struck_votes ) .
'');
 
$pager = new SecurePoll_ListPager( $this );

-- 
To view, visit https://gerrit.wikimedia.org/r/311128
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I371ac0f6d8c4e7ad39573ea497804714336c164c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Huji 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Glaisher 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid triggering SiteConfiguration lookup in JobQueueGroup::...

2016-09-16 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311168

Change subject: Avoid triggering SiteConfiguration lookup in 
JobQueueGroup::push()
..

Avoid triggering SiteConfiguration lookup in JobQueueGroup::push()

Just use $wgJobTypesExcludedFromDefaultQueue directly

Bug: T145819
Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/311168/1

diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index de5f410..71d68d9 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -120,6 +120,8 @@
 * @return void
 */
public function push( $jobs ) {
+   global $wgJobTypesExcludedFromDefaultQueue;
+
$jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
if ( !count( $jobs ) ) {
return;
@@ -149,7 +151,7 @@
'true',
15
);
-   if ( array_intersect( array_keys( $jobsByType ), 
$this->getDefaultQueueTypes() ) ) {
+   if ( array_diff( array_keys( $jobsByType ), 
$wgJobTypesExcludedFromDefaultQueue ) ) {
$cache->set(
$cache->makeGlobalKey( 'jobqueue', $this->wiki, 
'hasjobs', self::TYPE_DEFAULT ),
'true',

-- 
To view, visit https://gerrit.wikimedia.org/r/311168
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update list of mailman site languages

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: Update list of mailman site languages
..


Update list of mailman site languages

Remove ast, gl and sk from mailman site list. The debconf script parses the 
currently
used mailing list languages and presents the admin a list which to enable (the 
debconf
dialogue is pretty ridicilous these days, since all it does it potentially save 
150k of disk
space per language...), but we currently don't seem to have any more lists in 
Asturian,
Galician or Slovak, so the debconf::set tries to enable a setting which isn't 
presented
to begin with. This leads to the mailman services getting stopped as fallout of 
an
inconsistent installation status.

The cleanest fix would be to have the puppet module parse the list of used 
mailing list
languages and pass that to debconf::set, but I rather made the quick fix to 
allow
to reenable puppet on fermium. The list of mailing list languages is rather 
static anyway
and mailman3 will have a complete makeover anyway, so that will very likely be 
obsolete
anyway.

Bug: T144933
Change-Id: I166ddc1e1182697d5c6ae4d16f195f6c5e1b391e
---
M modules/mailman/manifests/listserve.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/mailman/manifests/listserve.pp 
b/modules/mailman/manifests/listserve.pp
index f01ffbf..84c6da6 100644
--- a/modules/mailman/manifests/listserve.pp
+++ b/modules/mailman/manifests/listserve.pp
@@ -14,7 +14,7 @@
 include locales::extended
 
 debconf::set { 'mailman/site_languages':
-value  => 'ar, ast, ca, cs, da, de, en, es, et, eu, fi, fr, gl, he, 
hr, hu, ia, it, ja, ko, lt, nl, no, pl, pt, pt_BR, ro, ru, sk, sl, sr, sv, tr, 
uk, vi, zh_CN, zh_TW',
+value  => 'ar, ca, cs, da, de, en, es, et, eu, fi, fr, he, hr, hu, ia, 
it, ja, ko, lt, nl, no, pl, pt, pt_BR, ro, ru, sl, sr, sv, tr, uk, vi, zh_CN, 
zh_TW',
 notify => Exec['dpkg-reconfigure mailman'],
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/310746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I166ddc1e1182697d5c6ae4d16f195f6c5e1b391e
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Muehlenhoff 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Faidon Liambotis 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Use Foundation color as app-wide accent color.

2016-09-16 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311166

Change subject: Use Foundation color as app-wide accent color.
..

Use Foundation color as app-wide accent color.

This sets Foundation Blue as the "accent color" for the app's theme. This
means a couple things:

- Components that have a color to them (e.g. ProgressBar, Switch, etc)
  will automatically inherit their color from this setting. We no longer
  need to set the color on a per-component basis (like we were doing with
  ProgressBars)
- We will now finally "own" the accent color in the components that our
  app uses, and be able to apply our brand to them.

Change-Id: I8cce0ecc20542f15c466e136d479ebef9ec95bbb
---
M app/src/main/res/layout/activity_page.xml
M app/src/main/res/layout/view_card_progress.xml
M app/src/main/res/values/styles.xml
M app/src/main/res/values/styles_dark.xml
M app/src/main/res/values/styles_light.xml
5 files changed, 15 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/66/311166/1

diff --git a/app/src/main/res/layout/activity_page.xml 
b/app/src/main/res/layout/activity_page.xml
index bff83b4..208735e 100644
--- a/app/src/main/res/layout/activity_page.xml
+++ b/app/src/main/res/layout/activity_page.xml
@@ -63,7 +63,7 @@
 android:layout_marginTop="-7dp"
 android:layout_gravity="top"
 android:max="1"
-style="@style/ProgressBarHorizontal" />
+style="@style/Widget.AppCompat.ProgressBar.Horizontal" />
 
 
 
diff --git a/app/src/main/res/layout/view_card_progress.xml 
b/app/src/main/res/layout/view_card_progress.xml
index 2ddf65f..61a6d38 100644
--- a/app/src/main/res/layout/view_card_progress.xml
+++ b/app/src/main/res/layout/view_card_progress.xml
@@ -7,7 +7,6 @@
 
+android:layout_gravity="center"/>
 
 
diff --git a/app/src/main/res/values/styles.xml 
b/app/src/main/res/values/styles.xml
index 3210030..60d1851 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -25,14 +25,12 @@
 
 
 
-@android:color/white
 @android:color/white
 @color/actionbar_highlight
 @color/actionbar_highlight
 
 
 
-@color/actionbar_background
 @color/actionbar_background
 ?attr/homeAsUpIndicator
 4dp
@@ -45,13 +43,11 @@
 
 
 
-@android:color/white
 @android:color/white
 
 
 
 @color/actionbar_background
-@color/actionbar_background
 @color/actionbar_background
 @style/AppTheme.ActionModeTitleStyle
 @style/AppTheme.ActionModeSubtitleStyle
@@ -243,20 +239,6 @@
 center
 @drawable/ic_image_gray_24dp
 center
-
-
-
-@color/foundation_blue
-src_in
-@color/foundation_blue
-src_in
-
-
-
-@color/foundation_blue
-src_in
-@color/foundation_blue
-src_in
 
 
 
\ No newline at end of file
diff --git a/app/src/main/res/values/styles_dark.xml 
b/app/src/main/res/values/styles_dark.xml
index 05a9060..640fef1 100644
--- a/app/src/main/res/values/styles_dark.xml
+++ b/app/src/main/res/values/styles_dark.xml
@@ -21,11 +21,11 @@
 @style/AppTheme.ToolbarTheme
 @style/AppTheme.ToolbarStyle
 @style/AppTheme.ActionModeStyle
-@style/AppTheme.ActionModeStyle
-@style/AppTheme.SearchViewEditTextStyle
 @color/background_floating_material_dark
 @style/AppTheme.SearchViewEditTextStyle
 @style/Theme.Dark.PopupMenuStyle
+

[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint: drop now unused sudo rule

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: contint: drop now unused sudo rule
..


contint: drop now unused sudo rule

The gerrit-sync-ve-push.sh is no more. It was to workaround a bug in
Gerrit which is now solved.

Remove the sudo rule from gallium, the script has already been deleted
everywhere.

Bug: T51846
Change-Id: I9b10f588cc97af0c7af8a75eaec48cd1fd7768e0
---
M manifests/site.pp
1 file changed, 0 insertions(+), 7 deletions(-)

Approvals:
  Dzahn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/site.pp b/manifests/site.pp
index 21d78d9..efc46b3 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1094,13 +1094,6 @@
 zuul::server,
 backup::host)
 
-# T51846, let us sync VisualEditor in mediawiki/extensions.git
-sudo::user { 'jenkins-slave':
-privileges => [
-'ALL = (jenkins) NOPASSWD: 
/srv/deployment/integration/slave-scripts/bin/gerrit-sync-ve-push.sh',
-]
-}
-
 include standard
 include contint::firewall
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/311161
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b10f588cc97af0c7af8a75eaec48cd1fd7768e0
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] wikimedia...wonderbolt[master]: Add bookmarking states

2016-09-16 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Add bookmarking states
..


Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: Iab2b2a84707e4438567d651b9df327ce221292ee
---
A global.R
M server.R
M ui.R
M wonderbolt.Rproj
M www/custom.js
5 files changed, 56 insertions(+), 66 deletions(-)

Approvals:
  Chelsyx: Verified; Looks good to me, approved



diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index 3b2fa03..1888f89 100644
--- a/server.R
+++ b/server.R
@@ -1,23 +1,21 @@
+library(shiny)
+library(shinydashboard)
+library(dygraphs)
+
 source("utils.R")
 
 existing_date <- Sys.Date() - 1
 
-shinyServer(function(input, output){
+function(input, output, session) {
   
   if (Sys.Date() != existing_date) {
 read_traffic()
 existing_date <<- Sys.Date()
   }
   
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
   output$traffic_summary_dygraph <- renderDygraph({
 summary_traffic_data[[input$platform_traffic_summary]] %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_traffic_summary)) 
%>%
-  
polloi::subset_by_date_range(time_frame_range(input$traffic_summary_timeframe, 
input$traffic_summary_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Pageviews",
title = "Sources of page views (e.g. search engines 
and internal referers)") %>%
   dyLegend(labelsDiv = "traffic_summary_legend", show = "always", 
showZeroValues = FALSE) %>%
@@ -29,7 +27,6 @@
   output$traffic_bysearch_dygraph <- renderDygraph({
 bysearch_traffic_data[[input$platform_traffic_bysearch]] %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_traffic_bysearch)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$traffic_bysearch_timeframe, 
input$traffic_bysearch_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Pageviews",
title = "Pageviews from external search engines, 
broken down by engine") %>%
   dyLegend(labelsDiv = "traffic_bysearch_legend", show = "always", 
showZeroValues = FALSE) %>%
@@ -47,4 +44,4 @@
 return(dropdownMenu(type = "notifications", .list = notifications))
   })
   
-})
+}
diff --git a/ui.R b/ui.R
index 8b7bd7f..358e8a9 100644
--- a/ui.R
+++ b/ui.R
@@ -2,64 +2,50 @@
 library(shinydashboard)
 library(dygraphs)
 
-#Header elements for the visualisation
-header <- dashboardHeader(title = "External Search Traffic", 
dropdownMenuOutput("message_menu"), disable = FALSE)
+function(request) {
+  dashboardPage(
 
-sidebar <- dashboardSidebar(
-  tags$head(
-tags$link(rel = "stylesheet", type = "text/css", href = "stylesheet.css"),
-tags$script(src = "custom.js")
-  ),
-  sidebarMenu(
-menuItem(text = "Traffic",
- menuSubItem(text = "Summary", tabName = "traffic_summary"),
- menuSubItem(text = "Pageviews by search engine", tabName = 
"traffic_by_engine")),
-menuItem(text = "Global Settings",
- selectInput(inputId = "smoothing_global", label = "Smoothing", 
selectize = TRUE, selected = "day",
- choices = c("No Smoothing" = "day", "Weekly Median" = 
"week", "Monthly Median" = "month", "Splines" = "gam")),
- selectInput(inputId = "timeframe_global", label = "Time Frame", 
selectize = TRUE, selected = "",
- choices = c("All available data" = "all", "Last 7 
days" = "week", "Last 30 days" = "month",
- "Last 90 days" = "quarter", "Custom" = 
"custom")),
- conditionalPanel("input.timeframe_global == 'custom'",
-  dateRangeInput("daterange_global", label = 
"Custom Date Range",
- start = Sys.Date()-11, end = 
Sys.Date()-1, min = "2015-04-14")),
- icon = icon("cog", lib = "glyphicon"))
-  ),
-  div(icon("info-sign", lib = "glyphicon"), HTML("Tip: you 
can drag on the graphs with your mouse to zoom in on a particular date 
range."), style = "padding: 10px; color: white;")
-)
+dashboardHeader(title = "External Search Traffic", 
dropdownMenuOutput("message_menu"), disable = FALSE),
 
-# Custom function to allow for the selection betwene
-platform_select <- function(name){
-  return(selectizeInput(inputId = name, label 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Apply wfBCP47() to HTTP response header Content-Language

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Apply wfBCP47() to HTTP response header Content-Language
..


Apply wfBCP47() to HTTP response header Content-Language

See https://tools.ietf.org/html/rfc7231#section-3.1.3 for Content-Language.
This references https://tools.ietf.org/html/rfc5646 aka BCP 47.

Example:
curl -I https://crh.wikipedia.org/wiki/Ba%C5%9F_Saife | grep -i 
'^content-language:'
should contain
Content-language: crh-Latn
instead of
Content-language: crh-latn

Change-Id: Ice4f40911c3761c2542430935bc1898bc4e7a4d4
---
M includes/OutputPage.php
M includes/cache/HTMLFileCache.php
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 4c4fb1c..ba14b99 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2268,7 +2268,7 @@
ob_start();
 
$response->header( 'Content-type: ' . $config->get( 'MimeType' 
) . '; charset=UTF-8' );
-   $response->header( 'Content-language: ' . $config->get( 
'LanguageCode' ) );
+   $response->header( 'Content-language: ' . $config->get( 
'ContLang' )->getHtmlCode() );
 
// Avoid Internet Explorer "compatibility view" in IE 8-10, so 
that
// jQuery etc. can work correctly.
diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php
index 52ae279..71011e0 100644
--- a/includes/cache/HTMLFileCache.php
+++ b/includes/cache/HTMLFileCache.php
@@ -154,7 +154,7 @@
 * @return void
 */
public function loadFromFileCache( IContextSource $context, $mode = 
self::MODE_NORMAL ) {
-   global $wgMimeType, $wgLanguageCode;
+   global $wgMimeType, $wgContLang;
 
wfDebug( __METHOD__ . "()\n" );
$filename = $this->cachePath();
@@ -166,7 +166,7 @@
 
$context->getOutput()->sendCacheControl();
header( "Content-Type: $wgMimeType; charset=UTF-8" );
-   header( "Content-Language: $wgLanguageCode" );
+   header( 'Content-Language: ' . $wgContLang->getHtmlCode() );
if ( $this->useGzip() ) {
if ( wfClientAcceptsGzip() ) {
header( 'Content-Encoding: gzip' );

-- 
To view, visit https://gerrit.wikimedia.org/r/251734
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ice4f40911c3761c2542430935bc1898bc4e7a4d4
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Daniel Friesen 
Gerrit-Reviewer: Fomafix 
Gerrit-Reviewer: Gerrit Patch Uploader 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] wikimedia...wetzel[master]: Add bookmarking states

2016-09-16 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Add bookmarking states
..


Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I9622c4a14cb2c4094574a3e1d1c9d3778d6e418f
---
A global.R
M server.R
M ui.R
M wetzel.Rproj
M www/custom.js
5 files changed, 144 insertions(+), 160 deletions(-)

Approvals:
  Chelsyx: Verified; Looks good to me, approved



diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index f828305..43bad95 100644
--- a/server.R
+++ b/server.R
@@ -4,7 +4,7 @@
 
 # Actual server code.
 shinyServer(function(input, output, session) {
-  
+
   if(Sys.Date() != existing_date){
 read_actions()
 read_users()
@@ -12,14 +12,7 @@
 read_countries()
 existing_date <<- Sys.Date()
   }
-  
-  shinyURL.server(session)
-  
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
+
   output$tiles_summary_series <- renderDygraph({
 temp <- polloi::data_select(input$tile_summary_automata_check, 
new_tiles_automata, new_tiles_no_automata) %>%
 ddply(.(date), summarize,
@@ -41,52 +34,48 @@
   dyEvent(as.Date("2016-01-08"), "B (enwiki launch)", labelLoc = "bottom") 
%>%
   dyEvent(as.Date("2016-01-12"), "C (cache clear)", labelLoc = "bottom")
   })
-  
+
   output$tiles_style_series <- renderDygraph({
 polloi::data_select(input$tile_style_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
 ddply(.(date, style), summarize, `total tiles` = sum(total)) %>%
   tidyr::spread(style, `total tiles`, fill = 0) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_style_series)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$tiles_style_series_timeframe,
 input$tiles_style_series_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Tiles", "Total tiles by style", 
legend_name = "Style") %>%
   dyLegend(labelsDiv = "tiles_style_series_legend", show = "always") %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2015-09-17"), "A (announcement)", labelLoc = "bottom")
   })
-  
+
   output$tiles_users_series <- renderDygraph({
 polloi::data_select(input$tile_users_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
   ddply(.(date, style), summarize, `total users` = sum(users)) %>%
   tidyr::spread(style, `total users`, fill = 0) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_users_series)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$tiles_users_series_timeframe,
 input$tiles_users_series_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Users", "Total users by style") %>%
   dyLegend(labelsDiv = "tiles_users_series_legend", show = "always") %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2015-09-17"), "A (announcement)", labelLoc = "bottom")
   })
-  
+
   output$zoom_level_selector_container <- renderUI({
 selectInput("zoom_level_selector", "Zoom level",
 multiple = TRUE, selected = "0", selectize = FALSE, size = 19,
 choices = 
as.character(sort(unique(new_tiles_no_automata$zoom
   })
-  
+
   output$tiles_zoom_series <- renderDygraph({
 polloi::data_select(input$tile_zoom_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
   subset(zoom %in% as.numeric(input$zoom_level_selector)) %>%
   ddply(.(date, zoom), summarize, `total tiles` = sum(total)) %>%
   tidyr::spread(zoom, `total tiles`, fill = 0) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_zoom_series)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$tiles_zoom_series_timeframe,
 input$tiles_zoom_series_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Tiles", "Total tiles by zoom level") %>%
   dyLegend(labelsDiv = "tiles_zoom_series_legend", show = "always")
   })
-  
+
   output$users_per_platform <- renderDygraph({
 user_data %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_users_per_platform)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$users_per_platform_timeframe,
 input$users_per_platform_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Events", "Unique users by platform, by 
day") %>%
   dyLegend(labelsDiv = 

[MediaWiki-commits] [Gerrit] wikimedia...twilightsparql[master]: Add bookmarking states

2016-09-16 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Add bookmarking states
..


Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I457fb18d6f90d5eb32067a87bbe47002384b80cb
---
A global.R
M server.R
M twilightsparql.Rproj
M ui.R
M www/custom.js
5 files changed, 47 insertions(+), 55 deletions(-)

Approvals:
  Chelsyx: Verified; Looks good to me, approved



diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index 753164c..fca3f17 100644
--- a/server.R
+++ b/server.R
@@ -2,18 +2,13 @@
 
 existing_date <- Sys.Date() - 1
 
-shinyServer(function(input, output) {
-  
+shinyServer(function(input, output, session) {
+
   if(Sys.Date() != existing_date){
 read_wdqs()
 existing_date <<- Sys.Date()
   }
-  
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
+
   output$wdqs_usage_plot <- renderDygraph(
 wdqs_usage %>%
   spider_subset(val = input$include_automata) %>%
@@ -23,14 +18,13 @@
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage), rename = 
FALSE) %>%
   # ...and then exp10-transformed back to the original scale:
   conditional_transform(input$usage_logscale && 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage) != "day", 
exp10) %>%
-  polloi::subset_by_date_range(time_frame_range(input$usage_timeframe, 
input$usage_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Daily WDQS 
Homepage usage", group = "usage") %>%
   # ...because we're using dygraphs' native log-scaling:
   dyAxis("y", logscale = input$usage_logscale) %>%
   dyLegend(labelsDiv = "usage_legend") %>%
   dyEvent(as.Date("2015-09-07"), "A (Announcement)", labelLoc = "bottom")
   )
-  
+
   output$sparql_usage_plot <- renderDygraph(
 sparql_usage %>%
   spider_subset(val = input$include_automata) %>%
@@ -38,7 +32,6 @@
   conditional_transform(input$usage_logscale && 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage) != "day", 
log10) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage), rename = 
FALSE) %>%
   conditional_transform(input$usage_logscale && 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage) != "day", 
exp10) %>%
-  polloi::subset_by_date_range(time_frame_range(input$usage_timeframe, 
input$usage_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Daily 
SPARQL usage", group = "usage") %>%
   dyLegend(labelsDiv = "usage_legend") %>%
   dyAxis("y", logscale = input$usage_logscale) %>%
@@ -46,7 +39,7 @@
   dyEvent(as.Date("2015-09-07"), "A (Announcement)", labelLoc = "bottom") 
%>%
   dyEvent(as.Date("2015-11-05"), "B (Labs bot)", labelLoc = "bottom")
   )
-  
+
   # Check datasets for missing data and notify user which datasets are missing 
data (if any)
   output$message_menu <- renderMenu({
 notifications <- list(
@@ -55,5 +48,5 @@
 notifications <- notifications[!sapply(notifications, is.null)]
 return(dropdownMenu(type = "notifications", .list = notifications))
   })
-  
+
 })
diff --git a/twilightsparql.Rproj b/twilightsparql.Rproj
index 0a8dc07..d64e28b 100644
--- a/twilightsparql.Rproj
+++ b/twilightsparql.Rproj
@@ -13,3 +13,4 @@
 LaTeX: pdfLaTeX
 
 AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
diff --git a/ui.R b/ui.R
index c3afb75..537cd97 100644
--- a/ui.R
+++ b/ui.R
@@ -1,49 +1,41 @@
-source("utils.R")
 library(shiny)
 library(shinydashboard)
 library(dygraphs)
 
-# Header elements for the visualization
-header <- dashboardHeader(title = "Wikidata Query Service", 
dropdownMenuOutput("message_menu"), disable = FALSE)
+function(request) {
+  dashboardPage(
 
-# Sidebar elements for the search visualizations
-sidebar <- dashboardSidebar(
-  tags$head(
-tags$link(rel = "stylesheet", type = "text/css", href = "custom.css"),
-tags$script(src = "custom.js")
-  ),
-  sidebarMenu(
-menuItem(text = "WDQS Usage", tabName = "wdqs_usage"),
-menuItem(text = "Global Settings",
- selectInput(inputId = "smoothing_global", label = "Smoothing", 
selectize = TRUE, selected = "day",
- choices = c("No Smoothing" = "day", "Weekly Median" = 
"week", "Monthly Median" = "month", "Splines" = "gam")),
- 

[MediaWiki-commits] [Gerrit] wikimedia...rainbow[master]: Add bookmarking states

2016-09-16 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Add bookmarking states
..


Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I0852673581c87a89d95da9f14715fc093daac6a6
---
A global.R
M server.R
M ui.R
R www/custom.js
4 files changed, 263 insertions(+), 345 deletions(-)

Approvals:
  Chelsyx: Verified; Looks good to me, approved



diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index 17a3679..5ac100c 100644
--- a/server.R
+++ b/server.R
@@ -6,11 +6,11 @@
 
 existing_date <- Sys.Date() - 1
 
-shinyServer(function(input, output, session) {
+function(input, output, session) {
 
   if (Sys.Date() != existing_date) {
 # Create a Progress object
-progress <- shiny::Progress$new(session, min = 0, max = 1)
+progress <- shiny::Progress$new()
 progress$set(message = "Downloading desktop data", value = 0)
 read_desktop()
 progress$set(message = "Downloading apps data", value = 0.1)
@@ -30,11 +30,6 @@
 progress$set(message = "Finished downloading datasets", value = 1)
 existing_date <<- Sys.Date()
 progress$close()
-  }
-
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
   }
 
   ## Desktop value boxes
@@ -69,7 +64,6 @@
   output$desktop_event_plot <- renderDygraph({
 desktop_dygraph_set %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_desktop_event)) 
%>%
-  
polloi::subset_by_date_range(time_frame_range(input$desktop_event_timeframe, 
input$desktop_event_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Desktop 
search events, by day") %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2016-07-12"), "A (schema switch)", labelLoc = "bottom")
@@ -78,7 +72,6 @@
   output$desktop_load_plot <- renderDygraph({
 desktop_load_data %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_desktop_load)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$desktop_load_timeframe, 
input$desktop_load_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Load time (ms)", title = 
"Desktop load times, by day", use_si = FALSE) %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2016-07-12"), "A (schema switch)", labelLoc = "bottom")
@@ -87,7 +80,6 @@
   output$paulscore_approx_plot_fulltext <- renderDygraph({
 paulscore_fulltext %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_paulscore_approx)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$paulscore_approx_timeframe, 
input$paulscore_approx_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "PaulScore", title = 
"PaulScore for fulltext searches, by day", use_si = FALSE, group = 
"paulscore_approx") %>%
   dyRangeSelector %>%
   dyLegend(labelsDiv = "paulscore_approx_legend", show = "always")
@@ -96,7 +88,6 @@
   output$paulscore_approx_plot_autocomplete <- renderDygraph({
 paulscore_autocomplete %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_paulscore_approx)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$paulscore_approx_timeframe, 
input$paulscore_approx_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "PaulScore", title = 
"PaulScore for autocomplete searches, by day", use_si = FALSE, group = 
"paulscore_approx") %>%
   dyRangeSelector %>%
   dyLegend(labelsDiv = "paulscore_approx_legend", show = "always")
@@ -134,7 +125,6 @@
   output$mobile_event_plot <- renderDygraph({
 mobile_dygraph_set %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_mobile_event)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$mobile_event_timeframe, 
input$mobile_event_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Mobile 
search events, by day") %>%
   dyRangeSelector
   })
@@ -142,7 +132,6 @@
   output$mobile_load_plot <- renderDygraph({
 mobile_load_data %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_mobile_load)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$mobile_load_timeframe, 

[MediaWiki-commits] [Gerrit] wikimedia...prince[master]: Add bookmarking states

2016-09-16 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged.

Change subject: Add bookmarking states
..


Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I32f0565a86500c3a702ad54cd06b87bf6059a2f4
---
M functions.R
A global.R
M prince.Rproj
M server.R
M ui.R
M www/custom.js
6 files changed, 238 insertions(+), 236 deletions(-)

Approvals:
  Chelsyx: Verified; Looks good to me, approved



diff --git a/functions.R b/functions.R
index 3674885..7ee1f65 100644
--- a/functions.R
+++ b/functions.R
@@ -7,27 +7,27 @@
 
 # Read in the traffic data
 read_clickthrough <- function(){
-  
+
   # Read in and format the high-level data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/clickthrough_rate.tsv"))
-  clickthrough_rate <<- data[, j = list(success_rate = (events[type == 
"clickthrough"]/sum(events))*100), by = "date"]
-  
+  clickthrough_rate <<- data[, j = list(`clickthrough rate` = (events[type == 
"clickthrough"]/sum(events))*100), by = "date"]
+
   # Read in and format the breakdown data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/clickthrough_breakdown.tsv"))
   data <- data[, j = list(section_used = section_used, proportion = 
(events/sum(events))*100), by = "date"]
   action_breakdown <<- reshape2::dcast(data, formula = date ~ section_used, 
fun.aggregate = sum)
-  
+
   # Read in most common section per visit data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/most_common_per_visit.tsv"))
   data <- data[, j = list(section_used = section_used, proportion = 
(visits/sum(visits))*100), by = "date"]
   most_common <<- reshape2::dcast(data, formula = date ~ section_used, 
fun.aggregate = sum)
-  
+
   # Read in first visit clickthrough rates
   data <- polloi::read_dataset(path = "portal/clickthrough_firstvisit.tsv")
   data[, -1] <- data[, -1]*100 # first column is always going to be the date
   data$`language search` <- 0
   first_visit_ctrs <<- as.data.frame(data[, names(action_breakdown)])
-  
+
   return(invisible())
 }
 
@@ -42,7 +42,7 @@
 
 read_country <- function(){
   data <- as.data.table(polloi::read_dataset(path = "portal/country_data.tsv"))
-  
+
   country_data <<- reshape2::dcast(data[,list(country = country, events = 
round(events/sum(events)*100,2)),
 by = "date"],
formula = date ~ country, fun.aggregate = 
sum)
@@ -88,15 +88,15 @@
 }
 
 read_referrals <- function(){
-  
+
   # Read in the initial data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/portal_referer_data.tsv"))
-  
+
   # Format
   data$is_search <- ifelse(data$is_search, "Referred by search", "Not referred 
by search")
   data$search_engine[data$search_engine == "none"] <- "Not referred by search"
-  
-  
+
+
   # Write out the overall values for traffic
   interim <- data[, j = list(pageviews = sum(pageviews)),
 by = c("date", "referer_class")] %>%
@@ -117,16 +117,16 @@
   "Unknown referers",
   "Total")
   summary_traffic_data <<- interim[, 1:7]
-  
+
   # Generate per-engine values
   interim <- data[data$search_engine != "Not referred by search",
   j = list(pageviews = sum(pageviews)),
   by = c("date", "search_engine")] %>%
 reshape2::dcast(formula = date ~ search_engine, fun.aggregate = sum)
   bysearch_traffic_data <<- cbind(date = interim$date, 
data.frame(round(100*t(apply(interim[, -1], 1, function(x) { x/sum(x) })), 2)))
-  
+
   return(invisible())
-  
+
 }
 
 fill_out <- function(x, start_date, end_date, fill = 0) {
diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/prince.Rproj b/prince.Rproj
index a213108..e83436a 100644
--- a/prince.Rproj
+++ b/prince.Rproj
@@ -13,3 +13,4 @@
 LaTeX: pdfLaTeX
 
 AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
diff --git a/server.R b/server.R
index 51a3264..3e50149 100644
--- a/server.R
+++ b/server.R
@@ -1,16 +1,14 @@
 library(shiny)
 library(shinydashboard)
 library(dygraphs)
-library(shinyURL)
 library(shinyjs)
 
 source("functions.R")
-options(scipen = 500)
 
 existing_date <- Sys.Date() - 1
 
 shinyServer(function(input, output, session) {
-  
+
   if (Sys.Date() != existing_date) {
 progress <- shiny::Progress$new(session, min = 0, max = 1)
 on.exit(progress$close())
@@ -31,14 +29,12 @@
 progress$set(message = "Finished downloading datasets.", value = 1)
 existing_date <<- Sys.Date()
   }
-  
-  shinyURL.server(session)
-  
+
   output$clickthrough_rate_dygraph <- renderDygraph({
 clickthrough_rate %>%
   polloi::smoother(smooth_level = 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update ebernhardson ssh key

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: Update ebernhardson ssh key
..


Update ebernhardson ssh key

Change-Id: I07b268750623f002d7798e30514ea036c0dbc45c
---
M modules/admin/data/data.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Dzahn: Verified; Looks good to me, approved



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 9daceae..81bb424 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -839,7 +839,7 @@
 gid: 500
 name: ebernhardson
 realname: Erik Bernhardson
-ssh_keys: [ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCw9RGPG974LGGgH43aZc6m0sWMbaTEaLlL91zNKzOazv0oQCuZKBlSv0SNoya1NXxK/c9XQBf4EoTaI1OLdgKr1sPA1xYHdm+aqnd3A7hT9suWctoH13sF0lq2gB+5FLvaRz0lBg8C0fHk3bLkB6XVWKedMu7Nshvtq/Si/ut+9cVSIyXk40PJgOGEUvmyi12w4MgdPKlPBbGiKBVh8/ehn1L3aloivyUdpckOqOstrP3KLfIn5AITjc4hZUM/OS0dYV0/XVOnNMHhL+IjHCBD9Ayf2NPGSCO5w7mXjXSQG21oVPIMyk4BuPgNMyf9ny3Iq0wZ1e+oTNcHFDRyag15
+ssh_keys: [ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCq5sClypKI1N1T1ZfR2ZZPbWH6gXPrQ9a3HRiFgWpcp+W4YIYT4taNNqd+gFO6aF7UyAS9148ROxivCksSK+MmfULsIz0cD4l8R6haR939kfK5MRC2yONusy8IUkQgPvkBWkIvOhrURNs2sPkxYVwEyHIOUX3Izf1cLjVZenz4lhRqPtstHMZQaa3TGAoCFcymOln/64j5vq9W8MljLBsEWpPdeUwmf6mD0EHb5LUA+2aVB1JwfmViY5Dm77FBh5CDHqdvMWa8ZF0ZybtUAuL0wpcO0h/H1WDhqS5j1Q4AemxtOeRnBJoCsh5Wlf4J4sZptMM2hvdNYnqWXb+3Dto7
 ebernhard...@wikimedia.org]
 uid: 3088
   esanders:

-- 
To view, visit https://gerrit.wikimedia.org/r/311149
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I07b268750623f002d7798e30514ea036c0dbc45c
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Remove use of breadcrumb_nav

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Puppet Panel:  Remove use of breadcrumb_nav
..


Puppet Panel:  Remove use of breadcrumb_nav

This turns out to be unavailable on Liberty, and doesn't
seem to do much in any case.

Bug: T91990
Change-Id: I41764250b950e211b5e15a85f579c4a11bc6c4ae
---
M 
modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
M 
modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
2 files changed, 0 insertions(+), 14 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
index 272cb68..6d74e64 100644
--- 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
+++ 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
@@ -1,15 +1,8 @@
 {% extends 'base.html' %}
 {% load i18n %}
-{% load breadcrumb_nav %}
 
 {% block title %}
   {{ page_title }}
-{% endblock %}
-
-{% block page_header %}
-  
-{% breadcrumb_nav %}
-  
 {% endblock %}
 
 {% block main %}
diff --git 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
index 272cb68..6d74e64 100644
--- 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
+++ 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
@@ -1,15 +1,8 @@
 {% extends 'base.html' %}
 {% load i18n %}
-{% load breadcrumb_nav %}
 
 {% block title %}
   {{ page_title }}
-{% endblock %}
-
-{% block page_header %}
-  
-{% breadcrumb_nav %}
-  
 {% endblock %}
 
 {% block main %}

-- 
To view, visit https://gerrit.wikimedia.org/r/311164
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I41764250b950e211b5e15a85f579c4a11bc6c4ae
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Remove use of breadcrumb_nav

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311164

Change subject: Puppet Panel:  Remove use of breadcrumb_nav
..

Puppet Panel:  Remove use of breadcrumb_nav

This turns out to be unavailable on Liberty, and doesn't
seem to do much in any case.

Bug: T91990
Change-Id: I41764250b950e211b5e15a85f579c4a11bc6c4ae
---
M 
modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
M 
modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
2 files changed, 0 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/64/311164/1

diff --git 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
index 272cb68..6d74e64 100644
--- 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
+++ 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html
@@ -1,15 +1,8 @@
 {% extends 'base.html' %}
 {% load i18n %}
-{% load breadcrumb_nav %}
 
 {% block title %}
   {{ page_title }}
-{% endblock %}
-
-{% block page_header %}
-  
-{% breadcrumb_nav %}
-  
 {% endblock %}
 
 {% block main %}
diff --git 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
index 272cb68..6d74e64 100644
--- 
a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
+++ 
b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/project_panel.html
@@ -1,15 +1,8 @@
 {% extends 'base.html' %}
 {% load i18n %}
-{% load breadcrumb_nav %}
 
 {% block title %}
   {{ page_title }}
-{% endblock %}
-
-{% block page_header %}
-  
-{% breadcrumb_nav %}
-  
 {% endblock %}
 
 {% block main %}

-- 
To view, visit https://gerrit.wikimedia.org/r/311164
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41764250b950e211b5e15a85f579c4a11bc6c4ae
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: Add a per-project puppetmaster role

2016-09-16 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311163

Change subject: labs: Add a per-project puppetmaster role
..

labs: Add a per-project puppetmaster role

Uses the puppetmaster module rather than the puppet module.

DEATH TO THE PUPPET MODULE

Change-Id: I5f11761bdd2a1f292d3d061363fa53346d1eb768
---
A modules/role/manifests/labs/project_puppetmaster.pp
1 file changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/63/311163/1

diff --git a/modules/role/manifests/labs/project_puppetmaster.pp 
b/modules/role/manifests/labs/project_puppetmaster.pp
new file mode 100644
index 000..92f430e
--- /dev/null
+++ b/modules/role/manifests/labs/project_puppetmaster.pp
@@ -0,0 +1,32 @@
+class role::labs::project_puppetmaster(
+$autosign = false,
+) {
+include ldap::role::config::labs
+
+$ldapconfig = $ldap::role::config::labs::ldapconfig
+$basedn = $ldapconfig['basedn']
+
+$encconfig = {
+'ldapserver'=> $ldapconfig['servernames'][0],
+'ldapbase'  => "ou=hosts,${basedn}",
+'ldapstring'=> 
'(&(objectclass=puppetClient)(associatedDomain=%s))',
+'ldapuser'  => $ldapconfig['proxyagent'],
+'ldappassword'  => $ldapconfig['proxypass'],
+'ldaptls'   => true,
+'node_terminus' => 'ldap'
+}
+
+# Allow access from everywhere! Use certificates to
+# control access
+$allow_from = '10.0.0.0/8'
+
+class { '::puppetmaster':
+server_name=> $::fqdn,
+allow_from => $allow_from,
+secure_private => false,
+config => merge($encconfig, {
+'thin_storeconfigs' => false,
+'autosign'  => $autosign,
+})
+}
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/311163
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f11761bdd2a1f292d3d061363fa53346d1eb768
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: Only log ChangesList filters for logged-in users

2016-09-16 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311162

Change subject: Only log ChangesList filters for logged-in users
..

Only log ChangesList filters for logged-in users

To reduce the event volume and try to filter out crawlers.

Bug: T144331
Change-Id: I7863ef6d4a5ce4a90af80902282a463128897b63
---
M WikimediaEventsHooks.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/62/311162/1

diff --git a/WikimediaEventsHooks.php b/WikimediaEventsHooks.php
index 50bfe0c..8ba1267 100644
--- a/WikimediaEventsHooks.php
+++ b/WikimediaEventsHooks.php
@@ -562,6 +562,11 @@
 * @param &$filters Associative array of filter definitions.
 */
public static function onChangesListSpecialPageFilters( $special, 
&$filters ) {
+   // For volume/capacity reasons, only log this for logged-in 
users
+   if ( $special->getUser()->isAnon() ) {
+   return;
+   }
+
$logData = [
'pagename' => $special->getName()
];

-- 
To view, visit https://gerrit.wikimedia.org/r/311162
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7863ef6d4a5ce4a90af80902282a463128897b63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Catrope 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: Fix MediawikiApi::HttpError in Selenium tests

2016-09-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix MediawikiApi::HttpError in Selenium tests
..


Fix MediawikiApi::HttpError in Selenium tests

Use https (instead of http) in mediawiki_url environment variable.

Bug: T145799
Change-Id: Ie4d7188a2f3a11f1eaa5163ffd83544e9828e136
---
M tests/browser/environments.yml
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Jhobs: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Phuedx: Looks good to me, approved



diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml
index a67c0c6..dc42d7f 100644
--- a/tests/browser/environments.yml
+++ b/tests/browser/environments.yml
@@ -28,12 +28,12 @@
   user_factory: true
 
 beta-desktop:
-  mediawiki_url: http://en.wikipedia.beta.wmflabs.org/wiki/
+  mediawiki_url: https://en.wikipedia.beta.wmflabs.org/wiki/
   mediawiki_user: Selenium_user
   # mediawiki_password: SET THIS IN THE ENVIRONMENT!
 
 beta-mobile:
-  mediawiki_url: http://en.m.wikipedia.beta.wmflabs.org/wiki/
+  mediawiki_url: https://en.m.wikipedia.beta.wmflabs.org/wiki/
   mediawiki_user: Selenium_user
   # mediawiki_password: SET THIS IN THE ENVIRONMENT!
 
@@ -43,7 +43,7 @@
   # mediawiki_password: SET THIS IN THE ENVIRONMENT!
 
 test2:
-  mediawiki_url: http://test2.wikipedia.org/wiki/
+  mediawiki_url: https://test2.wikipedia.org/wiki/
   mediawiki_user: Selenium_user
   # mediawiki_password: SET THIS IN THE ENVIRONMENT!
 

-- 
To view, visit https://gerrit.wikimedia.org/r/311140
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4d7188a2f3a11f1eaa5163ffd83544e9828e136
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RelatedArticles
Gerrit-Branch: master
Gerrit-Owner: Zfilipin 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Jhernandez 
Gerrit-Reviewer: Jhobs 
Gerrit-Reviewer: Phuedx 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint: drop now unused sudo rule

2016-09-16 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311161

Change subject: contint: drop now unused sudo rule
..

contint: drop now unused sudo rule

The gerrit-sync-ve-push.sh is no more. It was to workaround a bug in
Gerrit which is now solved.

Remove the sudo rule from gallium, the script has already been deleted
everywhere.

Bug: T51846
Change-Id: I9b10f588cc97af0c7af8a75eaec48cd1fd7768e0
---
M manifests/site.pp
1 file changed, 0 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/61/311161/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 21d78d9..efc46b3 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1094,13 +1094,6 @@
 zuul::server,
 backup::host)
 
-# T51846, let us sync VisualEditor in mediawiki/extensions.git
-sudo::user { 'jenkins-slave':
-privileges => [
-'ALL = (jenkins) NOPASSWD: 
/srv/deployment/integration/slave-scripts/bin/gerrit-sync-ve-push.sh',
-]
-}
-
 include standard
 include contint::firewall
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/311161
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b10f588cc97af0c7af8a75eaec48cd1fd7768e0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mediawiki_singlenode: Use require_package instead of package...

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: mediawiki_singlenode: Use require_package instead of package 
latest
..


mediawiki_singlenode: Use require_package instead of package latest

Bug: T115348
Change-Id: Ia6b14aa2ea4d38e813d1257e455a318ac0859cf3
---
M modules/mediawiki_singlenode/manifests/init.pp
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/mediawiki_singlenode/manifests/init.pp 
b/modules/mediawiki_singlenode/manifests/init.pp
index f48f913..565f8ee 100644
--- a/modules/mediawiki_singlenode/manifests/init.pp
+++ b/modules/mediawiki_singlenode/manifests/init.pp
@@ -35,9 +35,7 @@
 
 include ::imagemagick::install
 
-package { [ 'php-apc', 'php5-cli' ] :
-ensure => latest,
-}
+require_package('php-apc', 'php5-cli')
 
 if !defined(Class['memcached']) {
 class { 'memcached':

-- 
To view, visit https://gerrit.wikimedia.org/r/310703
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6b14aa2ea4d38e813d1257e455a318ac0859cf3
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: Chasemp 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Yuvipanda 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Add captions to instance tabs

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Puppet Panel:  Add captions to instance tabs
..


Puppet Panel:  Add captions to instance tabs

Since a given instance can be getting config from lots of
different places, this should clarify things a bit.

Bug: T91990
Change-Id: Idf71e3293d82ccaabc81fd52203a23ec02acb496
---
M modules/openstack/files/liberty/horizon/puppettab/tab.py
1 file changed, 49 insertions(+), 15 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/openstack/files/liberty/horizon/puppettab/tab.py 
b/modules/openstack/files/liberty/horizon/puppettab/tab.py
index e4591fc..a8c19e7 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/tab.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/tab.py
@@ -20,6 +20,7 @@
 
 from horizon import tabs
 from django.conf import settings
+from django.utils.safestring import mark_safe
 
 import puppet_tables as p_tables
 from puppet_config import puppet_config
@@ -37,16 +38,11 @@
 
 def __init__(self, *args, **kwargs):
 
-# if prefix_tab is true we're going to display a
-#  'delete prefix' button.
-self.prefix_tab = False
-
 # For some reason our parent class can't deal with these
 #  args, so extract them now if they're present
 if 'prefix' in kwargs:
 self.prefix = kwargs['prefix']
 self.name = _("Prefix %s") % self.prefix
-self.slug += '-%s' % self.prefix
 del kwargs['prefix']
 
 if 'tenant_id' in kwargs:
@@ -54,34 +50,72 @@
 del kwargs['tenant_id']
 
 if hasattr(self, 'tenant_id') and hasattr(self, 'prefix'):
-self.prefix_tab = True
-self.caption = _("These puppet settings will affect all VMs in the"
- " %s project whose names begin with \'%s\'.") % (
-self.tenant_id, self.prefix)
+self.slug += '-%s' % self.prefix
+self.tab_type = 'prefix'
 
 super(PuppetTab, self).__init__(*args, **kwargs)
 
 if 'instance' in self.tab_group.kwargs:
+self.tab_type = 'instance'
 tld = getattr(settings,
   "INSTANCE_TLD",
   "eqiad.wmflabs")
-instance = self.tab_group.kwargs['instance']
-self.prefix = "%s.%s.%s" % (instance.name,
-instance.tenant_id, tld)
-self.tenant_id = instance.tenant_id
+self.instance = self.tab_group.kwargs['instance']
+
+self.prefix = "%s.%s.%s" % (self.instance.name,
+self.instance.tenant_id, tld)
+self.tenant_id = self.instance.tenant_id
+
 elif 'tenant_id' in self.tab_group.kwargs:
+self.tab_type = 'project'
 self.tenant_id = self.tab_group.kwargs['tenant_id']
 self.prefix = self.tab_group.kwargs['prefix']
+else:
+self.tab_type = 'prefix'
+
+self.add_caption()
+
+self.config = puppet_config(self.prefix, self.tenant_id)
+
+def add_caption(self):
+
+self.capption = ""
+if self.tab_type == 'prefix':
+self.caption = _("These puppet settings will affect all VMs in the"
+ " %s project whose names begin with \'%s\'.") % (
+self.tenant_id, self.prefix)
+
+elif self.tab_type == 'project':
 self.caption = _("These puppet settings will affect all VMs"
  " in the %s project.") % self.tenant_id
 
-self.config = puppet_config(self.prefix, self.tenant_id)
+elif self.tab_type == 'instance':
+prefixes = puppet_config.get_prefixes(self.tenant_id)
+links = []
+for prefix in prefixes:
+if '.' in prefix:
+continue
+if prefix == '_':
+links.append("project config" %
+ urlresolvers.reverse(
+ "horizon:project:puppet:index"))
+elif self.instance.name.startswith(prefix):
+prefix_url = urlresolvers.reverse(
+"horizon:project:prefixpuppet:index",
+) + "?tab=prefix_puppet__puppet-%s" % prefix
+links.append("%s" % (prefix_url,
+prefix))
+
+if links:
+self.caption = mark_safe(_("This instance is also "
+   "affected by the following puppet "
+   "configs:  %s" % ", ".join(links)))
 
 def get_context_data(self, request, **kwargs):
 context = super(PuppetTab, 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Add captions to instance tabs

2016-09-16 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311160

Change subject: Puppet Panel:  Add captions to instance tabs
..

Puppet Panel:  Add captions to instance tabs

Since a given instance can be getting config from lots of
different places, this should clarify things a bit.

Bug: T91990
Change-Id: Idf71e3293d82ccaabc81fd52203a23ec02acb496
---
M modules/openstack/files/liberty/horizon/puppettab/tab.py
1 file changed, 49 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/60/311160/1

diff --git a/modules/openstack/files/liberty/horizon/puppettab/tab.py 
b/modules/openstack/files/liberty/horizon/puppettab/tab.py
index e4591fc..a8c19e7 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/tab.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/tab.py
@@ -20,6 +20,7 @@
 
 from horizon import tabs
 from django.conf import settings
+from django.utils.safestring import mark_safe
 
 import puppet_tables as p_tables
 from puppet_config import puppet_config
@@ -37,16 +38,11 @@
 
 def __init__(self, *args, **kwargs):
 
-# if prefix_tab is true we're going to display a
-#  'delete prefix' button.
-self.prefix_tab = False
-
 # For some reason our parent class can't deal with these
 #  args, so extract them now if they're present
 if 'prefix' in kwargs:
 self.prefix = kwargs['prefix']
 self.name = _("Prefix %s") % self.prefix
-self.slug += '-%s' % self.prefix
 del kwargs['prefix']
 
 if 'tenant_id' in kwargs:
@@ -54,34 +50,72 @@
 del kwargs['tenant_id']
 
 if hasattr(self, 'tenant_id') and hasattr(self, 'prefix'):
-self.prefix_tab = True
-self.caption = _("These puppet settings will affect all VMs in the"
- " %s project whose names begin with \'%s\'.") % (
-self.tenant_id, self.prefix)
+self.slug += '-%s' % self.prefix
+self.tab_type = 'prefix'
 
 super(PuppetTab, self).__init__(*args, **kwargs)
 
 if 'instance' in self.tab_group.kwargs:
+self.tab_type = 'instance'
 tld = getattr(settings,
   "INSTANCE_TLD",
   "eqiad.wmflabs")
-instance = self.tab_group.kwargs['instance']
-self.prefix = "%s.%s.%s" % (instance.name,
-instance.tenant_id, tld)
-self.tenant_id = instance.tenant_id
+self.instance = self.tab_group.kwargs['instance']
+
+self.prefix = "%s.%s.%s" % (self.instance.name,
+self.instance.tenant_id, tld)
+self.tenant_id = self.instance.tenant_id
+
 elif 'tenant_id' in self.tab_group.kwargs:
+self.tab_type = 'project'
 self.tenant_id = self.tab_group.kwargs['tenant_id']
 self.prefix = self.tab_group.kwargs['prefix']
+else:
+self.tab_type = 'prefix'
+
+self.add_caption()
+
+self.config = puppet_config(self.prefix, self.tenant_id)
+
+def add_caption(self):
+
+self.capption = ""
+if self.tab_type == 'prefix':
+self.caption = _("These puppet settings will affect all VMs in the"
+ " %s project whose names begin with \'%s\'.") % (
+self.tenant_id, self.prefix)
+
+elif self.tab_type == 'project':
 self.caption = _("These puppet settings will affect all VMs"
  " in the %s project.") % self.tenant_id
 
-self.config = puppet_config(self.prefix, self.tenant_id)
+elif self.tab_type == 'instance':
+prefixes = puppet_config.get_prefixes(self.tenant_id)
+links = []
+for prefix in prefixes:
+if '.' in prefix:
+continue
+if prefix == '_':
+links.append("project config" %
+ urlresolvers.reverse(
+ "horizon:project:puppet:index"))
+elif self.instance.name.startswith(prefix):
+prefix_url = urlresolvers.reverse(
+"horizon:project:prefixpuppet:index",
+) + "?tab=prefix_puppet__puppet-%s" % prefix
+links.append("%s" % (prefix_url,
+prefix))
+
+if links:
+self.caption = mark_safe(_("This instance is also "
+   "affected by the following puppet "
+   "configs:  %s" % ", ".join(links)))
 
 def get_context_data(self, request, **kwargs):
 context = 

[MediaWiki-commits] [Gerrit] wikimedia...wetzel[master]: Add bookmarking states

2016-09-16 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311158

Change subject: Add bookmarking states
..

Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I9622c4a14cb2c4094574a3e1d1c9d3778d6e418f
---
A global.R
M server.R
M ui.R
M wetzel.Rproj
M www/custom.js
5 files changed, 144 insertions(+), 160 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/wetzel 
refs/changes/58/311158/1

diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index f828305..43bad95 100644
--- a/server.R
+++ b/server.R
@@ -4,7 +4,7 @@
 
 # Actual server code.
 shinyServer(function(input, output, session) {
-  
+
   if(Sys.Date() != existing_date){
 read_actions()
 read_users()
@@ -12,14 +12,7 @@
 read_countries()
 existing_date <<- Sys.Date()
   }
-  
-  shinyURL.server(session)
-  
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
+
   output$tiles_summary_series <- renderDygraph({
 temp <- polloi::data_select(input$tile_summary_automata_check, 
new_tiles_automata, new_tiles_no_automata) %>%
 ddply(.(date), summarize,
@@ -41,52 +34,48 @@
   dyEvent(as.Date("2016-01-08"), "B (enwiki launch)", labelLoc = "bottom") 
%>%
   dyEvent(as.Date("2016-01-12"), "C (cache clear)", labelLoc = "bottom")
   })
-  
+
   output$tiles_style_series <- renderDygraph({
 polloi::data_select(input$tile_style_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
 ddply(.(date, style), summarize, `total tiles` = sum(total)) %>%
   tidyr::spread(style, `total tiles`, fill = 0) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_style_series)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$tiles_style_series_timeframe,
 input$tiles_style_series_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Tiles", "Total tiles by style", 
legend_name = "Style") %>%
   dyLegend(labelsDiv = "tiles_style_series_legend", show = "always") %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2015-09-17"), "A (announcement)", labelLoc = "bottom")
   })
-  
+
   output$tiles_users_series <- renderDygraph({
 polloi::data_select(input$tile_users_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
   ddply(.(date, style), summarize, `total users` = sum(users)) %>%
   tidyr::spread(style, `total users`, fill = 0) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_users_series)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$tiles_users_series_timeframe,
 input$tiles_users_series_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Users", "Total users by style") %>%
   dyLegend(labelsDiv = "tiles_users_series_legend", show = "always") %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2015-09-17"), "A (announcement)", labelLoc = "bottom")
   })
-  
+
   output$zoom_level_selector_container <- renderUI({
 selectInput("zoom_level_selector", "Zoom level",
 multiple = TRUE, selected = "0", selectize = FALSE, size = 19,
 choices = 
as.character(sort(unique(new_tiles_no_automata$zoom
   })
-  
+
   output$tiles_zoom_series <- renderDygraph({
 polloi::data_select(input$tile_zoom_automata_check, new_tiles_automata, 
new_tiles_no_automata) %>%
   subset(zoom %in% as.numeric(input$zoom_level_selector)) %>%
   ddply(.(date, zoom), summarize, `total tiles` = sum(total)) %>%
   tidyr::spread(zoom, `total tiles`, fill = 0) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_tiles_zoom_series)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$tiles_zoom_series_timeframe,
 input$tiles_zoom_series_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", "Tiles", "Total tiles by zoom level") %>%
   dyLegend(labelsDiv = "tiles_zoom_series_legend", show = "always")
   })
-  
+
   output$users_per_platform <- renderDygraph({
 user_data %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_users_per_platform)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$users_per_platform_timeframe,
 input$users_per_platform_timeframe_daterange)) %>%
   polloi::make_dygraph("Date", 

[MediaWiki-commits] [Gerrit] wikimedia...twilightsparql[master]: Add bookmarking states

2016-09-16 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311157

Change subject: Add bookmarking states
..

Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I457fb18d6f90d5eb32067a87bbe47002384b80cb
---
A global.R
M server.R
M twilightsparql.Rproj
M ui.R
M www/custom.js
5 files changed, 47 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/twilightsparql 
refs/changes/57/311157/1

diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index 753164c..fca3f17 100644
--- a/server.R
+++ b/server.R
@@ -2,18 +2,13 @@
 
 existing_date <- Sys.Date() - 1
 
-shinyServer(function(input, output) {
-  
+shinyServer(function(input, output, session) {
+
   if(Sys.Date() != existing_date){
 read_wdqs()
 existing_date <<- Sys.Date()
   }
-  
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
+
   output$wdqs_usage_plot <- renderDygraph(
 wdqs_usage %>%
   spider_subset(val = input$include_automata) %>%
@@ -23,14 +18,13 @@
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage), rename = 
FALSE) %>%
   # ...and then exp10-transformed back to the original scale:
   conditional_transform(input$usage_logscale && 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage) != "day", 
exp10) %>%
-  polloi::subset_by_date_range(time_frame_range(input$usage_timeframe, 
input$usage_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Daily WDQS 
Homepage usage", group = "usage") %>%
   # ...because we're using dygraphs' native log-scaling:
   dyAxis("y", logscale = input$usage_logscale) %>%
   dyLegend(labelsDiv = "usage_legend") %>%
   dyEvent(as.Date("2015-09-07"), "A (Announcement)", labelLoc = "bottom")
   )
-  
+
   output$sparql_usage_plot <- renderDygraph(
 sparql_usage %>%
   spider_subset(val = input$include_automata) %>%
@@ -38,7 +32,6 @@
   conditional_transform(input$usage_logscale && 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage) != "day", 
log10) %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage), rename = 
FALSE) %>%
   conditional_transform(input$usage_logscale && 
polloi::smooth_switch(input$smoothing_global, input$smoothing_usage) != "day", 
exp10) %>%
-  polloi::subset_by_date_range(time_frame_range(input$usage_timeframe, 
input$usage_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Daily 
SPARQL usage", group = "usage") %>%
   dyLegend(labelsDiv = "usage_legend") %>%
   dyAxis("y", logscale = input$usage_logscale) %>%
@@ -46,7 +39,7 @@
   dyEvent(as.Date("2015-09-07"), "A (Announcement)", labelLoc = "bottom") 
%>%
   dyEvent(as.Date("2015-11-05"), "B (Labs bot)", labelLoc = "bottom")
   )
-  
+
   # Check datasets for missing data and notify user which datasets are missing 
data (if any)
   output$message_menu <- renderMenu({
 notifications <- list(
@@ -55,5 +48,5 @@
 notifications <- notifications[!sapply(notifications, is.null)]
 return(dropdownMenu(type = "notifications", .list = notifications))
   })
-  
+
 })
diff --git a/twilightsparql.Rproj b/twilightsparql.Rproj
index 0a8dc07..d64e28b 100644
--- a/twilightsparql.Rproj
+++ b/twilightsparql.Rproj
@@ -13,3 +13,4 @@
 LaTeX: pdfLaTeX
 
 AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
diff --git a/ui.R b/ui.R
index c3afb75..537cd97 100644
--- a/ui.R
+++ b/ui.R
@@ -1,49 +1,41 @@
-source("utils.R")
 library(shiny)
 library(shinydashboard)
 library(dygraphs)
 
-# Header elements for the visualization
-header <- dashboardHeader(title = "Wikidata Query Service", 
dropdownMenuOutput("message_menu"), disable = FALSE)
+function(request) {
+  dashboardPage(
 
-# Sidebar elements for the search visualizations
-sidebar <- dashboardSidebar(
-  tags$head(
-tags$link(rel = "stylesheet", type = "text/css", href = "custom.css"),
-tags$script(src = "custom.js")
-  ),
-  sidebarMenu(
-menuItem(text = "WDQS Usage", tabName = "wdqs_usage"),
-menuItem(text = "Global Settings",
- selectInput(inputId = "smoothing_global", label = "Smoothing", 
selectize = TRUE, selected = "day",
- choices = c("No Smoothing" = "day", "Weekly Median" = 

[MediaWiki-commits] [Gerrit] wikimedia...wonderbolt[master]: Add bookmarking states

2016-09-16 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311159

Change subject: Add bookmarking states
..

Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: Iab2b2a84707e4438567d651b9df327ce221292ee
---
A global.R
M server.R
M ui.R
M wonderbolt.Rproj
M www/custom.js
5 files changed, 56 insertions(+), 66 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/wonderbolt 
refs/changes/59/311159/1

diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index 3b2fa03..1888f89 100644
--- a/server.R
+++ b/server.R
@@ -1,23 +1,21 @@
+library(shiny)
+library(shinydashboard)
+library(dygraphs)
+
 source("utils.R")
 
 existing_date <- Sys.Date() - 1
 
-shinyServer(function(input, output){
+function(input, output, session) {
   
   if (Sys.Date() != existing_date) {
 read_traffic()
 existing_date <<- Sys.Date()
   }
   
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
-  }
-  
   output$traffic_summary_dygraph <- renderDygraph({
 summary_traffic_data[[input$platform_traffic_summary]] %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_traffic_summary)) 
%>%
-  
polloi::subset_by_date_range(time_frame_range(input$traffic_summary_timeframe, 
input$traffic_summary_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Pageviews",
title = "Sources of page views (e.g. search engines 
and internal referers)") %>%
   dyLegend(labelsDiv = "traffic_summary_legend", show = "always", 
showZeroValues = FALSE) %>%
@@ -29,7 +27,6 @@
   output$traffic_bysearch_dygraph <- renderDygraph({
 bysearch_traffic_data[[input$platform_traffic_bysearch]] %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_traffic_bysearch)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$traffic_bysearch_timeframe, 
input$traffic_bysearch_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Pageviews",
title = "Pageviews from external search engines, 
broken down by engine") %>%
   dyLegend(labelsDiv = "traffic_bysearch_legend", show = "always", 
showZeroValues = FALSE) %>%
@@ -47,4 +44,4 @@
 return(dropdownMenu(type = "notifications", .list = notifications))
   })
   
-})
+}
diff --git a/ui.R b/ui.R
index 8b7bd7f..358e8a9 100644
--- a/ui.R
+++ b/ui.R
@@ -2,64 +2,50 @@
 library(shinydashboard)
 library(dygraphs)
 
-#Header elements for the visualisation
-header <- dashboardHeader(title = "External Search Traffic", 
dropdownMenuOutput("message_menu"), disable = FALSE)
+function(request) {
+  dashboardPage(
 
-sidebar <- dashboardSidebar(
-  tags$head(
-tags$link(rel = "stylesheet", type = "text/css", href = "stylesheet.css"),
-tags$script(src = "custom.js")
-  ),
-  sidebarMenu(
-menuItem(text = "Traffic",
- menuSubItem(text = "Summary", tabName = "traffic_summary"),
- menuSubItem(text = "Pageviews by search engine", tabName = 
"traffic_by_engine")),
-menuItem(text = "Global Settings",
- selectInput(inputId = "smoothing_global", label = "Smoothing", 
selectize = TRUE, selected = "day",
- choices = c("No Smoothing" = "day", "Weekly Median" = 
"week", "Monthly Median" = "month", "Splines" = "gam")),
- selectInput(inputId = "timeframe_global", label = "Time Frame", 
selectize = TRUE, selected = "",
- choices = c("All available data" = "all", "Last 7 
days" = "week", "Last 30 days" = "month",
- "Last 90 days" = "quarter", "Custom" = 
"custom")),
- conditionalPanel("input.timeframe_global == 'custom'",
-  dateRangeInput("daterange_global", label = 
"Custom Date Range",
- start = Sys.Date()-11, end = 
Sys.Date()-1, min = "2015-04-14")),
- icon = icon("cog", lib = "glyphicon"))
-  ),
-  div(icon("info-sign", lib = "glyphicon"), HTML("Tip: you 
can drag on the graphs with your mouse to zoom in on a particular date 
range."), style = "padding: 10px; color: white;")
-)
+dashboardHeader(title = "External Search Traffic", 
dropdownMenuOutput("message_menu"), disable = FALSE),
 
-# Custom function to allow for the selection betwene

[MediaWiki-commits] [Gerrit] wikimedia...prince[master]: Add bookmarking states

2016-09-16 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311156

Change subject: Add bookmarking states
..

Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I32f0565a86500c3a702ad54cd06b87bf6059a2f4
---
M functions.R
A global.R
M prince.Rproj
M server.R
M ui.R
M www/custom.js
6 files changed, 238 insertions(+), 236 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/prince 
refs/changes/56/311156/1

diff --git a/functions.R b/functions.R
index 3674885..7ee1f65 100644
--- a/functions.R
+++ b/functions.R
@@ -7,27 +7,27 @@
 
 # Read in the traffic data
 read_clickthrough <- function(){
-  
+
   # Read in and format the high-level data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/clickthrough_rate.tsv"))
-  clickthrough_rate <<- data[, j = list(success_rate = (events[type == 
"clickthrough"]/sum(events))*100), by = "date"]
-  
+  clickthrough_rate <<- data[, j = list(`clickthrough rate` = (events[type == 
"clickthrough"]/sum(events))*100), by = "date"]
+
   # Read in and format the breakdown data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/clickthrough_breakdown.tsv"))
   data <- data[, j = list(section_used = section_used, proportion = 
(events/sum(events))*100), by = "date"]
   action_breakdown <<- reshape2::dcast(data, formula = date ~ section_used, 
fun.aggregate = sum)
-  
+
   # Read in most common section per visit data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/most_common_per_visit.tsv"))
   data <- data[, j = list(section_used = section_used, proportion = 
(visits/sum(visits))*100), by = "date"]
   most_common <<- reshape2::dcast(data, formula = date ~ section_used, 
fun.aggregate = sum)
-  
+
   # Read in first visit clickthrough rates
   data <- polloi::read_dataset(path = "portal/clickthrough_firstvisit.tsv")
   data[, -1] <- data[, -1]*100 # first column is always going to be the date
   data$`language search` <- 0
   first_visit_ctrs <<- as.data.frame(data[, names(action_breakdown)])
-  
+
   return(invisible())
 }
 
@@ -42,7 +42,7 @@
 
 read_country <- function(){
   data <- as.data.table(polloi::read_dataset(path = "portal/country_data.tsv"))
-  
+
   country_data <<- reshape2::dcast(data[,list(country = country, events = 
round(events/sum(events)*100,2)),
 by = "date"],
formula = date ~ country, fun.aggregate = 
sum)
@@ -88,15 +88,15 @@
 }
 
 read_referrals <- function(){
-  
+
   # Read in the initial data
   data <- as.data.table(polloi::read_dataset(path = 
"portal/portal_referer_data.tsv"))
-  
+
   # Format
   data$is_search <- ifelse(data$is_search, "Referred by search", "Not referred 
by search")
   data$search_engine[data$search_engine == "none"] <- "Not referred by search"
-  
-  
+
+
   # Write out the overall values for traffic
   interim <- data[, j = list(pageviews = sum(pageviews)),
 by = c("date", "referer_class")] %>%
@@ -117,16 +117,16 @@
   "Unknown referers",
   "Total")
   summary_traffic_data <<- interim[, 1:7]
-  
+
   # Generate per-engine values
   interim <- data[data$search_engine != "Not referred by search",
   j = list(pageviews = sum(pageviews)),
   by = c("date", "search_engine")] %>%
 reshape2::dcast(formula = date ~ search_engine, fun.aggregate = sum)
   bysearch_traffic_data <<- cbind(date = interim$date, 
data.frame(round(100*t(apply(interim[, -1], 1, function(x) { x/sum(x) })), 2)))
-  
+
   return(invisible())
-  
+
 }
 
 fill_out <- function(x, start_date, end_date, fill = 0) {
diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/prince.Rproj b/prince.Rproj
index a213108..e83436a 100644
--- a/prince.Rproj
+++ b/prince.Rproj
@@ -13,3 +13,4 @@
 LaTeX: pdfLaTeX
 
 AutoAppendNewline: Yes
+StripTrailingWhitespace: Yes
diff --git a/server.R b/server.R
index 51a3264..3e50149 100644
--- a/server.R
+++ b/server.R
@@ -1,16 +1,14 @@
 library(shiny)
 library(shinydashboard)
 library(dygraphs)
-library(shinyURL)
 library(shinyjs)
 
 source("functions.R")
-options(scipen = 500)
 
 existing_date <- Sys.Date() - 1
 
 shinyServer(function(input, output, session) {
-  
+
   if (Sys.Date() != existing_date) {
 progress <- shiny::Progress$new(session, min = 0, max = 1)
 on.exit(progress$close())
@@ -31,14 +29,12 @@
 progress$set(message = "Finished downloading datasets.", value = 1)
 existing_date <<- Sys.Date()
   }
-  
-  shinyURL.server(session)
-  
+
   output$clickthrough_rate_dygraph <- renderDygraph({
 clickthrough_rate 

[MediaWiki-commits] [Gerrit] wikimedia...rainbow[master]: Add bookmarking states

2016-09-16 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311155

Change subject: Add bookmarking states
..

Add bookmarking states

In Shiny 0.14, RStudio added a way to bookmark
the state of the dashboard. Previously, we've
used the shinyURL R package, but this way we
use something that is now built into Shiny.

Bug: T145478
Change-Id: I0852673581c87a89d95da9f14715fc093daac6a6
---
A global.R
M server.R
M ui.R
R www/custom.js
4 files changed, 263 insertions(+), 345 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/rainbow 
refs/changes/55/311155/1

diff --git a/global.R b/global.R
new file mode 100644
index 000..6300d25
--- /dev/null
+++ b/global.R
@@ -0,0 +1 @@
+enableBookmarking(store = "url")
diff --git a/server.R b/server.R
index 17a3679..5ac100c 100644
--- a/server.R
+++ b/server.R
@@ -6,11 +6,11 @@
 
 existing_date <- Sys.Date() - 1
 
-shinyServer(function(input, output, session) {
+function(input, output, session) {
 
   if (Sys.Date() != existing_date) {
 # Create a Progress object
-progress <- shiny::Progress$new(session, min = 0, max = 1)
+progress <- shiny::Progress$new()
 progress$set(message = "Downloading desktop data", value = 0)
 read_desktop()
 progress$set(message = "Downloading apps data", value = 0.1)
@@ -30,11 +30,6 @@
 progress$set(message = "Finished downloading datasets", value = 1)
 existing_date <<- Sys.Date()
 progress$close()
-  }
-
-  # Wrap time_frame_range to provide global settings
-  time_frame_range <- function(input_local_timeframe, input_local_daterange) {
-return(polloi::time_frame_range(input_local_timeframe, 
input_local_daterange, input$timeframe_global, input$daterange_global))
   }
 
   ## Desktop value boxes
@@ -69,7 +64,6 @@
   output$desktop_event_plot <- renderDygraph({
 desktop_dygraph_set %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_desktop_event)) 
%>%
-  
polloi::subset_by_date_range(time_frame_range(input$desktop_event_timeframe, 
input$desktop_event_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Desktop 
search events, by day") %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2016-07-12"), "A (schema switch)", labelLoc = "bottom")
@@ -78,7 +72,6 @@
   output$desktop_load_plot <- renderDygraph({
 desktop_load_data %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_desktop_load)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$desktop_load_timeframe, 
input$desktop_load_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Load time (ms)", title = 
"Desktop load times, by day", use_si = FALSE) %>%
   dyRangeSelector %>%
   dyEvent(as.Date("2016-07-12"), "A (schema switch)", labelLoc = "bottom")
@@ -87,7 +80,6 @@
   output$paulscore_approx_plot_fulltext <- renderDygraph({
 paulscore_fulltext %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_paulscore_approx)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$paulscore_approx_timeframe, 
input$paulscore_approx_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "PaulScore", title = 
"PaulScore for fulltext searches, by day", use_si = FALSE, group = 
"paulscore_approx") %>%
   dyRangeSelector %>%
   dyLegend(labelsDiv = "paulscore_approx_legend", show = "always")
@@ -96,7 +88,6 @@
   output$paulscore_approx_plot_autocomplete <- renderDygraph({
 paulscore_autocomplete %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, 
input$smoothing_paulscore_approx)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$paulscore_approx_timeframe, 
input$paulscore_approx_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "PaulScore", title = 
"PaulScore for autocomplete searches, by day", use_si = FALSE, group = 
"paulscore_approx") %>%
   dyRangeSelector %>%
   dyLegend(labelsDiv = "paulscore_approx_legend", show = "always")
@@ -134,7 +125,6 @@
   output$mobile_event_plot <- renderDygraph({
 mobile_dygraph_set %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_mobile_event)) %>%
-  
polloi::subset_by_date_range(time_frame_range(input$mobile_event_timeframe, 
input$mobile_event_timeframe_daterange)) %>%
   polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Mobile 
search events, by day") %>%
   dyRangeSelector
   })
@@ -142,7 +132,6 @@
   output$mobile_load_plot <- renderDygraph({
 mobile_load_data %>%
   polloi::smoother(smooth_level = 
polloi::smooth_switch(input$smoothing_global, input$smoothing_mobile_load)) %>%
-  

[MediaWiki-commits] [Gerrit] operations/puppet[production]: ldap::client::utils: don't ensure => latest packages

2016-09-16 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: ldap::client::utils: don't ensure => latest packages
..


ldap::client::utils: don't ensure => latest packages

Bug: T115348
Change-Id: I98e3b7bd4c06d62a1d3e24bf7673c63a3c381277
---
M modules/ldap/manifests/client/utils.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/ldap/manifests/client/utils.pp 
b/modules/ldap/manifests/client/utils.pp
index cdd2c84..399c042 100644
--- a/modules/ldap/manifests/client/utils.pp
+++ b/modules/ldap/manifests/client/utils.pp
@@ -8,7 +8,7 @@
 'python-ldap',
 'python-pycurl',
 ]:
-ensure => latest,
+ensure => present,
 }
 
 file { '/usr/local/sbin/add-ldap-group':

-- 
To view, visit https://gerrit.wikimedia.org/r/311151
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I98e3b7bd4c06d62a1d3e24bf7673c63a3c381277
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Upgrade to OkHttp v3.4.1 and Retrofit v2.1.0

2016-09-16 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311154

Change subject: Upgrade to OkHttp v3.4.1 and Retrofit v2.1.0
..

Upgrade to OkHttp v3.4.1 and Retrofit v2.1.0

https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-341
https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-340
https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-340-rc1
https://github.com/square/retrofit/blob/master/CHANGELOG.md#version-210-2016-06-15

Change-Id: I4a739ade3c9e870e90c2ae5aba9c888fe7812d4b
---
M app/build.gradle
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/54/311154/1

diff --git a/app/build.gradle b/app/build.gradle
index e2ac521..988230d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -165,8 +165,8 @@
 // use http://gradleplease.appspot.com/ or http://search.maven.org/.
 // Debug with ./gradlew -q app:dependencies --configuration compile
 
-String retrofitVersion = '2.0.2'
-String okHttpVersion = '3.3.1'
+String okHttpVersion = '3.4.1'
+String retrofitVersion = '2.1.0'
 String supportVersion = '24.1.1'
 String espressoVersion = '2.2.2'
 String butterKnifeVersion = '8.4.0'

-- 
To view, visit https://gerrit.wikimedia.org/r/311154
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a739ade3c9e870e90c2ae5aba9c888fe7812d4b
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Return concurrency to normal.

2016-09-16 Thread Ppchelko (Code Review)
Ppchelko has submitted this change and it was merged.

Change subject: Return concurrency to normal.
..


Return concurrency to normal.

We've doubled the concurrency to help clear up
the backlog, now it's clear, so return it back
to avoid possible problems on weekends.

Change-Id: I4f92455532d942b81842d3ee8961562718d45116
---
M scap/templates/config.yaml.j2
M scap/vars.yaml
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Ppchelko: Verified; Looks good to me, approved



diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2
index f841d19..6eb84b6 100644
--- a/scap/templates/config.yaml.j2
+++ b/scap/templates/config.yaml.j2
@@ -277,7 +277,7 @@
 body: '{{globals.message}}'
 
 on_transclusion_update:
-  concurrency: <%= concurrency * 4 %>
+  concurrency: <%= concurrency * 8 %>
   topic: change-prop.transcludes.resource-change
   match:
 meta:
diff --git a/scap/vars.yaml b/scap/vars.yaml
index b351bac..80bb8dd 100644
--- a/scap/vars.yaml
+++ b/scap/vars.yaml
@@ -18,4 +18,4 @@
 ores_uri: localhost:8081
 purge_host: 127.0.0.1
 purge_port: 4827
-concurrency: 100
+concurrency: 50

-- 
To view, visit https://gerrit.wikimedia.org/r/311153
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f92455532d942b81842d3ee8961562718d45116
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko 
Gerrit-Reviewer: Ppchelko 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Return concurrency to normal.

2016-09-16 Thread Ppchelko (Code Review)
Ppchelko has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311153

Change subject: Return concurrency to normal.
..

Return concurrency to normal.

We've doubled the concurrency to help clear up
the backlog, now it's clear, so return it back
to avoid possible problems on weekends.

Change-Id: I4f92455532d942b81842d3ee8961562718d45116
---
M scap/templates/config.yaml.j2
M scap/vars.yaml
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/change-propagation/deploy 
refs/changes/53/311153/1

diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2
index f841d19..6eb84b6 100644
--- a/scap/templates/config.yaml.j2
+++ b/scap/templates/config.yaml.j2
@@ -277,7 +277,7 @@
 body: '{{globals.message}}'
 
 on_transclusion_update:
-  concurrency: <%= concurrency * 4 %>
+  concurrency: <%= concurrency * 8 %>
   topic: change-prop.transcludes.resource-change
   match:
 meta:
diff --git a/scap/vars.yaml b/scap/vars.yaml
index b351bac..80bb8dd 100644
--- a/scap/vars.yaml
+++ b/scap/vars.yaml
@@ -18,4 +18,4 @@
 ores_uri: localhost:8081
 purge_host: 127.0.0.1
 purge_port: 4827
-concurrency: 100
+concurrency: 50

-- 
To view, visit https://gerrit.wikimedia.org/r/311153
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f92455532d942b81842d3ee8961562718d45116
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Upgrade to Fresco v0.13.0

2016-09-16 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311152

Change subject: Upgrade to Fresco v0.13.0
..

Upgrade to Fresco v0.13.0

Also replace demo code copies per release notes[0,1,2]. From 6efeb95:

  [3]: MultiPointerGestureDetector, TransformGestureDetector
  [4]: DefaultZoomableController, ZoomableController, ZoomableDraweeView

The javax.annotation.Nullable import was changed to the Support library
and Checkstyle config updated to ignore these files.

[0] https://github.com/facebook/fresco/releases/tag/v0.11.0
[1] https://github.com/facebook/fresco/releases/tag/v0.12.0
[2] https://github.com/facebook/fresco/releases/tag/v0.13.0
[3] 
https://github.com/facebook/fresco/tree/master/samples/gestures/src/main/java/com/facebook/samples/gestures
[4] 
https://github.com/facebook/fresco/tree/master/samples/zoomable/src/main/java/com/facebook/samples/zoomable

Change-Id: I64be6993cb1ec4acb6509daf3a1d8a7373b28431
---
M app/build.gradle
M 
app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java
M app/src/main/java/com/facebook/samples/gestures/TransformGestureDetector.java
A 
app/src/main/java/com/facebook/samples/zoomable/AbstractAnimatedZoomableController.java
A 
app/src/main/java/com/facebook/samples/zoomable/AnimatedZoomableController.java
M app/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java
A app/src/main/java/com/facebook/samples/zoomable/GestureListenerWrapper.java
M app/src/main/java/com/facebook/samples/zoomable/ZoomableController.java
M app/src/main/java/com/facebook/samples/zoomable/ZoomableDraweeView.java
M app/src/main/java/org/wikipedia/views/FaceAndColorDetectImageView.java
M gradle/src/checkstyle.gradle
11 files changed, 1,130 insertions(+), 415 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/52/311152/1

diff --git a/app/build.gradle b/app/build.gradle
index b7445c1..e2ac521 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -170,7 +170,7 @@
 String supportVersion = '24.1.1'
 String espressoVersion = '2.2.2'
 String butterKnifeVersion = '8.4.0'
-String frescoVersion = '0.10.0'
+String frescoVersion = '0.13.0'
 String testingSupportVersion = '0.5'
 String mockitoCore = 'org.mockito:mockito-core:1.9.5'
 
diff --git 
a/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java
 
b/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java
index 5ed4874..97594ee 100644
--- 
a/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java
+++ 
b/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java
@@ -25,25 +25,26 @@
 
   /** The listener for receiving notifications when gestures occur. */
   public interface Listener {
-/** Responds to the beginning of a gesture. */
-void onGestureBegin(MultiPointerGestureDetector detector);
+/** A callback called right before the gesture is about to start. */
+public void onGestureBegin(MultiPointerGestureDetector detector);
 
-/** Responds to the update of a gesture in progress. */
-void onGestureUpdate(MultiPointerGestureDetector detector);
+/** A callback called each time the gesture gets updated. */
+public void onGestureUpdate(MultiPointerGestureDetector detector);
 
-/** Responds to the end of a gesture. */
-void onGestureEnd(MultiPointerGestureDetector detector);
+/** A callback called right after the gesture has finished. */
+public void onGestureEnd(MultiPointerGestureDetector detector);
   }
 
   private static final int MAX_POINTERS = 2;
 
   private boolean mGestureInProgress;
-  private int mCount;
-  private final int[] mId = new int[MAX_POINTERS];
-  private final float[] mStartX = new float[MAX_POINTERS];
-  private final float[] mStartY = new float[MAX_POINTERS];
-  private final float[] mCurrentX = new float[MAX_POINTERS];
-  private final float[] mCurrentY = new float[MAX_POINTERS];
+  private int mPointerCount;
+  private int mNewPointerCount;
+  private final int mId[] = new int[MAX_POINTERS];
+  private final float mStartX[] = new float[MAX_POINTERS];
+  private final float mStartY[] = new float[MAX_POINTERS];
+  private final float mCurrentX[] = new float[MAX_POINTERS];
+  private final float mCurrentY[] = new float[MAX_POINTERS];
 
   private Listener mListener = null;
 
@@ -69,7 +70,7 @@
*/
   public void reset() {
 mGestureInProgress = false;
-mCount = 0;
+mPointerCount = 0;
 for (int i = 0; i < MAX_POINTERS; i++) {
   mId[i] = MotionEvent.INVALID_POINTER_ID;
 }
@@ -83,15 +84,21 @@
 return true;
   }
 
+  /**
+   * Starts a new gesture and calls the listener just before starting it.
+   */
   private void startGesture() {
 if (!mGestureInProgress) {
-  mGestureInProgress = true;
   if (mListener != null) {
 

  1   2   3   >