[MediaWiki-commits] [Gerrit] API: Add isset() to avoid PHP warning - change (mediawiki/core)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: API: Add isset() to avoid PHP warning
..


API: Add isset() to avoid PHP warning

Bug: T120075
Change-Id: I8e4ac665c262e6f889abba24eb2beb4fd5a76d1b
---
M includes/api/ApiFeedWatchlist.php
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/includes/api/ApiFeedWatchlist.php 
b/includes/api/ApiFeedWatchlist.php
index 77a3a21..c841d83 100644
--- a/includes/api/ApiFeedWatchlist.php
+++ b/includes/api/ApiFeedWatchlist.php
@@ -265,7 +265,9 @@
if ( !isset( $p[ApiBase::PARAM_HELP_MSG] ) ) {
$p[ApiBase::PARAM_HELP_MSG] = 
"apihelp-query+watchlist-param-$from";
}
-   if ( is_array( $p[ApiBase::PARAM_TYPE] ) && 
isset( $p[ApiBase::PARAM_HELP_MSG_PER_VALUE] ) ) {
+   if ( isset( $p[ApiBase::PARAM_TYPE] ) && 
is_array( $p[ApiBase::PARAM_TYPE] ) &&
+   isset( 
$p[ApiBase::PARAM_HELP_MSG_PER_VALUE] )
+   ) {
foreach ( $p[ApiBase::PARAM_TYPE] as $v 
) {
if ( !isset( 
$p[ApiBase::PARAM_HELP_MSG_PER_VALUE][$v] ) ) {

$p[ApiBase::PARAM_HELP_MSG_PER_VALUE][$v] = 
"apihelp-query+watchlist-paramvalue-$from-$v";

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e4ac665c262e6f889abba24eb2beb4fd5a76d1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie 
Gerrit-Reviewer: Krinkle 
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] Track max and avg statements per entity - change (analytics/limn-wikidata-data)

2015-12-02 Thread Addshore (Code Review)
Addshore has submitted this change and it was merged.

Change subject: Track max and avg statements per entity
..


Track max and avg statements per entity

Bug: T119977
Change-Id: Ib8a9d03801c216ccb436a6e9cd52daa354cfbab8
---
M graphite/datamodel/statements_per_entity.php
1 file changed, 30 insertions(+), 2 deletions(-)

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



diff --git a/graphite/datamodel/statements_per_entity.php 
b/graphite/datamodel/statements_per_entity.php
index 51ad474..aee019c 100755
--- a/graphite/datamodel/statements_per_entity.php
+++ b/graphite/datamodel/statements_per_entity.php
@@ -21,7 +21,18 @@
 
$rows = $queryResult->fetchAll();
 
-   $totals = array();
+   $totals = array(
+   'item' => 0,
+   'property' => 0,
+   );
+   $maxes = array(
+   'item' => 0,
+   'property' => 0,
+   );
+   $entitiesWithStatements = array(
+   'item' => 0,
+   'property' => 0,
+   );
foreach( $rows as $row ) {
if( $row['namespace'] == '0' ) {
$entityType = 'item';
@@ -31,12 +42,17 @@
throw new LogicException( 'Couldn\'t identify 
namespace: ' . $row['namespace'] );
}
 
-   @$totals[$entityType] += ( $row['statements'] * 
$row['count'] );
+   $totals[$entityType] += ( $row['statements'] * 
$row['count'] );
+   $entitiesWithStatements[$entityType] += $row['count'];
 
$this->sendMetric(

"daily.wikidata.datamodel.$entityType.statements.count." . $row['statements'],
$row['count']
);
+
+   if( $maxes[$entityType] < $row['statements'] ) {
+   $maxes[$entityType] = $row['statements'];
+   }
}
 
foreach( $totals as $entityType => $value ) {
@@ -44,7 +60,19 @@

"daily.wikidata.datamodel.$entityType.statements.total",
$value
);
+   $this->sendMetric(
+   
"daily.wikidata.datamodel.$entityType.statements.avg",
+   $value / $entitiesWithStatements[$entityType]
+   );
}
+
+   foreach( $maxes as $entityType => $value ) {
+   $this->sendMetric(
+   
"daily.wikidata.datamodel.$entityType.statements.max",
+   $value
+   );
+   }
+
}
 
private function sendMetric( $name, $value ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib8a9d03801c216ccb436a6e9cd52daa354cfbab8
Gerrit-PatchSet: 2
Gerrit-Project: analytics/limn-wikidata-data
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] dumps: one more check to see if db is skipped before we dump it - change (operations/dumps)

2015-12-02 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: dumps: one more check to see if db is skipped before we dump it
..


dumps: one more check to see if db is skipped before we dump it

Bug: T116564
Change-Id: Icbc1ea3ee7b17c0a56028e550e97a55ab8ea1c8a
---
M xmldumps-backup/incrementals/generateincrementals.py
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/xmldumps-backup/incrementals/generateincrementals.py 
b/xmldumps-backup/incrementals/generateincrementals.py
index fb45687..50ef54e 100644
--- a/xmldumps-backup/incrementals/generateincrementals.py
+++ b/xmldumps-backup/incrementals/generateincrementals.py
@@ -206,7 +206,8 @@
 
 def do_one_wiki(self):
 if (self.wikiname not in self._config.private_wikis_list and
-self.wikiname not in self._config.closed_wikis_list):
+self.wikiname not in self._config.closed_wikis_list and
+self.wikiname not in self._config.skip_wikis_list):
 if not exists(self.incrdir.get_incdir(self.wikiname)):
 os.makedirs(self.incrdir.get_incdir(self.wikiname))
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbc1ea3ee7b17c0a56028e550e97a55ab8ea1c8a
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn 
Gerrit-Reviewer: ArielGlenn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add Mark's Yubikey based SSH pubkey - change (operations/puppet)

2015-12-02 Thread Mark Bergsma (Code Review)
Mark Bergsma has uploaded a new change for review.

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

Change subject: Add Mark's Yubikey based SSH pubkey
..

Add Mark's Yubikey based SSH pubkey

Change-Id: Ic1b63c4156882cf6e8e95c9420d002717d3b085f
---
M modules/admin/data/data.yaml
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/19/256419/1

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 237b2b0..8d43b20 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -498,8 +498,9 @@
 gid: 500
 name: mark
 realname: Mark Bergsma
-ssh_keys: [ssh-rsa 
B3NzaC1yc2EBIwAAAIEAorTmQ0qlrxB3RL+GULLzex3k1Pg/c6tgLbKsl1A7Qo0B5XI4eNgfWwaAXUrKyQW3/9gwDH3YJ2eoOue0/BGhKX6voOTnNPeGE9ZbrufpPLT6DXDEbvpmXQd/qw8s0GxdftleHYl28av0nTZgKY+1/Oc+ZHNUN5YxmdGehWBvTXs=
-Mark\s main public key]
+ssh_keys:
+  - ssh-rsa 
B3NzaC1yc2EBIwAAAIEAorTmQ0qlrxB3RL+GULLzex3k1Pg/c6tgLbKsl1A7Qo0B5XI4eNgfWwaAXUrKyQW3/9gwDH3YJ2eoOue0/BGhKX6voOTnNPeGE9ZbrufpPLT6DXDEbvpmXQd/qw8s0GxdftleHYl28av0nTZgKY+1/Oc+ZHNUN5YxmdGehWBvTXs=
 Mark\s main public key
+  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCGYwDexjSlyf1dMsVMr9VrEwnsEW90p3Ywgz/1Zl1EmYIrwLztKZ6V2bR6FbMx072YT6eEkg3m6dHxck5Q2Tx8QvUuUMoHzg18e/ZzsVZkG/cqtwrEXTRpg7O35xcdg0rYAbyyB0qo2z5gZWakZPd+h9hwfj2CUQ29aGRv83fsu2Ua5rbavU8OwAfndxJaBHDUqHsS/Mc+M3h6LF6XjhT9ELh0k7ZyPNhYTJ0N1VI4ROoxWI4/WRsclsSZtnWi7tYWP6WjhptezRGdbo2H/EMNffmISq5/n/1lkcAWGTIY3bppmBGe+f7CDcg8VN0i56Xe9+U7smlnqBSc17HZ8035
 mark@neo
 uid: 531
   jgreen:
 ensure: present

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1b63c4156882cf6e8e95c9420d002717d3b085f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma 

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


[MediaWiki-commits] [Gerrit] Link updates and formatting tweaks - change (mediawiki...UserExport)

2015-12-02 Thread Kghbln (Code Review)
Kghbln has uploaded a new change for review.

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

Change subject: Link updates and formatting tweaks
..

Link updates and formatting tweaks

Change-Id: I669d475f9f34e560d56f0e91e4a4cba07f21d0e3
---
M UserExport.body.php
M UserExport.php
2 files changed, 39 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UserExport 
refs/changes/28/256428/1

diff --git a/UserExport.body.php b/UserExport.body.php
index bc2b44c..ed66632 100644
--- a/UserExport.body.php
+++ b/UserExport.body.php
@@ -2,12 +2,12 @@
 /**
  * Main file for the UserExport extension.
  */
- 
-///Special page class for the User Export extension
+
+//Special page class for the User Export extension
 /**
  * Special page that allows sysops to export the username and
  * user email to a CSV file
- * 
+ *
  * @addtogroup Extensions
  * @author Rodrigo Sampaio Primo 
  */
@@ -15,17 +15,17 @@
function __construct() {
parent::__construct( 'UserExport', 'userexport' );
}
- 
+
function execute( $par ) {
global $wgRequest, $wgOut, $wgUser;
- 
+
$this->setHeaders();
- 
+
if ( !$wgUser->isAllowed( 'userexport' ) ) {
$wgOut->permissionRequired( 'userexport' );
return;
}
- 
+
 if ( $wgRequest->getText( 'exportusers' ) ) {
 if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) {
 // bad edit token
@@ -34,11 +34,11 @@
 $this->exportUsers();
 }
 }
- 
+
 $wgOut->addHTML(
-Xml::openElement('p') .
+Xml::openElement( 'p' ) .
 wfMessage( 'userexport-description' )->text() .
-Xml::closeElement('p') . 
+Xml::closeElement( 'p' ) .
 Xml::openElement( 'form', array( 'method' => 'post', 'action' => 
$this->getTitle()->getLocalUrl(), 'id' => 'userexportform' ) ) .
 Xml::submitButton( wfMessage( 'userexport-submit' )->text() ) .
Html::hidden( 'token', $wgUser->editToken() ) .
@@ -46,7 +46,7 @@
Xml::closeElement( 'form' ) . "\n"
);
}
- 
+
 /**
  * Function to query the database and generate the CVS file
  *
@@ -54,33 +54,33 @@
  */
 private function exportUsers()
 {
-$filePath = tempnam(sys_get_temp_dir(), '');
-$file = fopen($filePath, 'w');
- 
+$filePath = tempnam( sys_get_temp_dir(), '' );
+$file = fopen( $filePath, 'w' );
+
 $db = wfGetDB( DB_MASTER );
-$users = $db->select('user', array('user_name', 'user_email'));
- 
-fputcsv($file, array('login', 'email'));
- 
+$users = $db->select( 'user', array( 'user_name', 'user_email' ) );
+
+fputcsv( $file, array( 'login', 'email' ) );
+
 while ( $user = $db->fetchObject( $users ) ) {
-fputcsv($file, array($user->user_name, $user->user_email));
+fputcsv( $file, array( $user->user_name, $user->user_email ) );
 }
- 
-fclose($file);
- 
-header("Pragma:  no-cache");
-header("Expires: 0");
-header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
-header("Cache-Control: public");
-header("Content-Description: File Transfer");
-header("Content-type: text/csv");
-header("Content-Transfer-Encoding: binary"); 
-header("Content-Disposition: attachment; 
filename=\"mediawiki_users.csv\"");
-header("Content-Length: " . filesize($filePath));  
-header("Accept-Ranges: bytes");  
- 
-readfile($filePath);
-unlink($filePath);
+
+fclose( $file );
+
+header( "Pragma:  no-cache" );
+header( "Expires: 0" );
+header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
+header( "Cache-Control: public" );
+header( "Content-Description: File Transfer" );
+header( "Content-type: text/csv" );
+header( "Content-Transfer-Encoding: binary" );
+header( "Content-Disposition: attachment; 
filename=\"mediawiki_users.csv\"" );
+header( "Content-Length: " . filesize( $filePath ) );
+header( "Accept-Ranges: bytes" );
+
+readfile( $filePath );
+unlink( $filePath );
 die;
 }
 }
diff --git a/UserExport.php b/UserExport.php
index 419140f..df49de3 100644
--- a/UserExport.php
+++ b/UserExport.php
@@ -10,8 +10,8 @@
  *
  * @links https://github.com/kghbln/UserExport/blob/master/README.md 
Documentation
  * @links https://www.mediawiki.org/wiki/Extension_talk:UserExport Support
- * @links https://github.com/kghbln/UserExport/issues Bug tracker
- * @links https://github.com/kghbln/UserExport Source code
+ * @links 

[MediaWiki-commits] [Gerrit] Add Mark's Yubikey based SSH pubkey - change (operations/puppet)

2015-12-02 Thread Mark Bergsma (Code Review)
Mark Bergsma has submitted this change and it was merged.

Change subject: Add Mark's Yubikey based SSH pubkey
..


Add Mark's Yubikey based SSH pubkey

Change-Id: Ic1b63c4156882cf6e8e95c9420d002717d3b085f
---
M modules/admin/data/data.yaml
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 237b2b0..8d43b20 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -498,8 +498,9 @@
 gid: 500
 name: mark
 realname: Mark Bergsma
-ssh_keys: [ssh-rsa 
B3NzaC1yc2EBIwAAAIEAorTmQ0qlrxB3RL+GULLzex3k1Pg/c6tgLbKsl1A7Qo0B5XI4eNgfWwaAXUrKyQW3/9gwDH3YJ2eoOue0/BGhKX6voOTnNPeGE9ZbrufpPLT6DXDEbvpmXQd/qw8s0GxdftleHYl28av0nTZgKY+1/Oc+ZHNUN5YxmdGehWBvTXs=
-Mark\s main public key]
+ssh_keys:
+  - ssh-rsa 
B3NzaC1yc2EBIwAAAIEAorTmQ0qlrxB3RL+GULLzex3k1Pg/c6tgLbKsl1A7Qo0B5XI4eNgfWwaAXUrKyQW3/9gwDH3YJ2eoOue0/BGhKX6voOTnNPeGE9ZbrufpPLT6DXDEbvpmXQd/qw8s0GxdftleHYl28av0nTZgKY+1/Oc+ZHNUN5YxmdGehWBvTXs=
 Mark\s main public key
+  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCGYwDexjSlyf1dMsVMr9VrEwnsEW90p3Ywgz/1Zl1EmYIrwLztKZ6V2bR6FbMx072YT6eEkg3m6dHxck5Q2Tx8QvUuUMoHzg18e/ZzsVZkG/cqtwrEXTRpg7O35xcdg0rYAbyyB0qo2z5gZWakZPd+h9hwfj2CUQ29aGRv83fsu2Ua5rbavU8OwAfndxJaBHDUqHsS/Mc+M3h6LF6XjhT9ELh0k7ZyPNhYTJ0N1VI4ROoxWI4/WRsclsSZtnWi7tYWP6WjhptezRGdbo2H/EMNffmISq5/n/1lkcAWGTIY3bppmBGe+f7CDcg8VN0i56Xe9+U7smlnqBSc17HZ8035
 mark@neo
 uid: 531
   jgreen:
 ensure: present

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1b63c4156882cf6e8e95c9420d002717d3b085f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma 
Gerrit-Reviewer: Mark Bergsma 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add wikidata interface - change (mediawiki...MathSearch)

2015-12-02 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add wikidata interface
..

Add wikidata interface

* This only acts on behalf of a real interface as long
  no offical way to use wikidata data is provided

Change-Id: I25f69cf2fec3e60dce2d443eb347b883efa6c9f6
---
M extension.json
A includes/WikidataDriver.php
A tests/WikidataDriverTest.php
3 files changed, 89 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/32/256432/1

diff --git a/extension.json b/extension.json
index 9d5035f..47c7356 100644
--- a/extension.json
+++ b/extension.json
@@ -32,7 +32,8 @@
"MathosphereDriver": "includes/MathosphereDriver.php",
"MathIdGenerator": "includes/MathIdGenerator.php",
"MathHighlighter": "includes/MathHighlighter.php",
-   "MlpEvalForm": "includes/MlpEvalForm.php"
+   "MlpEvalForm": "includes/MlpEvalForm.php",
+   "WikidataDriver": "includes/WikidataDriver.php"
},
"AvailableRights": [
"mathwmcsubmit"
@@ -73,7 +74,8 @@
"MathUpdateObservations": false,
"MathUploadEnabled": false,
"MathWmcMaxResults": 1,
-   "MathWmcServer": false
+   "MathWmcServer": false,
+   "MathSearchWikidataUrl": "https://wikidata.org;
},
"MessagesDirs": {
"MathSearch": [
diff --git a/includes/WikidataDriver.php b/includes/WikidataDriver.php
new file mode 100644
index 000..8ad72ec
--- /dev/null
+++ b/includes/WikidataDriver.php
@@ -0,0 +1,61 @@
+makeConfig( 
'main' );
+   return $config->get( "MathSearchWikidataUrl" );
+   }
+
+
+   public function search( $term ) {
+   $term = urlencode( $term );
+   $request = array(
+   'method' => 'GET',
+   'url'=> $this->getBackendUrl() .
+   
"/w/api.php?format=json=wbsearchentities={$this->lang}={$term}"
+   );
+   $serviceClient = new VirtualRESTServiceClient( new 
MultiHttpClient( array() ) );
+   $response = $serviceClient->run( $request );
+   if ( $response['code'] === 200 ) {
+   $json = json_decode( $response['body'] );
+   if ( $json && json_last_error() === JSON_ERROR_NONE ) {
+   $this->data = $json;
+   return true;
+   }
+   }
+   $this->data = false;
+   return false;
+   }
+
+   private function element2String( $d, $desc = true ) {
+   if ( $desc && isset( $d->description ) ) {
+   return "{$d->label} ({$d->description})";
+   } else {
+   return $d->label;
+   }
+   }
+
+   public function getResults( $links = false, $desc = true ) {
+   $res = array();
+   if ( $this->data ) {
+   foreach ( $this->data->search as $d ) {
+   if ( $links ) {
+   $res[$d->id] = "{$this->element2String($d, $desc)}";
+   } else {
+   $res[$d->id] = $this->element2String( 
$d, $desc );
+   }
+   }
+   }
+   return $res;
+
+   }
+}
\ No newline at end of file
diff --git a/tests/WikidataDriverTest.php b/tests/WikidataDriverTest.php
new file mode 100644
index 000..6d2cfdd
--- /dev/null
+++ b/tests/WikidataDriverTest.php
@@ -0,0 +1,24 @@
+assertContains( 'wikidata', $wd->getBackendUrl() );
+   $this->assertTrue( $wd->search( 'magnet' ) );
+   $res = $wd->getResults();
+   $this->assertArrayHasKey( 'Q11421', $res );
+   $this->assertContains( 'magnetic field', $res['Q11421'] );
+   $res = $wd->getResults( false, false );
+   $this->assertEquals( 'magnet', $res['Q11421'] );
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25f69cf2fec3e60dce2d443eb347b883efa6c9f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt 

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


[MediaWiki-commits] [Gerrit] [IMPROV] Remove unnecessary variable definitions - change (pywikibot/core)

2015-12-02 Thread XZise (Code Review)
XZise has uploaded a new change for review.

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

Change subject: [IMPROV] Remove unnecessary variable definitions
..

[IMPROV] Remove unnecessary variable definitions

Defining a function locale variable directly before a `return` statement which
is not using that variable is unnecessary.

Change-Id: Idf623fad2498a0395b8b40a6bc2b78bba15fc412
---
M scripts/checkimages.py
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/11/256411/1

diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 0e752e5..762f6d6 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1532,7 +1532,6 @@
 # Here begins the check block.
 if brackets and license_found:
 # It works also without this... but i want only to be sure ^^
-brackets = False
 return True
 elif delete:
 pywikibot.output(u"%s is not a file!" % self.imageName)
@@ -1542,7 +1541,6 @@
 notification = din % self.imageName
 head = dih
 self.report(canctext, self.imageName, notification, head)
-delete = False
 return True
 elif self.imageCheckText in nothing:
 pywikibot.output(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf623fad2498a0395b8b40a6bc2b78bba15fc412
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise 

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


[MediaWiki-commits] [Gerrit] ocg: send out an alarm when ocg doesn't respond to health ch... - change (operations/puppet)

2015-12-02 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: ocg: send out an alarm when ocg doesn't respond to health checks
..

ocg: send out an alarm when ocg doesn't respond to health checks

Bug: T120078
Change-Id: I9f8e948a4548368eb4d51e30c5eb053f416d54c1
---
M modules/ocg/files/nagios/check_ocg_health
1 file changed, 11 insertions(+), 5 deletions(-)


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

diff --git a/modules/ocg/files/nagios/check_ocg_health 
b/modules/ocg/files/nagios/check_ocg_health
index cadb3e8..a594e1b 100755
--- a/modules/ocg/files/nagios/check_ocg_health
+++ b/modules/ocg/files/nagios/check_ocg_health
@@ -25,6 +25,9 @@
 import requests
 import sys
 
+class HTTPError(Exception):
+   pass
+
 def parse_arguments():
"""parse command line arguments into various thresholds
:returns: dict containing validated arguments
@@ -55,9 +58,9 @@
try:
r = requests.get(url, timeout=5)
except requests.exceptions.RequestException as e:
-   raise StandardError("connection error: %s" % e)
+   raise HTTPError("connection error: %s" % e)
if r.status_code != 200:
-   raise StandardError("http status %s" % r.status_code)
+   raise HTTPError("http status %s" % r.status_code)
try:
json_data = r.json()
except:
@@ -108,11 +111,14 @@
args = parse_arguments()
try:
data = poll_ocg_server(args.url)
-   except:
-   report = str(sys.exc_info()[1])
+   except HTTPError as e:
+   report = str(e)
+   exit_status = 2
+   except Exception as e:
+   report = str(e)
exit_status = 1
else:
-   exit_status,report = run_checks(args, data)
+   exit_status, report = run_checks(args, data)
if exit_status == 2:
print "CRITICAL: %s" % report
elif exit_status == 1:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f8e948a4548368eb4d51e30c5eb053f416d54c1
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto 

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


[MediaWiki-commits] [Gerrit] ocg: send out an alarm when ocg doesn't respond to health ch... - change (operations/puppet)

2015-12-02 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: ocg: send out an alarm when ocg doesn't respond to health checks
..


ocg: send out an alarm when ocg doesn't respond to health checks

Bug: T120078
Change-Id: I9f8e948a4548368eb4d51e30c5eb053f416d54c1
---
M modules/ocg/files/nagios/check_ocg_health
1 file changed, 11 insertions(+), 5 deletions(-)

Approvals:
  Giuseppe Lavagetto: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ocg/files/nagios/check_ocg_health 
b/modules/ocg/files/nagios/check_ocg_health
index cadb3e8..a594e1b 100755
--- a/modules/ocg/files/nagios/check_ocg_health
+++ b/modules/ocg/files/nagios/check_ocg_health
@@ -25,6 +25,9 @@
 import requests
 import sys
 
+class HTTPError(Exception):
+   pass
+
 def parse_arguments():
"""parse command line arguments into various thresholds
:returns: dict containing validated arguments
@@ -55,9 +58,9 @@
try:
r = requests.get(url, timeout=5)
except requests.exceptions.RequestException as e:
-   raise StandardError("connection error: %s" % e)
+   raise HTTPError("connection error: %s" % e)
if r.status_code != 200:
-   raise StandardError("http status %s" % r.status_code)
+   raise HTTPError("http status %s" % r.status_code)
try:
json_data = r.json()
except:
@@ -108,11 +111,14 @@
args = parse_arguments()
try:
data = poll_ocg_server(args.url)
-   except:
-   report = str(sys.exc_info()[1])
+   except HTTPError as e:
+   report = str(e)
+   exit_status = 2
+   except Exception as e:
+   report = str(e)
exit_status = 1
else:
-   exit_status,report = run_checks(args, data)
+   exit_status, report = run_checks(args, data)
if exit_status == 2:
print "CRITICAL: %s" % report
elif exit_status == 1:

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

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

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


[MediaWiki-commits] [Gerrit] Add thumbnail to link preview. - change (apps...wikipedia)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add thumbnail to link preview.
..


Add thumbnail to link preview.

This adds a thumbnail to the default link preview layout, to make it
consistent with other instances where we have a page title and a
thumbnail. Also a few minor design tweaks:
- Added a subtle gray divider between the title and extract text.
- Sightly reduced the font size of the title text, now that there's less
  horizontal space because of the thumbnail.
- Increased the maximum lines for the title text to 3.

Bug: T119214
Change-Id: Ifbc38fe20328e7b3237e03d8f8923183783c0e32
---
M app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
M app/src/main/res/layout/dialog_link_preview.xml
2 files changed, 36 insertions(+), 6 deletions(-)

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



diff --git 
a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java 
b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
index d507244..c2bebf1 100755
--- a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
+++ b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialog.java
@@ -25,14 +25,18 @@
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.v7.widget.PopupMenu;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
+import android.widget.ImageView;
 import android.widget.ProgressBar;
 import android.widget.TextView;
+
+import com.squareup.picasso.Picasso;
 
 import retrofit.RetrofitError;
 import retrofit.client.Response;
@@ -47,6 +51,7 @@
 
 private ProgressBar progressBar;
 private TextView extractText;
+private ImageView thumbnailView;
 private GalleryThumbnailScrollView thumbnailGallery;
 
 private PageTitle pageTitle;
@@ -121,6 +126,7 @@
 
 onNavigateListener = new DefaultOnNavigateListener();
 extractText = (TextView) 
rootView.findViewById(R.id.link_preview_extract);
+thumbnailView = (ImageView) 
rootView.findViewById(R.id.link_preview_thumbnail);
 
 thumbnailGallery = (GalleryThumbnailScrollView) 
rootView.findViewById(R.id.link_preview_thumbnail_gallery);
 if (shouldLoadImages) {
@@ -313,6 +319,18 @@
 if (contents.getExtract().length() > 0) {
 extractText.setText(contents.getExtract());
 }
+if (!TextUtils.isEmpty(contents.getTitle().getThumbUrl())
+&& WikipediaApp.getInstance().isImageDownloadEnabled()) {
+Picasso.with(getActivity())
+.load(contents.getTitle().getThumbUrl())
+.placeholder(R.drawable.ic_pageimage_placeholder)
+.error(R.drawable.ic_pageimage_placeholder)
+.into(thumbnailView);
+} else {
+Picasso.with(getActivity())
+.load(R.drawable.ic_pageimage_placeholder)
+.into(thumbnailView);
+}
 }
 
 private class GalleryThumbnailFetchTask extends GalleryCollectionFetchTask 
{
diff --git a/app/src/main/res/layout/dialog_link_preview.xml 
b/app/src/main/res/layout/dialog_link_preview.xml
index cfd6a78..5668f8f 100755
--- a/app/src/main/res/layout/dialog_link_preview.xml
+++ b/app/src/main/res/layout/dialog_link_preview.xml
@@ -31,18 +31,23 @@
 android:clickable="true"
 android:background="?attr/selectableItemBackground"
 android:minHeight="64dp">
+
 
 
 
+
+
 https://gerrit.wikimedia.org/r/256251
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] diamond: batch statsd metrics in production - change (operations/puppet)

2015-12-02 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: diamond: batch statsd metrics in production
..


diamond: batch statsd metrics in production

use 'batch' argument to StatsdHandler to send multiple metrics per UDP packet,
see also https://github.com/python-diamond/Diamond/pull/327 which will be
shipped in our internal diamond debian package

Bug: T116033
Change-Id: I12e61f1f69102580301dd4c791029432c5e763b9
---
M manifests/role/diamond.pp
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved



diff --git a/manifests/role/diamond.pp b/manifests/role/diamond.pp
index 99aad73..ef5954c 100644
--- a/manifests/role/diamond.pp
+++ b/manifests/role/diamond.pp
@@ -28,6 +28,7 @@
 # lint:endignore
 host=> $host,
 port=> '8125',
+batch   => '20',
 },
 }
 }

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

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

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


[MediaWiki-commits] [Gerrit] [WIP] setup EventBus extension for deployment-prep - change (operations/mediawiki-config)

2015-12-02 Thread Eevans (Code Review)
Eevans has uploaded a new change for review.

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

Change subject: [WIP] setup EventBus extension for deployment-prep
..

[WIP] setup EventBus extension for deployment-prep

Bug: T116786
Change-Id: Iec8ebbac1ad90a798d1832bae922bfb643b4accc
---
M wmf-config/CommonSettings-labs.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/extension-list-labs
3 files changed, 10 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings-labs.php 
b/wmf-config/CommonSettings-labs.php
index 6ab669d..b1cf918 100644
--- a/wmf-config/CommonSettings-labs.php
+++ b/wmf-config/CommonSettings-labs.php
@@ -329,6 +329,11 @@
require_once "$IP/extensions/Capiunto/Capiunto.php";
 }
 
+if ( $wmgUseEventBus ) {
+   wfLoadExtension( 'EventBus' );
+   $wgEventServiceUrl = 
'http://deployment-eventlogging04.deployment-prep.eqiad.wmflabs:8085/v1/events';
+}
+
 if ( $wmgUseEcho ) {
$wgEchoSharedTrackingDB = 'wikishared';
 }
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 1acdb86..b4b73a3 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -1004,6 +1004,10 @@
'default' => 
'http://c357be0613e24340a96aeaa28dde0...@sentry-beta.wmflabs.org/4',
),
 
+'wmgUseEventBus' => array(
+'default' => true,
+),
+
// Thumbnail chaining
 
'wgThumbnailBuckets' => array(
diff --git a/wmf-config/extension-list-labs b/wmf-config/extension-list-labs
index 688f774..460fdda 100644
--- a/wmf-config/extension-list-labs
+++ b/wmf-config/extension-list-labs
@@ -1,3 +1,4 @@
 $IP/extensions/Capiunto/Capiunto.php
 $IP/extensions/Sentry/Sentry.php
 $IP/extensions/UrlShortener/extension.json
+$IP/extensions/EventBus/extension.json

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

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

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


[MediaWiki-commits] [Gerrit] objectcache: Add $holdoff parameter to WANObjectCache::touch... - change (mediawiki/core)

2015-12-02 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: objectcache: Add $holdoff parameter to 
WANObjectCache::touchCheckKey()
..

objectcache: Add $holdoff parameter to WANObjectCache::touchCheckKey()

Change-Id: I14b6d7660b34271826b77875c660c34343712648
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/256417/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 3366a22..a859680 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -560,17 +560,18 @@
 * @see WANObjectCache::resetCheckKey()
 *
 * @param string $key Cache key
+* @param int $holdoff Hold off period
 * @return bool True if the item was purged or not found, false on 
failure
 */
-   final public function touchCheckKey( $key ) {
+   final public function touchCheckKey( $key, $holdoff = self::HOLDOFF_TTL 
) {
$key = self::TIME_KEY_PREFIX . $key;
// Update the local datacenter immediately
$ok = $this->cache->set( $key,
-   $this->makePurgeValue( microtime( true ), 
self::HOLDOFF_TTL ),
+   $this->makePurgeValue( microtime( true ), $holdoff ),
self::CHECK_KEY_TTL
);
// Publish the purge to all datacenters
-   return $this->relayPurge( $key, self::CHECK_KEY_TTL, 
self::HOLDOFF_TTL ) && $ok;
+   return $this->relayPurge( $key, self::CHECK_KEY_TTL, $holdoff ) 
&& $ok;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14b6d7660b34271826b77875c660c34343712648
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] Test: DO NOT MERGE - change (mediawiki/core)

2015-12-02 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Test: DO NOT MERGE
..

Test: DO NOT MERGE

Change-Id: Iae92c31309f0ccb0d28d58342dd8dfc00391d574
---
M package.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/256425/1

diff --git a/package.json b/package.json
index 209d325..d59b0fc 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
 "grunt-contrib-copy": "0.8.1",
 "grunt-contrib-jshint": "0.11.3",
 "grunt-contrib-watch": "0.6.1",
-"grunt-jscs": "2.1.0",
+"grunt-jscs": "2.4.0",
 "grunt-jsonlint": "1.0.5",
 "grunt-karma": "0.12.1",
 "karma": "0.13.10",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae92c31309f0ccb0d28d58342dd8dfc00391d574
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] Add wikidatawiki Q64 item to desktop WebPageTest - change (performance/WebPageTest)

2015-12-02 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Add wikidatawiki Q64 item to desktop WebPageTest
..

Add wikidatawiki Q64 item to desktop WebPageTest

Bug: T117555
Change-Id: I3ea65e8e925ac76cab71fa034bcba2d0550e9146
---
M scripts/batch/desktop.txt
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance/WebPageTest 
refs/changes/30/256430/1

diff --git a/scripts/batch/desktop.txt b/scripts/batch/desktop.txt
index ca70d43..ff0e3ba 100644
--- a/scripts/batch/desktop.txt
+++ b/scripts/batch/desktop.txt
@@ -26,6 +26,8 @@
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
 
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
+
 # Collect metrics using Firefox
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.enwiki.anonymous.Main_Page --reporter statsv 
https://en.wikipedia.org/wiki/Main_Page
 
@@ -42,6 +44,8 @@
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.enwiki-beta.anonymous.Chamber_music 
http://en.wikipedia.beta.wmflabs.org/wiki/Chamber_music
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
+
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
 
 # Collect metrics using IE 11 (running windows 7 = no SPDY)
 
@@ -62,3 +66,5 @@
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.enwiki-beta.anonymous.Chamber_music 
http://en.wikipedia.beta.wmflabs.org/wiki/Chamber_music
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
+
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ea65e8e925ac76cab71fa034bcba2d0550e9146
Gerrit-PatchSet: 1
Gerrit-Project: performance/WebPageTest
Gerrit-Branch: master
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] objectcache: Move WANObjectCache holdoff from get() to purge... - change (mediawiki/core)

2015-12-02 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: objectcache: Move WANObjectCache holdoff from get() to purge 
value
..

objectcache: Move WANObjectCache holdoff from get() to purge value

Move the holdoff period into the purge value instead of deciding
it at runtime. This opens the way for touchCheckKey() to support
a custom $holdoff parameter, which will allow callers to invalidate
keys without a holdoff period.

Right now the holdoff period is decided at run time.

Change-Id: Id10c036272e92ae4429effc823b75e08fb11a48b
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 75 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/256414/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 16e894e..8533d28 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -115,6 +115,7 @@
const FLD_TTL = 2;
const FLD_TIME = 3;
const FLD_FLAGS = 4;
+   const FLD_HOLDOFF = 4;
 
/** @var integer Treat this value as expired-on-arrival */
const FLG_STALE = 1;
@@ -232,18 +233,18 @@
$vPrefixLen = strlen( self::VALUE_KEY_PREFIX );
$valueKeys = self::prefixCacheKeys( $keys, 
self::VALUE_KEY_PREFIX );
 
-   $checksForAll = array();
-   $checksByKey = array();
+   $checkKeysForAll = array();
+   $checkKeysByKey = array();
$checkKeysFlat = array();
foreach ( $checkKeys as $i => $keys ) {
$prefixed = self::prefixCacheKeys( (array)$keys, 
self::TIME_KEY_PREFIX );
$checkKeysFlat = array_merge( $checkKeysFlat, $prefixed 
);
// Is this check keys for a specific cache key, or for 
all keys being fetched?
if ( is_int( $i ) ) {
-   $checksForAll = array_merge( $checksForAll, 
$prefixed );
+   $checkKeysForAll = array_merge( 
$checkKeysForAll, $prefixed );
} else {
-   $checksByKey[$i] = isset( $checksByKey[$i] )
-   ? array_merge( $checksByKey[$i], 
$prefixed )
+   $checkKeysByKey[$i] = isset( 
$checkKeysByKey[$i] )
+   ? array_merge( $checkKeysByKey[$i], 
$prefixed )
: $prefixed;
}
}
@@ -253,10 +254,10 @@
$now = microtime( true );
 
// Collect timestamps from all "check" keys
-   $checkKeyTimesForAll = $this->processCheckKeys( $checksForAll, 
$wrappedValues, $now );
-   $checkKeyTimesByKey = array();
-   foreach ( $checksByKey as $cacheKey => $checks ) {
-   $checkKeyTimesByKey[$cacheKey] =
+   $purgeValuesForAll = $this->processCheckKeys( $checkKeysForAll, 
$wrappedValues, $now );
+   $purgeValuesByKey = array();
+   foreach ( $checkKeysByKey as $cacheKey => $checks ) {
+   $purgeValuesByKey[$cacheKey] =
$this->processCheckKeys( $checks, 
$wrappedValues, $now );
}
 
@@ -274,14 +275,14 @@
 
// Force dependant keys to be invalid for a 
while after purging
// to reduce race conditions involving stale 
data getting cached
-   $checkKeyTimes = $checkKeyTimesForAll;
-   if ( isset( $checkKeyTimesByKey[$key] ) ) {
-   $checkKeyTimes = array_merge( 
$checkKeyTimes, $checkKeyTimesByKey[$key] );
+   $purgeValues = $purgeValuesForAll;
+   if ( isset( $purgeValuesByKey[$key] ) ) {
+   $purgeValues = array_merge( 
$purgeValues, $purgeValuesByKey[$key] );
}
-   foreach ( $checkKeyTimes as $checkKeyTime ) {
-   $safeTimestamp = $checkKeyTime + 
self::HOLDOFF_TTL;
+   foreach ( $purgeValues as $purge ) {
+   $safeTimestamp = $purge[self::FLD_TIME] 
+ $purge[self::FLD_HOLDOFF];
if ( $safeTimestamp >= 
$wrappedValues[$vKey][self::FLD_TIME] ) {
-   $curTTL = min( $curTTL, 
$checkKeyTime - $now );
+   $curTTL = min( $curTTL, 
$purge[self::FLD_TIME] - $now );
}
  

[MediaWiki-commits] [Gerrit] diamond: send log to stdout at level INFO - change (operations/puppet)

2015-12-02 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: diamond: send log to stdout at level INFO
..


diamond: send log to stdout at level INFO

since we're running diamond under upstart/systemd, it makes sense to let those
do the logging, rotation, etc. Also log at INFO level. Note that previously
I've attempted to run diamond with --log-stdout instead, this however forces
DEBUG level and double-prints to stdout/stderr

Change-Id: I46fa1ece5463704ac27868e46c8d34712d30bd8f
---
M modules/diamond/templates/diamond.conf.erb
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved



diff --git a/modules/diamond/templates/diamond.conf.erb 
b/modules/diamond/templates/diamond.conf.erb
index 6403288..69a93fa 100644
--- a/modules/diamond/templates/diamond.conf.erb
+++ b/modules/diamond/templates/diamond.conf.erb
@@ -12,7 +12,7 @@
 pid_file = /var/run/diamond.pid
 
 [handlers]
-keys = rotated_file
+keys = rotated_file,stdout
 
 ### Defaults options for all Handlers
 [[default]]
@@ -32,9 +32,13 @@
 [logger_root]
 # to increase verbosity, set DEBUG
 level = INFO
-handlers = rotated_file
+handlers = stdout
 propagate = 1
 
+[handler_stdout]
+class = logging.handlers.StreamHandler
+args = (None, )
+
 [handler_rotated_file]
 class = logging.handlers.TimedRotatingFileHandler
 level = DEBUG

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I46fa1ece5463704ac27868e46c8d34712d30bd8f
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Chasemp 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add wikidatawiki Main Page to WebPageTest - change (performance/WebPageTest)

2015-12-02 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Add wikidatawiki Main Page to WebPageTest
..

Add wikidatawiki Main Page to WebPageTest

Bug: T117555
Change-Id: I4e87f4800e619245ace155ae43676320ecb947c7
---
M scripts/batch/desktop.txt
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance/WebPageTest 
refs/changes/33/256433/1

diff --git a/scripts/batch/desktop.txt b/scripts/batch/desktop.txt
index 93f9341..368a60c 100644
--- a/scripts/batch/desktop.txt
+++ b/scripts/batch/desktop.txt
@@ -26,6 +26,8 @@
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
 
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki.anonymous.Main_Page --reporter statsv 
https://www.wikidata.org/wiki/Wikidata:Main_Page
+
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki-beta.anonymous.italy 
http://wikidata.beta.wmflabs.org/wiki/Q15905
@@ -46,6 +48,8 @@
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.enwiki-beta.anonymous.Chamber_music 
http://en.wikipedia.beta.wmflabs.org/wiki/Chamber_music
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
+
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki.anonymous.Main_Page --reporter statsv 
https://www.wikidata.org/wiki/Wikidata:Main_Page
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
 
@@ -71,6 +75,8 @@
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
 
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki.anonymous.Main_Page --reporter statsv 
https://www.wikidata.org/wiki/Wikidata:Main_Page
+
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki-beta.anonymous.italy 
http://wikidata.beta.wmflabs.org/wiki/Q15905

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e87f4800e619245ace155ae43676320ecb947c7
Gerrit-PatchSet: 1
Gerrit-Project: performance/WebPageTest
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki: alarm on session loss and bad tokens - change (operations/puppet)

2015-12-02 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: mediawiki: alarm on session loss and bad tokens
..

mediawiki: alarm on session loss and bad tokens

Bug: T108985
Change-Id: I3b88f9a6f96cf89761ce8f5bd9f6b826db3ac9a7
---
M modules/mediawiki/manifests/monitoring/graphite.pp
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/22/256422/1

diff --git a/modules/mediawiki/manifests/monitoring/graphite.pp 
b/modules/mediawiki/manifests/monitoring/graphite.pp
index 1f0b346..d67c867 100644
--- a/modules/mediawiki/manifests/monitoring/graphite.pp
+++ b/modules/mediawiki/manifests/monitoring/graphite.pp
@@ -26,4 +26,24 @@
 nagios_critical => false
 # this will be enabled shortly if we don't see false positives
 }
+
+# MediaWiki is reporting edit failures due to session loss
+monitoring::graphite_threshold { 'mediawiki_failure_session_loss':
+description => 'MediaWiki edit failures due to session loss',
+metric  => 'MediaWiki.edit.failures.session_loss.count',
+from=> '15min',
+warning => 30,
+critical=> 50,
+percentage  => 70,
+}
+
+# MediaWiki is reporting edit failures due to bad token
+monitoring::graphite_threshold { 'mediawiki_failure_bad_token':
+description => 'MediaWiki edit failures due to bad token',
+metric  => 'MediaWiki.edit.failures.bad_token.count',
+from=> '15min',
+warning => 30,
+critical=> 50,
+percentage  => 70,
+}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b88f9a6f96cf89761ce8f5bd9f6b826db3ac9a7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] Do SearchUpdate::indexTitle after search-update is supported... - change (mediawiki/core)

2015-12-02 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Do SearchUpdate::indexTitle after search-update is supported 
check
..

Do SearchUpdate::indexTitle after search-update is supported check

If the SearchEngine does not support search-update, then
$indexTitle is not used and thus no need to create it in
that case.

Change-Id: I487d06274e921223a3bcb5af846b48b7c2b8065e
---
M includes/deferred/SearchUpdate.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/20/256420/1

diff --git a/includes/deferred/SearchUpdate.php 
b/includes/deferred/SearchUpdate.php
index 6ed1d00..867fc61 100644
--- a/includes/deferred/SearchUpdate.php
+++ b/includes/deferred/SearchUpdate.php
@@ -82,11 +82,11 @@
 
foreach ( SearchEngine::getSearchTypes() as $type ) {
$search = SearchEngine::create( $type );
-   $indexTitle = $this->indexTitle( $search );
if ( !$search->supports( 'search-update' ) ) {
continue;
}
 
+   $indexTitle = $this->indexTitle( $search );
$normalTitle = $search->normalizeText( $indexTitle );
 
if ( $page === null ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I487d06274e921223a3bcb5af846b48b7c2b8065e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aude 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Update grunt-jscs to 2.4.0 - change (mediawiki...Metrolook)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update grunt-jscs to 2.4.0
..


Update grunt-jscs to 2.4.0

Change-Id: If8ba98d8e7a3a93f468d96d19035b3927f3729f6
---
M package.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/package.json b/package.json
index 6d608fb..7592a18 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
 "grunt-cli": "0.1.13",
 "grunt-contrib-jshint": "0.11.3",
 "grunt-banana-checker": "0.4.0",
-"grunt-jscs": "2.3.0",
+"grunt-jscs": "2.4.0",
 "grunt-jsonlint": "1.0.6",
 "jscs-preset-wikimedia": "~1.0.0"
   }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8ba98d8e7a3a93f468d96d19035b3927f3729f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use promises instead of triggers for Flickr - change (mediawiki...UploadWizard)

2015-12-02 Thread MarkTraceur (Code Review)
MarkTraceur has uploaded a new change for review.

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

Change subject: Use promises instead of triggers for Flickr
..

Use promises instead of triggers for Flickr

This is some bad bloody code. Also moved static stuff out of the
prototype and cached more intelligently.

Change-Id: I9ee2479697f62132510af65255eca2b4a04e0906
---
M resources/mw.FlickrChecker.js
M resources/mw.UploadWizard.js
2 files changed, 42 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/34/256434/1

diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js
index 0bf46f8..a4276bb 100644
--- a/resources/mw.FlickrChecker.js
+++ b/resources/mw.FlickrChecker.js
@@ -34,25 +34,35 @@
 */
mw.FlickrChecker.blacklist = null;
 
-   mw.FlickrChecker.prototype = {
-   licenseList: [],
-   // Map each Flickr license name to the equivalent templates.
-   // These are the current Flickr license names as of April 26, 
2011.
-   // Live list at 
http://api.flickr.com/services/rest/?=flickr.photos.licenses.getInfo_key=...
-   licenseMaps: {
-   'All Rights Reserved': 'invalid',
-   'Attribution License': 
'{{FlickrVerifiedByUploadWizard|cc-by-2.0}}{{cc-by-2.0}}',
-   'Attribution-NoDerivs License': 'invalid',
-   'Attribution-NonCommercial-NoDerivs License': 'invalid',
-   'Attribution-NonCommercial License': 'invalid',
-   'Attribution-NonCommercial-ShareAlike License': 
'invalid',
-   'Attribution-ShareAlike License': 
'{{FlickrVerifiedByUploadWizard|cc-by-sa-2.0}}{{cc-by-sa-2.0}}',
-   'No known copyright restrictions': 
'{{FlickrVerifiedByUploadWizard|Flickr-no known copyright 
restrictions}}{{Flickr-no known copyright restrictions}}',
-   'United States Government Work': 
'{{FlickrVerifiedByUploadWizard|PD-USGov}}{{PD-USGov}}',
-   'Public Domain Dedication (CC0)': 
'{{FlickrVerifiedByUploadWizard|cc-zero}}{{cc-zero}}',
-   'Public Domain Mark': 
'{{FlickrVerifiedByUploadWizard|Public Domain Mark}}' // T105629
-   },
+   /**
+* Cache for Flickr license lookups.
+* @type {jQuery.Promise}
+*/
+   mw.FlickrChecker.licensePromise = null;
 
+   /**
+* Flickr licenses.
+*/
+   mw.FlickrChecker.licenseList = [];
+
+   // Map each Flickr license name to the equivalent templates.
+   // These are the current Flickr license names as of April 26, 2011.
+   // Live list at 
http://api.flickr.com/services/rest/?=flickr.photos.licenses.getInfo_key=...
+   mw.FlickrChecker.licenseMaps = {
+   'All Rights Reserved': 'invalid',
+   'Attribution License': 
'{{FlickrVerifiedByUploadWizard|cc-by-2.0}}{{cc-by-2.0}}',
+   'Attribution-NoDerivs License': 'invalid',
+   'Attribution-NonCommercial-NoDerivs License': 'invalid',
+   'Attribution-NonCommercial License': 'invalid',
+   'Attribution-NonCommercial-ShareAlike License': 'invalid',
+   'Attribution-ShareAlike License': 
'{{FlickrVerifiedByUploadWizard|cc-by-sa-2.0}}{{cc-by-sa-2.0}}',
+   'No known copyright restrictions': 
'{{FlickrVerifiedByUploadWizard|Flickr-no known copyright 
restrictions}}{{Flickr-no known copyright restrictions}}',
+   'United States Government Work': 
'{{FlickrVerifiedByUploadWizard|PD-USGov}}{{PD-USGov}}',
+   'Public Domain Dedication (CC0)': 
'{{FlickrVerifiedByUploadWizard|cc-zero}}{{cc-zero}}',
+   'Public Domain Mark': '{{FlickrVerifiedByUploadWizard|Public 
Domain Mark}}' // T105629
+   };
+
+   mw.FlickrChecker.prototype = {
/**
 * If a photo is from Flickr, retrieve its license. If the 
license is valid, display the license
 * to the user, hide the normal license selection interface, 
and set it as the deed for the upload.
@@ -576,20 +586,27 @@
 
/**
 * Retrieve the list of all current Flickr licenses and store 
it in an array (`mw.FlickrChecker.licenseList`)
+*
+* @return {jQuery.Promise}
 */
getLicenses: function () {
+   if ( mw.FlickrChecker.licensePromise ) {
+   return mw.FlickrChecker.licensePromise;
+   }
+
// Workaround for http://bugs.jquery.com/ticket/8283
jQuery.support.cors = true;
-   this.flickrRequest( {
+   mw.FlickrChecker.licensePromise = this.flickrRequest( {

[MediaWiki-commits] [Gerrit] [IMPROV] Remove unnecessary variable definitions - change (pywikibot/core)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: [IMPROV] Remove unnecessary variable definitions
..


[IMPROV] Remove unnecessary variable definitions

Defining a function locale variable directly before a `return` statement which
is not using that variable is unnecessary.

Change-Id: Idf623fad2498a0395b8b40a6bc2b78bba15fc412
---
M scripts/checkimages.py
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 0e752e5..762f6d6 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1532,7 +1532,6 @@
 # Here begins the check block.
 if brackets and license_found:
 # It works also without this... but i want only to be sure ^^
-brackets = False
 return True
 elif delete:
 pywikibot.output(u"%s is not a file!" % self.imageName)
@@ -1542,7 +1541,6 @@
 notification = din % self.imageName
 head = dih
 self.report(canctext, self.imageName, notification, head)
-delete = False
 return True
 elif self.imageCheckText in nothing:
 pywikibot.output(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idf623fad2498a0395b8b40a6bc2b78bba15fc412
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Renamed schema files to not use camel case, and to have revi... - change (mediawiki/event-schemas)

2015-12-02 Thread Mobrovac (Code Review)
Mobrovac has submitted this change and it was merged.

Change subject: Renamed schema files to not use camel case, and to have 
revisions in filenames, also added schema_uri
..


Renamed schema files to not use camel case, and to have revisions in filenames, 
also added schema_uri

schema_uri is now used to tag an event with its jsonschema, instead of schema 
name and revision fields.
schema_uris can be any URI, but the path must end in /.

Change-Id: I715c6be273465bfe8455903406f9816155cefe80
---
R jsonschema/mediawiki/page_delete/1.yaml
R jsonschema/mediawiki/page_edit/1.yaml
R jsonschema/mediawiki/page_move/1.yaml
R jsonschema/mediawiki/page_restore/1.yaml
R jsonschema/mediawiki/revision_visibility_set/1.yaml
5 files changed, 30 insertions(+), 25 deletions(-)

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



diff --git a/jsonschema/mediawiki/PageDelete/PageDelete.yaml 
b/jsonschema/mediawiki/page_delete/1.yaml
similarity index 83%
rename from jsonschema/mediawiki/PageDelete/PageDelete.yaml
rename to jsonschema/mediawiki/page_delete/1.yaml
index be7f827..56008d9 100644
--- a/jsonschema/mediawiki/PageDelete/PageDelete.yaml
+++ b/jsonschema/mediawiki/page_delete/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git a/jsonschema/mediawiki/PageEdit/PageEdit.yaml 
b/jsonschema/mediawiki/page_edit/1.yaml
similarity index 86%
rename from jsonschema/mediawiki/PageEdit/PageEdit.yaml
rename to jsonschema/mediawiki/page_edit/1.yaml
index a994cf9..f96d1f5 100644
--- a/jsonschema/mediawiki/PageEdit/PageEdit.yaml
+++ b/jsonschema/mediawiki/page_edit/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git a/jsonschema/mediawiki/PageMove/PageMove.yaml 
b/jsonschema/mediawiki/page_move/1.yaml
similarity index 85%
rename from jsonschema/mediawiki/PageMove/PageMove.yaml
rename to jsonschema/mediawiki/page_move/1.yaml
index b7ac73a..990da50 100644
--- a/jsonschema/mediawiki/PageMove/PageMove.yaml
+++ b/jsonschema/mediawiki/page_move/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git a/jsonschema/mediawiki/PageRestore/PageRestore.yaml 
b/jsonschema/mediawiki/page_restore/1.yaml
similarity index 85%
rename from jsonschema/mediawiki/PageRestore/PageRestore.yaml
rename to jsonschema/mediawiki/page_restore/1.yaml
index 176e41e..2a7c766 100644
--- a/jsonschema/mediawiki/PageRestore/PageRestore.yaml
+++ b/jsonschema/mediawiki/page_restore/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git 

[MediaWiki-commits] [Gerrit] Update grunt-jscs to 2.4.0 - change (mediawiki...Metrolook)

2015-12-02 Thread Paladox (Code Review)
Paladox has uploaded a new change for review.

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

Change subject: Update grunt-jscs to 2.4.0
..

Update grunt-jscs to 2.4.0

Change-Id: If8ba98d8e7a3a93f468d96d19035b3927f3729f6
---
M package.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook 
refs/changes/29/256429/1

diff --git a/package.json b/package.json
index 6d608fb..7592a18 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
 "grunt-cli": "0.1.13",
 "grunt-contrib-jshint": "0.11.3",
 "grunt-banana-checker": "0.4.0",
-"grunt-jscs": "2.3.0",
+"grunt-jscs": "2.4.0",
 "grunt-jsonlint": "1.0.6",
 "jscs-preset-wikimedia": "~1.0.0"
   }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8ba98d8e7a3a93f468d96d19035b3927f3729f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] dumps: one more check to see if db is skipped before we dump it - change (operations/dumps)

2015-12-02 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

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

Change subject: dumps: one more check to see if db is skipped before we dump it
..

dumps: one more check to see if db is skipped before we dump it

Bug: T116564
Change-Id: Icbc1ea3ee7b17c0a56028e550e97a55ab8ea1c8a
---
M xmldumps-backup/incrementals/generateincrementals.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/10/256410/1

diff --git a/xmldumps-backup/incrementals/generateincrementals.py 
b/xmldumps-backup/incrementals/generateincrementals.py
index fb45687..50ef54e 100644
--- a/xmldumps-backup/incrementals/generateincrementals.py
+++ b/xmldumps-backup/incrementals/generateincrementals.py
@@ -206,7 +206,8 @@
 
 def do_one_wiki(self):
 if (self.wikiname not in self._config.private_wikis_list and
-self.wikiname not in self._config.closed_wikis_list):
+self.wikiname not in self._config.closed_wikis_list and
+self.wikiname not in self._config.skip_wikis_list):
 if not exists(self.incrdir.get_incdir(self.wikiname)):
 os.makedirs(self.incrdir.get_incdir(self.wikiname))
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbc1ea3ee7b17c0a56028e550e97a55ab8ea1c8a
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn 

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


[MediaWiki-commits] [Gerrit] Renamed schema files to not use camel case, and to have revi... - change (mediawiki/event-schemas)

2015-12-02 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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

Change subject: Renamed schema files to not use camel case, and to have 
revisions in filenames, also added schema_uri
..

Renamed schema files to not use camel case, and to have revisions in filenames, 
also added schema_uri

schema_uri is now used to tag an event with its jsonschema, instead of schema 
name and revision fields.
schema_uris can be any URI, but the path must end in /.

Change-Id: I715c6be273465bfe8455903406f9816155cefe80
---
R jsonschema/mediawiki/page_delete/1.yaml
R jsonschema/mediawiki/page_edit/1.yaml
R jsonschema/mediawiki/page_move/1.yaml
R jsonschema/mediawiki/page_restore/1.yaml
R jsonschema/mediawiki/revision_visibility_set/1.yaml
5 files changed, 30 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/event-schemas 
refs/changes/16/256416/1

diff --git a/jsonschema/mediawiki/PageDelete/PageDelete.yaml 
b/jsonschema/mediawiki/page_delete/1.yaml
similarity index 83%
rename from jsonschema/mediawiki/PageDelete/PageDelete.yaml
rename to jsonschema/mediawiki/page_delete/1.yaml
index be7f827..56008d9 100644
--- a/jsonschema/mediawiki/PageDelete/PageDelete.yaml
+++ b/jsonschema/mediawiki/page_delete/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git a/jsonschema/mediawiki/PageEdit/PageEdit.yaml 
b/jsonschema/mediawiki/page_edit/1.yaml
similarity index 86%
rename from jsonschema/mediawiki/PageEdit/PageEdit.yaml
rename to jsonschema/mediawiki/page_edit/1.yaml
index a994cf9..f96d1f5 100644
--- a/jsonschema/mediawiki/PageEdit/PageEdit.yaml
+++ b/jsonschema/mediawiki/page_edit/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git a/jsonschema/mediawiki/PageMove/PageMove.yaml 
b/jsonschema/mediawiki/page_move/1.yaml
similarity index 85%
rename from jsonschema/mediawiki/PageMove/PageMove.yaml
rename to jsonschema/mediawiki/page_move/1.yaml
index b7ac73a..990da50 100644
--- a/jsonschema/mediawiki/PageMove/PageMove.yaml
+++ b/jsonschema/mediawiki/page_move/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 format: uri
diff --git a/jsonschema/mediawiki/PageRestore/PageRestore.yaml 
b/jsonschema/mediawiki/page_restore/1.yaml
similarity index 85%
rename from jsonschema/mediawiki/PageRestore/PageRestore.yaml
rename to jsonschema/mediawiki/page_restore/1.yaml
index 176e41e..2a7c766 100644
--- a/jsonschema/mediawiki/PageRestore/PageRestore.yaml
+++ b/jsonschema/mediawiki/page_restore/1.yaml
@@ -10,12 +10,13 @@
   topic:
 type: string
 description: the queue topic name this message belongs to
-  schema:
+  schema_uri:
 type: string
-description: The name of this schema
-  revision:
-type: integer
-description: The revision of this schema
+description: >
+  The URI identifying the jsonschema for this event.  This may be just
+  a short uri containing only the name and revision at the end of the
+  URI path.  e.g. schema_name/12345 is acceptable.  This field
+  is not required.
   uri:
 type: string
 

[MediaWiki-commits] [Gerrit] Labs: switch PAM handling to use pam-auth-update - change (operations/puppet)

2015-12-02 Thread coren (Code Review)
coren has submitted this change and it was merged.

Change subject: Labs: switch PAM handling to use pam-auth-update
..


Labs: switch PAM handling to use pam-auth-update

This avoids having local modifications in /etc/pam.d that do
not play nice with the distro-provided config (and prevents
distro-specific breaking).  Rather than modify the pam.d
config directly we add a wikimedia-labs specific configuration
in /usr/share/pam-configs/ which is then merged properly
by pam-auth-update.

This changeset also includes a script that reverts manual
(or puppet-mediated) changes that were done to /etc/pam.d,
by reverting them to the package or freshly generated
versions.  This is intended to be invoked (once) by a salt
run on all instances to clean up remenants of the previous
way of doing things.

Bug: T85910
Change-Id: I1cf70b11c494ed010f14a3734b514dde36f6cf74
---
A modules/ldap/files/cleanup-pam-config
D modules/ldap/files/common-account
D modules/ldap/files/common-auth
D modules/ldap/files/common-password
D modules/ldap/files/common-session
D modules/ldap/files/common-session-noninteractive
D modules/ldap/files/sshd
A modules/ldap/files/wikimedia-labs-pam
M modules/ldap/manifests/client/pam.pp
9 files changed, 71 insertions(+), 123 deletions(-)

Approvals:
  coren: Looks good to me, approved
  Faidon Liambotis: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/ldap/files/cleanup-pam-config 
b/modules/ldap/files/cleanup-pam-config
new file mode 100644
index 000..5da5429
--- /dev/null
+++ b/modules/ldap/files/cleanup-pam-config
@@ -0,0 +1,43 @@
+#! /bin/bash
+
+## This script axes the current pam configuration from
+## /etc/pam.d/sshd and /etc/pam.d/common-* and forces it
+## to be recreated (from the package for the former, and
+## from /usr/share/pam-configs/ for the latter).
+##
+## The whole thing paranoidly:
+##  a) keeps backups;
+##  b) rolls back at the first sign of trouble; and
+##  c) won't even start if a backup is present
+
+if ! cd /etc/pam.d; then
+echo "Unable to cd to /etc/pam.d" >&2
+exit 1
+fi
+
+# iff ./sshd exists and ./sshd.orig does not, move the former
+# to the latter and force dpkg to reinstall missing config
+# files (via apt-get).  This restarts the sshd master daemon,
+# and returns ./sshd.orig to ./sshd if apt-get reports issues.
+#
+# If all went well, ./sshd has the stock config and ./sshd.orig
+# has a backup of the previous one.
+mv -n sshd sshd.orig && (
+apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall 
openssh-server ||
+mv -f sshd.orig sshd
+)
+
+# For ./common-* we make copies instead of moving the
+# configuration files around to avoid there ever being a point
+# where only /part/ of the configuration is present. Once
+# all the files have been copied, /then/ we remove the
+# originals and regenerate configuration.
+for i in common-{account,auth,password,session,session-noninteractive}; do
+cp -np $i $i.orig || exit 1
+done
+rm common-{account,auth,password,session,session-noninteractive} && (
+pam-auth-update --package --force ||
+for i in common-{account,auth,password,session,session-noninteractive}; do
+mv -f $i.orig $i
+done
+)
diff --git a/modules/ldap/files/common-account 
b/modules/ldap/files/common-account
deleted file mode 100644
index ee55340..000
--- a/modules/ldap/files/common-account
+++ /dev/null
@@ -1,11 +0,0 @@
-# here are the per-package modules (the "Primary" block)
-account [success=2 new_authtok_reqd=done default=ignore]pam_unix.so
-account [success=1 default=ignore]  pam_ldap.so
-# here's the fallback if no module succeeds
-account requisite   pam_deny.so
-# prime the stack with a positive return value if there isn't one already;
-# this avoids us returning an error just because nothing sets a success code
-# since the modules above will each just jump around
-account requiredpam_permit.so
-# and here are more per-package modules (the "Additional" block)
-# end of pam-auth-update config
diff --git a/modules/ldap/files/common-auth b/modules/ldap/files/common-auth
deleted file mode 100644
index 27a9721..000
--- a/modules/ldap/files/common-auth
+++ /dev/null
@@ -1,13 +0,0 @@
-# here are the per-package modules (the "Primary" block)
-auth[success=2 default=ignore]  pam_unix.so nullok_secure
-auth[success=1 default=ignore]  pam_ldap.so use_first_pass
-# here's the fallback if no module succeeds
-authrequisite   pam_deny.so
-# limit access to specific users
-authrequiredpam_access.so
-# prime the stack with a positive return value if there isn't one already;
-# this avoids us returning an error just because nothing sets a success code
-# since the modules above will each just jump around
-authrequiredpam_permit.so
-# and here 

[MediaWiki-commits] [Gerrit] Failing test case for delete at end of doc - change (VisualEditor/VisualEditor)

2015-12-02 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: Failing test case for delete at end of doc
..

Failing test case for delete at end of doc

Bug: T120052
Change-Id: Ib863282246e73638098412bba0aacf7142f5577f
---
M tests/ce/ve.ce.Surface.test.js
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/15/256415/1

diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js
index 723c9ab..8ae2d14 100644
--- a/tests/ce/ve.ce.Surface.test.js
+++ b/tests/ce/ve.ce.Surface.test.js
@@ -260,7 +260,6 @@
data.splice( 0, 2 );
data.splice( 2, 2 );
},
-   expectedRange: new ve.Range( 1 ),
expectedSelection: {
type: 'linear',
range: new ve.Range( 1 )
@@ -275,12 +274,23 @@
data.splice( 5, 2 );
data.splice( 7, 2 );
},
-   expectedRange: new ve.Range( 5 ),
expectedSelection: {
type: 'linear',
range: new ve.Range( 6 )
},
msg: 'List at end of document unwrapped by 
delete'
+   },
+   {
+   html: 'foo',
+   range: new ve.Range( 4 ),
+   operations: [ 'delete' ],
+   expectedData: function () {
+   },
+   expectedSelection: {
+   type: 'linear',
+   range: new ve.Range( 4 )
+   },
+   msg: 'Delete at end of last paragraph does 
nothing'
}
];
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib863282246e73638098412bba0aacf7142f5577f
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] Make 0.3.0 release - change (mediawiki...SemanticPageSeries)

2015-12-02 Thread Kghbln (Code Review)
Kghbln has uploaded a new change for review.

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

Change subject: Make 0.3.0 release
..

Make 0.3.0 release

* Added license-name
* Switched author to an array
* Changed link to https
* Switched consitently to __DIR__
* Migrated wfMsgForContent to wfMessage
* Added more file documenation
* Tweaked formatting

Change-Id: Ib64cdbd7e50cd3f0894b8399f36fb2e44b2e6972
---
M SemanticPageSeries.php
M includes/SPSException.php
2 files changed, 27 insertions(+), 24 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticPageSeries 
refs/changes/23/256423/1

diff --git a/SemanticPageSeries.php b/SemanticPageSeries.php
index 1ff4763..0a57ea2 100644
--- a/SemanticPageSeries.php
+++ b/SemanticPageSeries.php
@@ -14,10 +14,13 @@
  * @file
  * @ingroup SemanticPageSeries
  */
+
+// Ensure that the script cannot be executed outside of MediaWiki.
 if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is part of a MediaWiki extension, it is not a valid 
entry point.' );
 }
 
+// Do comopatibility checks with connected software
 if ( !defined( 'SMW_VERSION' ) ) {
die( 'Error: https://www.mediawiki.org/wiki/Extension:Semantic_Page_Series;>Semantic 
Page Series depends on the Semantic MediaWiki extension. You need to 
install https://www.mediawiki.org/wiki/Extension:Semantic_MediaWiki;>Semantic 
MediaWiki first.' );
 }
@@ -29,38 +32,38 @@
 /**
  * The Semantic Page Series version
  */
-define( 'SPS_VERSION', '0.3.0 alpha' );
+define( 'SPS_VERSION', '0.3.0' );
 
 // register the extension
 $wgExtensionCredits['semantic'][] = array(
'path' => __FILE__,
'name' => 'Semantic Page Series',
-   'author' => '[http://www.mediawiki.org/wiki/User:F.trott Stephan 
Gambke]',
+   'author' => array(
+   '[https://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]',
+   '...'
+   ),
'url' => 
'https://www.mediawiki.org/wiki/Extension:Semantic_Page_Series',
'descriptionmsg' => 'semanticpageseries-desc',
'version' => SPS_VERSION,
+   'license-name' => 'GPL-2.0+'
 );
-
-
-// server-local path to this file
-$dir = dirname( __FILE__ );
 
 // register message files
 $wgMessagesDirs['SemanticPageSeries'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['SemanticPageSeries'] = $dir . 
'/SemanticPageSeries.i18n.php';
-$wgExtensionMessagesFiles['SemanticPageSeriesMagic'] = $dir . 
'/SemanticPageSeries.magic.php';
-$wgExtensionMessagesFiles['SemanticPageSeriesAlias'] = $dir . 
'/SemanticPageSeries.alias.php';
+$wgExtensionMessagesFiles['SemanticPageSeries'] = __DIR__ . 
'/SemanticPageSeries.i18n.php';
+$wgExtensionMessagesFiles['SemanticPageSeriesMagic'] = __DIR__ . 
'/SemanticPageSeries.magic.php';
+$wgExtensionMessagesFiles['SemanticPageSeriesAlias'] = __DIR__ . 
'/SemanticPageSeries.alias.php';
 
 // register class files with the Autoloader
-$wgAutoloadClasses['SPSUtils'] = $dir . '/includes/SPSUtils.php';
-$wgAutoloadClasses['SPSSpecialSeriesEdit'] = $dir . 
'/includes/SPSSpecialSeriesEdit.php';
-$wgAutoloadClasses['SPSException'] = $dir . '/includes/SPSException.php';
-$wgAutoloadClasses['SPSPageCreationJob'] = $dir . 
'/includes/SPSPageCreationJob.php';
+$wgAutoloadClasses['SPSUtils'] = __DIR__ . '/includes/SPSUtils.php';
+$wgAutoloadClasses['SPSSpecialSeriesEdit'] = __DIR__ . 
'/includes/SPSSpecialSeriesEdit.php';
+$wgAutoloadClasses['SPSException'] = __DIR__ . '/includes/SPSException.php';
+$wgAutoloadClasses['SPSPageCreationJob'] = __DIR__ . 
'/includes/SPSPageCreationJob.php';
 
-$wgAutoloadClasses['SPSIterator'] = $dir . 
'/includes/iterators/SPSIterator.php';
-$wgAutoloadClasses['SPSDateIterator'] = $dir . 
'/includes/iterators/SPSDateIterator.php';
-$wgAutoloadClasses['SPSCountIterator'] = $dir . 
'/includes/iterators/SPSCountIterator.php';
-$wgAutoloadClasses['SPSPageIterator'] = $dir . 
'/includes/iterators/SPSPageIterator.php';
+$wgAutoloadClasses['SPSIterator'] = __DIR__ . 
'/includes/iterators/SPSIterator.php';
+$wgAutoloadClasses['SPSDateIterator'] = __DIR__ . 
'/includes/iterators/SPSDateIterator.php';
+$wgAutoloadClasses['SPSCountIterator'] = __DIR__ . 
'/includes/iterators/SPSCountIterator.php';
+$wgAutoloadClasses['SPSPageIterator'] = __DIR__ . 
'/includes/iterators/SPSPageIterator.php';
 
 
 // register Special page
diff --git a/includes/SPSException.php b/includes/SPSException.php
index 822fb2a..30f8f2b 100644
--- a/includes/SPSException.php
+++ b/includes/SPSException.php
@@ -20,9 +20,9 @@
 
/**
 * Return a HTML message.
-* 
+*
 * Overrides method from MWException: We don't need a backtrace
-* 
+*
 * @return String html to output
 */
function getHTML() {
@@ -31,9 +31,9 @@
 
/**
 * Return a text message.
-* 
+*
 * Overrides method from MWException: We don't need a backtrace
-* 
+  

[MediaWiki-commits] [Gerrit] Track max and svg statements per entity - change (analytics/limn-wikidata-data)

2015-12-02 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Track max and svg statements per entity
..

Track max and svg statements per entity

Bug: T119977
Change-Id: Ib8a9d03801c216ccb436a6e9cd52daa354cfbab8
---
M graphite/datamodel/statements_per_entity.php
1 file changed, 30 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/limn-wikidata-data 
refs/changes/24/256424/1

diff --git a/graphite/datamodel/statements_per_entity.php 
b/graphite/datamodel/statements_per_entity.php
index 51ad474..aee019c 100755
--- a/graphite/datamodel/statements_per_entity.php
+++ b/graphite/datamodel/statements_per_entity.php
@@ -21,7 +21,18 @@
 
$rows = $queryResult->fetchAll();
 
-   $totals = array();
+   $totals = array(
+   'item' => 0,
+   'property' => 0,
+   );
+   $maxes = array(
+   'item' => 0,
+   'property' => 0,
+   );
+   $entitiesWithStatements = array(
+   'item' => 0,
+   'property' => 0,
+   );
foreach( $rows as $row ) {
if( $row['namespace'] == '0' ) {
$entityType = 'item';
@@ -31,12 +42,17 @@
throw new LogicException( 'Couldn\'t identify 
namespace: ' . $row['namespace'] );
}
 
-   @$totals[$entityType] += ( $row['statements'] * 
$row['count'] );
+   $totals[$entityType] += ( $row['statements'] * 
$row['count'] );
+   $entitiesWithStatements[$entityType] += $row['count'];
 
$this->sendMetric(

"daily.wikidata.datamodel.$entityType.statements.count." . $row['statements'],
$row['count']
);
+
+   if( $maxes[$entityType] < $row['statements'] ) {
+   $maxes[$entityType] = $row['statements'];
+   }
}
 
foreach( $totals as $entityType => $value ) {
@@ -44,7 +60,19 @@

"daily.wikidata.datamodel.$entityType.statements.total",
$value
);
+   $this->sendMetric(
+   
"daily.wikidata.datamodel.$entityType.statements.avg",
+   $value / $entitiesWithStatements[$entityType]
+   );
}
+
+   foreach( $maxes as $entityType => $value ) {
+   $this->sendMetric(
+   
"daily.wikidata.datamodel.$entityType.statements.max",
+   $value
+   );
+   }
+
}
 
private function sendMetric( $name, $value ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8a9d03801c216ccb436a6e9cd52daa354cfbab8
Gerrit-PatchSet: 1
Gerrit-Project: analytics/limn-wikidata-data
Gerrit-Branch: master
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] Add wikidatawiki-beta Italy item to WebPageTest - change (performance/WebPageTest)

2015-12-02 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

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

Change subject: Add wikidatawiki-beta Italy item to WebPageTest
..

Add wikidatawiki-beta Italy item to WebPageTest

Bug: T117555
Change-Id: I29b0bba27200d5e69e511ac822d34ad52b34070b
---
M scripts/batch/desktop.txt
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance/WebPageTest 
refs/changes/31/256431/1

diff --git a/scripts/batch/desktop.txt b/scripts/batch/desktop.txt
index ff0e3ba..93f9341 100644
--- a/scripts/batch/desktop.txt
+++ b/scripts/batch/desktop.txt
@@ -28,6 +28,8 @@
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
 
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs 
<%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki-beta.anonymous.italy 
http://wikidata.beta.wmflabs.org/wiki/Q15905
+
 # Collect metrics using Firefox
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.enwiki.anonymous.Main_Page --reporter statsv 
https://en.wikipedia.org/wiki/Main_Page
 
@@ -46,6 +48,8 @@
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
+
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>:Firefox --label ff --reporter statsv 
--runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace 
webpagetest.wikidatawiki-beta.anonymous.italy 
http://wikidata.beta.wmflabs.org/wiki/Q15905
 
 # Collect metrics using IE 11 (running windows 7 = no SPDY)
 
@@ -68,3 +72,5 @@
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.test2wiki.anonymous.Washington_DC 
https://test2.wikipedia.org/wiki/Washington,_D.C.
 
 --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki.anonymous.Q64.276539678 
https://www.wikidata.org/w/index.php?title=Q64=276539678
+
+--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median 
SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> 
--endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace 
webpagetest.wikidatawiki-beta.anonymous.italy 
http://wikidata.beta.wmflabs.org/wiki/Q15905

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29b0bba27200d5e69e511ac822d34ad52b34070b
Gerrit-PatchSet: 1
Gerrit-Project: performance/WebPageTest
Gerrit-Branch: master
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] Fix apple-touch-icon.png on wikipedias - change (operations/puppet)

2015-12-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Fix apple-touch-icon.png on wikipedias
..

Fix apple-touch-icon.png on wikipedias

Bug: T115965
Change-Id: I8ae8046341e5cb18ddf2b3715cdadf1fd40b7bcb
---
M modules/mediawiki/files/apache/sites/main.conf
1 file changed, 1 insertion(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/256437/1

diff --git a/modules/mediawiki/files/apache/sites/main.conf 
b/modules/mediawiki/files/apache/sites/main.conf
index 3c0f19b..76c323b 100644
--- a/modules/mediawiki/files/apache/sites/main.conf
+++ b/modules/mediawiki/files/apache/sites/main.conf
@@ -386,9 +386,6 @@
 RewriteCond %{ENV:RW_PROTO} !=https
 RewriteRule . - [E=RW_PROTO:http]
 
-# Make robots.txt editable via Mediawiki:robots.txt
-RewriteRule ^/robots.txt$ /w/robots.php [L]
-
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
 
@@ -401,7 +398,6 @@
 # Standard intrawiki rewrites
 # Primary wiki redirector:
 Alias /wiki /srv/mediawiki/docroot/wikipedia.org/w/index.php
-RewriteRule ^/$ /w/index.php
 RewriteRule ^/w/$ /w/index.php
 
 # UseMod compatibility URLs
@@ -423,9 +419,7 @@
 RewriteRule ^/wikistats(/(.*$)|$) %{ENV:RW_PROTO}://stats.wikimedia.org/$2 
[R=302,L]
 
 Include "sites-enabled/api-rewrites.incl"
-
-# Configurable favicon
-RewriteRule ^/favicon\.ico$ /w/favicon.php [L]
+Include "sites-enabled/public-wiki-rewrites.incl"
 
 
 

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

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

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


[MediaWiki-commits] [Gerrit] Consolidate Title normalization code in SearchUpdate - change (mediawiki/core)

2015-12-02 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Consolidate Title normalization code in SearchUpdate
..

Consolidate Title normalization code in SearchUpdate

and rename the private method to be more clear

Change-Id: Iec7b934babddd102402cfa7616accd91fd3422ff
---
M includes/deferred/SearchUpdate.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/256426/1

diff --git a/includes/deferred/SearchUpdate.php 
b/includes/deferred/SearchUpdate.php
index 867fc61..f6c80f4 100644
--- a/includes/deferred/SearchUpdate.php
+++ b/includes/deferred/SearchUpdate.php
@@ -86,8 +86,7 @@
continue;
}
 
-   $indexTitle = $this->indexTitle( $search );
-   $normalTitle = $search->normalizeText( $indexTitle );
+   $normalTitle = $this->getNormalizedTitle( $search );
 
if ( $page === null ) {
$search->delete( $this->id, $normalTitle );
@@ -174,13 +173,13 @@
}
 
/**
-* Get a string representation of a title suitable for
+* Get a normalized string representation of a title suitable for
 * including in a search index
 *
 * @param SearchEngine $search
 * @return string A stripped-down title string ready for the search 
index
 */
-   private function indexTitle( SearchEngine $search ) {
+   private function getNormalizedTitle( SearchEngine $search ) {
global $wgContLang;
 
$ns = $this->title->getNamespace();
@@ -200,6 +199,7 @@
if ( $ns == NS_FILE ) {
$t = preg_replace( "/ (png|gif|jpg|jpeg|ogg)$/", "", $t 
);
}
-   return trim( $t );
+
+   return $search->normalizeText( trim( $t ) );
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec7b934babddd102402cfa7616accd91fd3422ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aude 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Don't load WikiPage (w/ READ_LATEST) if search-update is not... - change (mediawiki/core)

2015-12-02 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Don't load WikiPage (w/ READ_LATEST) if search-update is not 
supported
..

Don't load WikiPage (w/ READ_LATEST) if search-update is not supported

instead lazy load WikiPage, when needed.

Change-Id: If67057b0b76f0f889ed498d8bbedaaeae3b2785d
---
M includes/deferred/SearchUpdate.php
1 file changed, 21 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/256427/1

diff --git a/includes/deferred/SearchUpdate.php 
b/includes/deferred/SearchUpdate.php
index f6c80f4..2abf028 100644
--- a/includes/deferred/SearchUpdate.php
+++ b/includes/deferred/SearchUpdate.php
@@ -38,6 +38,9 @@
/** @var Content|bool Content of the page (not text) */
private $content;
 
+   /** @var WikiPage **/
+   private $page;
+
/**
 * Constructor
 *
@@ -78,8 +81,6 @@
return;
}
 
-   $page = WikiPage::newFromID( $this->id, WikiPage::READ_LATEST );
-
foreach ( SearchEngine::getSearchTypes() as $type ) {
$search = SearchEngine::create( $type );
if ( !$search->supports( 'search-update' ) ) {
@@ -88,7 +89,7 @@
 
$normalTitle = $this->getNormalizedTitle( $search );
 
-   if ( $page === null ) {
+   if ( $this->getLatestPage() === null ) {
$search->delete( $this->id, $normalTitle );
continue;
} elseif ( $this->content === false ) {
@@ -173,6 +174,23 @@
}
 
/**
+* Get WikiPage for the SearchUpdate $id using WikiPage::READ_LATEST
+* and ensure using the same WikiPage object if there are multiple
+* SearchEngine types.
+*
+* Returns null if a page has been deleted or is not found.
+*
+* @return WikiPage|null
+*/
+   private function getLatestPage() {
+   if ( !isset( $this->page ) ) {
+   $this->page = WikiPage::newFromID( $this->id, 
WikiPage::READ_LATEST );
+   }
+
+   return $this->page;
+   }
+
+   /**
 * Get a normalized string representation of a title suitable for
 * including in a search index
 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If67057b0b76f0f889ed498d8bbedaaeae3b2785d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aude 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] gmond_memcached.py: fix all kinds of pep8 warnings - change (operations/puppet)

2015-12-02 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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

Change subject: gmond_memcached.py: fix all kinds of pep8 warnings
..

gmond_memcached.py: fix all kinds of pep8 warnings

Mostly leading whitespace

Change-Id: I2ef92498ea5b3d0a9c5ba0f280dae36f094f0e0e
---
M modules/memcached/files/ganglia/gmond_memcached.py
1 file changed, 119 insertions(+), 102 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/38/256438/1

diff --git a/modules/memcached/files/ganglia/gmond_memcached.py 
b/modules/memcached/files/ganglia/gmond_memcached.py
index db0d541..76480af 100644
--- a/modules/memcached/files/ganglia/gmond_memcached.py
+++ b/modules/memcached/files/ganglia/gmond_memcached.py
@@ -10,14 +10,16 @@
 import select
 
 descriptors = list()
-Desc_Skel   = {}
+Desc_Skel = {}
 _Worker_Thread = None
-_Lock = threading.Lock() # synchronization lock
+_Lock = threading.Lock()  # synchronization lock
 Debug = False
+
 
 def dprint(f, *v):
 if Debug:
 print >>sys.stderr, "DEBUG: "+f % v
+
 
 def floatable(str):
 try:
@@ -26,27 +28,28 @@
 except:
 return False
 
+
 class UpdateMetricThread(threading.Thread):
 
 def __init__(self, params):
 threading.Thread.__init__(self)
-self.running  = False
+self.running = False
 self.shuttingdown = False
 self.refresh_rate = 15
 if "refresh_rate" in params:
 self.refresh_rate = int(params["refresh_rate"])
-self.metric   = {}
-self.last_metric   = {}
-self.timeout  = 2
+self.metric = {}
+self.last_metric = {}
+self.timeout = 2
 
-self.host = "localhost"
-self.port = 11211
+self.host = "localhost"
+self.port = 11211
 if "host" in params:
 self.host = params["host"]
 if "port" in params:
 self.port = int(params["port"])
-self.type= params["type"]
-self.mp  = params["metrix_prefix"]
+self.type = params["type"]
+self.mp = params["metrix_prefix"]
 
 def shutdown(self):
 self.shuttingdown = True
@@ -67,7 +70,7 @@
 
 def update_metric(self):
 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-msg  = ""
+msg = ""
 self.last_metric = self.metric.copy()
 try:
 dprint("connect %s:%d", self.host, self.port)
@@ -100,9 +103,10 @@
 def metric_of(self, name):
 val = 0
 mp = name.split("_")[0]
-if name.rsplit("_",1)[1] == "rate" and name.rsplit("_",1)[0] in 
self.metric:
+if (name.rsplit("_", 1)[1] == "rate" and
+name.rsplit("_", 1)[0] in self.metric):
 _Lock.acquire()
-name = name.rsplit("_",1)[0]
+name = name.rsplit("_", 1)[0]
 if name in self.last_metric:
 num = self.metric[name]-self.last_metric[name]
 period = self.metric[mp+"_time"]-self.last_metric[mp+"_time"]
@@ -116,6 +120,7 @@
 val = self.metric[name]
 _Lock.release()
 return val
+
 
 def metric_init(params):
 global descriptors, Desc_Skel, _Worker_Thread, Debug
@@ -134,15 +139,15 @@
 
 # initialize skeleton of descriptors
 Desc_Skel = {
-'name': 'XXX',
-'call_back'   : metric_of,
-'time_max': 60,
-'value_type'  : 'float',
-'format'  : '%.0f',
-'units'   : 'XXX',
-'slope'   : 'XXX', # zero|positive|negative|both
-'description' : 'XXX',
-'groups'  : params["type"],
+'name': 'XXX',
+'call_back': metric_of,
+'time_max': 60,
+'value_type': 'float',
+'format': '%.0f',
+'units': 'XXX',
+'slope': 'XXX',  # zero|positive|negative|both
+'description': 'XXX',
+'groups': params["type"],
 }
 
 if "refresh_rate" not in params:
@@ -161,93 +166,99 @@
 mp = params["metrix_prefix"]
 
 descriptors.append(create_desc(Desc_Skel, {
-"name"   : mp+"_curr_items",
-"units"  : "items",
-"slope"  : "both",
+"name": mp+"_curr_items",
+"units": "items",
+"slope": "both",
 "description": "Current number of items stored",
 }))
 descriptors.append(create_desc(Desc_Skel, {
-"name"   : mp+"_cmd_get",
-"units"  : "commands",
-"slope"  : "positive",
+"name": mp+"_cmd_get",
+"units": "commands",
+"slope": "positive",
 "description": "Cumulative number of retrieval reqs",
 }))
 descriptors.append(create_desc(Desc_Skel, {
-"name"   : 

[MediaWiki-commits] [Gerrit] Remove www.de rewrites - change (operations/puppet)

2015-12-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Remove www.de rewrites
..

Remove www.de rewrites

All of those don't resolve in DNS, so pointless being here

Change-Id: Ifdb1a512c14c2f157dcb3a97dc386266bd61ca36
---
M modules/mediawiki/files/apache/sites/main.conf
1 file changed, 0 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/41/256441/1

diff --git a/modules/mediawiki/files/apache/sites/main.conf 
b/modules/mediawiki/files/apache/sites/main.conf
index 3c0f19b..25f8536 100644
--- a/modules/mediawiki/files/apache/sites/main.conf
+++ b/modules/mediawiki/files/apache/sites/main.conf
@@ -276,10 +276,6 @@
 #RewriteRule ^/upload/(.*)$ /upload/%1/$1
 RewriteRule ^/upload/(.*)$ 
%{ENV:RW_PROTO}://upload.wikimedia.org/wikiquote/%1/$1 [R=302]
 
-# Send www.de.wikiquote.org -> de.wikiquote.org
-RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.wikiquote\.org$
-RewriteRule ^(.*)$ %{ENV:RW_PROTO}://%1.wikiquote.org$1 [R=301,L]
-
 # Primary wiki redirector:
 Alias /wiki /srv/mediawiki/docroot/wikiquote.org/w/index.php
 RewriteRule ^/$ /w/index.php
@@ -415,10 +411,6 @@
 # and is for the others...
 RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 
[R=301]
 
-# Send www.de.wikipedia.org -> de.wikipedia.org
-RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.wikipedia\.org$
-RewriteRule ^(.*)$ %{ENV:RW_PROTO}://%1.wikipedia.org$1 [R=301,L]
-
 # moved wikistats off NFS
 RewriteRule ^/wikistats(/(.*$)|$) %{ENV:RW_PROTO}://stats.wikimedia.org/$2 
[R=302,L]
 
@@ -481,10 +473,6 @@
 
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
-
-# Send www.de.wikibooks.org -> de.wikibooks.org
-RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.wikibooks\.org$
-RewriteRule ^(.*)$ %{ENV:RW_PROTO}://%1.wikibooks.org$1 [R=301,L]
 
 # Uploads to the host-specific directory
 # First grab the subdomain from HTTP_HOST
@@ -566,10 +554,6 @@
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
 
-# Send www.de.wikisource.org -> de.wikisource.org
-RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.wikisource\.org$
-RewriteRule ^(.*)$ %{ENV:RW_PROTO}://%1.wikisource.org$1 [R=301,L]
-
 # Uploads to the host-specific directory
 # First grab the subdomain from HTTP_HOST
 RewriteCond %{HTTP_HOST} ([a-z\-]+)\.wikisource\.org
@@ -649,10 +633,6 @@
 
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
-
-# Send www.de.wikinews.org -> de.wikinews.org
-RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.wikinews\.org$
-RewriteRule ^(.*)$ %{ENV:RW_PROTO}://%1.wikinews.org$1 [R=301,L]
 
 # Uploads to the host-specific directory
 # First grab the subdomain from HTTP_HOST
@@ -735,10 +715,6 @@
 
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
-
-# Send www.de.wikiversity.org -> de.wikiversity.org
-RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.wikiversity\.org$
-RewriteRule ^(.*)$ %{ENV:RW_PROTO}://%1.wikiversity.org$1 [R=301,L]
 
 # Uploads to the host-specific directory
 # First grab the subdomain from HTTP_HOST

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

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

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


[MediaWiki-commits] [Gerrit] Allow ssl key usage - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Allow ssl key usage
..


Allow ssl key usage

If ssl is enabled, import keys and certificates from the private
repository and set them with restricted privileges on the subdir
/etc/mysql/ssl.

For now, we will share the certificates, probably we should
generate one per host in the future.

The certificates and keys have to exist first before deploying
this commit.

Change-Id: Ice0a9c81b2815cce99aa591bbac66ba75a8eb123
References: T111654
---
M manifests/config.pp
A manifests/ssl_key.pp
2 files changed, 45 insertions(+), 4 deletions(-)

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



diff --git a/manifests/config.pp b/manifests/config.pp
index 96107cb..e028fac 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,5 +1,6 @@
 # Please use separate .cnf templates for each type of server.
-# Keep this independent and modular. It should be includable without the 
mariadb class.
+# Keep this independent and modular. It should be includable 
+# without the mariadb class.
 
 class mariadb::config(
 $config= 'mariadb/default.my.cnf.erb',
@@ -14,7 +15,8 @@
 ) {
 
 $server_id = inline_template(
-"<%= @ipaddress.split('.').inject(0) {|total,value| (total << 8 ) + 
value.to_i} %>"
+"<%= @ipaddress.split('.').inject(0)\
+{|total,value| (total << 8 ) + value.to_i} %>"
 )
 
 file { '/etc/my.cnf':
@@ -39,8 +41,8 @@
 }
 
 file { '/etc/mysql/my.cnf':
-ensure => link,
-target => '/etc/my.cnf',
+ensure  => link,
+target  => '/etc/my.cnf',
 require => File['/etc/mysql'],
 }
 
@@ -79,4 +81,31 @@
 mode   => '0755',
 source => 'puppet:///files/icinga/check_mariadb.pl',
 }
+
+if ($ssl == 'on') {
+include mariadb::ssl_key
+
+file { '/etc/mysql/ssl':
+ensure  => directory,
+owner   => 'root',
+group   => 'mysql',
+mode=> '0750',
+require => File['/etc/mysql']
+}
+ssl_key { 'cacert':
+file => 'cacert.pem',
+}
+ssl_key { 'server-key':
+file => 'server-key.pem',
+}
+ssl_key { 'server-cert':
+file => 'server-cert.pem',
+}
+ssl_key { 'client-key':
+file => 'client-key.pem',
+}
+ssl_key { 'client-cert':
+file => 'client-cert.pem',
+}
+}
 }
diff --git a/manifests/ssl_key.pp b/manifests/ssl_key.pp
new file mode 100644
index 000..e378617
--- /dev/null
+++ b/manifests/ssl_key.pp
@@ -0,0 +1,12 @@
+class mariadb::ssl_key ($file) {
+file { "/etc/mysql/ssl/${file}":
+ensure=> file,
+owner => 'root',
+group => 'mysql',
+mode  => '0440',
+show_diff => false,
+backup=> false,
+content   => secret("mysql/${file}"),
+require   => File['/etc/mysql/ssl'],
+}
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ice0a9c81b2815cce99aa591bbac66ba75a8eb123
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fixing import issue for ssl_key (minor syntax change) - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Fixing import issue for ssl_key (minor syntax change)
..

Fixing import issue for ssl_key (minor syntax change)

Change-Id: I6fba419c1f2a7e31a6a4252eaf8f12813f0a22a6
References: T111654
---
M manifests/config.pp
1 file changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/mariadb 
refs/changes/51/256451/1

diff --git a/manifests/config.pp b/manifests/config.pp
index e028fac..1aba373 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -83,7 +83,6 @@
 }
 
 if ($ssl == 'on') {
-include mariadb::ssl_key
 
 file { '/etc/mysql/ssl':
 ensure  => directory,
@@ -92,19 +91,19 @@
 mode=> '0750',
 require => File['/etc/mysql']
 }
-ssl_key { 'cacert':
+include mariadb::ssl_key { 'cacert':
 file => 'cacert.pem',
 }
-ssl_key { 'server-key':
+include mariadb::ssl_key { 'server-key':
 file => 'server-key.pem',
 }
-ssl_key { 'server-cert':
+include mariadb::ssl_key { 'server-cert':
 file => 'server-cert.pem',
 }
-ssl_key { 'client-key':
+include mariadb::ssl_key { 'client-key':
 file => 'client-key.pem',
 }
-ssl_key { 'client-cert':
+include mariadb::ssl_key { 'client-cert':
 file => 'client-cert.pem',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fba419c1f2a7e31a6a4252eaf8f12813f0a22a6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 

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


[MediaWiki-commits] [Gerrit] Fix I772920: mediawiki::users::web is a variable, not a class - change (operations/puppet)

2015-12-02 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Fix I772920: mediawiki::users::web is a variable, not a class
..

Fix I772920: mediawiki::users::web is a variable, not a class

Change-Id: I6e5818cec0c274dd2d2e5262721c490142b1c103
---
M modules/scap/manifests/l10nupdate.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/57/256457/1

diff --git a/modules/scap/manifests/l10nupdate.pp 
b/modules/scap/manifests/l10nupdate.pp
index 770243d..ff17b9e 100644
--- a/modules/scap/manifests/l10nupdate.pp
+++ b/modules/scap/manifests/l10nupdate.pp
@@ -13,7 +13,7 @@
 $deployment_group = 'wikidev',
 $run_l10nupdate   = false,
 ) {
-require ::mediawiki::users::web
+require ::mediawiki::users
 
 $ensure_l10nupdate_cron = $run_l10nupdate ? {
 true=> 'present',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e5818cec0c274dd2d2e5262721c490142b1c103
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Connect OOjs UI to MediaWiki's localisation system - change (mediawiki/core)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Connect OOjs UI to MediaWiki's localisation system
..


Connect OOjs UI to MediaWiki's localisation system

Somehow we have forgotten to do this in here, it was only done in
VisualEditor, which is why no one noticed for so long.

Bug: T119984
Change-Id: I9154345119846dcba90c30f81636ea70fd524471
---
M resources/ResourcesOOUI.php
A resources/src/oojs-ui-local.js
2 files changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/resources/ResourcesOOUI.php b/resources/ResourcesOOUI.php
index caf6dab..d3b74f2 100644
--- a/resources/ResourcesOOUI.php
+++ b/resources/ResourcesOOUI.php
@@ -36,6 +36,7 @@
$modules['oojs-ui'] = array(
'scripts' => array(
'resources/lib/oojs-ui/oojs-ui.js',
+   'resources/src/oojs-ui-local.js',
),
'skinScripts' => array_combine(
array_keys( $themes ),
@@ -51,6 +52,7 @@
'oojs-ui.styles.icons',
'oojs-ui.styles.indicators',
'oojs-ui.styles.textures',
+   'mediawiki.language',
),
'messages' => array(
'ooui-dialog-message-accept',
diff --git a/resources/src/oojs-ui-local.js b/resources/src/oojs-ui-local.js
new file mode 100644
index 000..84ec92d
--- /dev/null
+++ b/resources/src/oojs-ui-local.js
@@ -0,0 +1,5 @@
+// Connect OOjs UI to MediaWiki's localisation system
+( function ( mw ) {
+   OO.ui.getUserLanguages = mw.language.getFallbackLanguageChain;
+   OO.ui.msg = mw.msg;
+}( mediaWiki ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9154345119846dcba90c30f81636ea70fd524471
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Updating mariadb to the latest codebase - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Updating mariadb to the latest codebase
..


Updating mariadb to the latest codebase

Change-Id: Ia09c380699cd4f0c24e4d756039cb557082cdd55
References: T111654
---
M modules/mariadb
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/mariadb b/modules/mariadb
index 7fef40f..3e5eac0 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 7fef40f163f678af7790a0ec8b95afa3429e2234
+Subproject commit 3e5eac0d99b645607a0fc960a71ec4e999f6eac1

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

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

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


[MediaWiki-commits] [Gerrit] Correct CirrusSearchRequestSet table creation hql - change (analytics/refinery)

2015-12-02 Thread Joal (Code Review)
Joal has uploaded a new change for review.

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

Change subject: Correct CirrusSearchRequestSet table creation hql
..

Correct CirrusSearchRequestSet table creation hql

Change-Id: Ifa228ae5f894b77cf11fa07955f70a84ac61
---
M 
hive/mediawiki/cirrus-searchrequest-set/create_CirrusSearchRequestSet_table.hql
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery 
refs/changes/66/256466/1

diff --git 
a/hive/mediawiki/cirrus-searchrequest-set/create_CirrusSearchRequestSet_table.hql
 
b/hive/mediawiki/cirrus-searchrequest-set/create_CirrusSearchRequestSet_table.hql
index f7ff58b..974a0b0 100644
--- 
a/hive/mediawiki/cirrus-searchrequest-set/create_CirrusSearchRequestSet_table.hql
+++ 
b/hive/mediawiki/cirrus-searchrequest-set/create_CirrusSearchRequestSet_table.hql
@@ -16,7 +16,7 @@
 -- Parameters:
 -- None
 -- Usage:
--- hive -f create_CirrusSearchRequestSet_table.hql
+-- hive -f create_CirrusSearchRequestSet_table.hql --database wmf_raw
 --
 
 CREATE EXTERNAL TABLE CirrusSearchRequestSet
@@ -36,3 +36,4 @@
 TBLPROPERTIES (

'avro.schema.literal'='{"type":"record","name":"CirrusSearchRequestSet","namespace":"org.wikimedia.analytics.schemas","fields":[{"name":"ts","type":"int","default":0},{"name":"wikiId","type":"string","default":""},{"name":"source","type":"string","default":""},{"name":"identity","type":"string","default":""},{"name":"ip","type":"string","default":""},{"name":"userAgent","type":"string","default":""},{"name":"backendUserTests","type":{"type":"array","items":"string"},"default":[]},{"name":"payload","type":{"type":"map","values":"string"},"default":{}},{"name":"requests","default":[],"type":{"type":"array","items":{"name":"CirrusSearchRequest","namespace":"org.wikimedia.analytics.schemas","type":"record","fields":[{"name":"query","type":"string","default":""},{"name":"queryType","type":"string","default":""},{"name":"indices","type":{"type":"array","items":"string"},"default":[]},{"name":"tookMs","type":"int","default":-1},{"name":"elasticTookMs","type":"int","default":-1},{"name":"limit","type":"int","default":-1},{"name":"hitsTotal","type":"int","default":-1},{"name":"hitsReturned","type":"int","default":-1},{"name":"hitsOffset","type":"int","default":-1},{"name":"namespaces","type":{"type":"array","items":"int"},"default":[]},{"name":"suggestion","type":"string","default":""},{"name":"suggestionRequested","type":"boolean","default":false},{"name":"payload","type":{"type":"map","values":"string"},"default":{}}]}}}]}'
 )
+;
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa228ae5f894b77cf11fa07955f70a84ac61
Gerrit-PatchSet: 1
Gerrit-Project: analytics/refinery
Gerrit-Branch: master
Gerrit-Owner: Joal 

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


[MediaWiki-commits] [Gerrit] Use mediawiki.util to insert style tags - change (mediawiki...MwEmbedSupport)

2015-12-02 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Use mediawiki.util to insert style tags
..

Use mediawiki.util to insert style tags

jquery.loadingSpinner had it's own style insertion, which was throwing
errors. This seemed the simplest solution.

Bug: T118792
Change-Id: I777300db65e232ce2d093f580912662468ae17ab
(cherry picked from commit fcf4a8ad4210b140e6cfa8962f8eb71c489e4eb0)
---
M MwEmbedModules/MwEmbedSupport/MwEmbedSupport.php
M MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/Spinner.js
2 files changed, 9 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MwEmbedSupport 
refs/changes/46/256446/1

diff --git a/MwEmbedModules/MwEmbedSupport/MwEmbedSupport.php 
b/MwEmbedModules/MwEmbedSupport/MwEmbedSupport.php
index efc4060..75d577d 100644
--- a/MwEmbedModules/MwEmbedSupport/MwEmbedSupport.php
+++ b/MwEmbedModules/MwEmbedSupport/MwEmbedSupport.php
@@ -17,6 +17,7 @@
),
"Spinner" => array(
'scripts' => 'jquery.loadingSpinner/Spinner.js',
+   'dependencies' => array( 'mediawiki.util' ),
),
'iScroll' => array(
'scripts' => 'iscroll/src/iscroll.js',
diff --git a/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/Spinner.js 
b/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/Spinner.js
index 6544415..5b8fa78 100644
--- a/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/Spinner.js
+++ b/MwEmbedModules/MwEmbedSupport/jquery.loadingSpinner/Spinner.js
@@ -34,23 +34,6 @@
}
 
/**
-* Insert a new stylesheet to hold the
-*
-* @keyframe or VML rules.
-*/
-   // ins(document.getElementsByTagName('head')[0], createEl('style'));
-   // var sheet = document.styleSheets[document.styleSheets.length-1];
-   var sheet = (function() {
-   var style = document.createElement('style');
-   style['title'] = 'spinjs';
-   document.getElementsByTagName('head')[0].appendChild(style);
-   if (!window.createPopup) { /* For Safari */
-   style.appendChild(document.createTextNode(''));
-   }
-   return document.styleSheets[document.styleSheets.length - 1];
-   })();
-
-   /**
 * Creates an opacity keyframe animation rule and returns its name. 
Since
 * most mobile Webkits have timing issues with animation-delay, we 
create
 * separate rules for each line/segment.
@@ -63,11 +46,11 @@
&& '-' + prefix + '-' || '';
 
if (!animations[name]) {
-   sheet.insertRule('@' + pre + 'keyframes ' + name + '{'
+   mw.util.addCSS('@' + pre + 'keyframes ' + name + '{'
+ '0%{opacity:' + z + '}' + start + 
'%{opacity:' + alpha
+ '}' + (start + 0.01) + '%{opacity:1}' 
+ (start + trail)
% 100 + '%{opacity:' + alpha + '}' + 
'100%{opacity:' + z
-   + '}' + '}', 0);
+   + '}' + '}');
animations[name] = 1;
}
return name;
@@ -233,9 +216,11 @@
if (!vendor(s, 'transform') && s.adj) {
 
// VML support detected. Insert CSS rules ...
-   for (i = 4; i--;)
-   sheet.addRule([ 'group', 'roundrect', 'fill', 
'stroke' ][i],
-   'behavior:url(#default#VML)');
+   for (i = 4; i--;) {
+   mw.util.addCSS( [ 'group', 'roundrect', 'fill', 
'stroke' ][i] + ' {'
+   + 'behavior:url(#default#VML)'
+   + '}' );
+   }
 
proto.lines = function(el, o) {
var r = o.length + o.width, s = 2 * r;
@@ -300,4 +285,4 @@
 
window.Spinner = Spinner;
 
-})(window, document);
\ No newline at end of file
+})(window, document);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I777300db65e232ce2d093f580912662468ae17ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MwEmbedSupport
Gerrit-Branch: wmf/1.27.0-wmf.7
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: TheDJ 

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


[MediaWiki-commits] [Gerrit] End link preview a/b test. - change (apps...wikipedia)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: End link preview a/b test.
..


End link preview a/b test.

Change-Id: I0a61af33bca9a4149c468aee085d92b5b9ffe6a1
---
M app/src/main/java/org/wikipedia/WikipediaApp.java
M app/src/main/java/org/wikipedia/analytics/LinkPreviewFunnel.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
D app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialogB.java
M app/src/main/java/org/wikipedia/settings/Prefs.java
D app/src/main/res/layout/dialog_link_preview_b.xml
M app/src/main/res/values/preference_keys.xml
M app/src/main/res/xml/developer_preferences.xml
8 files changed, 2 insertions(+), 397 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/WikipediaApp.java 
b/app/src/main/java/org/wikipedia/WikipediaApp.java
index 20c6253..368bb37 100644
--- a/app/src/main/java/org/wikipedia/WikipediaApp.java
+++ b/app/src/main/java/org/wikipedia/WikipediaApp.java
@@ -429,21 +429,6 @@
 return enabled;
 }
 
-public int getLinkPreviewVersion() {
-int version;
-if (Prefs.hasLinkPreviewVersion()) {
-version = Prefs.getLinkPreviewVersion();
-} else {
-version = new Random().nextInt(2);
-Prefs.setLinkPreviewVersion(version);
-}
-return version;
-}
-
-public boolean isLinkPreviewExperimental() {
-return getLinkPreviewVersion() != 0;
-}
-
 /**
  * Gets the currently-selected theme for the app.
  * @return Theme that is currently selected, which is the actual theme ID 
that can
diff --git a/app/src/main/java/org/wikipedia/analytics/LinkPreviewFunnel.java 
b/app/src/main/java/org/wikipedia/analytics/LinkPreviewFunnel.java
index 4ffdd07..9b69a19 100644
--- a/app/src/main/java/org/wikipedia/analytics/LinkPreviewFunnel.java
+++ b/app/src/main/java/org/wikipedia/analytics/LinkPreviewFunnel.java
@@ -10,7 +10,6 @@
 private static final String SCHEMA_NAME = "MobileWikiAppLinkPreview";
 private static final int REV_ID = 14095177;
 private static final int PROD_LINK_PREVIEW_VERSION = 3;
-private static final int PROD_LINK_PREVIEW_VERSION_B = 4;
 
 public LinkPreviewFunnel(WikipediaApp app) {
 super(app, SCHEMA_NAME, REV_ID, app.isProdRelease() ? 
Funnel.SAMPLE_LOG_100 : Funnel.SAMPLE_LOG_ALL);
@@ -18,7 +17,7 @@
 
 @Override
 protected JSONObject preprocessData(@NonNull JSONObject eventData) {
-preprocessData(eventData, "version", 
WikipediaApp.getInstance().isLinkPreviewExperimental() ? 
PROD_LINK_PREVIEW_VERSION_B : PROD_LINK_PREVIEW_VERSION);
+preprocessData(eventData, "version", PROD_LINK_PREVIEW_VERSION);
 return super.preprocessData(eventData);
 }
 
diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index e116c13..1c94691 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -16,7 +16,6 @@
 import org.wikipedia.login.LoginActivity;
 import org.wikipedia.page.gallery.GalleryActivity;
 import org.wikipedia.page.linkpreview.LinkPreviewDialog;
-import org.wikipedia.page.linkpreview.LinkPreviewDialogB;
 import org.wikipedia.page.snippet.CompatActionMode;
 import org.wikipedia.random.RandomHandler;
 import org.wikipedia.recurring.RecurringTasksExecutor;
@@ -690,9 +689,7 @@
 
 public void showLinkPreview(PageTitle title, int entrySource) {
 if 
(getSupportFragmentManager().findFragmentByTag(LINK_PREVIEW_FRAGMENT_TAG) == 
null) {
-DialogFragment linkPreview = app.isLinkPreviewExperimental()
-? LinkPreviewDialogB.newInstance(title, entrySource)
-: LinkPreviewDialog.newInstance(title, entrySource);
+DialogFragment linkPreview = LinkPreviewDialog.newInstance(title, 
entrySource);
 linkPreview.show(getSupportFragmentManager(), 
LINK_PREVIEW_FRAGMENT_TAG);
 }
 }
diff --git 
a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialogB.java 
b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialogB.java
deleted file mode 100644
index 7cb0247..000
--- a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewDialogB.java
+++ /dev/null
@@ -1,265 +0,0 @@
-package org.wikipedia.page.linkpreview;
-
-import org.wikipedia.history.HistoryEntry;
-import org.wikipedia.R;
-import org.wikipedia.WikipediaApp;
-import org.wikipedia.analytics.LinkPreviewFunnel;
-import org.wikipedia.page.Page;
-import org.wikipedia.page.PageActivity;
-import org.wikipedia.page.PageCache;
-import org.wikipedia.page.PageTitle;
-import org.wikipedia.savedpages.LoadSavedPageTask;
-import org.wikipedia.server.PageServiceFactory;

[MediaWiki-commits] [Gerrit] Fix column widths in NewsletterTablePager - change (mediawiki...Newsletter)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix column widths in NewsletterTablePager
..


Fix column widths in NewsletterTablePager

Make this look a bit less awkward.

Change-Id: I1da3277315b0dc7492aa3ede74bde65404118e9d
---
M includes/specials/pagers/NewsletterTablePager.php
1 file changed, 9 insertions(+), 2 deletions(-)

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



diff --git a/includes/specials/pagers/NewsletterTablePager.php 
b/includes/specials/pagers/NewsletterTablePager.php
index 400132c..a51ec59 100644
--- a/includes/specials/pagers/NewsletterTablePager.php
+++ b/includes/specials/pagers/NewsletterTablePager.php
@@ -123,12 +123,19 @@
 */
public function getCellAttrs( $field, $value ) {
$ret = parent::getCellAttrs( $field, $value );
+   // @todo use CSS, not inline HTML
switch( $field ) {
+   case 'nl_name':
+   $ret['width'] = '20%';
+   break;
case 'nl_desc':
-   $ret['width'] = '50%';
+   $ret['width'] = '40%';
+   break;
+   case 'subscriber_count':
+   $ret['width'] = '5%';
break;
case 'action':
-   $ret['width'] = '25%';
+   $ret['width'] = '20%';
break;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1da3277315b0dc7492aa3ede74bde65404118e9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Glaisher 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Start with context dependent semantics - change (mediawiki...MathSearch)

2015-12-02 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Start with context dependent semantics
..

Start with context dependent semantics

Change-Id: I99fcb35b895a81d3ea737dff761b9c8d63f727dc
---
M includes/MlpEvalForm.php
M includes/WikidataDriver.php
M includes/special/SpecialMlpEval.php
3 files changed, 69 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/55/256455/1

diff --git a/includes/MlpEvalForm.php b/includes/MlpEvalForm.php
index d549ac6..24e0d14 100644
--- a/includes/MlpEvalForm.php
+++ b/includes/MlpEvalForm.php
@@ -99,6 +99,27 @@
);
break;
case SpecialMlpEval::STEP_DEFINITIONS:
+   foreach ( $this->specialPage->getIdentifiers() 
as $key => $id ) {
+   $options =array();
+   // $rendered = 
MathRenderer::renderMath( $id, array(), 'mathml' );
+   $rels = 
$this->specialPage->getRelations( $id );
+   foreach ( $rels as $rel ){
+   $options[$rel] = $rel;
+   }
+   $options['other'] = 'other';
+   if ( count( $rels ) ) {
+   $formDescriptor["6-id-$key"] = 
array(
+   'label' => 
"Select definitions for $id",
+   'type'  => 
'multiselect',
+   'options'   => 
$options,
+   // 'raw' => true
+   );
+   }
+   $formDescriptor["6-id-$key-other"] = 
array(
+   'label' => "Other for 
$id",
+   'type'  => 'text'
+   );
+   }
break;
}
$formDescriptor['submit-info'] = array(
diff --git a/includes/WikidataDriver.php b/includes/WikidataDriver.php
index d61bfa4..75f1a5e 100644
--- a/includes/WikidataDriver.php
+++ b/includes/WikidataDriver.php
@@ -21,7 +21,7 @@
$request = array(
'method' => 'GET',
'url'=> $this->getBackendUrl() .
-   
"/w/api.php?format=json=wbsearchentities={$this->lang}={$term}"
+   
"/w/api.php?format=json=wbsearchentities={$this->lang}={$this->lang}={$term}"
);
$serviceClient = new VirtualRESTServiceClient( new 
MultiHttpClient( array() ) );
$response = $serviceClient->run( $request );
diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index 29e0f89..d0f859b 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -36,6 +36,7 @@
private $revision;
private $texInputChanged = false;
private $identifiers = array();
+   private $relations;
 
/**
 * @return boolean
@@ -91,6 +92,14 @@
return $this->resetFormula();
case MlpEvalForm::OPT_CONTINUE:
$this->writeLog( "pgRst: User 
selects formula $fId" );
+   }
+   }
+   if ( $req->getArray('wp5-identifiers') ){
+   $this->identifiers = $req->getArray('wp5-identifiers');
+   $missing = $req->getText('wp5-missing') ;
+   if ( $missing ){
+   //TODO: Check for invalid TeX
+   $this->identifiers = array_merge( 
$this->identifiers, preg_split('/[\n\r]/', $missing ) );
}
}
return $this->setStep( $req->getInt( 'oldStep' ) + 1 );
@@ -242,14 +251,7 @@
case self::STEP_PAGE:
break;
case self::STEP_FORMULA:
-   $hl = new MathHighlighter( $this->fId, 
$this->oldId );
-   $out->addHtml(
-   ''
-   );
-   $this->printFormula();
-   $out->addHtml( 

[MediaWiki-commits] [Gerrit] Add missing uselang part for wikidata item search - change (mediawiki...MathSearch)

2015-12-02 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Add missing uselang part for wikidata item search
..

Add missing uselang part for wikidata item search

Change-Id: Id2cbadef152c731270a5347d33d02b04e066887a
---
M includes/WikidataDriver.php
M includes/special/SpecialMlpEval.php
2 files changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/56/256456/1

diff --git a/includes/WikidataDriver.php b/includes/WikidataDriver.php
index 75f1a5e..234f293 100644
--- a/includes/WikidataDriver.php
+++ b/includes/WikidataDriver.php
@@ -21,7 +21,8 @@
$request = array(
'method' => 'GET',
'url'=> $this->getBackendUrl() .
-   
"/w/api.php?format=json=wbsearchentities={$this->lang}={$this->lang}={$term}"
+   
"/w/api.php?format=json=wbsearchentities={$this->lang}".
+   "={$this->lang}={$term}"
);
$serviceClient = new VirtualRESTServiceClient( new 
MultiHttpClient( array() ) );
$response = $serviceClient->run( $request );
diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index d0f859b..3ef0fa6 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -94,12 +94,12 @@
$this->writeLog( "pgRst: User 
selects formula $fId" );
}
}
-   if ( $req->getArray('wp5-identifiers') ){
-   $this->identifiers = $req->getArray('wp5-identifiers');
-   $missing = $req->getText('wp5-missing') ;
+   if ( $req->getArray( 'wp5-identifiers' ) ){
+   $this->identifiers = $req->getArray( 'wp5-identifiers' 
);
+   $missing = $req->getText( 'wp5-missing' );
if ( $missing ){
-   //TODO: Check for invalid TeX
-   $this->identifiers = array_merge( 
$this->identifiers, preg_split('/[\n\r]/', $missing ) );
+   // TODO: Check for invalid TeX
+   $this->identifiers = array_merge( 
$this->identifiers, preg_split( '/[\n\r]/', $missing ) );
}
}
return $this->setStep( $req->getInt( 'oldStep' ) + 1 );
@@ -251,7 +251,7 @@
case self::STEP_PAGE:
break;
case self::STEP_FORMULA:
-   $this->printMathObjectInContext(  );
+   $this->printMathObjectInContext();
 
break;
case self::STEP_TEX:
@@ -291,7 +291,7 @@
$rels =  $mo->getRelations();
foreach ( $this->identifiers as $i ){
$this->relations[$i] = array();
-   if ( isset($rels[$i]) ){
+   if ( isset( $rels[$i] ) ){
foreach ( $rels[$i] as $rel ){
$this->relations[$i][] 
= $rel->definition;
}
@@ -401,7 +401,7 @@
/**
 * @throws MWException
 */
-   private function printMathObjectInContext(  ) {
+   private function printMathObjectInContext() {
$out = $this->getOutput();
$hl = new MathHighlighter( $this->fId, $this->oldId );
$out->addHtml(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2cbadef152c731270a5347d33d02b04e066887a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt 

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


[MediaWiki-commits] [Gerrit] Consolidate some of the photo handling - change (mediawiki...UploadWizard)

2015-12-02 Thread MarkTraceur (Code Review)
MarkTraceur has uploaded a new change for review.

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

Change subject: Consolidate some of the photo handling
..

Consolidate some of the photo handling

And more common sense changes too.

Change-Id: I06dbb018b3d6e12364151719d60e6f49cda5caf7
---
M resources/mw.FlickrChecker.js
1 file changed, 146 insertions(+), 122 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/64/256464/1

diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js
index a893a70..23a80c7 100644
--- a/resources/mw.FlickrChecker.js
+++ b/resources/mw.FlickrChecker.js
@@ -119,13 +119,17 @@
 * Usually the filename is just the Flickr title plus an 
extension, but in case of name conflicts
 * or empty title a unique filename is generated.
 *
-* @param {string} title image title on Flickr
+* @param {string} title image title on Flickr - sometimes they 
give us an object instead of a string, this method handles that
 * @param {number} id image id on Flickr
 * @param {string} ownername owner name on Flickr
 * @return {string}
 */
getFilenameFromItem: function ( title, id, ownername ) {
var fileName;
+
+   if ( title && title._content ) {
+   title = title._content;
+   }
 
if ( title === '' ) {
fileName = ownername + ' - ' + id + '.jpg';
@@ -372,29 +376,12 @@
// would be better to use isBlacklisted(), but didn't 
find a nice way of combining it with $.each
return $.when( flickrPromise, this.getBlacklist() 
).then( function ( photoset, blacklist ) {
var fileName, sourceURL,
+   promises = [],
imagesHTML = '',
x = 0;
 
$.each( photoset.photo, function ( i, item ) {
-   var flickrUpload, license, 
licenseValue, ownerId;
-
-   license = checker.checkLicense( 
item.license, i );
-   licenseValue = license.licenseValue;
-   if ( licenseValue === 'invalid' ) {
-   return;
-   }
-
-   if ( mode === 'photoset' ) {
-   ownerId = photoset.owner;
-   sourceURL = 
'http://www.flickr.com/photos/' + photoset.owner + '/' + item.id + '/';
-   } else if ( mode === 'photos' ) {
-   ownerId = item.owner;
-   sourceURL = 
'http://www.flickr.com/photos/' + item.owner + '/' + item.id + '/';
-   }
-
-   if ( ownerId in blacklist || 
item.pathalias in blacklist ) {
-   return;
-   }
+   var flickrUpload, license, licenseValue;
 
// Limit to maximum of 500 valid images
// (Flickr's API returns a maximum of 
500 images anyway.)
@@ -402,77 +389,75 @@
return false;
}
 
-   fileName = checker.getFilenameFromItem( 
item.title, item.id, item.ownername );
-
-   flickrUpload = {
-   name: fileName,
-   url: '',
-   type: 'JPEG',
-   fromURL: true,
-   licenseValue: licenseValue,
-   licenseMessage: 
license.licenseMessage,
-   license: license.licenseName 
!== 'Public Domain Mark',
-   photoId: item.id,
-   location: {
-   latitude: item.latitude,
-   longitude: 
item.longitude
-   },
-   author: item.ownername,
- 

[MediaWiki-commits] [Gerrit] Fixing namespace - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Fixing namespace
..

Fixing namespace

Change-Id: If826b7d22ac19b3906288292987a45911b2e85ee
---
M manifests/config.pp
1 file changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/manifests/config.pp b/manifests/config.pp
index 602dc1d..9d3ec46 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -91,19 +91,19 @@
 mode=> '0750',
 require => File['/etc/mysql']
 }
-mariadb::ssl_key { 'cacert':
+ssl_key { 'cacert':
 filename => 'cacert.pem',
 }
-mariadb::ssl_key { 'server-key':
+ssl_key { 'server-key':
 filename => 'server-key.pem',
 }
-mariadb::ssl_key { 'server-cert':
+ssl_key { 'server-cert':
 filename => 'server-cert.pem',
 }
-mariadb::ssl_key { 'client-key':
+ssl_key { 'client-key':
 filename => 'client-key.pem',
 }
-mariadb::ssl_key { 'client-cert':
+ssl_key { 'client-cert':
 filename => 'client-cert.pem',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If826b7d22ac19b3906288292987a45911b2e85ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 

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


[MediaWiki-commits] [Gerrit] [WIP] Script to remove topics before a certain date - change (mediawiki...Flow)

2015-12-02 Thread Matthias Mullie (Code Review)
Matthias Mullie has uploaded a new change for review.

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

Change subject: [WIP] Script to remove topics before a certain date
..

[WIP] Script to remove topics before a certain date

Change-Id: I593aac084939ef7317ac91ad932da2c23d463ad7
---
M includes/Repository/TreeRepository.php
A maintenance/FlowRemoveOldTopics.php
2 files changed, 174 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/49/256449/1

diff --git a/includes/Repository/TreeRepository.php 
b/includes/Repository/TreeRepository.php
index 41786c5..f605486 100644
--- a/includes/Repository/TreeRepository.php
+++ b/includes/Repository/TreeRepository.php
@@ -377,7 +377,7 @@
throw new DataModelException( 'No root exists in the 
identityMap', 'process-data' );
}
 
-   return $identityMap[$root];
+   return $identityMap[$root->getAlphadecimal()];
}
 
public function fetchFullTree( UUID $nodeId ) {
diff --git a/maintenance/FlowRemoveOldTopics.php 
b/maintenance/FlowRemoveOldTopics.php
new file mode 100644
index 000..226ca02
--- /dev/null
+++ b/maintenance/FlowRemoveOldTopics.php
@@ -0,0 +1,173 @@
+mDescription = "Deletes old topics";
+
+   $this->addOption( 'date', 'Date cutoff (in any format 
understood by wfTimestamp), topics older than this date will be deleted.', 
true, true );
+
+   $this->setBatchSize( 10 );
+   }
+
+   public function execute() {
+   $this->storage = Container::get( 'storage' );
+   $this->treeRepo = Container::get( 'repository.tree' );
+   $this->dbFactory = Container::get( 'db.factory' );
+
+   $timestamp = wfTimestamp( TS_MW, $this->getOption( 'date' ) );
+   $this->removeWorkflows( $timestamp );
+   $this->removeHeader( $timestamp );
+   // @todo: output how many were removed?
+   }
+
+   protected function removeHeader( $timestamp ) {
+   // @todo: do I actually want to remove header? what if it's 
been updated since?
+   // @todo: remove references
+   }
+
+   /**
+* @param string $timestamp Timestamp in TS_MW format
+* @throws \Flow\Exception\FlowException
+*/
+   protected function removeWorkflows( $timestamp ) {
+   $dbr = $this->dbFactory->getDB( DB_SLAVE );
+
+   // start from around unix epoch - there can be no Flow data 
before that
+   $startId = UUID::getComparisonUUID( '1' );
+   do {
+   $workflows = $this->storage->find(
+   'Workflow',
+   array(
+   new RawSql( 'workflow_id > ' . 
$dbr->addQuotes( $startId->getBinary() ) ),
+   'workflow_wiki' => wfWikiId(),
+   'workflow_type' => 'topic',
+   new RawSql( 
'workflow_last_update_timestamp < ' . $dbr->addQuotes( $timestamp ) ),
+   ),
+   array( 'limit' => $this->mBatchSize )
+   );
+
+   if ( empty( $workflows ) ) {
+   break;
+   }
+
+   // prepare for next batch
+   $startId = end( $workflows )->getId();
+
+   // @todo: remove everything else!
+   foreach ( $workflows as $workflow ) {
+   $this->removeTopicList( $workflow );
+   $this->removeSummary( $workflow );
+   $this->removePosts( $workflow );
+   }
+
+   var_dump( count( $workflows ) . ' workflows' );
+// $storage->multiRemove( $workflows ); // @todo
+
+   $this->dbFactory->waitForSlaves();
+   } while ( !empty( $workflows ) );
+   }
+
+   protected function removeTopicList( Workflow $workflow ) {
+   $entries = $this->storage->find( 'TopicListEntry', array( 
'topic_id' => $workflow->getId() ) );
+   if ( $entries ) {
+   var_dump( count( $entries ) . ' topiclist entries' );
+// $this->storage->multiRemove( $entries ); // @todo
+   }
+   }
+
+   protected function removeSummary( Workflow $workflow ) {
+   $revisions = $this->storage->find( 'PostSummary', array( 
'rev_type_id' => $workflow->getId() ) );
+   if ( $revisions ) {
+   foreach ( $revisions as $revision ) {
+   $this->removeReferences( $revision );
+   }
+
+ 

[MediaWiki-commits] [Gerrit] Clear all tabs when clearing history. - change (apps...wikipedia)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Clear all tabs when clearing history.
..


Clear all tabs when clearing history.

When pressing the Delete button in the History fragment, we now also clear
the tab list by simply deleting the corresponding Preference that contains
the serialized tabs, and reinitialize the fragment backstack in the main
activity.

Bug: T117371
Change-Id: Ic0753214ba1dae2cb0f99a94cd0affd514b06f17
---
M app/src/main/java/org/wikipedia/history/HistoryFragment.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
M app/src/main/java/org/wikipedia/settings/Prefs.java
M app/src/main/res/values-qq/strings.xml
M app/src/main/res/values/strings.xml
5 files changed, 34 insertions(+), 19 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/history/HistoryFragment.java 
b/app/src/main/java/org/wikipedia/history/HistoryFragment.java
index 3a20f62..7cb01c5 100644
--- a/app/src/main/java/org/wikipedia/history/HistoryFragment.java
+++ b/app/src/main/java/org/wikipedia/history/HistoryFragment.java
@@ -322,24 +322,24 @@
 public boolean onOptionsItemSelected(MenuItem item) {
 switch (item.getItemId()) {
 case R.id.menu_clear_all_history:
-AlertDialog.Builder builder = new 
AlertDialog.Builder(getActivity());
-builder.setMessage(R.string.dialog_title_clear_history);
-builder.setPositiveButton(R.string.yes, new 
DialogInterface.OnClickListener() {
-@Override
-public void onClick(DialogInterface dialog, int which) {
-// Clear history!
-new DeleteAllHistoryTask(app).execute();
-entryFilter.setVisibility(View.GONE);
-}
-});
-
-builder.setNegativeButton(R.string.no, new 
DialogInterface.OnClickListener() {
-@Override
-public void onClick(DialogInterface dialog, int which) {
-// Uh, do nothing?
-}
-});
-builder.create().show();
+new AlertDialog.Builder(getActivity())
+.setTitle(R.string.dialog_title_clear_history)
+.setMessage(R.string.dialog_message_clear_history)
+.setPositiveButton(R.string.yes, new 
DialogInterface.OnClickListener() {
+@Override
+public void onClick(DialogInterface dialog, int 
which) {
+// Clear history!
+new DeleteAllHistoryTask(app).execute();
+entryFilter.setVisibility(View.GONE);
+((PageActivity) 
getActivity()).resetAfterClearHistory();
+}
+})
+.setNegativeButton(R.string.no, new 
DialogInterface.OnClickListener() {
+@Override
+public void onClick(DialogInterface dialog, int 
which) {
+// Uh, do nothing?
+}
+}).create().show();
 return true;
 default:
 return super.onOptionsItemSelected(item);
diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index e116c13..5697691 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -22,6 +22,7 @@
 import org.wikipedia.recurring.RecurringTasksExecutor;
 import org.wikipedia.search.SearchArticlesFragment;
 import org.wikipedia.search.SearchBarHideHandler;
+import org.wikipedia.settings.Prefs;
 import org.wikipedia.settings.SettingsActivity;
 import org.wikipedia.staticdata.MainPageNameData;
 import org.wikipedia.theme.ThemeChooserDialog;
@@ -56,6 +57,7 @@
 import android.support.design.widget.NavigationView;
 import android.support.v4.app.DialogFragment;
 import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v4.view.GravityCompat;
 import android.support.v4.widget.DrawerLayout;
@@ -578,6 +580,13 @@
 updateProgressBar(false, true, 0);
 }
 
+public void resetAfterClearHistory() {
+// remove all current fragments from the backstack
+getSupportFragmentManager().popBackStackImmediate(null, 
FragmentManager.POP_BACK_STACK_INCLUSIVE);
+Prefs.clearTabs();
+displayMainPageIfNoTabs();
+}
+
 /**
  * Load a new page, and put it on top of the backstack.
  * @param title Title of 

[MediaWiki-commits] [Gerrit] Remove option to pass in wikiConfig when constructing env - change (mediawiki...parsoid)

2015-12-02 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Remove option to pass in wikiConfig when constructing env
..

Remove option to pass in wikiConfig when constructing env

 * This isn't ever used.

Change-Id: I44518b69b2b32c8d0cbb8e327dddcec491b74338
---
M bin/parse.js
M bin/parserTests.js
M bin/roundtrip-test.js
M lib/api/routes.js
M lib/config/MWParserEnvironment.js
M tests/mocha/test.helpers.js
M tools/fetch-wt.js
7 files changed, 17 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/50/256450/1

diff --git a/bin/parse.js b/bin/parse.js
index 29348f7..e8478d0 100755
--- a/bin/parse.js
+++ b/bin/parse.js
@@ -199,7 +199,7 @@
 };
 
 var parse = exports.parse = function(input, argv, parsoidConfig, prefix, 
domain) {
-   return ParserEnv.getParserEnv(parsoidConfig, null, {
+   return ParserEnv.getParserEnv(parsoidConfig, {
prefix: prefix,
domain: domain,
pageName: argv.page,
diff --git a/bin/parserTests.js b/bin/parserTests.js
index 9c67b9f..e2fef59 100755
--- a/bin/parserTests.js
+++ b/bin/parserTests.js
@@ -1686,7 +1686,7 @@
var parsoidConfig = new ParsoidConfig({ setup: setup }, options);
 
// Create a new parser environment
-   MWParserEnvironment.getParserEnv(parsoidConfig, null, { prefix: 
'enwiki' },
+   MWParserEnvironment.getParserEnv(parsoidConfig, { prefix: 'enwiki' },
function(err, env) {
// For posterity: err will never be non-null here, because we 
expect
// the WikiConfig to be basically empty, since the parserTests
diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js
index c32e14a..3edfc16 100755
--- a/bin/roundtrip-test.js
+++ b/bin/roundtrip-test.js
@@ -566,7 +566,7 @@
var data = {};
return Promise[err ? 'reject' : 'resolve'](err).then(function() {
return MWParserEnvironment.getParserEnv(
-   parsoidConfig, null, { prefix: prefix, pageName: title }
+   parsoidConfig, { prefix: prefix, pageName: title }
);
}).then(function(_env) {
env = _env;
diff --git a/lib/api/routes.js b/lib/api/routes.js
index b210d1c..e528748 100644
--- a/lib/api/routes.js
+++ b/lib/api/routes.js
@@ -138,7 +138,7 @@
cookie: req.headers.cookie,
reqId: req.headers['x-request-id'],
};
-   MWParserEnv.getParserEnv(parsoidConfig, null, 
options).then(function(env) {
+   MWParserEnv.getParserEnv(parsoidConfig, 
options).then(function(env) {
env.logger.registerBackend(/fatal(\/.*)?/, 
errBack.bind(this, env));
if (env.conf.parsoid.allowCORS) {
// Allow cross-domain requests (CORS) so that 
parsoid service
diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index e06c94d..493628c 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -22,9 +22,8 @@
  *
  * @constructor
  * @param {ParsoidConfig|null} parsoidConfig
- * @param {WikiConfig|null} wikiConfig
  */
-var MWParserEnvironment = function(parsoidConfig, wikiConfig, options) {
+var MWParserEnvironment = function(parsoidConfig, options) {
options = options || {};
 
// page information
@@ -75,17 +74,13 @@
 
this.configureLogging();
 
-   if (!wikiConfig) {
-   // Local things, per-wiki
-   console.assert(parsoidConfig.mwApiMap.has(options.prefix));
-   wikiConfig = new WikiConfig(
-   this, null, options.prefix,
-   parsoidConfig.mwApiMap.get(options.prefix).uri,
-   this.getAPIProxy(options.prefix)
-   );
-   }
-
-   this.conf.wiki = wikiConfig;
+   // Local things, per-wiki
+   console.assert(parsoidConfig.mwApiMap.has(options.prefix));
+   this.conf.wiki = new WikiConfig(
+   this, null, options.prefix,
+   parsoidConfig.mwApiMap.get(options.prefix).uri,
+   this.getAPIProxy(options.prefix)
+   );
 
this.initializeForPageName(options.pageName || this.defaultPageName);
 
@@ -239,14 +234,13 @@
  *
  * @method
  * @param {ParsoidConfig|null} parsoidConfig
- * @param {WikiConfig|null} wikiConfig
  * @param {Object} options
  * @param {Function} cb
  * @param {Error} cb.err
  * @param {MWParserEnvironment} cb.env The finished environment object
  * @static
  */
-MWParserEnvironment.getParserEnv = function(parsoidConfig, wikiConfig, 
options, cb) {
+MWParserEnvironment.getParserEnv = function(parsoidConfig, options, cb) {
// Get that wiki's config
return Promise.method(function() {

[MediaWiki-commits] [Gerrit] Fixing resource type error - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Fixing resource type error
..

Fixing resource type error

Change-Id: Iac3c9b9cd84f8257186a6ad4d61ef17c0eeb4648
---
M manifests/config.pp
M manifests/ssl_key.pp
2 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/mariadb 
refs/changes/58/256458/1

diff --git a/manifests/config.pp b/manifests/config.pp
index bef17ae..602dc1d 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -92,19 +92,19 @@
 require => File['/etc/mysql']
 }
 mariadb::ssl_key { 'cacert':
-file => 'cacert.pem',
+filename => 'cacert.pem',
 }
 mariadb::ssl_key { 'server-key':
-file => 'server-key.pem',
+filename => 'server-key.pem',
 }
 mariadb::ssl_key { 'server-cert':
-file => 'server-cert.pem',
+filename => 'server-cert.pem',
 }
 mariadb::ssl_key { 'client-key':
-file => 'client-key.pem',
+filename => 'client-key.pem',
 }
 mariadb::ssl_key { 'client-cert':
-file => 'client-cert.pem',
+filename => 'client-cert.pem',
 }
 }
 }
diff --git a/manifests/ssl_key.pp b/manifests/ssl_key.pp
index e378617..bbfa238 100644
--- a/manifests/ssl_key.pp
+++ b/manifests/ssl_key.pp
@@ -1,12 +1,12 @@
-class mariadb::ssl_key ($file) {
-file { "/etc/mysql/ssl/${file}":
+class mariadb::ssl_key ($filename) {
+file { "/etc/mysql/ssl/${filename}":
 ensure=> file,
 owner => 'root',
 group => 'mysql',
 mode  => '0440',
 show_diff => false,
 backup=> false,
-content   => secret("mysql/${file}"),
+content   => secret("mysql/${filename}"),
 require   => File['/etc/mysql/ssl'],
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac3c9b9cd84f8257186a6ad4d61ef17c0eeb4648
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 

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


[MediaWiki-commits] [Gerrit] Set the image Property id in configurations - change (mediawiki...ArticlePlaceholder)

2015-12-02 Thread Lucie Kaffee (Code Review)
Lucie Kaffee has uploaded a new change for review.

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

Change subject: Set the image Property id in configurations
..

Set the image Property id in configurations

Bug: T113957
Change-Id: I9ffb0ea1851a9a3c9a798ae83ce3ff7c3a616ad5
---
M ArticlePlaceholder.php
M Specials/SpecialAboutTopic.php
M includes/Hooks.php
A includes/Lua/Scribunto_LuaArticlePlaceholderLibrary.php
4 files changed, 80 insertions(+), 11 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/39/256439/1

diff --git a/ArticlePlaceholder.php b/ArticlePlaceholder.php
index 3d156ad..e2ea0e1 100644
--- a/ArticlePlaceholder.php
+++ b/ArticlePlaceholder.php
@@ -22,11 +22,15 @@
 
 $wgAutoloadClasses['ArticlePlaceholder\Specials\SpecialAboutTopic']
= __DIR__ . '/Specials/SpecialAboutTopic.php';
+$wgAutoloadClasses['ArticlePlaceholder\Lua\Scribunto_LuaArticlePlaceholderLibrary']
+   = __DIR__ . '/includes/Lua/Scribunto_LuaArticlePlaceholderLibrary.php';
 $wgAutoloadClasses['ArticlePlaceholder\Hooks'] = __DIR__ . 
'/includes/Hooks.php';
 $wgAutoloadClasses['ArticlePlaceholder\SearchHookHandler']
= __DIR__ . '/includes/SearchHookHandler.php';
 
-$wgHooks['ScribuntoExternalLibraryPaths'][]
+$wgHooks['ScribuntoExternalLibraries'][]
+   = '\ArticlePlaceholder\Hooks::onScribuntoExternalLibraries';
+$wgHooks['ScribuntoExternalLibraryPath'][]
= '\ArticlePlaceholder\Hooks::registerScribuntoExternalLibraryPaths';
 $wgHooks['SpecialSearchResultsAppend'][]
= '\ArticlePlaceholder\SearchHookHandler::onSpecialSearchResultsAppend';
diff --git a/Specials/SpecialAboutTopic.php b/Specials/SpecialAboutTopic.php
index b0c5169..dc342b6 100644
--- a/Specials/SpecialAboutTopic.php
+++ b/Specials/SpecialAboutTopic.php
@@ -325,9 +325,6 @@
 
if ( isset( $sitelinksTitles[0][1] ) ) {
$sitelinkTitle = $sitelinkTitles[0][1];
-   }
-
-   if ( $sitelinkTitle !== null ) {
return $this->titleFactory->newFromText( $sitelinkTitle 
)->getLinkURL();
}
 
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 3874699..55ffc3d 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -18,17 +18,31 @@
 *
 * @return bool
 */
+   public static function onScribuntoExternalLibraries(
+   $engine,
+   array &$extraLibraries
+   ) {
+   if ( $engine == 'lua' ) {
+   $extraLibraries['EntityRenderer'] = 
'ArticlePlaceholder\Lua\Scribunto_LuaArticlePlaceholderLibrary';
+   }
+   return true;
+   }
+
+   /**
+* External Lua library paths for Scribunto
+*
+* @param string $engine
+* @param array &$extraLibraryPaths
+*
+* @return bool
+*/
public static function registerScribuntoExternalLibraryPaths(
$engine,
-   array &$extraLibraryPaths
+   array &$extraLibraryPath
) {
-   if ( $engine !== 'lua' ) {
-   return true;
+   if ( $engine == 'lua' ) {
+   $extraLibraryPath[] = __DIR__ . '/Lua';
}
-
-   // Path containing pure Lua libraries that don't need to 
interact with PHP
-   $extraLibraryPaths[] = __DIR__ . '/Lua';
-
return true;
}
 
diff --git a/includes/Lua/Scribunto_LuaArticlePlaceholderLibrary.php 
b/includes/Lua/Scribunto_LuaArticlePlaceholderLibrary.php
new file mode 100644
index 000..d24b505
--- /dev/null
+++ b/includes/Lua/Scribunto_LuaArticlePlaceholderLibrary.php
@@ -0,0 +1,54 @@
+ array( $this, 'getImageProperty' 
),
+   );
+
+   return $this->getEngine()->registerInterface(
+   __DIR__ . '/EntityRenderer.lua', $lib, array()
+   );
+   }
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ffb0ea1851a9a3c9a798ae83ce3ff7c3a616ad5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Lucie Kaffee 

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


[MediaWiki-commits] [Gerrit] Fixup MW for HHVM Repo Authorative mode - change (mediawiki/core)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fixup MW for HHVM Repo Authorative mode
..


Fixup MW for HHVM Repo Authorative mode

https://github.com/facebook/hhvm/issues/5834
https://github.com/facebook/hhvm/issues/5833

Change-Id: I138ffa5df874c5660897dc7feab36adef9f32aea
---
M RELEASE-NOTES-1.26
M includes/debug/logger/LoggerFactory.php
2 files changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26
index 19c44b6..5e3420b 100644
--- a/RELEASE-NOTES-1.26
+++ b/RELEASE-NOTES-1.26
@@ -8,6 +8,7 @@
 === Changes since 1.26 ===
 * Fixed ConfigException in ExpandTemplates due to AlwaysUseTidy.
 * Fixed stray literal \n in Special:Search.
+* Fix issue that breaks HHVM Repo Authorative mode.
 
 == MediaWiki 1.26 ==
 
diff --git a/includes/debug/logger/LoggerFactory.php 
b/includes/debug/logger/LoggerFactory.php
index 0b6965f..1e44b70 100644
--- a/includes/debug/logger/LoggerFactory.php
+++ b/includes/debug/logger/LoggerFactory.php
@@ -94,7 +94,7 @@
 * @return \\Psr\\Log\\LoggerInterface
 */
public static function getInstance( $channel ) {
-   if ( !interface_exists( '\Psr\Log\LoggerInterface' ) ) {
+   if ( !interface_exists( 'Psr\Log\LoggerInterface' ) ) {
$message = (
'MediaWiki requires the https://github.com/php-fig/log;>PSR-3 logging ' .
"library to be present. This library is not 
embedded directly in MediaWiki's " .

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I138ffa5df874c5660897dc7feab36adef9f32aea
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_26
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] Improve FlickrChecker docs, use promises - change (mediawiki...UploadWizard)

2015-12-02 Thread MarkTraceur (Code Review)
MarkTraceur has uploaded a new change for review.

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

Change subject: Improve FlickrChecker docs, use promises
..

Improve FlickrChecker docs, use promises

Promises are not used, but are now returned from the relevant getter
functions (getPhotos, getPhoto, and their ilk).

Change-Id: I4a2bb4254fe036140c0a06007aa4fd492f08a713
---
M resources/mw.FlickrChecker.js
1 file changed, 62 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/47/256447/1

diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js
index a4276bb..6475794 100644
--- a/resources/mw.FlickrChecker.js
+++ b/resources/mw.FlickrChecker.js
@@ -165,23 +165,25 @@
 
/*
 * Retrieves a list of photos in photostream and displays it.
+* @see {@link getPhotos}
 * @param {string} mode may be: 'favorites' - user's favorites 
are retrieved,
 * or 'stream' - user's photostream is retrieved
-* @see {@link getPhotos}
+* @param {string} url URL to get the user from.
+* @return {jQuery.Promise}
 */
-   getPhotostream: function ( mode ) {
-   var that = this;
-   this.flickrRequest( {
+   getPhotostream: function ( mode, url ) {
+   var checker = this;
+   return this.flickrRequest( {
method: 'flickr.urls.lookupUser',
-   url: this.url
-   } ).done( function ( data ) {
+   url: url
+   } ).then( function ( data ) {
var method;
if ( mode === 'stream' ) {
method = 
'flickr.people.getPublicPhotos';
} else if ( mode === 'favorites' ) {
method = 
'flickr.favorites.getPublicList';
}
-   that.getPhotos( 'photos', {
+   return checker.getPhotos( 'photos', {
method: method,
user_id: data.user.id
} );
@@ -191,33 +193,37 @@
/**
 * Retrieves a list of photos in group pool and displays it.
 *
-* @param {Object} groupPoolMatches Result of `this.url.match`
+* @param {Object} groupPoolMatches Groups in the input URL
+* @param {string} url The URL from which to get the group.
 * @see {@link getPhotos}
+* @return {jQuery.Promise}
 */
-   getGroupPool: function ( groupPoolMatches ) {
-   var that = this;
-   this.flickrRequest( {
+   getGroupPool: function ( groupPoolMatches, url ) {
+   var checker = this;
+
+   return this.flickrRequest( {
method: 'flickr.urls.lookupGroup',
-   url: this.url
-   } ).done( function ( data ) {
+   url: url
+   } ).then( function ( data ) {
var gid = data.group.id;
+
if ( groupPoolMatches[ 1 ] ) { // URL contains 
a user ID
-   that.flickrRequest( {
+   return checker.flickrRequest( {
method: 
'flickr.urls.lookupUser',
url: 
'http://www.flickr.com/photos/' + groupPoolMatches[ 1 ]
-   } ).done( function ( data ) {
-   that.getPhotos( 'photos', {
+   } ).then( function ( data ) {
+   return checker.getPhotos( 
'photos', {
method: 
'flickr.groups.pools.getPhotos',
group_id: gid,
user_id: data.user.id
} );
} );
-   } else {
-   that.getPhotos( 'photos', {
-   method: 
'flickr.groups.pools.getPhotos',
-   group_id: gid
-   } );
   

[MediaWiki-commits] [Gerrit] Add support for batch production in eventlogging-service - change (eventlogging)

2015-12-02 Thread Nuria (Code Review)
Nuria has uploaded a new change for review.

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

Change subject: Add support for batch production in eventlogging-service
..

Add support for batch production in eventlogging-service

Reponses:
- 201 if all events are accepted.
- 207 if some but not all events are accepted.
- 400 if no events are accepted.

In case of any errored events, those events will be in the response
body as a list of EventError objects.

Change-Id: Ifdde80e68832d5b3c34ba4ebefbb9e56ff601feb
---
M bin/eventlogging-consumer
M bin/eventlogging-devserver
M bin/eventlogging-forwarder
M bin/eventlogging-multiplexer
M bin/eventlogging-processor
M bin/eventlogging-reporter
M bin/eventlogging-service
M eventlogging/schema.py
M eventlogging/service.py
M tests/test_service.py
10 files changed, 221 insertions(+), 62 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/eventlogging 
refs/changes/52/256452/1

diff --git a/bin/eventlogging-consumer b/bin/eventlogging-consumer
index c0b8f50..cb9a9a6 100755
--- a/bin/eventlogging-consumer
+++ b/bin/eventlogging-consumer
@@ -23,7 +23,7 @@
 from __future__ import unicode_literals
 
 import sys
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 
 import argparse
diff --git a/bin/eventlogging-devserver b/bin/eventlogging-devserver
index 48d57e5..ba7e7b6 100755
--- a/bin/eventlogging-devserver
+++ b/bin/eventlogging-devserver
@@ -33,7 +33,7 @@
 from __future__ import print_function, unicode_literals
 
 import sys
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 
 import argparse
diff --git a/bin/eventlogging-forwarder b/bin/eventlogging-forwarder
index cb9cdfe..86206ad 100755
--- a/bin/eventlogging-forwarder
+++ b/bin/eventlogging-forwarder
@@ -26,7 +26,7 @@
 from __future__ import unicode_literals
 
 import sys
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 
 import argparse
diff --git a/bin/eventlogging-multiplexer b/bin/eventlogging-multiplexer
index f0d225d..a736712 100755
--- a/bin/eventlogging-multiplexer
+++ b/bin/eventlogging-multiplexer
@@ -24,7 +24,7 @@
 from __future__ import unicode_literals
 
 import sys
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 
 import argparse
diff --git a/bin/eventlogging-processor b/bin/eventlogging-processor
index be6f901..d6d6b8c 100755
--- a/bin/eventlogging-processor
+++ b/bin/eventlogging-processor
@@ -32,7 +32,7 @@
 from __future__ import unicode_literals
 
 import sys
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 
 import argparse
diff --git a/bin/eventlogging-reporter b/bin/eventlogging-reporter
index 644a50d..ccff01c 100755
--- a/bin/eventlogging-reporter
+++ b/bin/eventlogging-reporter
@@ -13,7 +13,7 @@
 
 """
 import sys
-reload(sys)
+reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 
 import argparse
@@ -167,4 +167,4 @@
 
 
 if __name__ == '__main__':
-print monitor_pubs(iter_pubs('/etc/eventlogging.d/processors'))
+print(monitor_pubs(iter_pubs('/etc/eventlogging.d/processors')))
diff --git a/bin/eventlogging-service b/bin/eventlogging-service
index bd688c0..b12a0da 100755
--- a/bin/eventlogging-service
+++ b/bin/eventlogging-service
@@ -53,6 +53,13 @@
 'processes as there are cores.  Default 1.',
 )
 
+ap.add_argument(
+'--error-output',
+default=None,
+help='URI of output stream for errored events. '
+'Errored events are written using the EventError schema.'
+)
+
 ap.add_argument('output', nargs='+', help='URIs of output streams.')
 
 
@@ -82,7 +89,8 @@
 )
 
 service = EventLoggingService(
-args.output
+args.output,
+args.error_output
 )
 
 # Start listening for requests.
diff --git a/eventlogging/schema.py b/eventlogging/schema.py
index 8636c9a..62cc04f 100644
--- a/eventlogging/schema.py
+++ b/eventlogging/schema.py
@@ -73,6 +73,7 @@
 # SCID of the metadata object which wraps each capsule-style event.
 CAPSULE_SCID = ('EventCapsule', 10981547)
 
+# TODO: Make new meta style EventError on meta.
 ERROR_SCID = ('EventError', 14035058)
 
 # Schemas retrieved via HTTP or files are cached in this dictionary.
diff --git a/eventlogging/service.py b/eventlogging/service.py
index d54dfd4..d2a4d8e 100644
--- a/eventlogging/service.py
+++ b/eventlogging/service.py
@@ -21,7 +21,10 @@
 from . import ValidationError, SchemaError  # these are int __init__.py
 from .compat import json
 from .factory import apply_safe, get_writer
-from .schema import validate, get_schema, schema_name_from_event
+from .schema import (
+validate, get_schema, schema_name_from_event, id_from_event,
+create_event_error
+)
 from .topic import (
 get_topic_config, scid_for_topic, schema_for_topic, topic_from_event,
 TopicNotConfigured, TopicNotFound,
@@ -45,10 +48,13 @@
 until your event is ACKed by Kafka.
 """
 
-def __init__(self, writer_uris):
+def __init__(self, writer_uris, 

[MediaWiki-commits] [Gerrit] Fix I772920: mediawiki::users::web is a variable, not a class - change (operations/puppet)

2015-12-02 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Fix I772920: mediawiki::users::web is a variable, not a class
..


Fix I772920: mediawiki::users::web is a variable, not a class

Change-Id: I6e5818cec0c274dd2d2e5262721c490142b1c103
---
M modules/scap/manifests/l10nupdate.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/scap/manifests/l10nupdate.pp 
b/modules/scap/manifests/l10nupdate.pp
index 770243d..ff17b9e 100644
--- a/modules/scap/manifests/l10nupdate.pp
+++ b/modules/scap/manifests/l10nupdate.pp
@@ -13,7 +13,7 @@
 $deployment_group = 'wikidev',
 $run_l10nupdate   = false,
 ) {
-require ::mediawiki::users::web
+require ::mediawiki::users
 
 $ensure_l10nupdate_cron = $run_l10nupdate ? {
 true=> 'present',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e5818cec0c274dd2d2e5262721c490142b1c103
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Update mariadb submodule - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Update mariadb submodule
..


Update mariadb submodule

Change-Id: Iebbbf27c92aa3b759c38efd59f85709571cdc950
---
M modules/mariadb
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/mariadb b/modules/mariadb
index 3e5eac0..9cd9571 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 3e5eac0d99b645607a0fc960a71ec4e999f6eac1
+Subproject commit 9cd95714109e2a30b0761d35570e751e1672af5c

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

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

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


[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (apps...wikipedia)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Localisation updates from https://translatewiki.net.
..


Localisation updates from https://translatewiki.net.

Change-Id: I14d1c468297b5738288d639e198f7b915688d086
---
M app/src/main/res/values-af/strings.xml
M app/src/main/res/values-ak/strings.xml
M app/src/main/res/values-ar/strings.xml
M app/src/main/res/values-as/strings.xml
M app/src/main/res/values-bn/strings.xml
M app/src/main/res/values-br/strings.xml
M app/src/main/res/values-ca/strings.xml
M app/src/main/res/values-cs/strings.xml
M app/src/main/res/values-cy/strings.xml
M app/src/main/res/values-da/strings.xml
M app/src/main/res/values-de/strings.xml
M app/src/main/res/values-el/strings.xml
M app/src/main/res/values-eo/strings.xml
M app/src/main/res/values-es/strings.xml
M app/src/main/res/values-et/strings.xml
M app/src/main/res/values-eu/strings.xml
M app/src/main/res/values-fa/strings.xml
M app/src/main/res/values-fi/strings.xml
M app/src/main/res/values-fo/strings.xml
M app/src/main/res/values-fr/strings.xml
M app/src/main/res/values-gl/strings.xml
M app/src/main/res/values-gu/strings.xml
M app/src/main/res/values-hi/strings.xml
M app/src/main/res/values-hu/strings.xml
M app/src/main/res/values-ia/strings.xml
M app/src/main/res/values-in/strings.xml
M app/src/main/res/values-it/strings.xml
M app/src/main/res/values-iw/strings.xml
M app/src/main/res/values-ja/strings.xml
M app/src/main/res/values-ji/strings.xml
M app/src/main/res/values-ka/strings.xml
M app/src/main/res/values-km/strings.xml
M app/src/main/res/values-kn/strings.xml
M app/src/main/res/values-ko/strings.xml
M app/src/main/res/values-ku/strings.xml
M app/src/main/res/values-kw/strings.xml
M app/src/main/res/values-ky/strings.xml
M app/src/main/res/values-lb/strings.xml
M app/src/main/res/values-lt/strings.xml
M app/src/main/res/values-mk/strings.xml
M app/src/main/res/values-ml/strings.xml
M app/src/main/res/values-mr/strings.xml
M app/src/main/res/values-ms/strings.xml
M app/src/main/res/values-mt/strings.xml
M app/src/main/res/values-my/strings.xml
M app/src/main/res/values-nb/strings.xml
M app/src/main/res/values-nl/strings.xml
M app/src/main/res/values-oc/strings.xml
M app/src/main/res/values-or/strings.xml
M app/src/main/res/values-pa/strings.xml
M app/src/main/res/values-pl/strings.xml
M app/src/main/res/values-ps/strings.xml
M app/src/main/res/values-pt-rBR/strings.xml
M app/src/main/res/values-pt/strings.xml
M app/src/main/res/values-ro/strings.xml
M app/src/main/res/values-ru/strings.xml
M app/src/main/res/values-sa/strings.xml
M app/src/main/res/values-sd/strings.xml
M app/src/main/res/values-si/strings.xml
M app/src/main/res/values-sk/strings.xml
M app/src/main/res/values-sr/strings.xml
M app/src/main/res/values-sv/strings.xml
M app/src/main/res/values-sw/strings.xml
M app/src/main/res/values-ta/strings.xml
M app/src/main/res/values-te/strings.xml
M app/src/main/res/values-th/strings.xml
M app/src/main/res/values-tl/strings.xml
M app/src/main/res/values-tr/strings.xml
M app/src/main/res/values-uk/strings.xml
M app/src/main/res/values-ur/strings.xml
M app/src/main/res/values-uz/strings.xml
M app/src/main/res/values-vi/strings.xml
M app/src/main/res/values-zh-rTW/strings.xml
M app/src/main/res/values-zh/strings.xml
74 files changed, 149 insertions(+), 83 deletions(-)

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



diff --git a/app/src/main/res/values-af/strings.xml 
b/app/src/main/res/values-af/strings.xml
index 33f0c04..69a6ba0 100644
--- a/app/src/main/res/values-af/strings.xml
+++ b/app/src/main/res/values-af/strings.xml
@@ -13,7 +13,7 @@
   Skrap gestoorde bladsye
   Hierdie bladsy bestaan nie.
   Vandag
-  Skrap webblaaier 
geskiedenis?
+  Skrap webblaaier 
geskiedenis?
   Gestoorde bladsye
   Opdateer gestoorde 
bladsye
   Opdateer gestoorde 
bladsye
diff --git a/app/src/main/res/values-ak/strings.xml 
b/app/src/main/res/values-ak/strings.xml
index 344ca34..54076e4 100644
--- a/app/src/main/res/values-ak/strings.xml
+++ b/app/src/main/res/values-ak/strings.xml
@@ -10,7 +10,7 @@
   Pepa nea woayɛ atwam
   Popa nkrataa a woakora so
   Krataafa biara nni ha saa
-  Popa browsing a atwam
+  Popa browsing a 
atwam
   Nkrataa a wode asie
   Sesa nkrataa a wode asie
   Sesa nkrataa a wode 
asie
diff --git a/app/src/main/res/values-ar/strings.xml 
b/app/src/main/res/values-ar/strings.xml
index ae542b8..b2db146 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -13,7 +13,8 @@
   إفراغ الصفحات المحفوظة
   هذه الصفحة غير موجودة.
   اليوم
-  مسح تاريخ التصفح؟
+  مسح تاريخ 
التصفح؟
+  هل أنت متأكد من أنك 
تريد مسح كل التاريخ؟
   الصفحات المحفوظة
   تحديث الصفحات المحفوظة
   تحديث الصفحات 
المحفوظة
@@ -41,7 +42,7 @@
   شارك
   بالقرب من هنا
   لا يوجد صفحات بالقرب من هنا!
-  انتقل إلى مكانٍ جديد، لرؤية 
صفحات عن الأماكن التي بقربك.
+  انتقل إلى مكانٍ جديد، 

[MediaWiki-commits] [Gerrit] Update mariadb module - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Update mariadb module
..

Update mariadb module

Change-Id: Ic8d8d9bed3a890ffc556051bbfef636d4cbbfbde
---
M modules/mariadb
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/65/256465/1

diff --git a/modules/mariadb b/modules/mariadb
index 9cd9571..23bfd32 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 9cd95714109e2a30b0761d35570e751e1672af5c
+Subproject commit 23bfd325c53294c1e444994436fa0d601a08c35c

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

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

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


[MediaWiki-commits] [Gerrit] Move kenrick95/raun to own repo - change (translatewiki)

2015-12-02 Thread Kenrick95 (Code Review)
Kenrick95 has uploaded a new change for review.

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

Change subject: Move kenrick95/raun to own repo
..

Move kenrick95/raun to own repo

Change-Id: I1e5da35a0681adfeb5e96ab0732f25df753e9063
---
M REPOCONF
M TranslateSettings.php
M bin/EXTERNAL-PROJECTS
M bin/repocommit
M bin/repoexport
M bin/repoupdate
M groups/Intuition/intuition-textdomains.txt
A groups/Intuition/raun.yaml
8 files changed, 25 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/42/256442/1

diff --git a/REPOCONF b/REPOCONF
index 3f3195a..484dffc 100644
--- a/REPOCONF
+++ b/REPOCONF
@@ -24,6 +24,7 @@
 REPO_INATURALIST=git://github.com/inaturalist/inaturalist.git
 REPO_INTUITION=git://github.com/Krinkle/intuition.git
 REPO_INTORPHANTALK=git://github.com/Krinkle/mw-tool-orphantalk.git
+REPO_INTRAUN=git://github.com/kenrick95/Raun.git
 REPO_JQUERY_ULS=git://github.com/wikimedia/jquery.uls.git
 REPO_KIWIX=git://git.code.sf.net/p/kiwix/maintenance
 REPO_MANTIS=git://github.com/mantisbt/mantisbt.git
diff --git a/TranslateSettings.php b/TranslateSettings.php
index 66d6166..be27b33 100644
--- a/TranslateSettings.php
+++ b/TranslateSettings.php
@@ -315,6 +315,7 @@
 wfAddNamespace( 1240, 'Intuition' );
 $wgTranslateGroupFiles[] = "$GROUPS/Intuition/IntuitionAgg.yaml";
 $wgTranslateGroupFiles[] = "$GROUPS/Intuition/orphantalk.yaml";
+$wgTranslateGroupFiles[] = "$GROUPS/Intuition/raun.yaml";
 $wgNamespaceAliases['Toolserver'] = 1240;
 $wgNamespaceAliases['Toolserver_talk'] = 1240;
 $wgTranslateSupportUrlNamespace[NS_INTUITION] = array(
diff --git a/bin/EXTERNAL-PROJECTS b/bin/EXTERNAL-PROJECTS
index 16e7c2e..0848cee 100644
--- a/bin/EXTERNAL-PROJECTS
+++ b/bin/EXTERNAL-PROJECTS
@@ -12,6 +12,7 @@
 inaturalist
 intuition
 int-orphantalk
+int-raun
 jquery.uls
 kiwix
 mantis
diff --git a/bin/repocommit b/bin/repocommit
index 7094df9..a36cc17 100755
--- a/bin/repocommit
+++ b/bin/repocommit
@@ -46,6 +46,7 @@
 huggle \
 intuition \
 int-orphantalk \
+int-raun \
 jquery.uls \
 kiwix \
 mantis \
diff --git a/bin/repoexport b/bin/repoexport
index d60143d..7a15bf4 100755
--- a/bin/repoexport
+++ b/bin/repoexport
@@ -80,6 +80,10 @@
 then
php "$EXPORTER" --target . --group=int-orphantalk --lang='*' --skip 
"$SKIPLANGS" $HOURS
 
+elif [ "$PROJECT" = "int-raun" ]
+then
+   php "$EXPORTER" --target . --group=int-raun --lang='*' --skip 
"$SKIPLANGS" $HOURS
+
 elif [ "$PROJECT" = "jquery.uls" ]
 then
php "$EXPORTER" --target . --group=out-jquery-uls --lang='*' --skip 
en,qqq $THRESHOLD
diff --git a/bin/repoupdate b/bin/repoupdate
index 747640a..f28f997 100755
--- a/bin/repoupdate
+++ b/bin/repoupdate
@@ -76,6 +76,7 @@
 entryscape \
 huggle \
 int-orphantalk \
+int-raun \
 wikiedudashboard \
 wikipedia-android \
 wikipedia-ios \
diff --git a/groups/Intuition/intuition-textdomains.txt 
b/groups/Intuition/intuition-textdomains.txt
index a9b769d..ebb0b20 100644
--- a/groups/Intuition/intuition-textdomains.txt
+++ b/groups/Intuition/intuition-textdomains.txt
@@ -39,11 +39,6 @@
 
 Recent Anonymous Activity
 
-Raun
-ignored = ns, ns0, ns1, ns10, ns100, ns101
-ignored = ns11, ns12, ns13, ns14, ns15, ns2
-ignored = ns3, ns4, ns5, ns6, ns7, ns8, ns9
-
 Rtrc
 ignored = rtrc-months
 
diff --git a/groups/Intuition/raun.yaml b/groups/Intuition/raun.yaml
new file mode 100644
index 000..fd13ab9
--- /dev/null
+++ b/groups/Intuition/raun.yaml
@@ -0,0 +1,16 @@
+---
+BASIC:
+  id: int-raun
+  label: Raun
+  namespace: NS_INTUITION
+  class: FileBasedMessageGroup
+
+MANGLER:
+  class: StringMatcher
+  prefix: orphantalk2-
+  patterns:
+- "*"
+
+FILES:
+  class: JsonFFS
+  sourcePattern: "%GROUPROOT%/int-raun/messages/%CODE%.json"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e5da35a0681adfeb5e96ab0732f25df753e9063
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Kenrick95 

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


[MediaWiki-commits] [Gerrit] openstack: fix glance /srv permissions - change (operations/puppet)

2015-12-02 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: openstack: fix glance /srv permissions
..


openstack: fix glance /srv permissions

Change-Id: I567e5f787c8de2e8e291799fccdfdc78c44cbb06
---
M modules/openstack/manifests/glance/service.pp
1 file changed, 4 insertions(+), 5 deletions(-)

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



diff --git a/modules/openstack/manifests/glance/service.pp 
b/modules/openstack/manifests/glance/service.pp
index 90d48ab..bb90b85 100644
--- a/modules/openstack/manifests/glance/service.pp
+++ b/modules/openstack/manifests/glance/service.pp
@@ -36,16 +36,15 @@
 require => Class['openstack::repo'],
 }
 
-
-#  This is 775 so that the glancesync user can rsync to it.
 file { $glance_data:
 ensure  => directory,
-owner   => 'glance',
-group   => 'glance',
+owner   => 'root',
+group   => 'root',
 require => Package['glance'],
-mode=> '0775',
+mode=> '0755',
 }
 
+#  This is 775 so that the glancesync user can rsync to it.
 file { $glance_images_dir:
 ensure  => directory,
 owner   => 'glance',

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

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

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


[MediaWiki-commits] [Gerrit] Add wikidata interface - change (mediawiki...MathSearch)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add wikidata interface
..


Add wikidata interface

* This only acts on behalf of a real interface as long
  no offical way to use wikidata data is provided

Change-Id: I25f69cf2fec3e60dce2d443eb347b883efa6c9f6
---
M extension.json
A includes/WikidataDriver.php
A tests/WikidataDriverTest.php
3 files changed, 89 insertions(+), 2 deletions(-)

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



diff --git a/extension.json b/extension.json
index 9d5035f..47c7356 100644
--- a/extension.json
+++ b/extension.json
@@ -32,7 +32,8 @@
"MathosphereDriver": "includes/MathosphereDriver.php",
"MathIdGenerator": "includes/MathIdGenerator.php",
"MathHighlighter": "includes/MathHighlighter.php",
-   "MlpEvalForm": "includes/MlpEvalForm.php"
+   "MlpEvalForm": "includes/MlpEvalForm.php",
+   "WikidataDriver": "includes/WikidataDriver.php"
},
"AvailableRights": [
"mathwmcsubmit"
@@ -73,7 +74,8 @@
"MathUpdateObservations": false,
"MathUploadEnabled": false,
"MathWmcMaxResults": 1,
-   "MathWmcServer": false
+   "MathWmcServer": false,
+   "MathSearchWikidataUrl": "https://wikidata.org;
},
"MessagesDirs": {
"MathSearch": [
diff --git a/includes/WikidataDriver.php b/includes/WikidataDriver.php
new file mode 100644
index 000..d61bfa4
--- /dev/null
+++ b/includes/WikidataDriver.php
@@ -0,0 +1,61 @@
+makeConfig( 
'main' );
+   return $config->get( "MathSearchWikidataUrl" );
+   }
+
+
+   public function search( $term ) {
+   $term = urlencode( $term );
+   $request = array(
+   'method' => 'GET',
+   'url'=> $this->getBackendUrl() .
+   
"/w/api.php?format=json=wbsearchentities={$this->lang}={$term}"
+   );
+   $serviceClient = new VirtualRESTServiceClient( new 
MultiHttpClient( array() ) );
+   $response = $serviceClient->run( $request );
+   if ( $response['code'] === 200 ) {
+   $json = json_decode( $response['body'] );
+   if ( $json && json_last_error() === JSON_ERROR_NONE ) {
+   $this->data = $json;
+   return true;
+   }
+   }
+   $this->data = false;
+   return false;
+   }
+
+   private function element2String( $d, $desc = true ) {
+   if ( $desc && isset( $d->description ) ) {
+   return "{$d->label} ({$d->description})";
+   } else {
+   return $d->label;
+   }
+   }
+
+   public function getResults( $links = false, $desc = true ) {
+   $res = array();
+   if ( $this->data ) {
+   foreach ( $this->data->search as $d ) {
+   if ( $links ) {
+   $res[$d->id] = "{$this->element2String($d, $desc)}";
+   } else {
+   $res[$d->id] = $this->element2String( 
$d, $desc );
+   }
+   }
+   }
+   return $res;
+
+   }
+}
diff --git a/tests/WikidataDriverTest.php b/tests/WikidataDriverTest.php
new file mode 100644
index 000..6d2cfdd
--- /dev/null
+++ b/tests/WikidataDriverTest.php
@@ -0,0 +1,24 @@
+assertContains( 'wikidata', $wd->getBackendUrl() );
+   $this->assertTrue( $wd->search( 'magnet' ) );
+   $res = $wd->getResults();
+   $this->assertArrayHasKey( 'Q11421', $res );
+   $this->assertContains( 'magnetic field', $res['Q11421'] );
+   $res = $wd->getResults( false, false );
+   $this->assertEquals( 'magnet', $res['Q11421'] );
+   }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I25f69cf2fec3e60dce2d443eb347b883efa6c9f6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt 
Gerrit-Reviewer: Dyiop 
Gerrit-Reviewer: Hcohl 
Gerrit-Reviewer: Physikerwelt 
Gerrit-Reviewer: Whyameri 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fixup MW for HHVM Repo Authorative mode - change (mediawiki/core)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fixup MW for HHVM Repo Authorative mode
..


Fixup MW for HHVM Repo Authorative mode

https://github.com/facebook/hhvm/issues/5834
https://github.com/facebook/hhvm/issues/5833

Change-Id: I138ffa5df874c5660897dc7feab36adef9f32aea
---
M RELEASE-NOTES-1.25
M includes/debug/logger/LoggerFactory.php
2 files changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25
index fd549dd..362414f 100644
--- a/RELEASE-NOTES-1.25
+++ b/RELEASE-NOTES-1.25
@@ -8,7 +8,8 @@
 === Changes since 1.25.3 ===
 * (T103237) $wgUseGzip had no effect when using file cache.
 * (T114606) mw.notify was not correctly fixed to the page if
-  initialized while not at the top of the page
+  initialized while not at the top of the page.
+* * Fix issue that breaks HHVM Repo Authorative mode.
 
 == MediaWiki 1.25.3 ==
 
diff --git a/includes/debug/logger/LoggerFactory.php 
b/includes/debug/logger/LoggerFactory.php
index b3078b9..11d5cea 100644
--- a/includes/debug/logger/LoggerFactory.php
+++ b/includes/debug/logger/LoggerFactory.php
@@ -94,7 +94,7 @@
 * @return \Psr\Log\LoggerInterface
 */
public static function getInstance( $channel ) {
-   if ( !interface_exists( '\Psr\Log\LoggerInterface' ) ) {
+   if ( !interface_exists( 'Psr\Log\LoggerInterface' ) ) {
$message = (
'MediaWiki requires the https://github.com/php-fig/log;>PSR-3 logging ' .
"library to be present. This library is not 
embedded directly in MediaWiki's " .

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I138ffa5df874c5660897dc7feab36adef9f32aea
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_25
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] [WIP] Include Flow topics in Nuke - change (mediawiki...Flow)

2015-12-02 Thread Sbisson (Code Review)
Sbisson has uploaded a new change for review.

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

Change subject: [WIP] Include Flow topics in Nuke
..

[WIP] Include Flow topics in Nuke

Bug: T115695
Change-Id: I09aeb876066554496fc7f533e60bd0cea842777b
Depends-On: Ia9dc16b3a4a623ef213adbcf18f44b497f2d9f27
---
M Flow.php
M Hooks.php
2 files changed, 95 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/48/256448/1

diff --git a/Flow.php b/Flow.php
index 000d7be..d3f103d 100644
--- a/Flow.php
+++ b/Flow.php
@@ -173,6 +173,9 @@
 $wgHooks['GetBetaFeaturePreferences'][] = 
'FlowHooks::onGetBetaFeaturePreferences';
 $wgHooks['UserSaveOptions'][] = 'FlowHooks::onUserSaveOptions';
 
+// Nuke
+$wgHooks['NukeGetNewPages'][] = 'FlowHooks::onNukeGetNewPages';
+
 // Extension initialization
 $wgExtensionFunctions[] = 'FlowHooks::initFlowExtension';
 
diff --git a/Hooks.php b/Hooks.php
index 4aa7289..d0f0ebf 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1,5 +1,6 @@
 getNamespace() !== NS_TOPIC;
+   } );
+
+   // how many are we allowed to retrieve now
+   $newLimit = $limit - count( $pages );
+   if ( $newLimit > 0 ) {
+
+
+   $dbr = wfGetDB( DB_SLAVE );
+
+   $userSelect = array( 'username' => 
"IFNULL(tree_orig_user_ip, user_name)" );
+   $userWhere = array();
+   if ( $username ) {
+   $user = User::newFromName( $username );
+   if ( $user ) {
+   $userSelect = array( 'username' => 
'user_name' );
+   $userWhere = array( 'tree_orig_user_id' 
=> $user->getId() );
+   } else {
+   $userSelect = array( 'username' => 
'tree_orig_user_ip' );
+   $userWhere = array( 'tree_orig_user_ip' 
=> $username );
+   }
+   }
+
+   // get latest revision id for each topic
+   // by the specified user (optional)
+   // todo: filter for time
+   $result = $dbr->select(
+   array(
+   'r' => 'flow_revision',
+   'flow_tree_revision',
+   'user'
+   ),
+   array_merge( array(
+   'revId' => 'MAX(r.rev_id)'
+   ), $userSelect ),
+   array_merge( array(
+   'tree_parent_id' => null,
+   'r.rev_type' => 'post'
+   ), $userWhere ),
+   __METHOD__,
+   array(
+   'GROUP BY' => 'r.rev_type_id'
+   ),
+   array(
+   'flow_tree_revision' => array( 'INNER 
JOIN', 'r.rev_type_id=tree_rev_descendant_id' ),
+   'user' => array( 'LEFT JOIN', 
'user_id=tree_orig_user_id' )
+   )
+   );
+
+   $revIds = array();
+   foreach( $result as $r ) {
+   $revIds[$r->revId] = $r->username;
+   }
+
+   // get non-moderated revisions
+   $result = $dbr->select(
+   array( 'flow_revision' ),
+   array( 'topicId' => 'rev_type_id', 'revId' => 
'rev_id' ),
+   array( 'rev_mod_state' => '', 'rev_id' => 
array_keys( $revIds ) ),
+   __METHOD__,
+   array( 'LIMIT' => $newLimit )
+   );
+
+   foreach( $result as $r ) {
+   $topicTitle = Title::makeTitle( NS_TOPIC, 
UUID::create( $r->topicId )->getAlphadecimal() );
+   $creatorUsername = $revIds[$r->revId];
+   $pages[] = array(  $topicTitle, 
$creatorUsername );
+   }
+
+   }
+
+   return true;
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09aeb876066554496fc7f533e60bd0cea842777b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson 


[MediaWiki-commits] [Gerrit] Use Newsletter::canManage() in ApiNewsletterManage - change (mediawiki...Newsletter)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use Newsletter::canManage() in ApiNewsletterManage
..


Use Newsletter::canManage() in ApiNewsletterManage

Change-Id: I274584e4b31ab591bb2b7120f764c1ebfd56a6e8
---
M includes/api/ApiNewsletterManage.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/api/ApiNewsletterManage.php 
b/includes/api/ApiNewsletterManage.php
index a4a9ed4..514c44d 100644
--- a/includes/api/ApiNewsletterManage.php
+++ b/includes/api/ApiNewsletterManage.php
@@ -20,7 +20,7 @@
$this->dieUsage( 'Newsletter does not exist', 
'notfound' );
}
 
-   if ( !$newsletter->isPublisher( $user ) && !$user->isAllowed( 
'newsletter-manage' ) ) {
+   if ( !$newsletter->canManage( $user ) ) {
$this->dieUsage( 'You do not have permission to manage 
newsletters.', 'nopermissions' );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I274584e4b31ab591bb2b7120f764c1ebfd56a6e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Glaisher 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Enable Title and User suggestions on Special:ManageNewsletter - change (mediawiki...Newsletter)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Enable Title and User suggestions on Special:ManageNewsletter
..


Enable Title and User suggestions on Special:ManageNewsletter

Title: works fine
User: Depends on: I03eabf6ed5d5a3653 - Special:ManageNewsletter form
not using OOJS ui as of now

Bug: T116353
Change-Id: I04c960903025c29677d2549d56b9c468b4a76284
---
M includes/specials/SpecialNewsletterManage.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/specials/SpecialNewsletterManage.php 
b/includes/specials/SpecialNewsletterManage.php
index 2575d05..ed663bc 100644
--- a/includes/specials/SpecialNewsletterManage.php
+++ b/includes/specials/SpecialNewsletterManage.php
@@ -64,7 +64,7 @@
),
'publisher-name' => array(
'section' => 'addpublisher-section',
-   'type' => 'text',
+   'type' => 'user',
'label-message' => 
'newsletter-publisher-username',
),
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I04c960903025c29677d2549d56b9c468b4a76284
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com>
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Florianschmidtwelzow 
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] Clean up l10nupdate settings (2/2) - change (operations/puppet)

2015-12-02 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Clean up l10nupdate settings (2/2)
..


Clean up l10nupdate settings (2/2)

Follow up to I64ee38f. This should not be merged until the changes in
the previous patch have been applied to all MediaWiki servers by Puppet
as it removes some "ensure => absent" resources that are needed to clean
up the previous configuration.

* Move provisioning of l10nupdate user from ::mediawiki::users to
  ::scap::l10nupdate as user is only needed on deployment servers now.
* Remove "ensure => 'absent'" defines that were used to clean up
  dedicated l10nupdate ssh key.
* Use a fully qualified path name for refreshCdbJsonFiles in
  l10nupdate-1 script.

Bug: T119746
Change-Id: I7729207ae17386c06a0382de72f98a4e023bb0ad
---
M modules/mediawiki/manifests/users.pp
M modules/scap/files/l10nupdate-1
M modules/scap/manifests/l10nupdate.pp
3 files changed, 32 insertions(+), 45 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/mediawiki/manifests/users.pp 
b/modules/mediawiki/manifests/users.pp
index f704acb..e92e4ce 100644
--- a/modules/mediawiki/manifests/users.pp
+++ b/modules/mediawiki/manifests/users.pp
@@ -28,29 +28,8 @@
 content => $mwdeploy_pub_key,
 }
 
-# The l10nupdate account is used for updating the localisation files
-# with new interface message translations.
-
-group { 'l10nupdate':
-ensure => present,
-gid=> 10002,
-}
-
-user { 'l10nupdate':
-ensure => present,
-gid=> 10002,
-shell  => '/bin/bash',
-home   => '/home/l10nupdate',
-managehome => true,
-}
-
-# TODO: remove after ssh key has been purged from production servers
-ssh::userkey { 'l10nupdate':
-ensure => 'absent',
-}
-
-# Grant mwdeploy sudo rights to run anything as itself or apache.
-# This allows MediaWiki deployers to deploy as mwdeploy.
+# Grant mwdeploy sudo rights to run anything as itself, apache and the
+# l10nupdate user. This allows MediaWiki deployers to deploy as mwdeploy.
 sudo::user { 'mwdeploy':
 privileges => [
 "ALL = (${web},mwdeploy,l10nupdate) NOPASSWD: ALL",
@@ -60,13 +39,6 @@
 'ALL = (root) NOPASSWD: /usr/sbin/apache2ctl graceful-stop',
 ]
 }
-
-# Allow l10nupdate user to run anything as the unprivledged web user.
-# Needed for mwscript actions and related operations.
-sudo::user { 'l10nupdate':
-privileges => ["ALL = (${web}) NOPASSWD: ALL"],
-}
-
 
 # The pybal-check account is used by PyBal to monitor server health
 # See 
diff --git a/modules/scap/files/l10nupdate-1 b/modules/scap/files/l10nupdate-1
index 6c750b8..c550963 100755
--- a/modules/scap/files/l10nupdate-1
+++ b/modules/scap/files/l10nupdate-1
@@ -1,4 +1,7 @@
 #!/bin/bash
+# Merge new translations from HEAD into the l10n cache files for deployed
+# MediaWiki versions and sync the updated caches to the MediaWiki servers.
+#
 # This script belongs in /usr/local/bin/.
 
 . /etc/profile.d/mediawiki.sh
@@ -99,7 +102,7 @@
echo "Completed at `date --rfc-3339=seconds`. Copying LC files 
to $MEDIAWIKI_STAGING_DIR"
cp --preserve=timestamps --force "$tempCacheDir"/l10n_cache-* 
$MEDIAWIKI_STAGING_DIR/php-"$mwVerNum"/cache/l10n
# Include JSON versions of the CDB files and add MD5 files
-   refreshCdbJsonFiles 
--directory="$MEDIAWIKI_STAGING_DIR/php-$mwVerNum/cache/l10n"
+   ${SCAPDIR}/refreshCdbJsonFiles 
--directory="$MEDIAWIKI_STAGING_DIR/php-$mwVerNum/cache/l10n"
 
echo "Syncing to Apaches at `date --rfc-3339=seconds`"
sudo -u mwdeploy -n -- $SCAPDIR/sync-l10n --verbose $mwVerNum
diff --git a/modules/scap/manifests/l10nupdate.pp 
b/modules/scap/manifests/l10nupdate.pp
index 2119e30..770243d 100644
--- a/modules/scap/manifests/l10nupdate.pp
+++ b/modules/scap/manifests/l10nupdate.pp
@@ -13,9 +13,27 @@
 $deployment_group = 'wikidev',
 $run_l10nupdate   = false,
 ) {
+require ::mediawiki::users::web
+
 $ensure_l10nupdate_cron = $run_l10nupdate ? {
 true=> 'present',
 default => 'absent',
+}
+
+# The l10nupdate account is used for updating the localisation files
+# with new interface message translations.
+
+group { 'l10nupdate':
+ensure => present,
+gid=> 10002,
+}
+
+user { 'l10nupdate':
+ensure => present,
+gid=> 10002,
+shell  => '/bin/bash',
+home   => '/home/l10nupdate',
+managehome => true,
 }
 
 cron { 'l10nupdate':
@@ -39,24 +57,18 @@
 source => 'puppet:///modules/scap/l10nupdate-1',
 }
 
-# Allow l10nupdate user to call sync-l10n as the 

[MediaWiki-commits] [Gerrit] Add apple-touch-icon.png to Wikidata, Wikinews and Wiktionary - change (operations/puppet)

2015-12-02 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Add apple-touch-icon.png to Wikidata, Wikinews and Wiktionary
..

Add apple-touch-icon.png to Wikidata, Wikinews and Wiktionary

Refactoring

Change-Id: I20b202be2b755a8c1b73da736ee706e8425d441f
---
M modules/mediawiki/files/apache/sites/main.conf
1 file changed, 3 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/40/256440/1

diff --git a/modules/mediawiki/files/apache/sites/main.conf 
b/modules/mediawiki/files/apache/sites/main.conf
index 76c323b..9134839 100644
--- a/modules/mediawiki/files/apache/sites/main.conf
+++ b/modules/mediawiki/files/apache/sites/main.conf
@@ -84,20 +84,13 @@
 RewriteRule ^/w/wiki.phtml$  /w/index.php [L,QSA,NE]
 
 
-# Make robots.txt editable via Mediawiki:robots.txt
-RewriteRule ^/robots.txt$ /w/robots.php [L]
-
 # Primary wiki redirector:
 Alias /wiki /srv/mediawiki/docroot/wikidata/w/index.php
-RewriteRule ^/$ /w/index.php
 RewriteRule ^/w/$ /w/index.php
 
 Include "sites-enabled/wikidata-uris.incl"
-
 Include "sites-enabled/api-rewrites.incl"
-
-# Configurable favicon
-RewriteRule ^/favicon\.ico$ /w/favicon.php [L]
+Include "sites-enabled/public-wiki-rewrites.incl"
 
 

@@ -182,10 +175,6 @@
 RewriteRule ^/w/wiki.phtml$  /w/index.php [L,QSA,NE]
 
 
-
-# Make robots.txt editable via Mediawiki:robots.txt
-RewriteRule ^/robots.txt$ /w/robots.php [L]
-
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
 
@@ -197,7 +186,6 @@
 
 # Primary wiki redirector:
 Alias /wiki /srv/mediawiki/docroot/wiktionary.org/w/index.php
-RewriteRule ^/$ /w/index.php
 RewriteRule ^/w/$ /w/index.php
 
 # UseMod compatibility URLs
@@ -211,9 +199,7 @@
 RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 
[R=301]
 
 Include "sites-enabled/api-rewrites.incl"
-
-# Configurable favicon
-RewriteRule ^/favicon\.ico$ /w/favicon.php [L]
+Include "sites-enabled/public-wiki-rewrites.incl"
 
 

@@ -638,9 +624,6 @@
 RewriteRule ^/w/wiki.phtml$  /w/index.php [L,QSA,NE]
 
 
-# Make robots.txt editable via Mediawiki:robots.txt
-RewriteRule ^/robots.txt$ /w/robots.php [L]
-
 # ShortURL redirect RT-2121
 RewriteRule ^/s/.*$ /w/index.php
 
@@ -656,7 +639,6 @@
 
 # Primary wiki redirector:
 Alias /wiki /srv/mediawiki/docroot/wikinews.org/w/index.php
-RewriteRule ^/$ /w/index.php
 RewriteRule ^/w/$ /w/index.php
 
 # UseMod compatibility URLs
@@ -670,9 +652,7 @@
 RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 
[R=301]
 
 Include "sites-enabled/api-rewrites.incl"
-
-# Configurable favicon
-RewriteRule ^/favicon\.ico$ /w/favicon.php [L]
+Include "sites-enabled/public-wiki-rewrites.incl"
 
 
 

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

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

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


[MediaWiki-commits] [Gerrit] Update mariadb module to the latest commit - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Update mariadb module to the latest commit
..


Update mariadb module to the latest commit

Also add comment about client's server verification.

Change-Id: Idd1e0aa25e0d04b3ebb4831a5a8c1f0aa96c5c67
References: T111654
---
M modules/mariadb
M templates/mariadb/production.my.cnf.erb
2 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/modules/mariadb b/modules/mariadb
index 44fd087..7fef40f 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 44fd08751f4f6cfa15a6275253bf231f7533a88b
+Subproject commit 7fef40f163f678af7790a0ec8b95afa3429e2234
diff --git a/templates/mariadb/production.my.cnf.erb 
b/templates/mariadb/production.my.cnf.erb
index b57af97..c527e78 100644
--- a/templates/mariadb/production.my.cnf.erb
+++ b/templates/mariadb/production.my.cnf.erb
@@ -9,6 +9,9 @@
 ssl-ca=/etc/mysql/ssl/cacert.pem
 ssl-cert=/etc/mysql/ssl/server-cert.pem
 ssl-key=/etc/mysql/ssl/server-key.pem
+# skip server cert validation until we generate one cert per server
+# it would check the cert's common name against the host
+# ssl-verify-server-cert
 <% end %>
 
 [mysqld]

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

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

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


[MediaWiki-commits] [Gerrit] SpecialNewsletter: use $this->getPageTitle() instead of Spec... - change (mediawiki...Newsletter)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: SpecialNewsletter: use $this->getPageTitle() instead of 
SpecialPage::getTitleFor('Newsletter')
..


SpecialNewsletter: use $this->getPageTitle() instead of 
SpecialPage::getTitleFor('Newsletter')

Change-Id: Iefefafe88ff26a6b24a86d7cf85d5b55ddccbae7
---
M includes/specials/SpecialNewsletter.php
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/includes/specials/SpecialNewsletter.php 
b/includes/specials/SpecialNewsletter.php
index f6aae6f..5ce9bea 100644
--- a/includes/specials/SpecialNewsletter.php
+++ b/includes/specials/SpecialNewsletter.php
@@ -186,7 +186,7 @@
'label' => $this->msg( 
'newsletter-delete-button' )->escaped(),
'flags' => array( 'destructive' ),
'icon' => 'remove',
-   'href' => SpecialPage::getTitleFor( 
'Newsletter', $id . '/' . self::NEWSLETTER_DELETE )->getFullURL()
+   'href' => $this->getPageTitle( $id . 
'/' . self::NEWSLETTER_DELETE )->getFullURL()
)
);
}
@@ -208,7 +208,7 @@
'label' => $this->msg( 
'newsletter-announce-button' )->escaped(),
'flags' => array( 'progressive' ),
'icon' => 'comment',
-   'href' => SpecialPage::getTitleFor( 
'Newsletter', $id . '/' . self::NEWSLETTER_ANNOUNCE )->getFullURL()
+   'href' => $this->getPageTitle( $id . 
'/' . self::NEWSLETTER_ANNOUNCE )->getFullURL()
)
);
}
@@ -218,7 +218,7 @@
array(
'label' => $this->msg( 
'newsletter-unsubscribe-button' )->escaped(),
'flags' => array( 'primary', 
'destructive' ),
-   'href' => SpecialPage::getTitleFor( 
'Newsletter', $id . '/' . self::NEWSLETTER_UNSUBSCRIBE )->getFullURL()
+   'href' => $this->getPageTitle( $id . 
'/' . self::NEWSLETTER_UNSUBSCRIBE )->getFullURL()
)
);
} else {
@@ -226,7 +226,7 @@
array(
'label' => $this->msg( 
'newsletter-subscribe-button' )->escaped(),
'flags' => array( 'primary', 
'constructive' ),
-   'href' => SpecialPage::getTitleFor( 
'Newsletter', $id . '/' . self::NEWSLETTER_SUBSCRIBE )->getFullURL()
+   'href' => $this->getPageTitle( $id . 
'/' . self::NEWSLETTER_SUBSCRIBE )->getFullURL()
)
);
}
@@ -317,7 +317,7 @@
$form->addHeaderText( $txt );
$form->suppressDefaultSubmit();
$form->show();
-   $this->getOutput()->addReturnTo( SpecialPage::getTitleFor( 
'Newsletter', $this->newsletter->getId() ) );
+   $this->getOutput()->addReturnTo( $this->getPageTitle( 
$this->newsletter->getId() ) );
}
 
/**
@@ -523,7 +523,7 @@
 
if ( !$form->show() ) {
// After submission, no point in showing showing the 
return to link if the newsletter was just deleted
-   $out->addReturnTo( SpecialPage::getTitleFor( 
'Newsletter', $this->newsletter->getId() ) );
+   $out->addReturnTo( $this->getPageTitle( 
$this->newsletter->getId() ) );
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iefefafe88ff26a6b24a86d7cf85d5b55ddccbae7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Glaisher 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fixing import issue for ssl_key (minor syntax change) - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Fixing import issue for ssl_key (minor syntax change)
..


Fixing import issue for ssl_key (minor syntax change)

Change-Id: I6fba419c1f2a7e31a6a4252eaf8f12813f0a22a6
References: T111654
---
M manifests/config.pp
1 file changed, 5 insertions(+), 6 deletions(-)

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



diff --git a/manifests/config.pp b/manifests/config.pp
index e028fac..bef17ae 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -83,7 +83,6 @@
 }
 
 if ($ssl == 'on') {
-include mariadb::ssl_key
 
 file { '/etc/mysql/ssl':
 ensure  => directory,
@@ -92,19 +91,19 @@
 mode=> '0750',
 require => File['/etc/mysql']
 }
-ssl_key { 'cacert':
+mariadb::ssl_key { 'cacert':
 file => 'cacert.pem',
 }
-ssl_key { 'server-key':
+mariadb::ssl_key { 'server-key':
 file => 'server-key.pem',
 }
-ssl_key { 'server-cert':
+mariadb::ssl_key { 'server-cert':
 file => 'server-cert.pem',
 }
-ssl_key { 'client-key':
+mariadb::ssl_key { 'client-key':
 file => 'client-key.pem',
 }
-ssl_key { 'client-cert':
+mariadb::ssl_key { 'client-cert':
 file => 'client-cert.pem',
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6fba419c1f2a7e31a6a4252eaf8f12813f0a22a6
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Start with context dependent semantics - change (mediawiki...MathSearch)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Start with context dependent semantics
..


Start with context dependent semantics

Change-Id: I99fcb35b895a81d3ea737dff761b9c8d63f727dc
---
M includes/MlpEvalForm.php
M includes/special/SpecialMlpEval.php
2 files changed, 68 insertions(+), 9 deletions(-)

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



diff --git a/includes/MlpEvalForm.php b/includes/MlpEvalForm.php
index d549ac6..24e0d14 100644
--- a/includes/MlpEvalForm.php
+++ b/includes/MlpEvalForm.php
@@ -99,6 +99,27 @@
);
break;
case SpecialMlpEval::STEP_DEFINITIONS:
+   foreach ( $this->specialPage->getIdentifiers() 
as $key => $id ) {
+   $options =array();
+   // $rendered = 
MathRenderer::renderMath( $id, array(), 'mathml' );
+   $rels = 
$this->specialPage->getRelations( $id );
+   foreach ( $rels as $rel ){
+   $options[$rel] = $rel;
+   }
+   $options['other'] = 'other';
+   if ( count( $rels ) ) {
+   $formDescriptor["6-id-$key"] = 
array(
+   'label' => 
"Select definitions for $id",
+   'type'  => 
'multiselect',
+   'options'   => 
$options,
+   // 'raw' => true
+   );
+   }
+   $formDescriptor["6-id-$key-other"] = 
array(
+   'label' => "Other for 
$id",
+   'type'  => 'text'
+   );
+   }
break;
}
$formDescriptor['submit-info'] = array(
diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index 29e0f89..3ef0fa6 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -36,6 +36,7 @@
private $revision;
private $texInputChanged = false;
private $identifiers = array();
+   private $relations;
 
/**
 * @return boolean
@@ -91,6 +92,14 @@
return $this->resetFormula();
case MlpEvalForm::OPT_CONTINUE:
$this->writeLog( "pgRst: User 
selects formula $fId" );
+   }
+   }
+   if ( $req->getArray( 'wp5-identifiers' ) ){
+   $this->identifiers = $req->getArray( 'wp5-identifiers' 
);
+   $missing = $req->getText( 'wp5-missing' );
+   if ( $missing ){
+   // TODO: Check for invalid TeX
+   $this->identifiers = array_merge( 
$this->identifiers, preg_split( '/[\n\r]/', $missing ) );
}
}
return $this->setStep( $req->getInt( 'oldStep' ) + 1 );
@@ -242,14 +251,7 @@
case self::STEP_PAGE:
break;
case self::STEP_FORMULA:
-   $hl = new MathHighlighter( $this->fId, 
$this->oldId );
-   $out->addHtml(
-   ''
-   );
-   $this->printFormula();
-   $out->addHtml( '' );
-   $this->getOutput()->addWikiText( 
$hl->getWikiText() );
-   $out->addHtml( '' );
+   $this->printMathObjectInContext();
 
break;
case self::STEP_TEX:
@@ -282,9 +284,19 @@
}
break;
case self::STEP_DEFINITIONS:
+   $this->printMathObjectInContext();
$this->enableMathStyles();
$mo = MathObject::newFromRevisionText( 
$this->oldId, $this->fId );
-   $this->printSource( var_export( 
$mo->getRelations(), true ) );
+ 

[MediaWiki-commits] [Gerrit] Update mariadb submodule - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Update mariadb submodule
..

Update mariadb submodule

Change-Id: Iebbbf27c92aa3b759c38efd59f85709571cdc950
---
M modules/mariadb
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/60/256460/1

diff --git a/modules/mariadb b/modules/mariadb
index 3e5eac0..9cd9571 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 3e5eac0d99b645607a0fc960a71ec4e999f6eac1
+Subproject commit 9cd95714109e2a30b0761d35570e751e1672af5c

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

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

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


[MediaWiki-commits] [Gerrit] Connect OOjs UI to MediaWiki's localisation system - change (mediawiki/core)

2015-12-02 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Connect OOjs UI to MediaWiki's localisation system
..

Connect OOjs UI to MediaWiki's localisation system

Somehow we have forgotten to do this in here, it was only done in
VisualEditor, which is why no one noticed for so long.

Bug: T119984
Change-Id: I9154345119846dcba90c30f81636ea70fd524471
(cherry picked from commit f034d488b3689fccde621f55f6b6a0e8814eb24f)
---
M resources/ResourcesOOUI.php
A resources/src/oojs-ui-local.js
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/59/256459/1

diff --git a/resources/ResourcesOOUI.php b/resources/ResourcesOOUI.php
index caf6dab..d3b74f2 100644
--- a/resources/ResourcesOOUI.php
+++ b/resources/ResourcesOOUI.php
@@ -36,6 +36,7 @@
$modules['oojs-ui'] = array(
'scripts' => array(
'resources/lib/oojs-ui/oojs-ui.js',
+   'resources/src/oojs-ui-local.js',
),
'skinScripts' => array_combine(
array_keys( $themes ),
@@ -51,6 +52,7 @@
'oojs-ui.styles.icons',
'oojs-ui.styles.indicators',
'oojs-ui.styles.textures',
+   'mediawiki.language',
),
'messages' => array(
'ooui-dialog-message-accept',
diff --git a/resources/src/oojs-ui-local.js b/resources/src/oojs-ui-local.js
new file mode 100644
index 000..84ec92d
--- /dev/null
+++ b/resources/src/oojs-ui-local.js
@@ -0,0 +1,5 @@
+// Connect OOjs UI to MediaWiki's localisation system
+( function ( mw ) {
+   OO.ui.getUserLanguages = mw.language.getFallbackLanguageChain;
+   OO.ui.msg = mw.msg;
+}( mediaWiki ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9154345119846dcba90c30f81636ea70fd524471
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.7
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Fixing resource type error - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Fixing resource type error
..


Fixing resource type error

Change-Id: Iac3c9b9cd84f8257186a6ad4d61ef17c0eeb4648
---
M manifests/config.pp
M manifests/ssl_key.pp
2 files changed, 8 insertions(+), 8 deletions(-)

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



diff --git a/manifests/config.pp b/manifests/config.pp
index bef17ae..602dc1d 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -92,19 +92,19 @@
 require => File['/etc/mysql']
 }
 mariadb::ssl_key { 'cacert':
-file => 'cacert.pem',
+filename => 'cacert.pem',
 }
 mariadb::ssl_key { 'server-key':
-file => 'server-key.pem',
+filename => 'server-key.pem',
 }
 mariadb::ssl_key { 'server-cert':
-file => 'server-cert.pem',
+filename => 'server-cert.pem',
 }
 mariadb::ssl_key { 'client-key':
-file => 'client-key.pem',
+filename => 'client-key.pem',
 }
 mariadb::ssl_key { 'client-cert':
-file => 'client-cert.pem',
+filename => 'client-cert.pem',
 }
 }
 }
diff --git a/manifests/ssl_key.pp b/manifests/ssl_key.pp
index e378617..bbfa238 100644
--- a/manifests/ssl_key.pp
+++ b/manifests/ssl_key.pp
@@ -1,12 +1,12 @@
-class mariadb::ssl_key ($file) {
-file { "/etc/mysql/ssl/${file}":
+class mariadb::ssl_key ($filename) {
+file { "/etc/mysql/ssl/${filename}":
 ensure=> file,
 owner => 'root',
 group => 'mysql',
 mode  => '0440',
 show_diff => false,
 backup=> false,
-content   => secret("mysql/${file}"),
+content   => secret("mysql/${filename}"),
 require   => File['/etc/mysql/ssl'],
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac3c9b9cd84f8257186a6ad4d61ef17c0eeb4648
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (apps...wikipedia)

2015-12-02 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Localisation updates from https://translatewiki.net.
..

Localisation updates from https://translatewiki.net.

Change-Id: I14d1c468297b5738288d639e198f7b915688d086
---
M app/src/main/res/values-af/strings.xml
M app/src/main/res/values-ak/strings.xml
M app/src/main/res/values-ar/strings.xml
M app/src/main/res/values-as/strings.xml
M app/src/main/res/values-bn/strings.xml
M app/src/main/res/values-br/strings.xml
M app/src/main/res/values-ca/strings.xml
M app/src/main/res/values-cs/strings.xml
M app/src/main/res/values-cy/strings.xml
M app/src/main/res/values-da/strings.xml
M app/src/main/res/values-de/strings.xml
M app/src/main/res/values-el/strings.xml
M app/src/main/res/values-eo/strings.xml
M app/src/main/res/values-es/strings.xml
M app/src/main/res/values-et/strings.xml
M app/src/main/res/values-eu/strings.xml
M app/src/main/res/values-fa/strings.xml
M app/src/main/res/values-fi/strings.xml
M app/src/main/res/values-fo/strings.xml
M app/src/main/res/values-fr/strings.xml
M app/src/main/res/values-gl/strings.xml
M app/src/main/res/values-gu/strings.xml
M app/src/main/res/values-hi/strings.xml
M app/src/main/res/values-hu/strings.xml
M app/src/main/res/values-ia/strings.xml
M app/src/main/res/values-in/strings.xml
M app/src/main/res/values-it/strings.xml
M app/src/main/res/values-iw/strings.xml
M app/src/main/res/values-ja/strings.xml
M app/src/main/res/values-ji/strings.xml
M app/src/main/res/values-ka/strings.xml
M app/src/main/res/values-km/strings.xml
M app/src/main/res/values-kn/strings.xml
M app/src/main/res/values-ko/strings.xml
M app/src/main/res/values-ku/strings.xml
M app/src/main/res/values-kw/strings.xml
M app/src/main/res/values-ky/strings.xml
M app/src/main/res/values-lb/strings.xml
M app/src/main/res/values-lt/strings.xml
M app/src/main/res/values-mk/strings.xml
M app/src/main/res/values-ml/strings.xml
M app/src/main/res/values-mr/strings.xml
M app/src/main/res/values-ms/strings.xml
M app/src/main/res/values-mt/strings.xml
M app/src/main/res/values-my/strings.xml
M app/src/main/res/values-nb/strings.xml
M app/src/main/res/values-nl/strings.xml
M app/src/main/res/values-oc/strings.xml
M app/src/main/res/values-or/strings.xml
M app/src/main/res/values-pa/strings.xml
M app/src/main/res/values-pl/strings.xml
M app/src/main/res/values-ps/strings.xml
M app/src/main/res/values-pt-rBR/strings.xml
M app/src/main/res/values-pt/strings.xml
M app/src/main/res/values-ro/strings.xml
M app/src/main/res/values-ru/strings.xml
M app/src/main/res/values-sa/strings.xml
M app/src/main/res/values-sd/strings.xml
M app/src/main/res/values-si/strings.xml
M app/src/main/res/values-sk/strings.xml
M app/src/main/res/values-sr/strings.xml
M app/src/main/res/values-sv/strings.xml
M app/src/main/res/values-sw/strings.xml
M app/src/main/res/values-ta/strings.xml
M app/src/main/res/values-te/strings.xml
M app/src/main/res/values-th/strings.xml
M app/src/main/res/values-tl/strings.xml
M app/src/main/res/values-tr/strings.xml
M app/src/main/res/values-uk/strings.xml
M app/src/main/res/values-ur/strings.xml
M app/src/main/res/values-uz/strings.xml
M app/src/main/res/values-vi/strings.xml
M app/src/main/res/values-zh-rTW/strings.xml
M app/src/main/res/values-zh/strings.xml
74 files changed, 149 insertions(+), 83 deletions(-)


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

diff --git a/app/src/main/res/values-af/strings.xml 
b/app/src/main/res/values-af/strings.xml
index 33f0c04..69a6ba0 100644
--- a/app/src/main/res/values-af/strings.xml
+++ b/app/src/main/res/values-af/strings.xml
@@ -13,7 +13,7 @@
   Skrap gestoorde bladsye
   Hierdie bladsy bestaan nie.
   Vandag
-  Skrap webblaaier 
geskiedenis?
+  Skrap webblaaier 
geskiedenis?
   Gestoorde bladsye
   Opdateer gestoorde 
bladsye
   Opdateer gestoorde 
bladsye
diff --git a/app/src/main/res/values-ak/strings.xml 
b/app/src/main/res/values-ak/strings.xml
index 344ca34..54076e4 100644
--- a/app/src/main/res/values-ak/strings.xml
+++ b/app/src/main/res/values-ak/strings.xml
@@ -10,7 +10,7 @@
   Pepa nea woayɛ atwam
   Popa nkrataa a woakora so
   Krataafa biara nni ha saa
-  Popa browsing a atwam
+  Popa browsing a 
atwam
   Nkrataa a wode asie
   Sesa nkrataa a wode asie
   Sesa nkrataa a wode 
asie
diff --git a/app/src/main/res/values-ar/strings.xml 
b/app/src/main/res/values-ar/strings.xml
index ae542b8..b2db146 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -13,7 +13,8 @@
   إفراغ الصفحات المحفوظة
   هذه الصفحة غير موجودة.
   اليوم
-  مسح تاريخ التصفح؟
+  مسح تاريخ 
التصفح؟
+  هل أنت متأكد من أنك 
تريد مسح كل التاريخ؟
   الصفحات المحفوظة
   تحديث الصفحات المحفوظة
   تحديث الصفحات 
المحفوظة
@@ -41,7 +42,7 @@
   شارك
   بالقرب من هنا
   لا يوجد صفحات بالقرب من هنا!
-  انتقل إلى مكانٍ جديد، لرؤية 
صفحات 

[MediaWiki-commits] [Gerrit] Assign per-data Salt grains for debdeploy - change (operations/puppet)

2015-12-02 Thread Muehlenhoff (Code Review)
Muehlenhoff has uploaded a new change for review.

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

Change subject: Assign per-data Salt grains for debdeploy
..

Assign per-data Salt grains for debdeploy

Most of the Salt grain addressing occurs per-role, but there's also
widespread updates of tools without service impact which can better
be handled en gros. Define an additional Salt grain per data centre.

Bug: T111006
Change-Id: I8ea5c3db684dd3c0576b9a63163d1376835a4780
---
M hieradata/codfw.yaml
M hieradata/eqiad.yaml
M hieradata/esams.yaml
M hieradata/ulsfo.yaml
M modules/base/manifests/debdeploy.pp
5 files changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/62/256462/1

diff --git a/hieradata/codfw.yaml b/hieradata/codfw.yaml
index d1a13c7..c00026c 100644
--- a/hieradata/codfw.yaml
+++ b/hieradata/codfw.yaml
@@ -39,3 +39,7 @@
 - conf1001.eqiad.wmnet
 - conf1002.eqiad.wmnet
 - conf1003.eqiad.wmnet
+
+debdeploy::dc_grain:
+  debdeploy-dc-codfw:
+value: standard
diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml
index 8ee040b..1913a12 100644
--- a/hieradata/eqiad.yaml
+++ b/hieradata/eqiad.yaml
@@ -108,3 +108,7 @@
   pdns_db_name: 'pdns'
   rabbit_host:  *labsnovacontroller
   controller_hostname: *labsnovacontroller
+
+debdeploy::dc_grain:
+  debdeploy-dc-eqiad:
+value: standard
diff --git a/hieradata/esams.yaml b/hieradata/esams.yaml
index 030ef4d..eb36991 100644
--- a/hieradata/esams.yaml
+++ b/hieradata/esams.yaml
@@ -1 +1,4 @@
 ganglia_aggregators: hooft.esams.wikimedia.org:11649
+debdeploy::dc_grain:
+  debdeploy-dc-esams:
+value: standard
diff --git a/hieradata/ulsfo.yaml b/hieradata/ulsfo.yaml
index 1081ce0..222dfc3 100644
--- a/hieradata/ulsfo.yaml
+++ b/hieradata/ulsfo.yaml
@@ -1 +1,4 @@
 ganglia_aggregators: bast4001.wikimedia.org:12649
+debdeploy::dc_grain:
+  debdeploy-dc-ulsfo:
+value: standard
diff --git a/modules/base/manifests/debdeploy.pp 
b/modules/base/manifests/debdeploy.pp
index ffa260d..f44afe3 100644
--- a/modules/base/manifests/debdeploy.pp
+++ b/modules/base/manifests/debdeploy.pp
@@ -14,4 +14,11 @@
 if $grains != {} {
 create_resources(salt::grain, $grains)
 }
+
+$dc_grain = hiera_hash('debdeploy::dc_grain', {})
+
+if $dc_grain != {} {
+create_resources(salt::grain, $dc_grain)
+}
+
 }

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

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

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


[MediaWiki-commits] [Gerrit] Eventloggging alarm that triggers when sql insertion decreases - change (operations/puppet)

2015-12-02 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Eventloggging alarm that triggers when sql insertion decreases
..


Eventloggging alarm that triggers when sql insertion decreases

Bug: T119771
Change-Id: Ic39dfcaa62f79e743bc2336fc79ef1614234a023
---
M modules/eventlogging/manifests/monitoring/graphite.pp
1 file changed, 17 insertions(+), 0 deletions(-)

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



diff --git a/modules/eventlogging/manifests/monitoring/graphite.pp 
b/modules/eventlogging/manifests/monitoring/graphite.pp
index 24cefea..e7553be 100644
--- a/modules/eventlogging/manifests/monitoring/graphite.pp
+++ b/modules/eventlogging/manifests/monitoring/graphite.pp
@@ -56,4 +56,21 @@
 until => '10min',
 contact_group => 'analytics',
 }
+
+
+# Warn/Alert if the db inserts of EventLogging data have dropped 
dramatically
+# Since the MySQL consumer is at the bottom of the pipeline
+# this metric is a good proxy to make sure events are flowing through the
+# kafka pipeline
+monitoring::graphite_threshold { 'eventlogging_overall_inserted_rate':
+description   => 'Overall insertion rate from MySQL consumer',
+metric=> "eventlogging.overall.inserted.rate",
+warning   => 100,
+critical  => 10,
+percentage=> 20, # At least 3 of the (25 - 10) = 15 readings
+from  => '25min',
+until => '10min',
+contact_group => 'analytics',
+under => true
+}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic39dfcaa62f79e743bc2336fc79ef1614234a023
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Nuria 
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] icinga cleanup: move gsb monitoring to ./monitor/ - change (operations/puppet)

2015-12-02 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: icinga cleanup: move gsb monitoring to ./monitor/
..

icinga cleanup: move gsb monitoring to ./monitor/

Move the gsb monitoring class to ./monitor/ along with
the other existing classes doing similar stuff.

Use the same naming scheme for classes for general cleanup
of the icinga module.

Change-Id: I1efa09d01835fb648b191a3ed34f5dbb7ef24425
---
M manifests/role/icinga.pp
R modules/icinga/manifests/monitor/gsb.pp
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/67/256467/1

diff --git a/manifests/role/icinga.pp b/manifests/role/icinga.pp
index 2d2bded..f1e011a 100644
--- a/manifests/role/icinga.pp
+++ b/manifests/role/icinga.pp
@@ -20,13 +20,13 @@
 include icinga::monitor::ripeatlas
 include icinga::monitor::legal
 include icinga::monitor::certs
+include icinga::monitor::gsb
 include icinga::groups::misc
 include lvs::monitor
 include role::authdns::monitoring
 include network::checks
 include scap::dsh
 include mysql
-include icinga::gsbmonitoring
 include nrpe
 include standard
 include base::firewall
diff --git a/modules/icinga/manifests/gsbmonitoring.pp 
b/modules/icinga/manifests/monitor/gsb.pp
similarity index 97%
rename from modules/icinga/manifests/gsbmonitoring.pp
rename to modules/icinga/manifests/monitor/gsb.pp
index 3ca9478..13aea34 100644
--- a/modules/icinga/manifests/gsbmonitoring.pp
+++ b/modules/icinga/manifests/monitor/gsb.pp
@@ -1,4 +1,4 @@
-class icinga::gsbmonitoring($client_id, $api_key){
+class icinga::monitor::gsb($client_id, $api_key){
 @monitoring::host { 'google':
 host_fqdn => 'google.com'
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1efa09d01835fb648b191a3ed34f5dbb7ef24425
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] labtestcontrol install changes - change (operations/puppet)

2015-12-02 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: labtestcontrol install changes
..


labtestcontrol install changes

* glance /srv/glance/images cannot be created as
  /srv/glance isn't handled
* puppetmaster role for controller should be a top level
  role keyword item
* hiera lookup files are specified by realm
* secret lookup by realm needs to be added

Change-Id: I9615c1198e21a7c026f7d90fc08c4dcb0d08d153
---
M manifests/site.pp
M modules/openstack/manifests/adminscripts.pp
M modules/openstack/manifests/glance/service.pp
A modules/puppetmaster/files/labtest.hiera.yaml
M modules/puppetmaster/files/production.hiera.yaml
M modules/role/manifests/labs/openstack/nova.pp
6 files changed, 49 insertions(+), 13 deletions(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index 7470539..32c2a52 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1051,7 +1051,8 @@
 #$is_labs_puppet_master = true
 
 include standard
-role labs::openstack::nova::controller
+role labs::openstack::nova::controller,
+  labs::puppetmaster
 
 #role labs::openstack::nova::controller,
 #  salt::masters::labs,
@@ -1164,6 +1165,7 @@
 $is_labs_puppet_master = true
 
 role labs::openstack::nova::controller,
+  labs::puppetmaster,
   salt::masters::labs,
   deployment::salt_masters,
   dns::ldap
@@ -1186,6 +1188,7 @@
 $is_labs_puppet_master = true
 
 role labs::openstack::nova::controller,
+  labs::puppetmaster,
   salt::masters::labs,
   deployment::salt_masters,
   dns::ldap
diff --git a/modules/openstack/manifests/adminscripts.pp 
b/modules/openstack/manifests/adminscripts.pp
index 470b9c7..0836128 100644
--- a/modules/openstack/manifests/adminscripts.pp
+++ b/modules/openstack/manifests/adminscripts.pp
@@ -2,12 +2,19 @@
 class openstack::adminscripts(
 $novaconfig,
 $openstack_version = $::openstack::version,
+$nova_region = $::site,
 ) {
 
 include passwords::openstack::nova
 $wikitech_nova_ldap_user_pass = 
$passwords::openstack::nova::nova_ldap_user_pass
 $nova_controller_hostname = $novaconfig['controller_hostname']
-$nova_region = $::site
+
+# Installing this package ensures that we have all the UIDs that
+#  are used to store an instance volume.  That's important for
+#  when we rsync files via this host.
+package { 'libvirt-bin':
+ensure => present,
+}
 
 # Handy script to set up environment for commandline nova magic
 file { '/root/novaenv.sh':
@@ -87,14 +94,9 @@
 owner   => 'nova',
 group   => 'nova',
 mode=> '0600',
+require => Package['nova-common']
 }
 
-# Installing this package ensures that we have all the UIDs that
-#  are used to store an instance volume.  That's important for
-#  when we rsync files via this host.
-package { 'libvirt-bin':
-ensure => present,
-}
 # Script to rsync shutoff instances between compute nodes.
 #  This ignores most nova facilities so is a good last resort
 #  when nova is misbehaving.
diff --git a/modules/openstack/manifests/glance/service.pp 
b/modules/openstack/manifests/glance/service.pp
index 544713c..90d48ab 100644
--- a/modules/openstack/manifests/glance/service.pp
+++ b/modules/openstack/manifests/glance/service.pp
@@ -1,6 +1,6 @@
 class openstack::glance::service(
 $openstack_version=$::openstack::version,
-$image_datadir = '/srv/glance/images',
+$glance_data = '/srv/glance/',
 $active_server,
 $standby_server,
 $keystone_host,
@@ -9,6 +9,7 @@
 ) {
 include openstack::repo
 
+$glance_images_dir = "${glance_data}/images"
 $keystone_host_ip  = ipresolve($keystone_host,4)
 $keystone_auth_uri = "http://${active_server}:5000/v2.0;
 
@@ -35,8 +36,17 @@
 require => Class['openstack::repo'],
 }
 
+
 #  This is 775 so that the glancesync user can rsync to it.
-file { $image_datadir:
+file { $glance_data:
+ensure  => directory,
+owner   => 'glance',
+group   => 'glance',
+require => Package['glance'],
+mode=> '0775',
+}
+
+file { $glance_images_dir:
 ensure  => directory,
 owner   => 'glance',
 group   => 'glance',
@@ -90,7 +100,7 @@
 
 if $spandby_server != $active_server {
 cron { 'rsync_glance_images':
-command => "/usr/bin/rsync -aS ${image_datadir}/* 
${standby_server}:${image_datadir}/",
+command => "/usr/bin/rsync -aS ${glance_images_dir}/* 
${standby_server}:${glance_images_dir}/",
 minute  => 15,
 user=> 'glancesync',
 require => User['glancesync'],
@@ -112,7 +122,7 @@
 require => Package['glance'],
 }
  

[MediaWiki-commits] [Gerrit] openstack: fix glance /srv permissions - change (operations/puppet)

2015-12-02 Thread Rush (Code Review)
Rush has uploaded a new change for review.

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

Change subject: openstack: fix glance /srv permissions
..

openstack: fix glance /srv permissions

Change-Id: I567e5f787c8de2e8e291799fccdfdc78c44cbb06
---
M modules/openstack/manifests/glance/service.pp
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/44/256444/1

diff --git a/modules/openstack/manifests/glance/service.pp 
b/modules/openstack/manifests/glance/service.pp
index 90d48ab..bb90b85 100644
--- a/modules/openstack/manifests/glance/service.pp
+++ b/modules/openstack/manifests/glance/service.pp
@@ -36,16 +36,15 @@
 require => Class['openstack::repo'],
 }
 
-
-#  This is 775 so that the glancesync user can rsync to it.
 file { $glance_data:
 ensure  => directory,
-owner   => 'glance',
-group   => 'glance',
+owner   => 'root',
+group   => 'root',
 require => Package['glance'],
-mode=> '0775',
+mode=> '0755',
 }
 
+#  This is 775 so that the glancesync user can rsync to it.
 file { $glance_images_dir:
 ensure  => directory,
 owner   => 'glance',

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

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

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


[MediaWiki-commits] [Gerrit] Updating mariadb to the latest codebase - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Updating mariadb to the latest codebase
..

Updating mariadb to the latest codebase

Change-Id: Ia09c380699cd4f0c24e4d756039cb557082cdd55
References: T111654
---
M modules/mariadb
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/54/256454/1

diff --git a/modules/mariadb b/modules/mariadb
index 7fef40f..3e5eac0 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 7fef40f163f678af7790a0ec8b95afa3429e2234
+Subproject commit 3e5eac0d99b645607a0fc960a71ec4e999f6eac1

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

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

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


[MediaWiki-commits] [Gerrit] Fix Android periodic test polling - change (integration/config)

2015-12-02 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Fix Android periodic test polling
..

Fix Android periodic test polling

apps-android-wikipedia-periodic-test triggers on pollscm. pollscm does
not populate parameters. In this case, the COMMIT parameter was always
empty causing the build to never trigger. Hardcode the polling and build
commit to origin/master.

Change-Id: I2f9e970f95c2a556701d9a4295fc3ab3acf351f1
---
M jjb/mobile.yaml
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/53/256453/1

diff --git a/jjb/mobile.yaml b/jjb/mobile.yaml
index 5af6cf0..f7cfd19 100644
--- a/jjb/mobile.yaml
+++ b/jjb/mobile.yaml
@@ -57,10 +57,6 @@
 node: contintLabsSlave && AndroidEmulator
 defaults: use-remoteonly-zuul
 concurrent: true
-parameters:
- - string:
- name: COMMIT # Seam for manual one-offs.
- default: $GIT_COMMIT # Trigger commit
 properties:
  - throttle-one-per-node
 triggers:
@@ -70,7 +66,7 @@
  - git:
 url: https://phabricator.wikimedia.org/diffusion/APAW
 branches:
-  - ${{COMMIT}}
+  - origin/master # Hardcode to branch so pollscm works properly.
 wrappers:
  - android-emulator:
  os: android-15

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f9e970f95c2a556701d9a4295fc3ab3acf351f1
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] Fixing namespace - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Fixing namespace
..


Fixing namespace

Change-Id: If826b7d22ac19b3906288292987a45911b2e85ee
---
M manifests/config.pp
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/manifests/config.pp b/manifests/config.pp
index 602dc1d..9d3ec46 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -91,19 +91,19 @@
 mode=> '0750',
 require => File['/etc/mysql']
 }
-mariadb::ssl_key { 'cacert':
+ssl_key { 'cacert':
 filename => 'cacert.pem',
 }
-mariadb::ssl_key { 'server-key':
+ssl_key { 'server-key':
 filename => 'server-key.pem',
 }
-mariadb::ssl_key { 'server-cert':
+ssl_key { 'server-cert':
 filename => 'server-cert.pem',
 }
-mariadb::ssl_key { 'client-key':
+ssl_key { 'client-key':
 filename => 'client-key.pem',
 }
-mariadb::ssl_key { 'client-cert':
+ssl_key { 'client-cert':
 filename => 'client-cert.pem',
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If826b7d22ac19b3906288292987a45911b2e85ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add custom header on login page - change (phabricator/extensions)

2015-12-02 Thread 20after4 (Code Review)
20after4 has submitted this change and it was merged.

Change subject: Add custom header on login page
..


Add custom header on login page

Restores https://gerrit.wikimedia.org/r/#/c/194126/ lost due to
https://secure.phabricator.com/T9346

Bug: T116142
Change-Id: Ifba25927758d956baf23215f4c015ddcc412c3ae
---
A CustomLoginHandler.php
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  20after4: Verified; Looks good to me, approved
  Dzahn: Looks good to me, but someone else must approve



diff --git a/CustomLoginHandler.php b/CustomLoginHandler.php
new file mode 100644
index 000..411dfbe
--- /dev/null
+++ b/CustomLoginHandler.php
@@ -0,0 +1,13 @@
+Log in 
or register to Wikimedia PhabricatorClick 
the MediaWiki button below to connect your Wikimedia unified 
account.Alternatively, you can introduce your Labs/Gerrit LDAP credentials.In case of 
doubt, check the Phabricator Help: Creating 
your account.');
+  }
+
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifba25927758d956baf23215f4c015ddcc412c3ae
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions
Gerrit-Branch: master
Gerrit-Owner: Aklapper 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: Dzahn 

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


[MediaWiki-commits] [Gerrit] Getting rid of separate class - change (operations...mariadb)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review.

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

Change subject: Getting rid of separate class
..

Getting rid of separate class

Change-Id: I5a0cd5f7e4bd76ae178c675d195caa43c3011e06
---
M manifests/config.pp
D manifests/ssl_key.pp
2 files changed, 45 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/mariadb 
refs/changes/68/256468/1

diff --git a/manifests/config.pp b/manifests/config.pp
index 9d3ec46..d8034c3 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -91,20 +91,55 @@
 mode=> '0750',
 require => File['/etc/mysql']
 }
-ssl_key { 'cacert':
-filename => 'cacert.pem',
+file { '/etc/mysql/ssl/cacert.pem':
+ensure=> file,
+owner => 'root',
+group => 'mysql',
+mode  => '0440',
+show_diff => false,
+backup=> false,
+content   => secret("mysql/cacert.pem"),
+require   => File['/etc/mysql/ssl'],
 }
-ssl_key { 'server-key':
-filename => 'server-key.pem',
+file { '/etc/mysql/ssl/server-key.pem':
+ensure=> file,
+owner => 'root',
+group => 'mysql',
+mode  => '0440',
+show_diff => false,
+backup=> false,
+content   => secret("mysql/server-key.pem"),
+require   => File['/etc/mysql/ssl'],
 }
-ssl_key { 'server-cert':
-filename => 'server-cert.pem',
+file { '/etc/mysql/ssl/server-cert.pem':
+ensure=> file,
+owner => 'root',
+group => 'mysql',
+mode  => '0440',
+show_diff => false,
+backup=> false,
+content   => secret("mysql/server-cert.pem"),
+require   => File['/etc/mysql/ssl'],
 }
-ssl_key { 'client-key':
-filename => 'client-key.pem',
+file { '/etc/mysql/ssl/client-key.pem':
+ensure=> file,
+owner => 'root',
+group => 'mysql',
+mode  => '0440',
+show_diff => false,
+backup=> false,
+content   => secret("mysql/client-key.pem"),
+require   => File['/etc/mysql/ssl'],
 }
-ssl_key { 'client-cert':
-filename => 'client-cert.pem',
+file { '/etc/mysql/ssl/client-cert.pem':
+ensure=> file,
+owner => 'root',
+group => 'mysql',
+mode  => '0440',
+show_diff => false,
+backup=> false,
+content   => secret("mysql/client-cert.pem"),
+require   => File['/etc/mysql/ssl'],
 }
 }
 }
diff --git a/manifests/ssl_key.pp b/manifests/ssl_key.pp
deleted file mode 100644
index bbfa238..000
--- a/manifests/ssl_key.pp
+++ /dev/null
@@ -1,12 +0,0 @@
-class mariadb::ssl_key ($filename) {
-file { "/etc/mysql/ssl/${filename}":
-ensure=> file,
-owner => 'root',
-group => 'mysql',
-mode  => '0440',
-show_diff => false,
-backup=> false,
-content   => secret("mysql/${filename}"),
-require   => File['/etc/mysql/ssl'],
-}
-}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a0cd5f7e4bd76ae178c675d195caa43c3011e06
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 

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


[MediaWiki-commits] [Gerrit] labtestcontrol install changes - change (operations/puppet)

2015-12-02 Thread Rush (Code Review)
Rush has uploaded a new change for review.

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

Change subject: labtestcontrol install changes
..

labtestcontrol install changes

* glance /srv/glance/images cannot be created as
  /srv/glance isn't handled
* puppetmaster role for controller should be a top level
  role keyword item
* hiera lookup files are specified by realm
* secret lookup by realm needs to be added

Change-Id: I9615c1198e21a7c026f7d90fc08c4dcb0d08d153
---
M manifests/site.pp
M modules/openstack/manifests/adminscripts.pp
M modules/openstack/manifests/glance/service.pp
A modules/puppetmaster/files/labtest.hiera.yaml
M modules/puppetmaster/files/production.hiera.yaml
M modules/role/manifests/labs/openstack/nova.pp
6 files changed, 49 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/35/256435/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 7470539..32c2a52 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1051,7 +1051,8 @@
 #$is_labs_puppet_master = true
 
 include standard
-role labs::openstack::nova::controller
+role labs::openstack::nova::controller,
+  labs::puppetmaster
 
 #role labs::openstack::nova::controller,
 #  salt::masters::labs,
@@ -1164,6 +1165,7 @@
 $is_labs_puppet_master = true
 
 role labs::openstack::nova::controller,
+  labs::puppetmaster,
   salt::masters::labs,
   deployment::salt_masters,
   dns::ldap
@@ -1186,6 +1188,7 @@
 $is_labs_puppet_master = true
 
 role labs::openstack::nova::controller,
+  labs::puppetmaster,
   salt::masters::labs,
   deployment::salt_masters,
   dns::ldap
diff --git a/modules/openstack/manifests/adminscripts.pp 
b/modules/openstack/manifests/adminscripts.pp
index 470b9c7..0836128 100644
--- a/modules/openstack/manifests/adminscripts.pp
+++ b/modules/openstack/manifests/adminscripts.pp
@@ -2,12 +2,19 @@
 class openstack::adminscripts(
 $novaconfig,
 $openstack_version = $::openstack::version,
+$nova_region = $::site,
 ) {
 
 include passwords::openstack::nova
 $wikitech_nova_ldap_user_pass = 
$passwords::openstack::nova::nova_ldap_user_pass
 $nova_controller_hostname = $novaconfig['controller_hostname']
-$nova_region = $::site
+
+# Installing this package ensures that we have all the UIDs that
+#  are used to store an instance volume.  That's important for
+#  when we rsync files via this host.
+package { 'libvirt-bin':
+ensure => present,
+}
 
 # Handy script to set up environment for commandline nova magic
 file { '/root/novaenv.sh':
@@ -87,14 +94,9 @@
 owner   => 'nova',
 group   => 'nova',
 mode=> '0600',
+require => Package['nova-common']
 }
 
-# Installing this package ensures that we have all the UIDs that
-#  are used to store an instance volume.  That's important for
-#  when we rsync files via this host.
-package { 'libvirt-bin':
-ensure => present,
-}
 # Script to rsync shutoff instances between compute nodes.
 #  This ignores most nova facilities so is a good last resort
 #  when nova is misbehaving.
diff --git a/modules/openstack/manifests/glance/service.pp 
b/modules/openstack/manifests/glance/service.pp
index 544713c..90d48ab 100644
--- a/modules/openstack/manifests/glance/service.pp
+++ b/modules/openstack/manifests/glance/service.pp
@@ -1,6 +1,6 @@
 class openstack::glance::service(
 $openstack_version=$::openstack::version,
-$image_datadir = '/srv/glance/images',
+$glance_data = '/srv/glance/',
 $active_server,
 $standby_server,
 $keystone_host,
@@ -9,6 +9,7 @@
 ) {
 include openstack::repo
 
+$glance_images_dir = "${glance_data}/images"
 $keystone_host_ip  = ipresolve($keystone_host,4)
 $keystone_auth_uri = "http://${active_server}:5000/v2.0;
 
@@ -35,8 +36,17 @@
 require => Class['openstack::repo'],
 }
 
+
 #  This is 775 so that the glancesync user can rsync to it.
-file { $image_datadir:
+file { $glance_data:
+ensure  => directory,
+owner   => 'glance',
+group   => 'glance',
+require => Package['glance'],
+mode=> '0775',
+}
+
+file { $glance_images_dir:
 ensure  => directory,
 owner   => 'glance',
 group   => 'glance',
@@ -90,7 +100,7 @@
 
 if $spandby_server != $active_server {
 cron { 'rsync_glance_images':
-command => "/usr/bin/rsync -aS ${image_datadir}/* 
${standby_server}:${image_datadir}/",
+command => "/usr/bin/rsync -aS ${glance_images_dir}/* 
${standby_server}:${glance_images_dir}/",
 minute  => 15,
 user=> 'glancesync',
 require => User['glancesync'],
@@ -112,7 +122,7 @@
  

[MediaWiki-commits] [Gerrit] Connect OOjs UI to MediaWiki's localisation system - change (mediawiki/core)

2015-12-02 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Connect OOjs UI to MediaWiki's localisation system
..

Connect OOjs UI to MediaWiki's localisation system

Somehow we have forgotten to do this in here, it was only done in
VisualEditor, which is why no one noticed for so long.

Bug: T119984
Change-Id: I9154345119846dcba90c30f81636ea70fd524471
---
M resources/ResourcesOOUI.php
A resources/src/oojs-ui-local.js
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/256436/1

diff --git a/resources/ResourcesOOUI.php b/resources/ResourcesOOUI.php
index caf6dab..d3b74f2 100644
--- a/resources/ResourcesOOUI.php
+++ b/resources/ResourcesOOUI.php
@@ -36,6 +36,7 @@
$modules['oojs-ui'] = array(
'scripts' => array(
'resources/lib/oojs-ui/oojs-ui.js',
+   'resources/src/oojs-ui-local.js',
),
'skinScripts' => array_combine(
array_keys( $themes ),
@@ -51,6 +52,7 @@
'oojs-ui.styles.icons',
'oojs-ui.styles.indicators',
'oojs-ui.styles.textures',
+   'mediawiki.language',
),
'messages' => array(
'ooui-dialog-message-accept',
diff --git a/resources/src/oojs-ui-local.js b/resources/src/oojs-ui-local.js
new file mode 100644
index 000..84ec92d
--- /dev/null
+++ b/resources/src/oojs-ui-local.js
@@ -0,0 +1,5 @@
+// Connect OOjs UI to MediaWiki's localisation system
+( function ( mw ) {
+   OO.ui.getUserLanguages = mw.language.getFallbackLanguageChain;
+   OO.ui.msg = mw.msg;
+}( mediaWiki ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9154345119846dcba90c30f81636ea70fd524471
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] Abort previous unfinished API request before sending new req... - change (mediawiki...CodeEditor)

2015-12-02 Thread Gerrit Patch Uploader (Code Review)
Gerrit Patch Uploader has uploaded a new change for review.

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

Change subject: Abort previous unfinished API request before sending new request
..

Abort previous unfinished API request before sending new request

This change requires 81171ab3 from core included in MediaWiki 1.27.

Change-Id: I8dec32bf49e412510cf5d98f2f946bfd337f47a1
---
M modules/jquery.codeEditor.js
1 file changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor 
refs/changes/43/256443/1

diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index ca12d28..555aa96 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -48,7 +48,8 @@
selectedLine = 0,
cookieEnabled,
returnFalse = function () { return false; },
-   extIconPath = mw.config.get( 'wgCodeEditorAssetsPath', 
mw.config.get( 'wgExtensionAssetsPath' ) ) + '/CodeEditor/images/';
+   extIconPath = mw.config.get( 'wgCodeEditorAssetsPath', 
mw.config.get( 'wgExtensionAssetsPath' ) ) + '/CodeEditor/images/',
+   api = new mw.Api();
 
// Initialize state
cookieEnabled = parseInt( mw.cookie.get( 'codeEditor-' + 
context.instance + '-showInvisibleChars' ), 10 );
@@ -293,14 +294,24 @@
context.fn.updateButtonIcon( 'lineWrapping', 
context.fn.lineWrappingToolbarIcon );
},
setCodeEditorPreference: function ( prefValue ) {
-   var api = new mw.Api();
// Do not try to save options for anonymous user
if ( mw.user.isAnon() ) {
return;
}
+
+   // Abort any previous request
+   api.abort();
+
api.saveOption( 'usecodeeditor', prefValue ? 1 
: 0 )
.fail( function ( code, result ) {
-   var message = 'Failed to set code 
editor preference: ' + code;
+   var message;
+
+   if ( code === 'http' && 
result.textStatus === 'abort' ) {
+   // Request was aborted. Ignore 
error
+   return;
+   }
+
+   message = 'Failed to set code editor 
preference: ' + code;
if ( result.error && result.error.info 
) {
message += '\n' + 
result.error.info;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8dec32bf49e412510cf5d98f2f946bfd337f47a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader 

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


[MediaWiki-commits] [Gerrit] Remove legacy 'callback' parameter from startServer and frie... - change (mediawiki...parsoid)

2015-12-02 Thread Cscott (Code Review)
Cscott has uploaded a new change for review.

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

Change subject: Remove legacy 'callback' parameter from startServer and friends.
..

Remove legacy 'callback' parameter from startServer and friends.

Promises all the way, baby.

Change-Id: Id61ab31054345014586dc965486491d8ab17d589
---
M tests/apiServer.js
1 file changed, 22 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/45/256445/1

diff --git a/tests/apiServer.js b/tests/apiServer.js
index 219d9b1..23955a3 100644
--- a/tests/apiServer.js
+++ b/tests/apiServer.js
@@ -53,11 +53,14 @@
 
 /**
  * Starts a server on passed port or a random port if none passed.
- * The callback will get the URL of the started server.
+ * @return {Promise}
+ *   A promise which resolves to an object with two properties: `url`
+ *   (the url of the started server) and `child` (the ChildProcess object
+ *   for the started server).  The promise only resolves after the server
+ *   is up and running (a 'startup' message has been received).
  */
-var startServer = function(opts, cb) {
-   // Don't create callback chains when invoked recursively
-   if (!cb || !cb.promise) { cb = JSUtils.mkPromised(cb); }
+var startServer = function(opts) {
+   var deferred = Promise.defer();
 
if (!opts) {
throw "Please provide server options.";
@@ -117,7 +120,9 @@
console.warn('Restarting server at: ', url);
forkedServers.delete(url);
}
-   startServer(opts, cb);
+   // XXX This server isn't guaranteed to start up at the same url,
+   // but maybe we crashed before we could startup successfully.
+   deferred.resolve(startServer(opts));
});
 
forkedServer.child.on('message', function(m) {
@@ -125,14 +130,11 @@
url = 'http://' + opts.iface + ':' + m.port.toString() 
+ opts.urlPath;
opts.port = m.port;
forkedServers.set(url, forkedServer);
-   if (typeof cb === 'function') {
-   cb(null, { url: url, child: forkedServer.child 
});
-   cb = null; // prevent invoking cb again on 
restart
-   }
+   deferred.resolve({ url: url, child: forkedServer.child 
});
}
});
 
-   return cb.promise;
+   return deferred.promise;
 };
 
 var parsoidServerOpts = {
@@ -149,10 +151,10 @@
serverEnv: {},
 };
 
-// Returns a Promise; the `cb` parameter is optional (for legacy use)
-var startParsoidServer = function(opts, cb) {
+// Returns a Promise. (see startServer)
+var startParsoidServer = function(opts) {
opts = !opts ? parsoidServerOpts : Util.extendProps(opts, 
parsoidServerOpts);
-   return startServer(opts, cb);
+   return startServer(opts);
 };
 
 var mockAPIServerOpts = {
@@ -165,16 +167,20 @@
serverEnv: { silent: true },
 };
 
-// Returns a Promise; the `cb` parameter is optional (for legacy use)
-var startMockAPIServer = function(opts, cb) {
+// Returns a Promise (see startServer)
+var startMockAPIServer = function(opts) {
opts = !opts ? mockAPIServerOpts : Util.extendProps(opts, 
mockAPIServerOpts);
-   return startServer(opts, cb);
+   return startServer(opts);
 };
 
 module.exports = {
+   // These functions aren't currently used outside this module, so
+   // don't export them for now.
+   /*
startServer: startServer,
stopServer: stopServer,
stopAllServers: stopAllServers,
+   */
startParsoidServer: startParsoidServer,
startMockAPIServer: startMockAPIServer,
exitOnProcessTerm: exitOnProcessTerm,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id61ab31054345014586dc965486491d8ab17d589
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott 

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


[MediaWiki-commits] [Gerrit] Update mariadb module - change (operations/puppet)

2015-12-02 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged.

Change subject: Update mariadb module
..


Update mariadb module

Change-Id: Ic8d8d9bed3a890ffc556051bbfef636d4cbbfbde
---
M modules/mariadb
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/mariadb b/modules/mariadb
index 9cd9571..23bfd32 16
--- a/modules/mariadb
+++ b/modules/mariadb
-Subproject commit 9cd95714109e2a30b0761d35570e751e1672af5c
+Subproject commit 23bfd325c53294c1e444994436fa0d601a08c35c

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

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

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


[MediaWiki-commits] [Gerrit] Remove excess parameter from `startServer` call. - change (mediawiki...parsoid)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove excess parameter from `startServer` call.
..


Remove excess parameter from `startServer` call.

This was an oversight in the refactor done by
I8fba8f83a78ba97527dc3908591c24d0334d178c.

Change-Id: Iab21c66cc05189aff8824e5d793cbf5d04265f1d
---
M tests/apiServer.js
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/tests/apiServer.js b/tests/apiServer.js
index 5b60026..219d9b1 100644
--- a/tests/apiServer.js
+++ b/tests/apiServer.js
@@ -152,7 +152,7 @@
 // Returns a Promise; the `cb` parameter is optional (for legacy use)
 var startParsoidServer = function(opts, cb) {
opts = !opts ? parsoidServerOpts : Util.extendProps(opts, 
parsoidServerOpts);
-   return startServer(opts, false, cb);
+   return startServer(opts, cb);
 };
 
 var mockAPIServerOpts = {
@@ -168,7 +168,7 @@
 // Returns a Promise; the `cb` parameter is optional (for legacy use)
 var startMockAPIServer = function(opts, cb) {
opts = !opts ? mockAPIServerOpts : Util.extendProps(opts, 
mockAPIServerOpts);
-   return startServer(opts, false, cb);
+   return startServer(opts, cb);
 };
 
 module.exports = {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab21c66cc05189aff8824e5d793cbf5d04265f1d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: Cscott 
Gerrit-Reviewer: Subramanya Sastry 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] eventlogging, varnish: fix last 2 quoting warnings - change (operations/puppet)

2015-12-02 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: eventlogging, varnish: fix last 2 quoting warnings
..

eventlogging, varnish: fix last 2 quoting warnings

These are the last 2 lint warnings of the type
"double quoted string containing no variable"
across the entire repo (except submodule cassandra).

After fixing these we can re-enable that particular lint check.

Bug:T93645
Change-Id: Ic834d12574d5d5eb04c9701c83c8250451f7d693
---
M modules/eventlogging/manifests/monitoring/graphite.pp
M modules/varnish/manifests/instance.pp
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/72/256472/1

diff --git a/modules/eventlogging/manifests/monitoring/graphite.pp 
b/modules/eventlogging/manifests/monitoring/graphite.pp
index e7553be..a10606a 100644
--- a/modules/eventlogging/manifests/monitoring/graphite.pp
+++ b/modules/eventlogging/manifests/monitoring/graphite.pp
@@ -64,7 +64,7 @@
 # kafka pipeline
 monitoring::graphite_threshold { 'eventlogging_overall_inserted_rate':
 description   => 'Overall insertion rate from MySQL consumer',
-metric=> "eventlogging.overall.inserted.rate",
+metric=> 'eventlogging.overall.inserted.rate',
 warning   => 100,
 critical  => 10,
 percentage=> 20, # At least 3 of the (25 - 10) = 15 readings
diff --git a/modules/varnish/manifests/instance.pp 
b/modules/varnish/manifests/instance.pp
index fa73ae2..b88f7d2 100644
--- a/modules/varnish/manifests/instance.pp
+++ b/modules/varnish/manifests/instance.pp
@@ -49,7 +49,7 @@
 }
 
 # lint:ignore:quoted_booleans
-if inline_template("<%= @directors.map{|k,v| v['dynamic'] 
}.include?('yes') %>") == "true" {
+if inline_template("<%= @directors.map{|k,v| v['dynamic'] 
}.include?('yes') %>") == 'true' {
 $use_dynamic_directors = true
 } else {
 $use_dynamic_directors = false

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic834d12574d5d5eb04c9701c83c8250451f7d693
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] Use `body_only` instead of `bodyOnly` in REST v1/Parsoid v3 ... - change (mediawiki...bundler)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use `body_only` instead of `bodyOnly` in REST v1/Parsoid v3 API.
..


Use `body_only` instead of `bodyOnly` in REST v1/Parsoid v3 API.

Change-Id: I8e194b6e0400a289afb613982399bc76ec4a9161
---
M lib/parsoid.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/lib/parsoid.js b/lib/parsoid.js
index 97abd51..659e69c 100644
--- a/lib/parsoid.js
+++ b/lib/parsoid.js
@@ -249,7 +249,7 @@
form: (
apiURL.api === 'parsoid1' ? { wt: wikitext, 
body: true } :
apiURL.api === 'parsoid2' ? { wikitext: 
wikitext, body: true } :
-   { wikitext: wikitext, bodyOnly: true }
+   { wikitext: wikitext, body_only: true }
),
}, function(error, response, body) {
if (error || response.statusCode !== 200) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e194b6e0400a289afb613982399bc76ec4a9161
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler
Gerrit-Branch: master
Gerrit-Owner: Cscott 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use async serializeDOM in jsapi - change (mediawiki...parsoid)

2015-12-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use async serializeDOM in jsapi
..


Use async serializeDOM in jsapi

 * Replace uses of (sync) `toString` with an (async) `toWikitext` method.

 * Follow up to Id68d24007229dcfa0bf6fb16c6ed3ecdaad0c2e5 where these
   tests were skipped.

Change-Id: I33717f9261885bd121aef27360602fe8ebbc8ccb
---
M guides/jsapi/README.md
M lib/jsapi.js
M tests/mocha/jsapi.js
3 files changed, 269 insertions(+), 80 deletions(-)

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



diff --git a/guides/jsapi/README.md b/guides/jsapi/README.md
index 5ff6dcf..4df3b5a 100644
--- a/guides/jsapi/README.md
+++ b/guides/jsapi/README.md
@@ -12,7 +12,20 @@
 exports vanilla [`Promise`]s if you wish to maintain compatibility
 with old versions of `node` at the cost of a little bit of readability.
 
-Use as a wikitext parser is straightforward (where `text` is
+Since many methods in the API return [`Promise`]s, we've also provided
+a [`Promise`]-aware REPL, that will wait for a promise to be resolved
+before printing its value.  This can be started from the
+shell using:
+
+   node -e 'require("parsoid").repl()'
+
+Use `"./"` instead of `"parsoid"` if you are running this from a
+checked-out repository.  Code examples below which contain lines
+starting with `>` show sessions using this REPL.  (You may also
+wish to look in `tests/mocha/jsapi.js` for examples using a more
+traditional promise-chaining style.)
+
+Use of Parsoid as a wikitext parser is straightforward (where `text` is
 wikitext input):
 
#/usr/bin/node --harmony-generators
@@ -29,8 +42,8 @@
main().done();
 
 As you can see, there is a little bit of boilerplate needed to get the
-asynchronous machinery started.  Future code examples will be assumed
-to replace the body of the `main()` method above.
+asynchronous machinery started.  The body of the `main()` method can
+be replaced with your code.
 
 The `pdoc` variable above holds a [`PDoc`] object, which has
 helpful methods to filter and manipulate the document.  If you want
@@ -46,29 +59,29 @@
 
> var text = "I has a template! {{foo|bar|baz|eggs=spam}} See it?\n";
> var pdoc = yield Parsoid.parse(text, { pdoc: true });
-   > console.log(String(pdoc));
+   > console.log(yield pdoc.toWikitext());
I has a template! {{foo|bar|baz|eggs=spam}} See it?
> var templates = pdoc.filterTemplates();
-   > console.log(templates.map(String));
+   > console.log(yield Promise.map(templates, Parsoid.toWikitext));
[ '{{foo|bar|baz|eggs=spam}}' ]
> var template = templates[0];
> console.log(template.name);
foo
> template.name = 'notfoo';
-   > console.log(String(template));
+   > console.log(yield template.toWikitext());
{{notfoo|bar|baz|eggs=spam}}
> console.log(template.params.map(function(p) { return p.name; }));
[ '1', '2', 'eggs' ]
-   > console.log(template.get(1).value);
+   > console.log(yield template.get(1).value.toWikitext());
bar
-   > console.log(template.get("eggs").value);
+   > console.log(yield template.get("eggs").value.toWikitext());
spam
 
 Getting nested templates is trivial:
 
> var text = "{{foo|bar={{baz|{{spam}}";
> var pdoc = yield Parsoid.parse(text, { pdoc: true });
-   > console.log(pdoc.filterTemplates().map(String));
+   > console.log(yield Promise.map(pdoc.filterTemplates(), 
Parsoid.toWikitext));
[ '{{foo|bar={{baz|{{spam}}',
  '{{baz|{{spam',
  '{{spam}}' ]
@@ -82,15 +95,15 @@
> var text = "{{foo|this {{includes a|template";
> var pdoc = yield Parsoid.parse(text, { pdoc: true });
> var templates = pdoc.filterTemplates({ recursive: false });
-   > console.log(templates.map(String));
+   > console.log(yield Promise.map(templates, Parsoid.toWikitext));
[ '{{foo|this {{includes a|template' ]
> var foo = templates[0];
-   > console.log(String(foo.get(1).value));
+   > console.log(yield foo.get(1).value.toWikitext());
this {{includes a|template}}
> var more = foo.get(1).value.filterTemplates();
-   > console.log(more.map(String));
+   > console.log(yield Promise.map(more, Parsoid.toWikitext));
[ '{{includes a|template}}' ]
-   > console.log(String(more[0].get(1).value));
+   > console.log(yield more[0].get(1).value.toWikitext());
template
 
 Templates can be easily modified to add, remove, or alter params.
@@ -108,13 +121,14 @@
...template.name = 'bar-stub';
...}
... });
-   > console.log(String(pdoc));
+   > console.log(yield pdoc.toWikitext());
{{cleanup|date = July 2012}} '''Foo''' is a [[bar]]. {{bar-stub}}
 
 At any time you can convert the `pdoc` into HTML 

[MediaWiki-commits] [Gerrit] Make "Id starting with underscore" test more precise in Pars... - change (mediawiki...parsoid)

2015-12-02 Thread Cscott (Code Review)
Cscott has uploaded a new change for review.

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

Change subject: Make "Id starting with underscore" test more precise in Parsoid.
..

Make "Id starting with underscore" test more precise in Parsoid.

Use `html/*` so we don't aggressively normalize.

Change-Id: I91f1c717108f982e3a5f1b71ebf0523289075f4b
---
M tests/parserTests.txt
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/86/256486/1

diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index b45d750..62c98c0 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -20207,7 +20207,7 @@
 Id starting with underscore
 !! wikitext
 
-!! html
+!! html/*
 
 
 !! end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91f1c717108f982e3a5f1b71ebf0523289075f4b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott 

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


  1   2   3   4   >