[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' of https://gerrit.wikimedia.org/r/wiki...

2017-07-04 Thread Eileen (Code Review)
Eileen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363290 )

Change subject: Merge branch 'master' of 
https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm into deployment
..

Merge branch 'master' of 
https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm into deployment

 263222b3ff300711cb3fb2eb164529a5b46bff0c Test tidy ups, ensure data from 
failed run doesn not break test
 c8eaf54055cf16983b1ac55e26b25a096eed6d8d Remove further instance of class_api 
in favour of civicrm_api3
 ec413e77b1420c6894642c15d316aca33cc72625 Stop calling deprecated function.
 c3eecf3aed0b672b4a429af5b3338975545c2d3d Remove deprecated function call from 
unit test.
 44894d6cc4e6d875abc92cfa07c437cfcf84d88e Enable CiviCampaign.
 3676cf5ddfedeb17c06fdb86219d0514758cbeb9 Specify output directory for 
make-exchange-refs
 48baba94e0b087eb32a61247440b4afb9d455d0d $correlationId -> $logId
 02955c188a62ff110cd09e9ea62662e62b32425c CiviCRM Submodule update 9e4899f 
CRM-20778 - Use civicontribute permission for contribution recur.cancel 5781882 
CiviCRM composer update.
 c4adb98c4309063a5e1d3ad4945ff4f2056983c8 Add index to civicrm_campaign.name

Change-Id: I0026fbe243c33b8ceb6c96c845d0ef93b082991d
---
D sites/all/modules/large_donation/tests/LargeDonationTest.php
D sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
D sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php
D sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json
D sites/all/modules/queue2civicrm/tests/includes/Message.php
D sites/all/modules/wmf_civicrm/tests/phpunit/PhoneImportTest.php
D sites/all/modules/wmf_communication/tests/phpunit/CiviMailBulkTest.php
7 files changed, 0 insertions(+), 574 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/90/363290/1

diff --git a/sites/all/modules/large_donation/tests/LargeDonationTest.php 
b/sites/all/modules/large_donation/tests/LargeDonationTest.php
deleted file mode 100644
index 72f4b15..000
--- a/sites/all/modules/large_donation/tests/LargeDonationTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<<< HEAD   (e53d62 CiviCRM Submodule update 9e4899f CRM-20778 - Use 
civicontrib)
-===
-threshold = 100;
-
-db_delete( 'large_donation_notification' )
-->execute();
-
-db_insert( 'large_donation_notification' )
-->fields( array(
-'addressee' => 'noti...@localhost.net',
-'threshold' => $this->threshold,
-) )
-->execute();
-
-$result = $this->callAPISuccess('Contact', 'create', array(
-'contact_type' => 'Individual',
-'first_name' => 'Testes',
-));
-$this->contact_id = $result['id'];
-}
-
-function tearDown() {
-db_delete( 'large_donation_notification' )
-->execute();
-
-parent::tearDown();
-}
-
-function testUnderThreshold() {
-$result = civicrm_api3( 'Contribution', 'create', array(
-'contact_id' => $this->contact_id,
-'contribution_type' => 'Cash',
-'currency' => 'USD',
-'payment_instrument' => 'Credit Card',
-'total_amount' => $this->threshold - 0.01,
-'trxn_id' => 'TEST_GATEWAY ' . mt_rand(),
-) );
-
-$this->assertEquals( 0, TestMailer::countMailings() );
-}
-
-function testAboveThreshold() {
-$amount = $this->threshold + 0.01;
-$this->callAPISuccess('Contribution', 'create', array(
-'contact_id' => $this->contact_id,
-'contribution_type' => 'Cash',
-'currency' => 'USD',
-'payment_instrument' => 'Credit Card',
-'total_amount' => $amount,
-'trxn_id' => 'TEST_GATEWAY ' . mt_rand(),
-'source' => 'EUR 2020',
-) );
-
-$this->assertEquals( 1, TestMailer::countMailings() );
-
-$mailing = TestMailer::getMailing( 0 );
-$this->assertEquals( 1, preg_match( "/{$amount}/", $mailing['html'] ),
-'Found amount in the notification email body.' );
-}
-}
->>> BRANCH (c4adb9 Add index to civicrm_campaign.name)
diff --git a/sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php 
b/sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
deleted file mode 100644
index f8ca11c..000
--- a/sites/all/modules/offline2civicrm/tests/ForeignChecksFileTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<<< HEAD   (e53d62 CiviCRM Submodule update 9e4899f CRM-20778 - Use 
civicontrib)
-===
-epochtime = wmf_common_date_parse_string('2017-02-28');
-$this->setExchangeRates($this->epochtime, array('USD' => 1, 'GBP' => 
2));
-
-require_once __DIR__ . "/includes/ForeignChecksFileProbe.php";
-}
-
-function testParseRow() {
-$data = array(
-'Batch Number' => '1234',
- 

[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Exclude vendor directory from linter tests

2017-07-04 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363289 )

Change subject: Exclude vendor directory from linter tests
..

Exclude vendor directory from linter tests

Change-Id: I3e6d5f79001da9c5c0c56a41cfb22fb385dfe689
---
M Gruntfile.js
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/89/363289/1

diff --git a/Gruntfile.js b/Gruntfile.js
index 75215f3..82168fa 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -13,7 +13,8 @@
all: [
'**/*.js',
'!lib/**',
-   '!node_modules/**'
+   '!node_modules/**',
+   '!vendor/**'
]
},
stylelint: {
@@ -32,7 +33,8 @@
jsonlint: {
all: [
'**/*.json',
-   '!node_modules/**'
+   '!node_modules/**',
+   '!vendor/**'
]
}
} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e6d5f79001da9c5c0c56a41cfb22fb385dfe689
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Let PageTitleWidget inherit from OO.ui.MultilineTextInputWidget

2017-07-04 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363288 )

Change subject: Let PageTitleWidget inherit from OO.ui.MultilineTextInputWidget
..

Let PageTitleWidget inherit from OO.ui.MultilineTextInputWidget

Instead of OO.ui.TextInputWidget with multiline configuration,
OO.ui.MultilineTextInputWidget fits our need and also resolves
T169610.

Use readonly property instead of setting the title disabled
for source column.

Bug: T169610
Change-Id: I9e1c9d1f7bcceed2795c9d14fa86eaa6d5960656
---
M modules/ui/styles/widgets/mw.cx.ui.PageTitleWidget.less
M modules/ui/widgets/mw.cx.ui.PageTitleWidget.js
2 files changed, 7 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/88/363288/1

diff --git a/modules/ui/styles/widgets/mw.cx.ui.PageTitleWidget.less 
b/modules/ui/styles/widgets/mw.cx.ui.PageTitleWidget.less
index 9b9d4ed..5f46ebc 100644
--- a/modules/ui/styles/widgets/mw.cx.ui.PageTitleWidget.less
+++ b/modules/ui/styles/widgets/mw.cx.ui.PageTitleWidget.less
@@ -21,6 +21,9 @@
border-color: @gray-light;
box-shadow: inset 0 0 0 1px @gray-light;
}
+   &[readonly] {
+   background-color: @white;
+   }
}
}
 }
diff --git a/modules/ui/widgets/mw.cx.ui.PageTitleWidget.js 
b/modules/ui/widgets/mw.cx.ui.PageTitleWidget.js
index 1821cb2..a8c35f4 100644
--- a/modules/ui/widgets/mw.cx.ui.PageTitleWidget.js
+++ b/modules/ui/widgets/mw.cx.ui.PageTitleWidget.js
@@ -5,21 +5,20 @@
  * It is editable (contenteditable) for translation and readonly for source 
page.
  * Supports validation of values.
  * @class
+ * @extends OO.ui.MultilineTextInputWidget
  * @param {Object} [config] Configuration object
  */
 mw.cx.widgets.PageTitleWidget = function ( config ) {
// Configuration initialization
config = $.extend( config, {
classes: [ 'cx-pagetitle' ],
-   multiline: true,
type: 'text',
-   autosize: true,
-   disable: !this.editable
+   autosize: true
} );
this.editable = config.editable;
// Parent constructor
mw.cx.widgets.PageTitleWidget.super.call( this, config );
-   this.setDisabled( !this.editable );
+   this.setReadOnly( !this.editable );
if ( this.editable ) {
this.setValidation( this.validate );
}
@@ -27,7 +26,7 @@
 
 /* Setup */
 
-OO.inheritClass( mw.cx.widgets.PageTitleWidget, OO.ui.TextInputWidget );
+OO.inheritClass( mw.cx.widgets.PageTitleWidget, OO.ui.MultilineTextInputWidget 
);
 
 mw.cx.widgets.PageTitleWidget.prototype.validate = function ( value ) {
if ( value === undefined || value === null || value === '' ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e1c9d1f7bcceed2795c9d14fa86eaa6d5960656
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] labs...wikibugs2[master]: Wikimedia-cloud: Adjust for renamed tags

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363287 )

Change subject: Wikimedia-cloud: Adjust for renamed tags
..


Wikimedia-cloud: Adjust for renamed tags

Update tasks sent to the #wikimedia-could channel to work with renamed
tags.

Bug: T167244
Change-Id: I70b8180dea8b63a4f6deb6f3e244492c72f8555f
---
M channels.yaml
1 file changed, 15 insertions(+), 7 deletions(-)

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



diff --git a/channels.yaml b/channels.yaml
index 68100b1..c8cfd1c 100644
--- a/channels.yaml
+++ b/channels.yaml
@@ -76,17 +76,25 @@
 - translatewiki\.net
 
 "#wikimedia-cloud":
-- Tool-Labs(.*)?
-- Labs(-.*)?
-- Wikimedia-Labs(-.*)?
-- MediaWiki-extensions-OpenStackManager
-- Quarry
-- Wikibugs
+- Cloud-Services
+- cloud-services-team(.*)?
+- Cloud-VPS
+- Data-Services
 - Gerrit-Patch-Uploader
+- Horizon
 - LabsDB-Auditor
+- MediaWiki-extensions-OpenStackManager
 - PAWS
+- Quarry
 - Striker
-- cloud-services-team
+- Tool-(.*)
+- Toolforge
+- Tools
+- Tools-Kubernetes
+- VPS-Project-(.*)
+- VPS-Projects
+- Wikibugs
+- wikitech.wikimedia.org
 
 "#wikimedia-devtools":
 # teams

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I70b8180dea8b63a4f6deb6f3e244492c72f8555f
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/wikibugs2
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...wikibugs2[master]: Wikimedia-cloud: Adjust for renamed tags

2017-07-04 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363287 )

Change subject: Wikimedia-cloud: Adjust for renamed tags
..

Wikimedia-cloud: Adjust for renamed tags

Update tasks sent to the #wikimedia-could channel to work with renamed
tags.

Bug: T167244
Change-Id: I70b8180dea8b63a4f6deb6f3e244492c72f8555f
---
M channels.yaml
1 file changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 
refs/changes/87/363287/1

diff --git a/channels.yaml b/channels.yaml
index 68100b1..c8cfd1c 100644
--- a/channels.yaml
+++ b/channels.yaml
@@ -76,17 +76,25 @@
 - translatewiki\.net
 
 "#wikimedia-cloud":
-- Tool-Labs(.*)?
-- Labs(-.*)?
-- Wikimedia-Labs(-.*)?
-- MediaWiki-extensions-OpenStackManager
-- Quarry
-- Wikibugs
+- Cloud-Services
+- cloud-services-team(.*)?
+- Cloud-VPS
+- Data-Services
 - Gerrit-Patch-Uploader
+- Horizon
 - LabsDB-Auditor
+- MediaWiki-extensions-OpenStackManager
 - PAWS
+- Quarry
 - Striker
-- cloud-services-team
+- Tool-(.*)
+- Toolforge
+- Tools
+- Tools-Kubernetes
+- VPS-Project-(.*)
+- VPS-Projects
+- Wikibugs
+- wikitech.wikimedia.org
 
 "#wikimedia-devtools":
 # teams

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70b8180dea8b63a4f6deb6f3e244492c72f8555f
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/wikibugs2
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Factor OldRevisionImporter & WikiRevisionOldRevision out of ...

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363286 )

Change subject: Factor OldRevisionImporter & WikiRevisionOldRevision out of 
WikiRevision
..

Factor OldRevisionImporter & WikiRevisionOldRevision out of WikiRevision

Change-Id: Ib094d4829764ccc8e5bd2619fb827d701ae06d43
---
M autoload.php
A includes/import/OldRevisionImporter.php
M includes/import/WikiRevision.php
A includes/import/WikiRevisionOldRevision.php
4 files changed, 208 insertions(+), 96 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/363286/1

diff --git a/autoload.php b/autoload.php
index e172f58..c3a7fd4 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1039,6 +1039,7 @@
'ObjectFactory' => __DIR__ . '/includes/libs/ObjectFactory.php',
'OldChangesList' => __DIR__ . '/includes/changes/OldChangesList.php',
'OldLocalFile' => __DIR__ . '/includes/filerepo/file/OldLocalFile.php',
+   'OldRevisionImporter' => __DIR__ . 
'/includes/import/OldRevisionImporter.php',
'OracleInstaller' => __DIR__ . 
'/includes/installer/OracleInstaller.php',
'OracleUpdater' => __DIR__ . '/includes/installer/OracleUpdater.php',
'OrphanStats' => __DIR__ . '/maintenance/storage/orphanStats.php',
@@ -1611,6 +1612,7 @@
'WikiPage' => __DIR__ . '/includes/page/WikiPage.php',
'WikiReference' => __DIR__ . '/includes/WikiReference.php',
'WikiRevision' => __DIR__ . '/includes/import/WikiRevision.php',
+   'WikiRevisionOldRevision' => __DIR__ . 
'/includes/import/WikiRevisionOldRevision.php',
'WikiRevisionUpload' => __DIR__ . 
'/includes/import/WikiRevisionUpload.php',
'WikiStatsOutput' => __DIR__ . '/maintenance/language/StatOutputs.php',
'WikiTextStructure' => __DIR__ . 
'/includes/content/WikiTextStructure.php',
diff --git a/includes/import/OldRevisionImporter.php 
b/includes/import/OldRevisionImporter.php
new file mode 100644
index 000..c20
--- /dev/null
+++ b/includes/import/OldRevisionImporter.php
@@ -0,0 +1,138 @@
+doUpdates = $doUpdates;
+   $this->logger = $logger;
+   }
+
+   /**
+* @since 1.30
+* 
+* @param WikiRevisionOldRevision $wikiRevision
+* 
+* @return bool
+*/
+   public function import( WikiRevisionOldRevision $wikiRevision ) {
+   $dbw = wfGetDB( DB_MASTER );
+
+   # Sneak a single revision into place
+   $user = $wikiRevision->getUserObj() ?: User::newFromName( 
$wikiRevision->getUser() );
+   if ( $user ) {
+   $userId = intval( $user->getId() );
+   $userText = $user->getName();
+   } else {
+   $userId = 0;
+   $userText = $wikiRevision->getUser();
+   $user = new User;
+   }
+
+   // avoid memory leak...?
+   Title::clearCaches();
+
+   $page = WikiPage::factory( $wikiRevision->getTitle() );
+   $page->loadPageData( 'fromdbmaster' );
+   if ( !$page->exists() ) {
+   // must create the page...
+   $pageId = $page->insertOn( $dbw );
+   $created = true;
+   $oldcountable = null;
+   } else {
+   $pageId = $page->getId();
+   $created = false;
+
+   $prior = $dbw->selectField( 'revision', '1',
+   [ 'rev_page' => $pageId,
+   'rev_timestamp' => $dbw->timestamp( 
$wikiRevision->getTimestamp() ),
+   'rev_user_text' => $userText,
+   'rev_comment' => 
$wikiRevision->getComment() ],
+   __METHOD__
+   );
+   if ( $prior ) {
+   // @todo FIXME: This could fail slightly for 
multiple matches :P
+   wfDebug( __METHOD__ . ": skipping existing 
revision for [[" .
+   
$wikiRevision->getTitle()->getPrefixedText() . "]], timestamp " . 
$wikiRevision->getTimestamp() . "\n" );
+   return false;
+   }
+   }
+
+   if ( !$pageId ) {
+   // This seems to happen if two clients simultaneously 
try to import the
+   // same page
+   wfDebug( __METHOD__ . ': got invalid $pageId when 
importing revision of [[' .
+   $wikiRevision->getTitle()->getPrefixedText() . 
']], timestamp ' . $wikiRevision->getTimestamp() . "\n" );
+   return false;
+   }
+
+   // Select previous version to make 

[MediaWiki-commits] [Gerrit] wikidata...gui[master]: [DNM] Bootstrap 4 test

2017-07-04 Thread Jonas Kress (WMDE) (Code Review)
Jonas Kress (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363285 )

Change subject: [DNM] Bootstrap 4 test
..

[DNM] Bootstrap 4 test

Change-Id: I2ddfde543120e9df39331582866b3f024fab17df
---
M index.html
M package.json
M style.css
M vendor/bootstrapx-clickover/bootstrapx-clickover.js
M wikibase/queryService/ui/App.js
M wikibase/queryService/ui/QueryExampleDialog.js
M wikibase/queryService/ui/queryHelper/SelectorBox.js
7 files changed, 331 insertions(+), 267 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/85/363285/1

diff --git a/index.html b/index.html
index 9d1e7b7..85ca791 100644
--- a/index.html
+++ b/index.html
@@ -1,275 +1,334 @@
 
 
-
-
-
-   
-   Wikidata Query Service
+
+
+
+
+Wikidata Query Service
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+☰
+ 
+
+
+
+
+
+
 
-
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-
-   
-   
-   
-   
-
-
-   
-   
-   
-   
-   
-   
-   Toggle 
navigation   

-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   

-   
-   https://tools.wmflabs.org/hay/propbrowse/;> Hay's Properties 
Browser
-   https://tools.wmflabs.org/sqid/#/browse?type=properties;> SQID 
Properties Browser
-   https://angryloki.github.io/wikidata-graph-builder/;> Wikidata 
Graph Builder
-   
-   https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md;> Exploring 
Linked Data
-   https://tools.wmflabs.org/wdq2sparql/w2s.php;> WDQ Syntax Translator
-   https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#SPARQL_endpoint;> SPARQL REST 
Endpoint
-   
-   
-   
-   https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Wikidata_Query_Help;
 target="_blank" class="btn btn-default">
+
+https://tools.wmflabs.org/hay/propbrowse/;> Hay's 
Properties Browser
+
+https://tools.wmflabs.org/sqid/#/browse?type=properties;> SQID 
Properties Browser
+
+https://angryloki.github.io/wikidata-graph-builder/;> Wikidata 
Graph Builder
+
+
+https://github.com/wikimedia/wikidata-query-rdf/blob/master/docs/exploring-linked-data.md;> Exploring 
Linked Data
+
+https://tools.wmflabs.org/wdq2sparql/w2s.php;> WDQ Syntax 
Translator
+
+https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#SPARQL_endpoint;> SPARQL REST 
Endpoint
+
+
+
+
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WIP factor UploadImporter out of WikiRevision

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363284 )

Change subject: WIP factor UploadImporter out of WikiRevision
..

WIP factor UploadImporter out of WikiRevision

Change-Id: I4a6c573fc0a69b06d696cd2afca9226fb492a9bc
---
M autoload.php
A includes/import/UploadImporter.php
M includes/import/WikiRevision.php
3 files changed, 107 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/363284/1

diff --git a/autoload.php b/autoload.php
index 2560bdb..d64647e 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1525,6 +1525,7 @@
'UploadFromFile' => __DIR__ . '/includes/upload/UploadFromFile.php',
'UploadFromStash' => __DIR__ . '/includes/upload/UploadFromStash.php',
'UploadFromUrl' => __DIR__ . '/includes/upload/UploadFromUrl.php',
+   'UploadImporter' => __DIR__ . '/includes/import/UploadImporter.php',
'UploadLogFormatter' => __DIR__ . 
'/includes/logging/UploadLogFormatter.php',
'UploadSourceAdapter' => __DIR__ . 
'/includes/import/UploadSourceAdapter.php',
'UploadSourceField' => __DIR__ . '/includes/specials/SpecialUpload.php',
diff --git a/includes/import/UploadImporter.php 
b/includes/import/UploadImporter.php
new file mode 100644
index 000..feaf4ea
--- /dev/null
+++ b/includes/import/UploadImporter.php
@@ -0,0 +1,101 @@
+logger = $logger;
+   }
+
+   /**
+* @return StatusValue
+*/
+   private function newNotOkStatus() {
+   $statusValue = new StatusValue();
+   $statusValue->setOK( false );
+   return $statusValue;
+   }
+
+   /**
+* @todo maybe accept a finer grained WikiRevision interface here...?
+*
+* @param WikiRevision $wikiRevision
+*
+* @return StatusValue On success, the value member contains the
+* archive name, or an empty string if it was a new file.
+*/
+   public function import( WikiRevision $wikiRevision ) {
+   # Construct a file
+   $archiveName = $wikiRevision->getArchiveName();
+   if ( $archiveName ) {
+   $this->logger->debug( __METHOD__ . "Importing archived 
file as $archiveName\n" );
+   $file = OldLocalFile::newFromArchiveName( 
$wikiRevision->getTitle(),
+   RepoGroup::singleton()->getLocalRepo(), 
$archiveName );
+   } else {
+   $file = wfLocalFile( $wikiRevision->getTitle() );
+   $file->load( File::READ_LATEST );
+   $this->logger->debug( __METHOD__ . 'Importing new file 
as ' . $file->getName() . "\n" );
+   if ( $file->exists() && $file->getTimestamp() > 
$wikiRevision->getTimestamp() ) {
+   $archiveName = $file->getTimestamp() . '!' . 
$file->getName();
+   $file = OldLocalFile::newFromArchiveName( 
$wikiRevision->getTitle(),
+   RepoGroup::singleton()->getLocalRepo(), 
$archiveName );
+   $this->logger->debug( __METHOD__ . "File 
already exists; importing as $archiveName\n" );
+   }
+   }
+   if ( !$file ) {
+   $this->logger->debug( __METHOD__ . ': Bad file for ' . 
$wikiRevision->getTitle() . "\n" );
+   return $this->newNotOkStatus();
+   }
+
+   # Get the file source or download if necessary
+   $source = $wikiRevision->getFileSrc();
+   $autoDeleteSource = $wikiRevision->isTempSrc();
+   if ( !strlen( $source ) ) {
+   $source = $wikiRevision->downloadSource();
+   $autoDeleteSource = true;
+   }
+   if ( !strlen( $source ) ) {
+   $this->logger->debug( __METHOD__ . ": Could not fetch 
remote file.\n" );
+   return $this->newNotOkStatus();
+   }
+
+   $tmpFile = new TempFSFile( $source );
+   if ( $autoDeleteSource ) {
+   $tmpFile->autocollect();
+   }
+
+   $sha1File = ltrim( sha1_file( $source ), '0' );
+   $sha1 = $wikiRevision->getSha1();
+   if ( $sha1 && ( $sha1 !== $sha1File ) ) {
+   $this->logger->debug( __METHOD__ . ": Corrupt file 
$source.\n" );
+   return $this->newNotOkStatus();
+   }
+
+   $user = $wikiRevision->getUserObj() ?: User::newFromName( 
$wikiRevision->getUser() );
+
+   # Do the actual upload
+   if ( $archiveName ) {
+   $status = $file->uploadOld( $source, $archiveName,
+   $wikiRevision->getTimestamp(), 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix Revi's mailmap email address

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363040 )

Change subject: Fix Revi's mailmap email address
..


Fix Revi's mailmap email address

I just realized it was using old email address. While it redirects
to the new address, it's better to have it fixed.

Change-Id: I2df2a32f6144acca985d04b4bf58372343d119f6
---
M .mailmap
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/.mailmap b/.mailmap
index e649fb1..2134fc5 100644
--- a/.mailmap
+++ b/.mailmap
@@ -455,9 +455,9 @@
 Yaron Koren 
 Yaron Koren  
 Yaroslav Melnychuk 
-Yongmin Hong 
-Yongmin Hong  
-Yongmin Hong  
+Yongmin Hong 
+Yongmin Hong  
+Yongmin Hong  
 Yuri Astrakhan 
 Yuri Astrakhan  
 Yuri Astrakhan  

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2df2a32f6144acca985d04b4bf58372343d119f6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Revi 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Zppix 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Add a maintenance script to disable oathauth for a username

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/359618 )

Change subject: Add a maintenance script to disable oathauth for a username
..


Add a maintenance script to disable oathauth for a username

Change-Id: I230ce0eafc7576a84dd577dd594ed46236924688
---
A maintenance/disableOATHAuthForUser.php
1 file changed, 41 insertions(+), 0 deletions(-)

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



diff --git a/maintenance/disableOATHAuthForUser.php 
b/maintenance/disableOATHAuthForUser.php
new file mode 100644
index 000..8a14d89
--- /dev/null
+++ b/maintenance/disableOATHAuthForUser.php
@@ -0,0 +1,41 @@
+mDescription = 'Remove OATHAuth from a specific user';
+   $this->addArg( 'user', 'The username to remove OATHAuth from.' 
);
+   $this->requireExtension( 'OATHAuth' );
+   }
+
+   public function execute() {
+   $username = $this->getArg( 0 );
+
+   $user = User::newFromName( $username );
+   if ( $user && $user->getId() === 0 ) {
+   $this->error( "User $username doesn't exist!", 1 );
+   }
+
+   $repo = OATHAuthHooks::getOATHUserRepository();
+
+   $oathUser = $repo->findByUser( $user );
+
+   if ( $oathUser->getKey() === null ) {
+   $this->error( "User $username doesn't have OATHAuth 
enabled!", 1 );
+   }
+
+   $repo->remove( $oathUser );
+   $this->output( "OATHAuth disabled for $username.\n" );
+   }
+}
+
+$maintClass = "DisableOATHAuthForUser";
+require_once RUN_MAINTENANCE_IF_MAIN;
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I230ce0eafc7576a84dd577dd594ed46236924688
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Block WP Zero users from accessing Phabricator uploads

2017-07-04 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363264 )

Change subject: Block WP Zero users from accessing Phabricator uploads
..

Block WP Zero users from accessing Phabricator uploads

To prevet wasting our time on endless whack-a-mole with abusers,
just hard-block all the uploaded images from Zero networks. The
collateral damage should be quite small: only attachments and avatars,
general Phabricator functionality will not be affected.

Bug: T168142
Change-Id: I3ddc3db7c2c4011ba138f81933a5696d285c7542
---
M modules/varnish/templates/misc-frontend.inc.vcl.erb
1 file changed, 10 insertions(+), 1 deletion(-)


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

diff --git a/modules/varnish/templates/misc-frontend.inc.vcl.erb 
b/modules/varnish/templates/misc-frontend.inc.vcl.erb
index 7b32a74..721d891 100644
--- a/modules/varnish/templates/misc-frontend.inc.vcl.erb
+++ b/modules/varnish/templates/misc-frontend.inc.vcl.erb
@@ -1,6 +1,15 @@
 include "misc-common.inc.vcl";
 
-sub cluster_fe_recv_pre_purge { }
+sub cluster_fe_recv_pre_purge {
+// Block WP Zero users from accessing Phabricator uploads to prevent abuse 
(T168142)
+if (req.http.Host == "phab.wmfusercontent.org" && req.url ~"^/file/data/") 
{
+call tag_carrier;
+if (req.http.X-CS) {
+return (synth(403, "Disallowed"));
+}
+unset req.http.X-CS;
+}
+}
 
 sub cluster_fe_recv {
 if (req.http.Host == "grafana.wikimedia.org" || req.http.host == 
"grafana-admin.wikimedia.org"

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Adjust translation headers in the dashboard

2017-07-04 Thread Petar.petkovic (Code Review)
Petar.petkovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363234 )

Change subject: Adjust translation headers in the dashboard
..

Adjust translation headers in the dashboard

Provide all different lists (suggestions, ongoing translations
and published articles) with a header that is part of the same
piece of paper as the content displayed

Bug: T160398
Change-Id: I6df7293869594003a0e6917e7df24e7a2a61e03d
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/dashboard/ext.cx.suggestionlist.js
M modules/dashboard/ext.cx.translationlist.js
M modules/dashboard/styles/ext.cx.dashboard.less
M modules/dashboard/styles/ext.cx.lists.common.less
M modules/dashboard/styles/ext.cx.suggestionlist.less
8 files changed, 51 insertions(+), 23 deletions(-)


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

diff --git a/extension.json b/extension.json
index 3df9b61..685dfd2 100644
--- a/extension.json
+++ b/extension.json
@@ -941,6 +941,8 @@
"cx-translation-status-draft",
"cx-translation-status-deleted",
"cx-translation-status-published",
+   "cx-translation-label-draft",
+   "cx-translation-label-published",
"cx-draft-discard-confirmation-message",
"cx-draft-cancel-button-label",
"cx-draft-discard-button-label",
diff --git a/i18n/en.json b/i18n/en.json
index 5c8cdd8..bc51876 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -109,7 +109,7 @@
"cx-translation-filter-draft-translations": "In progress",
"cx-translation-filter-suggested-translations": "Suggestions",
"cx-suggestionlist-favorite": "For later",
-   "cx-suggestionlist-title": "More suggestions",
+   "cx-suggestionlist-title": "Suggested pages",
"cx-suggestionlist-empty-title": "No suggestions for now",
"cx-suggestionlist-empty-desc": "We found no suggestions. You can check 
later or find relevant pages using our recommendation tool (experimental).",
"cx-suggestionlist-empty-desc-recommend-link-text": "View suggestions 
(experimental)",
@@ -117,7 +117,7 @@
"cx-suggestionlist-view-source-page": "View source page",
"cx-translation-filter-from-any-language": "From any language",
"cx-translation-filter-to-any-language": "To any language",
-   "cx-create-new-translation": "New translation",
+   "cx-create-new-translation": "Start a new translation",
"cx-save-draft-save-success": "Saved {{PLURAL:$1|a minute ago|$1 
minutes ago|0=just now}}",
"cx-save-draft-saving": "Saving...",
"cx-save-draft-tooltip": "Translation drafts are saved automatically",
@@ -136,6 +136,8 @@
"cx-translation-status-draft": "In progress",
"cx-translation-status-published": "Published",
"cx-translation-status-deleted": "Deleted",
+   "cx-translation-label-draft": "Translations in progress",
+   "cx-translation-label-published": "Translations published",
"cx-translation-already-in-progress": "This is an ongoing translation 
{{GENDER:$2|by}} $1.",
"cx-translation-already-in-progress-collaborate": "Please make sure you 
coordinate with the {{GENDER:$1|user}} who translated the current translation.",
"cx-publishing-dialog-publish-draft-button": "Publish as draft",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 8bc55a7..e90172a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -145,6 +145,8 @@
"cx-translation-status-draft": "In progress status label for the 
translation in the Content Translation dashboard. This means that the 
translation is stored internally as a draft, accessible only to the user who 
started it, and not published as a wiki page.",
"cx-translation-status-published": "Published status label for the 
translation in the Content Translation dashboard.\n{{Identical|Published}}",
"cx-translation-status-deleted": "Deleted status label for the 
translation in the Content Translation dashboard.\n{{Identical|Deleted}}",
+   "cx-translation-label-draft": "Label in header for list of draft 
translations in the Content Translation dashboard",
+   "cx-translation-label-published": "Label in header for list of 
published translations in the Content Translation dashboard",
"cx-translation-already-in-progress": "Message shown when a second 
translator tries to translate the same page between same languages. 
\n\nParameters:\n* $1 - User name of first translator\n* $2 - Gender of the 
first translator",
"cx-translation-already-in-progress-collaborate": "A message to 
collaborate with other translator. Shown when there is translation 
conflict.\n\nParameters:\n* $1 - Gender of the 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: ve.ui.MWWikitextSwitchConfirmDialog: Remove broken "evil hack"

2017-07-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363231 )

Change subject: ve.ui.MWWikitextSwitchConfirmDialog: Remove broken "evil hack"
..

ve.ui.MWWikitextSwitchConfirmDialog: Remove broken "evil hack"

The promise #getTeardownProcess is trying to resolve/reject no longer
exists, causing exceptions. The code has been unnecessary for a while,
as we do all the work in #getActionProcess. (In the case that we do
switch, the teardown code isn't even called, since we navigate away.)

Cancelling the switch to wikitext works correctly after removing this
code.

Bug: T169588
Change-Id: I1b9b12edf12a0b91f06c13aa53024efb80868387
---
M modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js
1 file changed, 0 insertions(+), 16 deletions(-)


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

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js
index b79b196..b03f209 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js
@@ -83,22 +83,6 @@
return ve.ui.MWWikitextSwitchConfirmDialog.super.prototype.setup.call( 
this, data );
 };
 
-/**
- * @inheritdoc
- */
-ve.ui.MWWikitextSwitchConfirmDialog.prototype.getTeardownProcess = function ( 
data ) {
-   data = data || {};
-   return 
ve.ui.MWWikitextSwitchConfirmDialog.super.prototype.getTeardownProcess.call( 
this, data )
-   .first( function () {
-   // EVIL HACK - we shouldn't be reaching into the 
manager for these promises
-   if ( data.action === 'switch' ) {
-   this.manager.closing.resolve( data );
-   } else {
-   this.manager.closing.reject( data );
-   }
-   }, this );
-};
-
 /* Registration */
 
 ve.ui.windowFactory.register( ve.ui.MWWikitextSwitchConfirmDialog );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b9b12edf12a0b91f06c13aa53024efb80868387
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
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] operations/puppet[production]: Redact ep_courses.course_token

2017-07-04 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363230 )

Change subject: Redact ep_courses.course_token
..

Redact ep_courses.course_token

Its a shared password used to allow people to register for a
course. Its primarily meant as an anti-spam measure, but should
not be published.

Bug: T169661
Change-Id: Ifb66a6ec04489f72c98c46e70b68c752c3eaa922
---
M modules/role/templates/labs/db/views/maintain-views.yaml
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/30/363230/1

diff --git a/modules/role/templates/labs/db/views/maintain-views.yaml 
b/modules/role/templates/labs/db/views/maintain-views.yaml
index 719b5bf..68099a4 100644
--- a/modules/role/templates/labs/db/views/maintain-views.yaml
+++ b/modules/role/templates/labs/db/views/maintain-views.yaml
@@ -37,7 +37,6 @@
   - change_tag
   - ep_articles
   - ep_cas
-  - ep_courses
   - ep_events
   - ep_instructors
   - ep_oas
@@ -191,6 +190,14 @@
   as ar_text_id, ar_deleted, if(ar_deleted&1,null,ar_len) as ar_len, 
ar_page_id, ar_parent_id,
   if(ar_deleted&1,null,ar_sha1) as ar_sha1
 where: (ar_deleted&4)=0
+  ep_courses:
+source: ep_courses
+view: >
+  select course_id, course_org_id, course_title, course_name, course_start,
+  course_end, course_description, course_students, course_online_ambs,
+  course_campus_ambs, course_instructors, NULL as course_token, 
course_field,
+  course_level, course_term, course_lang, course_instructor_count, 
course_oa_count,
+  course_ca_count, course_student_count, course_touched
   filearchive:
 source: filearchive
 view: >

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb66a6ec04489f72c98c46e70b68c752c3eaa922
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow install.php to run env-checks with no db

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363225 )

Change subject: Allow install.php to run env-checks with no db
..


Allow install.php to run env-checks with no db

Bug: T169668
Change-Id: Ibb05b26cbf2d26c02ee7f26497e16d2c98e97de2
---
M maintenance/doMaintenance.php
M maintenance/install.php
2 files changed, 18 insertions(+), 7 deletions(-)

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



diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php
index e649c9d..53a317a 100644
--- a/maintenance/doMaintenance.php
+++ b/maintenance/doMaintenance.php
@@ -113,14 +113,18 @@
 // Potentially debug globals
 $maintenance->globals();
 
-// Perform deferred updates.
-$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
-$lbFactory->commitMasterChanges( $maintClass );
-DeferredUpdates::doUpdates();
+if ( $maintenance->getDbType() !== Maintenance::DB_NONE ) {
+   // Perform deferred updates.
+   $lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+   $lbFactory->commitMasterChanges( $maintClass );
+   DeferredUpdates::doUpdates();
+}
 
 // log profiling info
 wfLogProfilingData();
 
-// Commit and close up!
-$lbFactory->commitMasterChanges( 'doMaintenance' );
-$lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
+if ( isset( $lbFactory ) ) {
+   // Commit and close up!
+   $lbFactory->commitMasterChanges( 'doMaintenance' );
+   $lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
+}
diff --git a/maintenance/install.php b/maintenance/install.php
index 81b6d9c..cac3009 100644
--- a/maintenance/install.php
+++ b/maintenance/install.php
@@ -90,6 +90,13 @@
$this->addOption( 'env-checks', "Run environment checks only, 
don't change anything" );
}
 
+   public function getDbType() {
+   if ( $this->hasOption( 'env-checks' ) ) {
+   return Maintenance::DB_NONE;
+   }
+   return parent::getDbType();
+   }
+
function execute() {
global $IP;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb05b26cbf2d26c02ee7f26497e16d2c98e97de2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MarkAHershberger 
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] mediawiki/core[master]: Don't ask for password for env-checks in install.php

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363223 )

Change subject: Don't ask for password for env-checks in install.php
..


Don't ask for password for env-checks in install.php

Bug: T169669
Change-Id: I00dbaca0e4532ecc499317ec8f1cb7f9eb872db3
---
M maintenance/install.php
1 file changed, 25 insertions(+), 15 deletions(-)

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



diff --git a/maintenance/install.php b/maintenance/install.php
index 3e632f0..81b6d9c 100644
--- a/maintenance/install.php
+++ b/maintenance/install.php
@@ -95,7 +95,30 @@
 
$siteName = $this->getArg( 0, 'MediaWiki' ); // Will not be set 
if used with --env-checks
$adminName = $this->getArg( 1 );
+   $envChecksOnly = $this->hasOption( 'env-checks' );
 
+   $this->setDbPassOption();
+   if ( !$envChecksOnly ) {
+   $this->setPassOption();
+   }
+
+   $installer = InstallerOverrides::getCliInstaller( $siteName, 
$adminName, $this->mOptions );
+
+   $status = $installer->doEnvironmentChecks();
+   if ( $status->isGood() ) {
+   $installer->showMessage( 'config-env-good' );
+   } else {
+   $installer->showStatusMessage( $status );
+
+   return;
+   }
+   if ( !$envChecksOnly ) {
+   $installer->execute();
+   $installer->writeConfigurationFile( $this->getOption( 
'confpath', $IP ) );
+   }
+   }
+
+   private function setDbPassOption() {
$dbpassfile = $this->getOption( 'dbpassfile' );
if ( $dbpassfile !== null ) {
if ( $this->getOption( 'dbpass' ) !== null ) {
@@ -110,7 +133,9 @@
}
$this->mOptions['dbpass'] = trim( $dbpass, "\r\n" );
}
+   }
 
+   private function setPassOption() {
$passfile = $this->getOption( 'passfile' );
if ( $passfile !== null ) {
if ( $this->getOption( 'pass' ) !== null ) {
@@ -126,21 +151,6 @@
$this->mOptions['pass'] = trim( $pass, "\r\n" );
} elseif ( $this->getOption( 'pass' ) === null ) {
$this->error( 'You need to provide the option "pass" or 
"passfile"', true );
-   }
-
-   $installer = InstallerOverrides::getCliInstaller( $siteName, 
$adminName, $this->mOptions );
-
-   $status = $installer->doEnvironmentChecks();
-   if ( $status->isGood() ) {
-   $installer->showMessage( 'config-env-good' );
-   } else {
-   $installer->showStatusMessage( $status );
-
-   return;
-   }
-   if ( !$this->hasOption( 'env-checks' ) ) {
-   $installer->execute();
-   $installer->writeConfigurationFile( $this->getOption( 
'confpath', $IP ) );
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I00dbaca0e4532ecc499317ec8f1cb7f9eb872db3
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MarkAHershberger 
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] integration/config[master]: Add civicrm-buildkit/bin to path for CRM builds

2017-07-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363229 )

Change subject: Add civicrm-buildkit/bin to path for CRM builds
..

Add civicrm-buildkit/bin to path for CRM builds

Bug: T169593
Change-Id: I2aa7c5761ebc3a20893e694cd86a6cd1bf007e25
---
M jjb/wm-fundraising.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/29/363229/1

diff --git a/jjb/wm-fundraising.yaml b/jjb/wm-fundraising.yaml
index 5a60bbb..3af2616 100644
--- a/jjb/wm-fundraising.yaml
+++ b/jjb/wm-fundraising.yaml
@@ -21,6 +21,7 @@
   else
 git clone https://github.com/civicrm/civicrm-buildkit.git 
$WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit
   fi
+  export 
PATH=$PATH:$WORKSPACE/src/wikimedia/fundraising/civicrm-buildkit/bin
   $WORKSPACE/src/wikimedia/fundraising/crm/bin/ci-create-dbs.sh
   $WORKSPACE/src/wikimedia/fundraising/crm/bin/ci-populate-dbs.sh
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2aa7c5761ebc3a20893e694cd86a6cd1bf007e25
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: Refactor UploadBase interaction & add tests

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363228 )

Change subject: Refactor UploadBase interaction & add tests
..

Refactor UploadBase interaction & add tests

Change-Id: I7cf7f54222d7b3ed8d11b25bec3aaa17a3cf0af9
---
M extension.json
M src/ServiceWiring.php
M src/Services/ImportPlanFactory.php
M src/Services/ImportPlanValidator.php
M src/Services/Importer.php
A src/Services/UploadBase/UploadBaseFactory.php
R src/Services/UploadBase/ValidatingUploadBase.php
M tests/phpunit/MediaWiki/FileImporterUploadBaseTest.php
M tests/phpunit/Services/ImportPlanValidatorTest.php
D tests/phpunit/Services/ImporterTest.php
A tests/phpunit/Services/UploadBase/ValidatingUploadBaseTest.php
11 files changed, 188 insertions(+), 43 deletions(-)


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

diff --git a/extension.json b/extension.json
index 0574df1..c82f5c8 100644
--- a/extension.json
+++ b/extension.json
@@ -44,7 +44,8 @@
"FileImporter\\Interfaces\\ImportTitleChecker": 
"src/Interfaces/ImportTitleChecker.php",
"FileImporter\\Interfaces\\SourceUrlChecker": 
"src/Interfaces/SourceUrlChecker.php",
"FileImporter\\Services\\DuplicateFileRevisionChecker": 
"src/Services/DuplicateFileRevisionChecker.php",
-   "FileImporter\\Services\\FileImporterUploadBase": 
"src/Services/FileImporterUploadBase.php",
+   "FileImporter\\Services\\UploadBase\\UploadBaseFactory": 
"src/Services/UploadBase/UploadBaseFactory.php",
+   "FileImporter\\Services\\UploadBase\\ValidatingUploadBase": 
"src/Services/UploadBase/ValidatingUploadBase.php",
"FileImporter\\Services\\Http\\FileChunkSaver": 
"src/Services/Http/FileChunkSaver.php",
"FileImporter\\Services\\Http\\HttpRequestExecutor": 
"src/Services/Http/HttpRequestExecutor.php",
"FileImporter\\Services\\Importer": "src/Services/Importer.php",
diff --git a/src/ServiceWiring.php b/src/ServiceWiring.php
index bbaad3a..d70226d 100644
--- a/src/ServiceWiring.php
+++ b/src/ServiceWiring.php
@@ -8,6 +8,7 @@
 use FileImporter\Services\ImportPlanFactory;
 use FileImporter\Services\NullRevisionCreator;
 use FileImporter\Services\SourceSiteLocator;
+use FileImporter\Services\UploadBase\UploadBaseFactory;
 use FileImporter\Services\WikiRevisionFactory;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
@@ -44,12 +45,15 @@
$wikiRevisionFactory = $services->getService( 
'FileImporterWikiRevisionFactory' );
/** @var NullRevisionCreator $nullRevisionCreator */
$nullRevisionCreator = $services->getService( 
'FileImporterNullRevisionCreator' );
-   /** @var \FileImporter\Services\Http\HttpRequestExecutor 
$httpRequestExecutor */
+   /** @var HttpRequestExecutor $httpRequestExecutor */
$httpRequestExecutor = $services->getService( 
'FileImporterHttpRequestExecutor' );
+   /** @var UploadBaseFactory $uploadBaseFactory */
+   $uploadBaseFactory = $services->getService( 
'FileImporterUploadBaseFactory' );
$importer = new Importer(
$wikiRevisionFactory,
$nullRevisionCreator,
-   $httpRequestExecutor
+   $httpRequestExecutor,
+   $uploadBaseFactory
);
$importer->setLogger( LoggerFactory::getInstance( 
'FileImporter' ) );
return $importer;
@@ -68,8 +72,18 @@
$sourceSiteLocator = $services->getService( 
'FileImporterSourceSiteLocator' );
/** @var DuplicateFileRevisionChecker $duplicateFileChecker */
$duplicateFileChecker = $services->getService( 
'FileImporterDuplicateFileRevisionChecker' );
-   $factory = new ImportPlanFactory( $sourceSiteLocator, 
$duplicateFileChecker );
+   /** @var UploadBaseFactory $uploadBaseFactory */
+   $uploadBaseFactory = $services->getService( 
'FileImporterUploadBaseFactory' );
+   $factory = new ImportPlanFactory(
+   $sourceSiteLocator,
+   $duplicateFileChecker,
+   $uploadBaseFactory
+   );
return $factory;
},
 
+   'FileImporterUploadBaseFactory' => function ( MediaWikiServices 
$services ) {
+   return new UploadBaseFactory( LoggerFactory::getInstance( 
'FileImporter' ) );
+   },
+
 ];
diff --git a/src/Services/ImportPlanFactory.php 
b/src/Services/ImportPlanFactory.php
index d75edcf..2d50192 100644
--- a/src/Services/ImportPlanFactory.php
+++ b/src/Services/ImportPlanFactory.php
@@ -5,19 +5,23 @@
 use FileImporter\Data\ImportDetails;
 use FileImporter\Data\ImportPlan;
 use 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: ve.fixBase: Fix protocol-relative base href for Chrome

2017-07-04 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363227 )

Change subject: ve.fixBase: Fix protocol-relative base href for Chrome
..

ve.fixBase: Fix protocol-relative base href for Chrome

Bug: T167936
Change-Id: Ic0695243029e846874487927b835a09e33749d71
---
M src/ve.utils.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/27/363227/1

diff --git a/src/ve.utils.js b/src/ve.utils.js
index 362b848..c5cb7b0 100644
--- a/src/ve.utils.js
+++ b/src/ve.utils.js
@@ -1021,7 +1021,11 @@
baseNode.setAttribute( 'href', fallbackBase );
}
}
-   // else:  tag present and valid, do nothing
+   // Support: Chrome
+   // Chrome just entirely ignores  tags with a 
protocol-relative href attribute.
+   // Code below is *not a no-op*; reading the href property and 
setting it back
+   // will expand the href *attribute* to use an absolute URL if 
it was relative.
+   baseNode.href = baseNode.href;
} else if ( fallbackBase ) {
// Support: Firefox
// No  tag, add one

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0695243029e846874487927b835a09e33749d71
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
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] mediawiki/extensions[master]: Removing Extension:Nonlinear

2017-07-04 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363226 )

Change subject: Removing Extension:Nonlinear
..

Removing Extension:Nonlinear

Extension has been archived.

Bug: T169519
Change-Id: I857d0b06daa5d0c9a333e6de352c7650cf784dac
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions 
refs/changes/26/363226/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I857d0b06daa5d0c9a333e6de352c7650cf784dac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 

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


[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Change "article" to "page"

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363116 )

Change subject: Change "article" to "page"
..


Change "article" to "page"

This is the usual practice in MediaWiki extensions,
for consistency among wikis where pages are
not necessarily articles.

Change-Id: Iec216fa977de6c1525159b863aef36d40ac8c042
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index ed57dbd..e2574b6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -21,7 +21,7 @@
"apihelp-graph-summary": "Access graph tag functionality.",
"apihelp-graph-example": "Get the graph JSON by hash and title",
"apihelp-graph-param-hash": "Hash value of the graph",
-   "apihelp-graph-param-title": "Title of the article with the graph",
+   "apihelp-graph-param-title": "Title of the page with the graph",
"apihelp-graph-param-text": "Text of the graph to be converted to JSON. 
Must be posted and used without title and hash parameters",
"apierror-graph-mustposttext": "Request must be POSTed when the 
text parameter is used.",
"apierror-graph-invalid": "Graph is not valid.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec216fa977de6c1525159b863aef36d40ac8c042
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow install.php to run env-checks with no db

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363225 )

Change subject: Allow install.php to run env-checks with no db
..

Allow install.php to run env-checks with no db

Bug: T169668
Change-Id: Ibb05b26cbf2d26c02ee7f26497e16d2c98e97de2
---
M maintenance/doMaintenance.php
M maintenance/install.php
2 files changed, 18 insertions(+), 7 deletions(-)


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

diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php
index e649c9d..53a317a 100644
--- a/maintenance/doMaintenance.php
+++ b/maintenance/doMaintenance.php
@@ -113,14 +113,18 @@
 // Potentially debug globals
 $maintenance->globals();
 
-// Perform deferred updates.
-$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
-$lbFactory->commitMasterChanges( $maintClass );
-DeferredUpdates::doUpdates();
+if ( $maintenance->getDbType() !== Maintenance::DB_NONE ) {
+   // Perform deferred updates.
+   $lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+   $lbFactory->commitMasterChanges( $maintClass );
+   DeferredUpdates::doUpdates();
+}
 
 // log profiling info
 wfLogProfilingData();
 
-// Commit and close up!
-$lbFactory->commitMasterChanges( 'doMaintenance' );
-$lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
+if ( isset( $lbFactory ) ) {
+   // Commit and close up!
+   $lbFactory->commitMasterChanges( 'doMaintenance' );
+   $lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
+}
diff --git a/maintenance/install.php b/maintenance/install.php
index 81b6d9c..cac3009 100644
--- a/maintenance/install.php
+++ b/maintenance/install.php
@@ -90,6 +90,13 @@
$this->addOption( 'env-checks', "Run environment checks only, 
don't change anything" );
}
 
+   public function getDbType() {
+   if ( $this->hasOption( 'env-checks' ) ) {
+   return Maintenance::DB_NONE;
+   }
+   return parent::getDbType();
+   }
+
function execute() {
global $IP;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb05b26cbf2d26c02ee7f26497e16d2c98e97de2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] mediawiki/core[master]: Pass old user options in PreferencesFormPreSave hook

2017-07-04 Thread Pmiazga (Code Review)
Pmiazga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363224 )

Change subject: Pass old user options in PreferencesFormPreSave hook
..

Pass old user options in PreferencesFormPreSave hook

Changes:
 - added one argument to PreferencesFormPreSave hook,
   a $oldUserOptions array which contains set of all user
   options before save

Bug: T169365
Change-Id: I28003c5898d64031e1efb212cb0bec58ff44b958
---
M includes/Preferences.php
M tests/phpunit/includes/PreferencesTest.php
2 files changed, 66 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/363224/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index 4017619..008963b 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -1485,6 +1485,8 @@
}
 
if ( $user->isAllowed( 'editmyoptions' ) ) {
+   $oldUserOptions = $user->getOptions();
+
foreach ( self::$saveBlacklist as $b ) {
unset( $formData[$b] );
}
@@ -1505,7 +1507,10 @@
$user->setOption( $key, $value );
}
 
-   Hooks::run( 'PreferencesFormPreSave', [ $formData, 
$form, $user, &$result ] );
+   Hooks::run(
+   'PreferencesFormPreSave',
+   [ $formData, $form, $user, &$result, 
$oldUserOptions ]
+   );
}
 
MediaWiki\Auth\AuthManager::callLegacyAuthPlugin( 
'updateExternalDB', [ $user ] );
diff --git a/tests/phpunit/includes/PreferencesTest.php 
b/tests/phpunit/includes/PreferencesTest.php
index 90b6396..831eb2e 100644
--- a/tests/phpunit/includes/PreferencesTest.php
+++ b/tests/phpunit/includes/PreferencesTest.php
@@ -77,6 +77,66 @@
$this->assertEquals( 'mw-email-authenticated', 
$prefs['emailauthentication']['cssclass'] );
}
 
+   /**
+* Test that PreferencesFormPreSave hook has correct data:
+*  - user Object is passed
+*  - oldUserOptions contains previous user options (before save)
+*  - formData and User object have set up new properties
+*
+* @see https://phabricator.wikimedia.org/T169365
+* @covers Preferences::tryFormSubmit
+*/
+   public function testPreferencesFormPreSaveHookHasCorrectData() {
+   $oldOptions = [
+   'test' => 'abc',
+   'option' => 'old'
+   ];
+   $formData = [
+   'test' => 'abc',
+   'option' => 'new'
+   ];
+   $configMock = new HashConfig( [
+   'HiddenPrefs' => []
+   ] );
+   $form = $this->getMockBuilder( PreferencesForm::class )
+   ->disableOriginalConstructor()
+   ->getMock();
+
+   $userMock = $this->getMutableTestUser()->getUser();
+   foreach ( $oldOptions as $option => $value ) {
+   $userMock->setOption( $option, $value );
+   }
+
+   $form->expects( $this->any() )
+   ->method( 'getModifiedUser' )
+   ->willReturn( $userMock );
+
+   $form->expects( $this->any() )
+   ->method( 'getContext' )
+   ->willReturn( $this->context );
+
+   $form->expects( $this->any() )
+   ->method( 'getConfig' )
+   ->willReturn( $configMock );
+
+   $this->setTemporaryHook( 'PreferencesFormPreSave', function(
+   $formData, $form, $user, &$result, $oldUserOptions )
+   use ( $formData, $oldOptions, $userMock ) {
+
+   $this->assertSame( $userMock, $user );
+   foreach ( $formData as $option => $value ) {
+   $this->assertSame( $value, $user->getOption( 
$option ) );
+   }
+   foreach ( $oldOptions as $option => $value ) {
+   $this->assertSame( $value, $oldUserOptions[ 
$option ] );
+   }
+   $this->assertEquals( true, $result );
+   }
+   );
+
+   Preferences::tryFormSubmit( $formData, $form );
+   }
+
/** Helper */
protected function prefsFor( $user_key ) {
$preferences = [];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28003c5898d64031e1efb212cb0bec58ff44b958
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Don't ask for password for env-checks in install.php

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363223 )

Change subject: Don't ask for password for env-checks in install.php
..

Don't ask for password for env-checks in install.php

Bug: T169669
Change-Id: I00dbaca0e4532ecc499317ec8f1cb7f9eb872db3
---
M includes/WatchedItemStore.php
M maintenance/install.php
2 files changed, 32 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/363223/1

diff --git a/includes/WatchedItemStore.php b/includes/WatchedItemStore.php
index 9cd3308..8b5b451 100644
--- a/includes/WatchedItemStore.php
+++ b/includes/WatchedItemStore.php
@@ -235,6 +235,13 @@
}
 
/**
+* @param callable|null $revisionGetTimestampFromIdCallback
+*/
+   public function setRevisionGetTimestampFromIdCallback( 
$revisionGetTimestampFromIdCallback ) {
+
+   $this->revisionGetTimestampFromIdCallback = 
$revisionGetTimestampFromIdCallback;
+   }
+   /**
 * Deletes ALL watched items for the given user when under
 * MAX_INTERACTIVE_ITEM_DELETE entries exist.
 *
diff --git a/maintenance/install.php b/maintenance/install.php
index 3e632f0..c479dd3 100644
--- a/maintenance/install.php
+++ b/maintenance/install.php
@@ -95,7 +95,30 @@
 
$siteName = $this->getArg( 0, 'MediaWiki' ); // Will not be set 
if used with --env-checks
$adminName = $this->getArg( 1 );
+   $envChecksOnly = $this->hasOption( 'env-checks' );
 
+   $this->setDebPassOption();
+   if ( !$envChecksOnly ) {
+   $this->setPassOption();
+   }
+
+   $installer = InstallerOverrides::getCliInstaller( $siteName, 
$adminName, $this->mOptions );
+
+   $status = $installer->doEnvironmentChecks();
+   if ( $status->isGood() ) {
+   $installer->showMessage( 'config-env-good' );
+   } else {
+   $installer->showStatusMessage( $status );
+
+   return;
+   }
+   if ( !$envChecksOnly ) {
+   $installer->execute();
+   $installer->writeConfigurationFile( $this->getOption( 
'confpath', $IP ) );
+   }
+   }
+
+   private function setDebPassOption() {
$dbpassfile = $this->getOption( 'dbpassfile' );
if ( $dbpassfile !== null ) {
if ( $this->getOption( 'dbpass' ) !== null ) {
@@ -110,7 +133,9 @@
}
$this->mOptions['dbpass'] = trim( $dbpass, "\r\n" );
}
+   }
 
+   private function setPassOption() {
$passfile = $this->getOption( 'passfile' );
if ( $passfile !== null ) {
if ( $this->getOption( 'pass' ) !== null ) {
@@ -126,21 +151,6 @@
$this->mOptions['pass'] = trim( $pass, "\r\n" );
} elseif ( $this->getOption( 'pass' ) === null ) {
$this->error( 'You need to provide the option "pass" or 
"passfile"', true );
-   }
-
-   $installer = InstallerOverrides::getCliInstaller( $siteName, 
$adminName, $this->mOptions );
-
-   $status = $installer->doEnvironmentChecks();
-   if ( $status->isGood() ) {
-   $installer->showMessage( 'config-env-good' );
-   } else {
-   $installer->showStatusMessage( $status );
-
-   return;
-   }
-   if ( !$this->hasOption( 'env-checks' ) ) {
-   $installer->execute();
-   $installer->writeConfigurationFile( $this->getOption( 
'confpath', $IP ) );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00dbaca0e4532ecc499317ec8f1cb7f9eb872db3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
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] wikidata...gui[master]: Editor toolbar make execute button more prominent

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362868 )

Change subject: Editor toolbar make execute button more prominent
..


Editor toolbar make execute button more prominent

Use opacity for other buttons.
More space to separate execute button from others.

Change-Id: Icb5589fedbc34e14997dcc679c58acbb80592eef
---
M style.css
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Lucas Werkmeister (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/style.css b/style.css
index c743245..8847643 100644
--- a/style.css
+++ b/style.css
@@ -126,6 +126,10 @@
padding-top: 0.5em;
vertical-align: top;
text-align: left;
+   opacity: 0.5;
+}
+#query-box .toolbar:hover {
+   opacity: 1;
 }
 
 #query-box .toolbar .fa {
@@ -134,6 +138,7 @@
 
 #query-box .toolbar-bottom {
padding-bottom: 0.5em;
+   padding-top: 1em;
vertical-align: bottom;
text-align: center;
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb5589fedbc34e14997dcc679c58acbb80592eef
Gerrit-PatchSet: 4
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cognate[master]: Stop ignoring PhanTypeMismatchArgument phan issue

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363221 )

Change subject: Stop ignoring PhanTypeMismatchArgument phan issue
..

Stop ignoring PhanTypeMismatchArgument phan issue

It looks like this needs the newer version of phan,
hence the Depends-On.
This passes for me locally.

Depends-On: I6a98cc11d2d6569812766b2830686496f0e70db1
Change-Id: Ic9bba7f6f7039a8955668f53c51496c3136c19cf
---
M tests/phan/config.php
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cognate 
refs/changes/21/363221/2

diff --git a/tests/phan/config.php b/tests/phan/config.php
index 77c4b5b..48acaa9 100644
--- a/tests/phan/config.php
+++ b/tests/phan/config.php
@@ -270,10 +270,7 @@
 * Add any issue types (such as 'PhanUndeclaredMethod')
 * to this black-list to inhibit them from being reported.
 */
-   'suppress_issue_types' => [
-   // approximate error count: 4
-   "PhanTypeMismatchArgument",
-   ],
+   'suppress_issue_types' => [],
 
/**
 * If empty, no filter against issues types will be applied.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9bba7f6f7039a8955668f53c51496c3136c19cf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cognate
Gerrit-Branch: master
Gerrit-Owner: 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] integration/config[master]: Use phan version 0.8

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363222 )

Change subject: Use phan version 0.8
..

Use phan version 0.8

This still can't be included in the composer.json
as it requires php7 which mediawiki in general does
not.

If this update breaks jobs then it might be an idea
to put the phan version in the job name so
it can be dynamicaly selected per repo.

Change-Id: I6a98cc11d2d6569812766b2830686496f0e70db1
---
M jjb/mediawiki-extensions.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/22/363222/1

diff --git a/jjb/mediawiki-extensions.yaml b/jjb/mediawiki-extensions.yaml
index a511262..1f75889 100644
--- a/jjb/mediawiki-extensions.yaml
+++ b/jjb/mediawiki-extensions.yaml
@@ -393,7 +393,7 @@
  - shell: |
 cd $WORKSPACE/src
 mkdir -p $WORKSPACE/log
-composer require etsy/phan:0.7 --prefer-dist --dev --no-progress 
--ansi --profile -v # todo don't hardcode version here
+composer require etsy/phan:0.8 --prefer-dist --dev --no-progress 
--ansi --profile -v # todo don't hardcode version here
 PHAN=$WORKSPACE/src/vendor/bin/phan ./tests/phan/bin/phan 
./extensions/$EXT_NAME -m checkstyle
 mv $WORKSPACE/src/extensions/$EXT_NAME/tests/phan/issues/latest 
$WORKSPACE/log/phan-issues
 publishers:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a98cc11d2d6569812766b2830686496f0e70db1
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] integration/config[master]: Add extension-phan-generic to FileImporter

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363220 )

Change subject: Add extension-phan-generic to FileImporter
..

Add extension-phan-generic to FileImporter

Depends-On: Iafa2f82e7c31972e2b6809eb9578510b1152ab5b
Change-Id: I83191a311832983ed9788ca44ddc660c9019fcc3
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/20/363220/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index da82698..039e45f 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -3566,6 +3566,7 @@
   - name: mediawiki/extensions/FileImporter
 template:
   - name: extension-unittests-generic
+  - name: extension-phan-generic
   - name: mwgate-npm
 
   - name: mediawiki/extensions/FileExporter

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83191a311832983ed9788ca44ddc660c9019fcc3
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] mediawiki...release[master]: Add Newsletter to make-wmf-branch

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362388 )

Change subject: Add Newsletter to make-wmf-branch
..


Add Newsletter to make-wmf-branch

Bug: T110170
Change-Id: I47721be2ef0f83b0583f0e840b50ff863837bed2
---
M make-wmf-branch/config.json
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/make-wmf-branch/config.json b/make-wmf-branch/config.json
index f60bc38..9cdfe0a 100644
--- a/make-wmf-branch/config.json
+++ b/make-wmf-branch/config.json
@@ -87,6 +87,7 @@
"MultimediaViewer",
"MwEmbedSupport",
"NavigationTiming",
+   "Newsletter",
"NewUserMessage",
"Nuke",
"OAuth",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47721be2ef0f83b0583f0e840b50ff863837bed2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Legoktm 
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] mediawiki...WikibaseQualityConstraints[master]: Add tracking for type checker SPARQL fallback

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363168 )

Change subject: Add tracking for type checker SPARQL fallback
..


Add tracking for type checker SPARQL fallback

Increment a counter whenever the TypeCheckerHelper falls back to SPARQL
to check if an item is a subclass of a certain other item. This should
let us know if the fallback works as intended.

Change-Id: I7903949300ccffa398b677ebc7f350ebadc81dcc
---
M includes/ConstraintCheck/Helper/TypeCheckerHelper.php
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ConstraintCheck/Helper/TypeCheckerHelper.php 
b/includes/ConstraintCheck/Helper/TypeCheckerHelper.php
index f33fa53..ad4373e 100644
--- a/includes/ConstraintCheck/Helper/TypeCheckerHelper.php
+++ b/includes/ConstraintCheck/Helper/TypeCheckerHelper.php
@@ -3,6 +3,7 @@
 namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Helper;
 
 use Config;
+use MediaWiki\MediaWikiServices;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdValue;
 use Wikibase\DataModel\Entity\PropertyId;
@@ -81,6 +82,8 @@
$maxEntities = $this->config->get( 
'WBQualityConstraintsTypeCheckMaxEntities' );
if ( ++$entitiesChecked > $maxEntities ) {
if ( $entitiesChecked === $maxEntities + 1 && 
$this->sparqlHelper !== null ) {
+   
MediaWikiServices::getInstance()->getStatsdDataFactory()
+   ->increment( 
'wikibase.quality.constraints.sparql.typeFallback' );
return $this->sparqlHelper->hasType(
$comparativeClass->getSerialization(),
$classesToCheck,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7903949300ccffa398b677ebc7f350ebadc81dcc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Support claimid with lowercase entity ID

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363212 )

Change subject: Support claimid with lowercase entity ID
..


Support claimid with lowercase entity ID

Old Wikidata statements have a statement GUID like

> q42$8419C20C-8EF8-4EC0-80D6-AF1CA55E7557

instead of the current format, which is:

> Q42$8419c20c-8ef8-4ec0-80d6-af1ca55e7557

When we parse this string, it is split up into entity ID and GUID part,
and StatementGuid holds both and reassembles the serialization from
those parts; the StatementGuid’s serialization is therefore

> Q42$8419C20C-8EF8-4EC0-80D6-AF1CA55E7557

since the entity ID was normalized during parsing, but nothing was done
to the GUID part.

When we search for this statement by its statement GUID,
StatementList::getFirstStatementWithGuid walks the statements and does a
simple string comparison on the entire statement GUID, which means that
the statement is not found because of the case mismatch in the entity
ID. To remedy this, we try to find the statement again if the change was
unsuccessful, this time with the first character (the Q or P of the
entity ID) lowercased.

(The assumption that “convert the first character to lowercase” is a
meaningful operation may not necessarily hold for future entity types,
but hopefully future entity types will never introduce this sort of case
confusion into the statement GUIDs stored in the database, so this
should not matter.)

Bug: T165020
Change-Id: Icbe934f8b0b018705a8f38ee17a6a7c8439afef0
---
M includes/ConstraintCheck/DelegatingConstraintChecker.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ConstraintCheck/DelegatingConstraintChecker.php 
b/includes/ConstraintCheck/DelegatingConstraintChecker.php
index d7eb5b7..6d3b66e 100644
--- a/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -132,6 +132,11 @@
$entity = $this->entityLookup->getEntity( $entityId );
if ( $entity instanceof StatementListProvider ) {
$statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guid->getSerialization() 
);
+   if ( $statement === null ) {
+   // try lowercasing the entity ID for legacy 
statement GUIDs
+   $guidSerialization = lcfirst( 
$guid->getSerialization() );
+   $statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guidSerialization );
+   }
if ( $statement ) {
$result = $this->checkStatement( $entity, 
$statement, $constraintIds );
$output = $this->sortResult( $result );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbe934f8b0b018705a8f38ee17a6a7c8439afef0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: Only use FileChunkSaver in HttpRequestExecutor

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363219 )

Change subject: Only use FileChunkSaver in HttpRequestExecutor
..

Only use FileChunkSaver in HttpRequestExecutor

This was taken extracted from PS1 of
I109520afdb96c87fb196c06e4746d022d973ea88

Change-Id: Ib0513c0372dc9df1287423e19714236536843fb7
---
M extension.json
M src/Remote/MediaWiki/ApiDetailRetriever.php
M src/Remote/MediaWiki/HttpApiLookup.php
M src/Remote/MediaWiki/RemoteApiImportTitleChecker.php
M src/Remote/MediaWiki/SiteWiring.php
M src/ServiceWiring.php
R src/Services/Http/FileChunkSaver.php
A src/Services/Http/HttpRequestExecutor.php
D src/Services/HttpRequestExecutor.php
M src/Services/Importer.php
R tests/phpunit/Services/Http/HttpRequestExecutorTest.php
M tests/phpunit/SpecialImportFileIntegrationTest.php
12 files changed, 131 insertions(+), 103 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter 
refs/changes/19/363219/1

diff --git a/extension.json b/extension.json
index e739e1b..8f8b337 100644
--- a/extension.json
+++ b/extension.json
@@ -45,8 +45,8 @@
"FileImporter\\Interfaces\\SourceUrlChecker": 
"src/Interfaces/SourceUrlChecker.php",
"FileImporter\\Services\\DuplicateFileRevisionChecker": 
"src/Services/DuplicateFileRevisionChecker.php",
"FileImporter\\Services\\FileImporterUploadBase": 
"src/Services/FileImporterUploadBase.php",
-   "FileImporter\\Services\\HttpRequestExecutor": 
"src/Services/HttpRequestExecutor.php",
-   "FileImporter\\Services\\HttpRequestFileChunkSaver": 
"src/Services/HttpRequestFileChunkSaver.php",
+   "FileImporter\\Services\\Http\\HttpRequestExecutor": 
"src/Services/Http/HttpRequestExecutor.php",
+   "FileImporter\\Services\\Http\\HttpRequestFileChunkSaver": 
"src/Services/Http/HttpRequestFileChunkSaver.php",
"FileImporter\\Services\\Importer": "src/Services/Importer.php",
"FileImporter\\Services\\ImportPlanFactory": 
"src/Services/ImportPlanFactory.php",
"FileImporter\\Services\\ImportPlanValidator": 
"src/Services/ImportPlanValidator.php",
diff --git a/src/Remote/MediaWiki/ApiDetailRetriever.php 
b/src/Remote/MediaWiki/ApiDetailRetriever.php
index 44b6007..899eb69 100644
--- a/src/Remote/MediaWiki/ApiDetailRetriever.php
+++ b/src/Remote/MediaWiki/ApiDetailRetriever.php
@@ -12,7 +12,7 @@
 use FileImporter\Exceptions\ImportException;
 use FileImporter\Exceptions\LocalizedImportException;
 use FileImporter\Interfaces\DetailRetriever;
-use FileImporter\Services\HttpRequestExecutor;
+use FileImporter\Services\Http\HttpRequestExecutor;
 use Message;
 use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerInterface;
diff --git a/src/Remote/MediaWiki/HttpApiLookup.php 
b/src/Remote/MediaWiki/HttpApiLookup.php
index 494816d..ef8bf76 100644
--- a/src/Remote/MediaWiki/HttpApiLookup.php
+++ b/src/Remote/MediaWiki/HttpApiLookup.php
@@ -7,7 +7,7 @@
 use FileImporter\Data\SourceUrl;
 use FileImporter\Exceptions\HttpRequestException;
 use FileImporter\Exceptions\ImportException;
-use FileImporter\Services\HttpRequestExecutor;
+use FileImporter\Services\Http\HttpRequestExecutor;
 use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerInterface;
 use Psr\Log\NullLogger;
@@ -24,7 +24,7 @@
private $logger;
 
/**
-* @var HttpRequestExecutor
+* @var \FileImporter\Services\Http\HttpRequestExecutor
 */
private $httpRequestExecutor;
 
diff --git a/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php 
b/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php
index 11d5823..3da4012 100644
--- a/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php
+++ b/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php
@@ -7,7 +7,7 @@
 use FileImporter\Exceptions\ImportException;
 use FileImporter\Interfaces\ImportTitleChecker;
 use FileImporter\Remote\MediaWiki\HttpApiLookup;
-use FileImporter\Services\HttpRequestExecutor;
+use FileImporter\Services\Http\HttpRequestExecutor;
 
 class RemoteApiImportTitleChecker implements ImportTitleChecker {
 
diff --git a/src/Remote/MediaWiki/SiteWiring.php 
b/src/Remote/MediaWiki/SiteWiring.php
index fdfbb35..382b450 100644
--- a/src/Remote/MediaWiki/SiteWiring.php
+++ b/src/Remote/MediaWiki/SiteWiring.php
@@ -5,7 +5,7 @@
 use FileImporter\Remote\MediaWiki\AnyMediaWikiFileUrlChecker;
 use FileImporter\Remote\MediaWiki\SiteTableSiteLookup;
 use FileImporter\Remote\MediaWiki\SiteTableSourceUrlChecker;
-use FileImporter\Services\HttpRequestExecutor;
+use FileImporter\Services\Http\HttpRequestExecutor;
 use FileImporter\Services\SourceSite;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
@@ -15,7 +15,7 @@
// General services
 
'FileImporterMediaWikiHttpApiLookup' => function ( MediaWikiServices 
$services ) {
-   /** @var 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: ep_courses.course_token should not be public, but filtered

2017-07-04 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363218 )

Change subject: ep_courses.course_token should not be public, but filtered
..


ep_courses.course_token should not be public, but filtered

This field has been erased on labs everywhere, add it to
the automatic filtering process on sanitarium(s) from now on.

Bug: T169661
Change-Id: Ifb66a6ec04489f72c98c46e70b68c752c3eaa951
---
M modules/role/files/mariadb/filtered_tables.txt
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/role/files/mariadb/filtered_tables.txt 
b/modules/role/files/mariadb/filtered_tables.txt
index 0021c2f..171b7ac 100644
--- a/modules/role/files/mariadb/filtered_tables.txt
+++ b/modules/role/files/mariadb/filtered_tables.txt
@@ -232,7 +232,7 @@
 ep_courses,course_online_ambs,K
 ep_courses,course_campus_ambs,K
 ep_courses,course_instructors,K
-ep_courses,course_token,K
+ep_courses,course_token,F
 ep_courses,course_field,K
 ep_courses,course_level,K
 ep_courses,course_term,K

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ep_courses.course_token should not be public, but filtered

2017-07-04 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363218 )

Change subject: ep_courses.course_token should not be public, but filtered
..

ep_courses.course_token should not be public, but filtered

This field has been erased on labs everywhere, add it to
the automatic filtering process on sanitarium(s) from now on.

Bug: T169661
Change-Id: Ifb66a6ec04489f72c98c46e70b68c752c3eaa951
---
M modules/role/files/mariadb/filtered_tables.txt
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/18/363218/1

diff --git a/modules/role/files/mariadb/filtered_tables.txt 
b/modules/role/files/mariadb/filtered_tables.txt
index 0021c2f..171b7ac 100644
--- a/modules/role/files/mariadb/filtered_tables.txt
+++ b/modules/role/files/mariadb/filtered_tables.txt
@@ -232,7 +232,7 @@
 ep_courses,course_online_ambs,K
 ep_courses,course_campus_ambs,K
 ep_courses,course_instructors,K
-ep_courses,course_token,K
+ep_courses,course_token,F
 ep_courses,course_field,K
 ep_courses,course_level,K
 ep_courses,course_term,K

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb66a6ec04489f72c98c46e70b68c752c3eaa951
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] operations...puppet-compiler[master]: [WiP] Generalize state management, allow multiple run modes

2017-07-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363217 )

Change subject: [WiP] Generalize state management, allow multiple run modes
..

[WiP] Generalize state management, allow multiple run modes

Change-Id: Ibde85bfd689f20d7d577ddbb82eed4f813828821
---
M puppet_compiler/controller.py
M puppet_compiler/presentation/html.py
A puppet_compiler/state.py
3 files changed, 103 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/puppet-compiler 
refs/changes/17/363217/1

diff --git a/puppet_compiler/controller.py b/puppet_compiler/controller.py
index 0fed5bf..6fc3201 100644
--- a/puppet_compiler/controller.py
+++ b/puppet_compiler/controller.py
@@ -3,7 +3,10 @@
 
 import yaml
 
-from puppet_compiler import prepare, _log, threads, worker, nodegen, 
directories
+from collections import defaultdict
+
+from puppet_compiler import directories, _log, nodegen, prepare, state, \
+threads, worker
 from puppet_compiler.presentation import html
 """
 How data are organized:
@@ -38,6 +41,7 @@
 'puppet_var': '/var/lib/catalog-differ/puppet',
 'pool_size': nthreads,
 }
+self.run_modes = {'change': (worker.HostWorker, state.ChangeState)}
 try:
 if configfile is not None:
 self._parse_conf(configfile)
@@ -48,14 +52,13 @@
 except Exception:
 _log.exception("Couldn't load the configuration from %s", 
configfile)
 
-self.count = 0
+self.count = defaultdict(int)
 self.pick_hosts(host_list)
 directories.FHS.setup(job_id, self.config['base'])
 self.m = prepare.ManageCode(self.config, job_id, change_id)
 self.outdir = directories.FHS.output_dir
 # State of all nodes
-self.state = {'noop': set(), 'diff': set(),
-  'err': set(), 'fail': set()}
+self.state = state.StatesCollection()
 # Set up variables to be used by the html output class
 html.change_id = change_id
 html.job_id = job_id
@@ -107,15 +110,24 @@
 # work is executed in the main thread via
 # Controller.on_node_compiled
 for host in self.hosts:
-h = worker.HostWorker(self.config['puppet_var'], host)
-threadpool.add(h.run_host, hostname=host)
+for mode, classes in self.run_modes.items():
+worker_class, state_class = classes
+h = worker_class(self.config['puppet_var'], host)
+threadpool.add(h.run_host,
+   hostname=host,
+   mode=mode,
+   state_class=state_class)
 threadpool.fetch(self.on_node_compiled)
-index = html.Index(self.outdir)
-index.render(self.state)
-_log.info('Run finished; see your results at %s/%s/', 
self.config['http_url'], html.job_id)
+for mode in self.run_modes.keys():
+index = html.Index(self.outdir, mode)
+index.render(self.state.modes[mode])
+_log.info('Run finished; see your results at %s', 
self.index_url(index))
 # Remove the source and the diffs etc, we just need the output.
 self.m.cleanup()
 return self.success
+
+def index_url(self, index):
+return "%s/%s/%s" % (self.config['http_url'], html.job_id, index.url)
 
 @property
 def success(self):
@@ -125,35 +137,37 @@
 Currently it just tries to see if more than half of the hosts are
 marked "fail"
 """
-if not self.count:
-# We still didn't run
-return True
-f = len(self.state['fail'])
-return (2 * f < self.count)
+for mode in self.run_modes.keys():
+if not self.count[mode]:
+# We still didn't run
+continue
+f = len(self.state.modes[mode]['fail'])
+if (2 * f >= self.count):
+return False
+return True
 
 def on_node_compiled(self, payload):
 """
 This callback is called in the main thread once one payload has been
 completed in a worker thread.
 """
-self.count += 1
 hostname = payload.kwargs['hostname']
+state_class = payload.kwargs['state_class']
+mode = payload.kwargs['mode']
+self.count[mode] += 1
 if payload.is_error:
 # Running _run_host returned with an exception, this is unexpected
-self.state['fail'].add(hostname)
+state = state_class(mode, hostname, False, False, False)
+self.state.modes.add(state)
 _log.critical("Unexpected error running the payload: %s",
   payload.value)
 else:
-self.state[payload.value].add(hostname)
+base, change, diff = payload.value
+   

[MediaWiki-commits] [Gerrit] operations...puppet-compiler[master]: Rationalize and centralize directory references

2017-07-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363216 )

Change subject: Rationalize and centralize directory references
..

Rationalize and centralize directory references

We had references to files and directories all across the code, which
would need to be coordinated across different points of the source if we
wanted to change anything.

Create a submodule to manage shared file structures.

Change-Id: I984b42e20d02954ab9394b0e3934900e0fa1d2fb
---
M puppet_compiler/controller.py
A puppet_compiler/directories.py
M puppet_compiler/prepare.py
M puppet_compiler/presentation/html.py
M puppet_compiler/tests/fixtures/exit_nodiff
A puppet_compiler/tests/test_directories.py
M puppet_compiler/tests/test_hostworker.py
M puppet_compiler/tests/test_prepare.py
M puppet_compiler/worker.py
M tox.ini
10 files changed, 154 insertions(+), 75 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/puppet-compiler 
refs/changes/16/363216/1

diff --git a/puppet_compiler/controller.py b/puppet_compiler/controller.py
index 8043fbd..0fed5bf 100644
--- a/puppet_compiler/controller.py
+++ b/puppet_compiler/controller.py
@@ -1,10 +1,9 @@
-import os
 import re
 import sys
 
 import yaml
 
-from puppet_compiler import prepare, _log, threads, worker, nodegen
+from puppet_compiler import prepare, _log, threads, worker, nodegen, 
directories
 from puppet_compiler.presentation import html
 """
 How data are organized:
@@ -51,8 +50,9 @@
 
 self.count = 0
 self.pick_hosts(host_list)
+directories.FHS.setup(job_id, self.config['base'])
 self.m = prepare.ManageCode(self.config, job_id, change_id)
-self.outdir = os.path.join(self.config['base'], 'output', str(job_id))
+self.outdir = directories.FHS.output_dir
 # State of all nodes
 self.state = {'noop': set(), 'diff': set(),
   'err': set(), 'fail': set()}
@@ -107,7 +107,7 @@
 # work is executed in the main thread via
 # Controller.on_node_compiled
 for host in self.hosts:
-h = worker.HostWorker(self.m, host, self.outdir)
+h = worker.HostWorker(self.config['puppet_var'], host)
 threadpool.add(h.run_host, hostname=host)
 threadpool.fetch(self.on_node_compiled)
 index = html.Index(self.outdir)
diff --git a/puppet_compiler/directories.py b/puppet_compiler/directories.py
new file mode 100644
index 000..214f776
--- /dev/null
+++ b/puppet_compiler/directories.py
@@ -0,0 +1,50 @@
+import os
+
+
+class FHS(object):
+base_dir = None
+prod_dir = None
+change_dir = None
+diff_dir = None
+output_dir = None
+
+@classmethod
+def setup(cls, job_id, base):
+cls.base_dir = os.path.join(base, str(job_id))
+cls.prod_dir = os.path.join(cls.base_dir, 'production')
+cls.change_dir = os.path.join(cls.base_dir, 'change')
+cls.diff_dir = os.path.join(cls.base_dir, 'diffs')
+cls.output_dir = os.path.join(base, 'output', str(job_id))
+
+
+class HostFiles(object):
+
+def __init__(self, hostname):
+self.hostname = hostname
+self.outdir = os.path.join(FHS.output_dir, self.hostname)
+
+def file_for(self, env, what):
+if env in ['prod', 'change']:
+suffix = ""
+else:
+suffix = "-%s" % env
+
+if what == 'diff':
+return os.path.join(FHS.diff_dir, self.hostname + suffix + '.diff')
+
+if env == 'prod':
+base = FHS.prod_dir
+else:
+base = FHS.change_dir
+
+if what == 'catalog':
+ext = '.pson'
+elif what == 'errors':
+ext = '.err'
+else:
+raise ValueError('Unrecognized object: %s' % what)
+return os.path.join(base, 'catalogs', self.hostname + suffix + ext)
+
+def outfile_for(self, env, what):
+name = os.basename(self.file_for(env, what))
+return os.path.join(self.output_dir, env + '.' + name)
diff --git a/puppet_compiler/prepare.py b/puppet_compiler/prepare.py
index b3b9de9..670c6bc 100644
--- a/puppet_compiler/prepare.py
+++ b/puppet_compiler/prepare.py
@@ -6,6 +6,7 @@
 import shutil
 import requests
 from puppet_compiler import _log
+from puppet_compiler.directories import FHS
 
 LDAP_YAML_PATH = '/etc/ldap.yaml'
 
@@ -22,18 +23,17 @@
 private_modules = ['passwords', 'contacts', 'privateexim']
 
 def __init__(self, config, jobid, changeid, realm='production'):
-self.base_dir = os.path.join(config['base'],
- str(jobid))
+self.base_dir = FHS.base_dir
 self.puppet_src = config['puppet_src']
 self.puppet_private = config['puppet_private']
 self.puppet_var = config['puppet_var']
 self.change_id = changeid
 self.realm = realm
 
-self.change_dir = 

[MediaWiki-commits] [Gerrit] operations...puppet-compiler[master]: Re-add support for defining threads from CI/cli

2017-07-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363214 )

Change subject: Re-add support for defining threads from CI/cli
..

Re-add support for defining threads from CI/cli

Change-Id: I7f00990e9c3e32fa4373e6ee712768d606d167ce
---
M puppet_compiler/cli.py
M puppet_compiler/controller.py
M puppet_compiler/tests/test_controller.py
M setup.py
4 files changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/puppet-compiler 
refs/changes/14/363214/1

diff --git a/puppet_compiler/cli.py b/puppet_compiler/cli.py
index 6ebe084..d4b34d1 100644
--- a/puppet_compiler/cli.py
+++ b/puppet_compiler/cli.py
@@ -13,6 +13,7 @@
 nodes = os.environ.get('NODES', None)
 job_id = int(os.environ.get('BUILD_NUMBER'))
 configfile = os.environ.get('PC_CONFIG', '/etc/puppet-compiler.conf')
+nthreads = os.environ.get('NUM_THREADS', 2)
 
 
 def main():
@@ -37,7 +38,7 @@
 
 _log.info("Working on change %d", change)
 c = controller.Controller(configfile, job_id,
-  change, nodes)
+  change, host_list=nodes, nthreads=nthreads)
 success = c.run()
 # If the run is marked as failed, exit with a non-zero exit code
 if not success:
diff --git a/puppet_compiler/controller.py b/puppet_compiler/controller.py
index 7fee062..9eaf592 100644
--- a/puppet_compiler/controller.py
+++ b/puppet_compiler/controller.py
@@ -22,7 +22,7 @@
 
 class Controller(object):
 
-def __init__(self, configfile, job_id, change_id, host_list=[]):
+def __init__(self, configfile, job_id, change_id, host_list=[], 
nthreads=2):
 self.config = {
 # Url under which results will be found
 'http_url': 'https://puppet-compiler.wmflabs.org/html',
@@ -36,7 +36,8 @@
 'puppet_private': 'https://gerrit.wikimedia.org/r/labs/private',
 # Directory hosting all of puppet's runtime files usually
 # under /var/lib/puppet on debian-derivatives
-'puppet_var': '/var/lib/catalog-differ/puppet'
+'puppet_var': '/var/lib/catalog-differ/puppet',
+'pool_size': nthreads,
 }
 try:
 if configfile is not None:
@@ -98,7 +99,7 @@
 self.m.prepare()
 
 threadpool = threads.ThreadOrchestrator(
-self.config.get('pool_size', 2))
+self.config['pool_size'])
 
 # For each host, the threadpool will execute
 # Controller._run_host with the host as the only argument.
diff --git a/puppet_compiler/tests/test_controller.py 
b/puppet_compiler/tests/test_controller.py
index c8171d3..c562d5b 100644
--- a/puppet_compiler/tests/test_controller.py
+++ b/puppet_compiler/tests/test_controller.py
@@ -11,7 +11,7 @@
 cls.fixtures = os.path.join(os.path.dirname(__file__), 'fixtures')
 
 def test_initialize_no_configfile(self):
-c = controller.Controller(None, 19, 224570, 'test.eqiad.wmnet')
+c = controller.Controller(None, 19, 224570, 'test.eqiad.wmnet', 
nthreads=2)
 self.assertEquals(c.hosts, ['test.eqiad.wmnet'])
 self.assertEquals(c.config['http_url'],
   'https://puppet-compiler.wmflabs.org/html')
@@ -19,7 +19,7 @@
 
 def test_parse_config(self):
 filename = os.path.join(self.fixtures, 'test_config.yaml')
-c = controller.Controller(filename, 19, 224570, 'test.eqiad.wmnet')
+c = controller.Controller(filename, 19, 224570, 'test.eqiad.wmnet', 
nthreads=2)
 self.assertEquals(len(c.config['test_non_existent']), 2)
 self.assertEquals(c.config['http_url'],
   'http://www.example.com/garbagehere')
diff --git a/setup.py b/setup.py
index 53de09f..4849bbc 100755
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+from functools import reduce
 import os
 from setuptools import setup, find_packages
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f00990e9c3e32fa4373e6ee712768d606d167ce
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/puppet-compiler
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto 

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


[MediaWiki-commits] [Gerrit] operations...puppet-compiler[master]: Move HostWorker to a dedicated class

2017-07-04 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363215 )

Change subject: Move HostWorker to a dedicated class
..

Move HostWorker to a dedicated class

Change-Id: I100fe891e307193ea70fd12214bcccbdb159e697
---
M puppet_compiler/controller.py
M puppet_compiler/tests/test_controller.py
M puppet_compiler/tests/test_hostworker.py
A puppet_compiler/worker.py
4 files changed, 172 insertions(+), 165 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/puppet-compiler 
refs/changes/15/363215/1

diff --git a/puppet_compiler/controller.py b/puppet_compiler/controller.py
index 9eaf592..8043fbd 100644
--- a/puppet_compiler/controller.py
+++ b/puppet_compiler/controller.py
@@ -1,10 +1,10 @@
 import os
 import re
-import subprocess
-import shutil
 import sys
+
 import yaml
-from puppet_compiler import prepare, _log, threads, puppet, nodegen
+
+from puppet_compiler import prepare, _log, threads, worker, nodegen
 from puppet_compiler.presentation import html
 """
 How data are organized:
@@ -107,7 +107,7 @@
 # work is executed in the main thread via
 # Controller.on_node_compiled
 for host in self.hosts:
-h = HostWorker(self.m, host, self.outdir)
+h = worker.HostWorker(self.m, host, self.outdir)
 threadpool.add(h.run_host, hostname=host)
 threadpool.fetch(self.on_node_compiled)
 index = html.Index(self.outdir)
@@ -157,160 +157,3 @@
 len(self.state['err']),
 len(self.state['fail'])
 )
-
-
-class HostWorker(object):
-E_OK = 0
-E_PROD = 1
-E_CHANGE = 2
-
-def __init__(self, manager, hostname, outdir):
-self.m = manager
-self.files = {
-'prod': {
-'catalog': os.path.join(self.m.prod_dir, 'catalogs',
-hostname + '.pson'),
-'errors': os.path.join(self.m.prod_dir, 'catalogs',
-   hostname + '.err')
-},
-'change': {
-'catalog': os.path.join(self.m.change_dir, 'catalogs',
-hostname + '.pson'),
-'errors': os.path.join(self.m.change_dir, 'catalogs',
-   hostname + '.err')
-}
-}
-self.hostname = hostname
-self.outdir = os.path.join(outdir, self.hostname)
-
-def run_host(self, *args, **kwdargs):
-"""
-Compiles and diffs an host. Gets delegated to a worker thread
-"""
-if not self.m.find_yaml(self.hostname):
-_log.error('Unable to find facts for host %s, skipping',
-   self.hostname)
-return 'fail'
-errors = self._compile_all()
-retcode = self._make_diff(errors)
-try:
-self._make_output()
-self._build_html(retcode)
-except Exception as e:
-_log.error('Error preparing output for %s: %s', self.hostname, e,
-   exc_info=True)
-return retcode
-
-def _compile_all(self):
-"""
-Does the grindwork of compiling the catalogs
-"""
-errors = self.E_OK
-try:
-_log.info("Compiling host %s (production)", self.hostname)
-puppet.compile(self.hostname,
-   self.m.prod_dir,
-   self.m.puppet_var)
-except subprocess.CalledProcessError as e:
-_log.error("Compilation failed for hostname %s "
-   " with the current tree.", self.hostname)
-_log.info("Compilation exited with code %d", e.returncode)
-_log.debug("Failed command: %s", e.cmd)
-errors += self.E_PROD
-args = []
-if os.path.isfile(os.path.join(self.m.change_dir, 'src', '.configs')):
-with open(os.path.join(self.m.change_dir, 'src', '.configs')) as f:
-configs = f.readlines()
-# Make sure every item has exactly 2 dashes prepended
-configs = map(lambda x: "--{}".format(x.lstrip('-')), configs)
-args.extend(configs)
-try:
-_log.info("Compiling host %s (change)", self.hostname)
-puppet.compile(self.hostname,
-   self.m.change_dir,
-   self.m.puppet_var,
-   *args)
-except subprocess.CalledProcessError as e:
-_log.error("Compilation failed for hostname %s "
-   " with the change.", self.hostname)
-_log.info("Compilation exited with code %d", e.returncode)
-_log.debug("Failed command: %s", e.cmd)
-errors += self.E_CHANGE
-return errors
-
-def _make_diff(self, errors):
-"""
-Based on the outcome 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Restrict http access to ununpentium

2017-07-04 Thread Muehlenhoff (Code Review)
Muehlenhoff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363213 )

Change subject: Restrict http access to ununpentium
..

Restrict http access to ununpentium

rt.wikimedia.org is served via Varnish, so restrict to production
networks.

Now that it no longer needs SMTP access, it could also be removed to
a non-public address, but not sure if that's really worth the hassle.

Change-Id: Iebc3228fc69f133190a899bf883607c7a423812c
---
M modules/profile/manifests/requesttracker/server.pp
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/13/363213/1

diff --git a/modules/profile/manifests/requesttracker/server.pp 
b/modules/profile/manifests/requesttracker/server.pp
index 098b1a7..8c4ae6c 100644
--- a/modules/profile/manifests/requesttracker/server.pp
+++ b/modules/profile/manifests/requesttracker/server.pp
@@ -23,8 +23,8 @@
 include ::base::firewall
 
 ferm::service { 'rt-http':
-proto => 'tcp',
-port  => '80',
+proto  => 'tcp',
+port   => '80',
+srange => '$PRODUCTION_NETWORKS',
 }
-
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebc3228fc69f133190a899bf883607c7a423812c
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] mediawiki...WikibaseQualityConstraints[master]: Support claimid with lowercase entity ID

2017-07-04 Thread Lucas Werkmeister (WMDE) (Code Review)
Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363212 )

Change subject: Support claimid with lowercase entity ID
..

Support claimid with lowercase entity ID

Old Wikidata statements have a statement GUID like

> q42$8419C20C-8EF8-4EC0-80D6-AF1CA55E7557

instead of the current format, which is:

> Q42$8419c20c-8ef8-4ec0-80d6-af1ca55e7557

When we parse this string, it is split up into entity ID and GUID part,
and StatementGuid holds both and reassembles the serialization from
those parts; the StatementGuid’s serialization is therefore

> Q42$8419C20C-8EF8-4EC0-80D6-AF1CA55E7557

since the entity ID was normalized during parsing, but nothing was done
to the GUID part.

When we search for this statement by its statement GUID,
StatementList::getFirstStatementWithGuid walks the statements and does a
simple string comparison on the entire statement GUID, which means that
the statement is not found because of the case mismatch in the entity
ID. To remedy this, we try to find the statement again if the change was
unsuccessful, this time with the first character (the Q or P of the
entity ID) lowercased.

(The assumption that “convert the first character to lowercase” is a
meaningful operation may not necessarily hold for future entity types,
but hopefully future entity types will never introduce this sort of case
confusion into the statement GUIDs stored in the database, so this
should not matter.)

Bug: T165020
Change-Id: Icbe934f8b0b018705a8f38ee17a6a7c8439afef0
---
M includes/ConstraintCheck/DelegatingConstraintChecker.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/12/363212/1

diff --git a/includes/ConstraintCheck/DelegatingConstraintChecker.php 
b/includes/ConstraintCheck/DelegatingConstraintChecker.php
index d7eb5b7..6d3b66e 100644
--- a/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -132,6 +132,11 @@
$entity = $this->entityLookup->getEntity( $entityId );
if ( $entity instanceof StatementListProvider ) {
$statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guid->getSerialization() 
);
+   if ( $statement === null ) {
+   // try lowercasing the entity ID for legacy 
statement GUIDs
+   $guidSerialization = lcfirst( 
$guid->getSerialization() );
+   $statement = 
$entity->getStatements()->getFirstStatementWithGuid( $guidSerialization );
+   }
if ( $statement ) {
$result = $this->checkStatement( $entity, 
$statement, $constraintIds );
$output = $this->sortResult( $result );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbe934f8b0b018705a8f38ee17a6a7c8439afef0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: Add messages for extendedmover group

2017-07-04 Thread GeoffreyT2000 (Code Review)
GeoffreyT2000 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363211 )

Change subject: Add messages for extendedmover group
..

Add messages for extendedmover group

Bug: T169663
Change-Id: I44a72eb180354be8905020cea7a8f42b3ba0075d
---
M i18n/wikimedia/en.json
M i18n/wikimedia/qqq.json
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/11/363211/1

diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json
index 421ceb6..99d5c83 100644
--- a/i18n/wikimedia/en.json
+++ b/i18n/wikimedia/en.json
@@ -70,6 +70,9 @@
"group-extendedconfirmed": "Extended confirmed users",
"group-extendedconfirmed-member": "{{GENDER:$1|extended confirmed 
user}}",
"grouppage-extendedconfirmed": "{{ns:project}}:Extended confirmed 
editors",
+   "group-extendedmover": "Extended movers",
+   "group-extendedmover-member": "{{GENDER:$1|extended mover}}",
+   "grouppage-extendedmover": "{{ns:project}}:Extended movers",
"group-filemover": "File movers",
"group-filemover-member": "{{GENDER:$1|file mover}}",
"grouppage-filemover": "{{ns:project}}:File movers",
diff --git a/i18n/wikimedia/qqq.json b/i18n/wikimedia/qqq.json
index 5528492..8a61e3e 100644
--- a/i18n/wikimedia/qqq.json
+++ b/i18n/wikimedia/qqq.json
@@ -99,6 +99,9 @@
"group-extendedconfirmed": "{{doc-group|extendedconfirmed}}\nUsergroup 
introduced for enwiki ([[phab:T126607|Task T126607]]). It is automatically 
granted to users with accounts older than 30 days with 500 edits, and 
potentially manually granted to other editors, and carries the right to edit 
pages protected to a new level.",
"group-extendedconfirmed-member": 
"{{doc-group|extendedconfirmed|member}}",
"grouppage-extendedconfirmed": "{{doc-group|extendedconfirmed|page}}",
+   "group-extendedmover": "{{doc-group|extendedmover}}",
+   "group-extendedmover-member": "{{doc-group|extendedmover|member}}",
+   "grouppage-extendedmover": "{{doc-group|extendedmover|page}}",
"group-filemover": "{{doc-group|filemover}}",
"group-filemover-member": "{{doc-group|filemover|member}}",
"grouppage-filemover": "{{doc-group|filemover|page}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44a72eb180354be8905020cea7a8f42b3ba0075d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: GeoffreyT2000 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Display categories on File redirects

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334336 )

Change subject: Display categories on File redirects
..


Display categories on File redirects

This NS_FILE-specific redirect logic was introduced in 2008,
in 3c9536652a3b27ec97cb2e3f046c5e98849c58a4.

mTitle, as referenced to in the comments, no longer exists.
Article also no longer creates redirects in there, that’s now
in WikitextContent::fillParserOutput.
The original commit message describes that this was introduced
to be able to display redirects to foreign file repos. A lot
has changed in how that works since 2008, too :)

Back to the present: for redirects to foreign repos,
`$this->mPage->getFile()->getRedirected()` seems to always return
`null` (a placeholder object is created when the thing doesn’t
exist), so this this foreign repo-specific bit of code is bypassed
anyway. For local redirects, Article::view seems to be working just
fine.

By using Article::view, Categories used on file redirect pages
will now actually be displayed too.

And we can get rid of the otherwise no longer used Article::viewRedirect.

Bug: T29857
Change-Id: Icb02f3af32d10870f58d945cb06a84b3ba1305d3
---
M RELEASE-NOTES-1.30
M includes/page/Article.php
M includes/page/ImagePage.php
3 files changed, 6 insertions(+), 15 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30
index 260276f..c8b746d 100644
--- a/RELEASE-NOTES-1.30
+++ b/RELEASE-NOTES-1.30
@@ -126,6 +126,7 @@
   ParserOptions that would pollute the parser cache. Callers should use
   WikiPage::makeParserOptions() to create the ParserOptions object and only
   change options that affect the parser cache key.
+* Article::viewRedirect() is deprecated.
 
 == Compatibility ==
 MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 656e610..dc4096c 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1433,6 +1433,8 @@
 * @param bool $appendSubtitle [optional]
 * @param bool $forceKnown Should the image be shown as a bluelink 
regardless of existence?
 * @return string Containing HTML with redirect link
+*
+* @deprecated since 1.30
 */
public function viewRedirect( $target, $appendSubtitle = true, 
$forceKnown = false ) {
$lang = $this->getTitle()->getPageLanguage();
diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php
index 6a751ac..d37700b 100644
--- a/includes/page/ImagePage.php
+++ b/includes/page/ImagePage.php
@@ -115,23 +115,11 @@
 
if ( $this->getTitle()->getNamespace() == NS_FILE && 
$this->mPage->getFile()->getRedirected() ) {
if ( $this->getTitle()->getDBkey() == 
$this->mPage->getFile()->getName() || $diff !== null ) {
-   // mTitle is the same as the redirect target so 
ask Article
-   // to perform the redirect for us.
$request->setVal( 'diffonly', 'true' );
-   parent::view();
-   return;
-   } else {
-   // mTitle is not the same as the redirect 
target so it is
-   // probably the redirect page itself. Fake the 
redirect symbol
-   $out->setPageTitle( 
$this->getTitle()->getPrefixedText() );
-   $out->addHTML( $this->viewRedirect(
-   Title::makeTitle( NS_FILE, 
$this->mPage->getFile()->getName() ),
-   /* $appendSubtitle */ true,
-   /* $forceKnown */ true )
-   );
-   $this->mPage->doViewUpdates( 
$this->getContext()->getUser(), $this->getOldID() );
-   return;
}
+
+   parent::view();
+   return;
}
 
if ( $wgShowEXIF && $this->displayImg->exists() ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb02f3af32d10870f58d945cb06a84b3ba1305d3
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Fomafix 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: MarkTraceur 
Gerrit-Reviewer: TheDJ 
Gerrit-Reviewer: jenkins-bot <>


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Remove __version string from scripts

2017-07-04 Thread Xqt (Code Review)
Xqt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363210 )

Change subject: Remove __version string from scripts
..

Remove __version string from scripts

Also remove this string from older scripts when using compat2core.py

Bug: T87409
Change-Id: Id95c94d2371d0d09b47fd9f157ae3bc7815849ab
---
M scripts/add_text.py
M scripts/archivebot.py
M scripts/basic.py
M scripts/blockpageschecker.py
M scripts/capitalize_redirects.py
M scripts/casechecker.py
M scripts/catall.py
M scripts/category.py
M scripts/category_redirect.py
M scripts/cfd.py
M scripts/checkimages.py
M scripts/claimit.py
M scripts/clean_sandbox.py
M scripts/commons_link.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/create_categories.py
M scripts/data_ingestion.py
M scripts/delete.py
M scripts/disambredir.py
M scripts/djvutext.py
M scripts/editarticle.py
M scripts/fixing_redirects.py
M scripts/flickrripper.py
M scripts/followlive.py
M scripts/freebasemappingupload.py
M scripts/harvest_template.py
M scripts/illustrate_wikidata.py
M scripts/image.py
M scripts/imagecopy.py
M scripts/imagecopy_self.py
M scripts/imageharvest.py
M scripts/imagerecat.py
M scripts/imagetransfer.py
M scripts/imageuncat.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/isbn.py
M scripts/listpages.py
M scripts/login.py
M scripts/lonelypages.py
M scripts/maintenance/cache.py
M scripts/maintenance/compat2core.py
M scripts/maintenance/make_i18n_dict.py
M scripts/maintenance/wikimedia_sites.py
M scripts/makecat.py
M scripts/match_images.py
M scripts/misspelling.py
M scripts/movepages.py
M scripts/newitem.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/patrol.py
M scripts/piper.py
M scripts/protect.py
M scripts/redirect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/script_wui.py
M scripts/shell.py
M scripts/solve_disambiguation.py
M scripts/spamremove.py
M scripts/standardize_interwiki.py
M scripts/states_redirect.py
M scripts/table2wiki.py
M scripts/template.py
M scripts/templatecount.py
M scripts/touch.py
M scripts/transferbot.py
M scripts/unlink.py
M scripts/unusedfiles.py
M scripts/upload.py
M scripts/version.py
M scripts/watchlist.py
M scripts/weblinkchecker.py
M scripts/welcome.py
M scripts/wikisourcetext.py
81 files changed, 30 insertions(+), 244 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/10/363210/1

diff --git a/scripts/add_text.py b/scripts/add_text.py
index 73d3f27..a40d765 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -62,9 +62,6 @@
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
-
 import codecs
 import re
 import sys
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index e6c0ca4..fa04721 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -89,14 +89,12 @@
 #
 # (C) Misza13, 2006-2010
 # (C) xqt, 2009-2016
-# (C) Pywikibot team, 2007-2016
+# (C) Pywikibot team, 2007-2017
 #
 # Distributed under the terms of the MIT license.
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
 import datetime
 import locale
 import math
diff --git a/scripts/basic.py b/scripts/basic.py
index c39804e..2112953 100755
--- a/scripts/basic.py
+++ b/scripts/basic.py
@@ -31,9 +31,6 @@
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
-
 import pywikibot
 from pywikibot import pagegenerators
 
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index 2756042..0f64bb2 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -56,9 +56,6 @@
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
-
 import re
 import time
 import webbrowser
diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py
index 339a88f..0ce8da7 100755
--- a/scripts/capitalize_redirects.py
+++ b/scripts/capitalize_redirects.py
@@ -33,9 +33,6 @@
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
-
 import pywikibot
 from pywikibot import i18n, pagegenerators
 from pywikibot.bot import (
diff --git a/scripts/casechecker.py b/scripts/casechecker.py
index 61287ab..9732227 100755
--- a/scripts/casechecker.py
+++ b/scripts/casechecker.py
@@ -7,7 +7,6 @@
 # Distributed under the terms of the MIT license.
 #
 from __future__ import absolute_import, unicode_literals
-__version__ = '$Id$'
 
 import codecs
 import itertools
diff --git a/scripts/catall.py b/scripts/catall.py
index 31ee2db..ed41c91 100755
--- a/scripts/catall.py
+++ b/scripts/catall.py
@@ -26,9 +26,6 @@
 #
 from __future__ import absolute_import, unicode_literals
 
-__version__ = '$Id$'
-#
-
 import pywikibot
 from pywikibot import i18n, textlib
 from pywikibot.bot import 

[MediaWiki-commits] [Gerrit] mediawiki...UserExport[master]: Release version 1.2.0

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363025 )

Change subject: Release version 1.2.0
..


Release version 1.2.0

* Get changes since the last 1.1.1 release out to the public (see CHANGELOG for 
the respective changes)
* Remove obsolete I18n shim for unsuported versions of MediaWiki < 1.23.x

Bug: T168353
Change-Id: I4efb31f7ee183ccb9dfb678e4d5ecaf1b70ed8e3
---
M CHANGELOG.md
M README.md
D UserExport.i18n.php
M UserExport.php
4 files changed, 91 insertions(+), 66 deletions(-)

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



diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff6536f..e0ff01c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,22 +1,54 @@
-## Changelog of the UserExport extension
+## UserExport extension
+
+The UserExport extension to MediaWiki allows to export all user's account 
names together with the respective
+e-mail address as a UTF-8 encoded CSV file.
+
+This file documents the development changes.
+
+
+### 1.2.0
+
+Released: 2017-07-03  
+Authored: Kghbln
+
+* Added support for MW 1.26+
+* Removed support for < MW 1.23.0
+* Removed I18n shim for php message files (by Kghbln)
+* Migrated registration of special pages to `SpecialPage::getGroupName` (by 
Umherirrender)
+* Fixed typos for special pages aliases (by Umherirrender)
+* Updated file documentation (by Kghbln)
+* Updated README (by Kgbhln)
+
+
+### 1.1.1
+
+Released: 2017-01-21  
+Authored: SamanthaNguyen
+
+* Migrated to `getEditToken` (by Reedy)
+* Improved exception reporting (by Reedy)
+* Fixed registration of special page aliases (by SamanthaNyuyen)
+* Improved code formatting (by Kghbln and Reedy)
+* Updated file documenation (by Kghbln)
+
 
 ### 1.1.0
 
 Released: 2014-11-14  
 Authored: Kghbln
 
-* Remove support for ≤ PHP 5.2
-* Remove support for < MW 1.17.0
-* Migrate to JSON I18n
-* Migrate to new alias I18n inclusion
-* Migrate depreciated ```wfMsg``` to ```wfMessage```
-* Improve system messages
-* Add missing system messages
-* Apply several code tweaks
-* Remove dead code
-* Overhaul file documentation
-* Add CHANGELOG
-* Add COPYING
+* Removed support for ≤ PHP 5.2
+* Removed support for < MW 1.17.0
+* Migrated to I18n served via json-files (by Kghbln)
+* Migrated to new alias I18n inclusion (by Kghbln)
+* Migrated deprecated `wfMsg` to `wfMessage` (by Kghbln)
+* Improved wording of system messages (by Kghbln)
+* Added missing system messages (by Kghbln)
+* Apply several code tweaks (by Kghbln)
+* Remove dead code (by Kghbln)
+* Overhaul file documentation (by Kghbln)
+* Add CHANGELOG (by Kghbln)
+* Add COPYING (by Kghbln)
 
 
 ### 1.0.1
@@ -24,7 +56,7 @@
 Released: 2014-01-02  
 Authored: Kghbln
 
-* Improve formatting and file documentation
+* Improved formatting and file documentation (by Kghbln)
 
 
 ### 1.0
@@ -32,4 +64,4 @@
 Released: 2009-08-09  
 Authored: Rodrigoprimo
 
-* Initial public release
+* Initial public release (by Rodrigoprimo)
diff --git a/README.md b/README.md
index d8008d9..cff4563 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,39 @@
-# UserExport
+## UserExport
 
-The UserExport extension to MediaWiki allows to export all user's name and 
e-mail address as a CSV file.
+The UserExport extension to MediaWiki allows to export all user's account 
names together with the respective
+e-mail address as a UTF-8 encoded CSV file.
 
-## Installation
-1. Obtain the code from [GitHub](https://github.com/kghbln/UserExport)
-2. Extract the files in a directory called ``UserExport`` in your 
``extensions/`` folder.
-3. Add the following code at the bottom of your "LocalSettings.php" file:``require_once "$IP/extensions/UserExport/UserExport.php";``
-4. Go to "Special:Version" on your wiki to verify that the extension is 
successfully installed.
-5. Done.
 
-## Configuration
+### Compatibility
+
+* PHP 5.3+
+* MediaWiki 1.23+
+
+See also the CHANGELOG.md file provided with the code.
+
+
+### Installation
+
+1. Obtain the code from 
[GitHub](https://github.com/wikimedia/mediawiki-extensions-UserExport)
+2. Extract the files in a directory called `UserExport` in your `extensions/` 
folder.
+3. Add the following code at the bottom of your "LocalSettings.php" file:  
+```
+require_once "$IP/extensions/UserExport/UserExport.php";`
+```
+4. Configure as required. See the "Configuration" section below.
+5. Go to "Special:Version" on your wiki to verify that the extension was 
successfully installed.
+6. Done.
+
+
+### Configuration
+
+By default the `userexport` right provided by this extension is assigned to 
any user group. In case you would
+like to assign the right to an additional user group, e.g. "bureaucrat" add 
the following line to your
+"LocalSettings.php" file after the inclusion of the extension as described in 
the "Installation" section above:
+
+```
+$wgGroupPermissions['bureaucrat']['userexport'] = true;
+```
+
+### Usage
 See the 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Add maintenance script to import constraint statements

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362982 )

Change subject: Add maintenance script to import constraint statements
..


Add maintenance script to import constraint statements

This script can be used to import existing constraint statements which
were added while constraint statement import was disabled via the
WBQualityConstraintsEnableConstraintsImportFromStatements config.

The code to enumerate all properties is taken from Wikibase’s
SpecialListProperties class.

Bug: T169218
Change-Id: I562e90808522846df2cb40236c9bacfd6e21cc6f
---
A maintenance/ImportConstraintStatements.php
1 file changed, 51 insertions(+), 0 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/ImportConstraintStatements.php 
b/maintenance/ImportConstraintStatements.php
new file mode 100644
index 000..7cc3ce5
--- /dev/null
+++ b/maintenance/ImportConstraintStatements.php
@@ -0,0 +1,51 @@
+addDescription( 'Imports property constraints from 
statements on properties' );
+   }
+
+   public function execute() {
+   if ( !MediaWikiServices::getInstance()->getMainConfig()->get( 
'WBQualityConstraintsEnableConstraintsImportFromStatements' ) ) {
+   $this->error( 'Constraint statements are not enabled. 
Aborting.', 1 );
+   }
+
+   $propertyInfoLookup = 
WikibaseRepo::getDefaultInstance()->getStore()->getPropertyInfoLookup();
+   foreach ( $propertyInfoLookup->getAllPropertyInfo() as 
$propertyIdSerialization => $info ) {
+   $this->output( sprintf( 'Importing constraint 
statements for % 6s... ', $propertyIdSerialization ), $propertyIdSerialization 
);
+   $startTime = microtime( true );
+   $job = UpdateConstraintsTableJob::newFromGlobalState( 
Title::newMainPage(), [ 'propertyId' => $propertyIdSerialization ] );
+   $job->run();
+   $endTime = microtime( true );
+   $millis = ( $endTime - $startTime ) * 1000;
+   $this->output( sprintf( 'done in % 6.2f ms.', $millis 
), $propertyIdSerialization );
+   }
+   }
+
+}
+
+// @codeCoverageIgnoreStart
+$maintClass = ImportConstraintStatements::class;
+require_once RUN_MAINTENANCE_IF_MAIN;
+// @codeCoverageIgnoreEnd

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I562e90808522846df2cb40236c9bacfd6e21cc6f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] analytics...scripts[production]: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363209 )

Change subject: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist
..


Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index c60a1db..d8d64f7 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -17,8 +17,6 @@
'uls-compact-links',
'popups',
'cx',
-   'read-more',
-   'ores-enabled',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
Gerrit-Branch: production
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] analytics...scripts[production]: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363209 )

Change subject: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist
..

Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/scripts 
refs/changes/09/363209/1

diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index c60a1db..d8d64f7 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -17,8 +17,6 @@
'uls-compact-links',
'popups',
'cx',
-   'read-more',
-   'ores-enabled',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
Gerrit-Branch: production
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] analytics...scripts[master]: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363208 )

Change subject: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist
..


Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index c60a1db..d8d64f7 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -17,8 +17,6 @@
'uls-compact-links',
'popups',
'cx',
-   'read-more',
-   'ores-enabled',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
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] analytics...scripts[master]: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363208 )

Change subject: Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist
..

Remove 2 betafeatures that are not in wgBetaFeaturesWhitelist

Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/scripts 
refs/changes/08/363208/1

diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index c60a1db..d8d64f7 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -17,8 +17,6 @@
'uls-compact-links',
'popups',
'cx',
-   'read-more',
-   'ores-enabled',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c0ce1a72d42ffcbcc6a2d828f39465f8a4d5d6a
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
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] mediawiki...WikibaseQualityConstraints[master]: Add constraint status for incorrect parameters

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363032 )

Change subject: Add constraint status for incorrect parameters
..


Add constraint status for incorrect parameters

A fifth constraint status is added, which marks constraints with missing
or invalid parameters. The gadget shows violations of this type, and
also adds a CSS class for the constraint status to the report.

Bug: T167397
Change-Id: I0f0ee0f508d8fc440536c883c5312e407c3023f3
---
M i18n/en.json
M i18n/qqq.json
M includes/ConstraintCheck/DelegatingConstraintChecker.php
M includes/ConstraintCheck/Result/CheckResult.php
M modules/SpecialConstraintReportPage.css
M modules/gadget.js
6 files changed, 13 insertions(+), 4 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index f8f8156..3ae6ce2 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -21,6 +21,7 @@
"wbqc-constraintreport-status-compliance": "Compliance",
"wbqc-constraintreport-status-exception": "Exception",
"wbqc-constraintreport-status-todo": "Todo",
+   "wbqc-constraintreport-status-bad-parameters": "Bad parameters",
"wbqc-constraintreport-result-table-header-status": "Status",
"wbqc-constraintreport-result-table-header-claim": "Claim",
"wbqc-constraintreport-result-table-header-constraint": "Constraint",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a37f040..51f6970 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -23,6 +23,7 @@
"wbqc-constraintreport-status-compliance": "Status for claims that 
comply with a constraint",
"wbqc-constraintreport-status-exception": "Status for claims that were 
marked as a exception",
"wbqc-constraintreport-status-todo": "Status for constraints which 
cannot be checked yet.\n{{Identical|Todo}}",
+   "wbqc-constraintreport-status-bad-parameters": "Status for constraints 
that have missing or invalid constraint parameters.",
"wbqc-constraintreport-result-table-header-status": "Header of the 
column that tells whether the check found a violation or something 
else.\n{{Identical|Status}}",
"wbqc-constraintreport-result-table-header-claim": "Header of the 
column that displays a link to the claim, the used property and its 
value.\n{{Identical|Claim}}",
"wbqc-constraintreport-result-table-header-constraint": "Header of the 
column that gives information about which constraint was 
checked.\n{{Identical|Constraint}}",
diff --git a/includes/ConstraintCheck/DelegatingConstraintChecker.php 
b/includes/ConstraintCheck/DelegatingConstraintChecker.php
index 34cfe68..79d7a80 100644
--- a/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -240,7 +240,7 @@
$statement,
$constraint,
[],
-   CheckResult::STATUS_VIOLATION,
+   CheckResult::STATUS_BAD_PARAMETERS,
$e->getMessage()
);
} catch ( SparqlHelperException $e ) {
@@ -275,7 +275,7 @@
}
 
$sortFunction = function ( CheckResult $a, CheckResult $b ) {
-   $order = [ 'other' => 4, 'compliance' => 3, 'exception' 
=> 2, 'violation' => 1 ];
+   $order = [ 'other' => 4, 'compliance' => 3, 'exception' 
=> 2, 'violation' => 1, 'bad-parameters' => 0 ];
 
$statusA = $a->getStatus();
$statusB = $b->getStatus();
diff --git a/includes/ConstraintCheck/Result/CheckResult.php 
b/includes/ConstraintCheck/Result/CheckResult.php
index 03314d3..0b33e32 100644
--- a/includes/ConstraintCheck/Result/CheckResult.php
+++ b/includes/ConstraintCheck/Result/CheckResult.php
@@ -24,6 +24,7 @@
const STATUS_VIOLATION = 'violation';
const STATUS_EXCEPTION = 'exception';
const STATUS_TODO = 'todo';
+   const STATUS_BAD_PARAMETERS = 'bad-parameters';
 
/**
 * @var EntityId
diff --git a/modules/SpecialConstraintReportPage.css 
b/modules/SpecialConstraintReportPage.css
index 47a50ae..831949f 100644
--- a/modules/SpecialConstraintReportPage.css
+++ b/modules/SpecialConstraintReportPage.css
@@ -36,6 +36,10 @@
color: #54595d; /* Base20 */
 }
 
+.wbqc-status-bad-parameters {
+   color: #b32424; /* Red30 */
+}
+
 /* Tooltip */
 .wbqc-indicator {
color: #72777d; /* Base30 */
diff --git a/modules/gadget.js b/modules/gadget.js
index b6ac5e4..0c5d051 100644
--- a/modules/gadget.js
+++ b/modules/gadget.js
@@ -30,8 +30,10 @@
function buildReport( result ) {
var $report, $heading, $helpButton;
 
-  

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: DNM Remove wm?gRevisionSliderBetaFeature

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363207 )

Change subject: DNM Remove wm?gRevisionSliderBetaFeature
..

DNM Remove wm?gRevisionSliderBetaFeature

The Depends-On patch should be merged and deployed
before this patch is merged and deployed

Change-Id: I846adf50cc49bf9bb84d3979586e69f1012c57e9
Depends-On: Iad2e34e2f906777c7ba0e22e245dc55891f211ae
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 0 insertions(+), 5 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 2c12b52..fc94936 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2923,7 +2923,6 @@
 
 if ( $wmgUseRevisionSlider ) {
wfLoadExtension( 'RevisionSlider' );
-   $wgRevisionSliderBetaFeature = $wmgRevisionSliderBetaFeature;
 }
 
 if ( $wmgUseTwoColConflict ) {
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 08424d5..d61e7e8 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -17325,10 +17325,6 @@
'default' => true,
 ],
 
-'wmgRevisionSliderBetaFeature' => [
-   'default' => false, // T163685
-],
-
 'wgRevisionSliderAlternateSlider' => [
'default' => true,
 ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I846adf50cc49bf9bb84d3979586e69f1012c57e9
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] operations/mediawiki-config[master]: DNM remove wgRevisionSliderAlternateSlider

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363206 )

Change subject: DNM remove wgRevisionSliderAlternateSlider
..

DNM remove wgRevisionSliderAlternateSlider

The Depends-on patch removes the config variable
and should be merged and deployed before this is
deployed

Change-Id: I610818d2086e18022e68e2f620c7df4f22193535
Depends-on: I9ac410613361e567bd825f096eb12bbb3edc5cde
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 4 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 08424d5..5069c70 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -17329,10 +17329,6 @@
'default' => false, // T163685
 ],
 
-'wgRevisionSliderAlternateSlider' => [
-   'default' => true,
-],
-
 'wmgUseTwoColConflict' => [
'default' => true,
 ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I610818d2086e18022e68e2f620c7df4f22193535
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] pywikibot/core[master]: [bugfix] Don't fail TestSiteGenerators.test_pagetemplates tests

2017-07-04 Thread Xqt (Code Review)
Xqt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363205 )

Change subject: [bugfix] Don't fail TestSiteGenerators.test_pagetemplates tests
..

[bugfix] Don't fail TestSiteGenerators.test_pagetemplates tests

There are some randomized templates on enwiki Main page which lead
TestSiteGenerators.test_pagetemplates tests to fail. Remove these
templates out of the subset check but check whether the number of
the removed items is equal.

Change-Id: I43be8d868a79a702afcd3cbc3b4b99f9d8890c36
---
M tests/site_tests.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/05/363205/1

diff --git a/tests/site_tests.py b/tests/site_tests.py
index 2740a44..af4a5fe 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -556,8 +556,15 @@
 
 for te in pagetemplates_all:
 self.assertIsInstance(te, pywikibot.Page)
+
+# cleanup randomized templates
+pt_all = [te for te in pagetemplates_all if te.depth < 2]
+pt_ns_10 = [te for te in pagetemplates_ns_10 if te.depth < 2]
 
-self.assertLessEqual(pagetemplates_ns_10, pagetemplates_all)
+self.assertLessEqual(pt_ns_10, pt_all)
+# check the removed template number
+self.assertEqual(len(pagetemplates_all) - len(pt_all),
+ len(pagetemplates_ns_10) - len(pt_ns_10))
 
 def test_pagelanglinks(self):
 """Test Site.pagelanglinks."""

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Use Wikimedia Style Guide named colors

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363031 )

Change subject: Use Wikimedia Style Guide named colors
..


Use Wikimedia Style Guide named colors

The gadget already used a color from the Wikimedia Style Guide, but
without naming it. Adding the names ensures that the color definitions
can be found later, and makes it easier to find other colors for new
purposes.

Change-Id: I574b1fd32df9041c06429ef4d8277a11a2c84793
---
M modules/SpecialConstraintReportPage.css
M modules/gadget.css
2 files changed, 15 insertions(+), 11 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/SpecialConstraintReportPage.css 
b/modules/SpecialConstraintReportPage.css
index 4939a7c..47a50ae 100644
--- a/modules/SpecialConstraintReportPage.css
+++ b/modules/SpecialConstraintReportPage.css
@@ -1,3 +1,5 @@
+/* named colors refer to the Wikimedia Style Guide, 
https://wikimedia.github.io/WikimediaUI-Style-Guide/visual-style_colors.html */
+
 /* Entity id form */
 form {
margin-bottom: 20px;
@@ -10,7 +12,7 @@
 
 .wbqc-constraintreport-notice-error {
font-weight: bold;
-   color: #ba;
+   color: #d33; /* Red50 */
 }
 
 /* Statuses */
@@ -19,34 +21,34 @@
 }
 
 .wbqc-status-compliance {
-   color: #008000;
+   color: #00af89; /* Green50 */
 }
 
 .wbqc-status-exception {
-   color: #e6b800;
+   color: #ac6600; /* Yellow30 */
 }
 
 .wbqc-status-violation {
-   color: #ba;
+   color: #d33; /* Red50 */
 }
 
 .wbqc-status-todo {
-   color: #404040;
+   color: #54595d; /* Base20 */
 }
 
 /* Tooltip */
 .wbqc-indicator {
-   color: #ccc;
+   color: #72777d; /* Base30 */
font-weight: 600;
 }
 
 .wbqc-tooltip {
margin-top: -40px;
margin-left: -5px;
-   background-color: #f2f2f2;
-   border: 1px solid #aaa;
+   background-color: #f8f9fa; /* Base90 */
+   border: 1px solid #a2a9b1; /* Base50 */
border-radius: 5px;
-   box-shadow: 2px 2px 1px #ccc;
+   box-shadow: 2px 2px 1px rgba( 0, 0, 0, 0.2 );
padding: 2px 5px 2px 5px;
position: absolute;
float: left;
@@ -69,6 +71,6 @@
 }
 
 .wbqc-expandable-content {
-   color: #333;
+   color: #222; /* Base10 */
display: none;
 }
diff --git a/modules/gadget.css b/modules/gadget.css
index 618d5cf..73b9bc1 100644
--- a/modules/gadget.css
+++ b/modules/gadget.css
@@ -1,8 +1,10 @@
+/* named colors refer to the Wikimedia Style Guide, 
https://wikimedia.github.io/WikimediaUI-Style-Guide/visual-style_colors.html */
+
 .wbqc-reports-button {
margin-left: 0.5em;
 }
 .wbqc-report {
-   border-top: 1px solid #eaecf0;
+   border-top: 1px solid #eaecf0; /* Base80 */
 }
 .wbqc-constraint-type-help {
transform: scale( 0.75 );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I574b1fd32df9041c06429ef4d8277a11a2c84793
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: JS deserialization of Lexeme representations

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362398 )

Change subject: JS deserialization of Lexeme representations
..


JS deserialization of Lexeme representations

Note: Temporary treat single representation as a
  default/English representation. Will be removed
  in later patches.

Change-Id: Ia4c8906643e6eb5f3dcb4ebd0fd3614b182a65c8
---
M resources/datamodel/LexemeForm.js
M resources/jquery.wikibase.lexemeformview.js
M resources/serialization/LexemeDeserializer.js
M tests/qunit/datamodel/LexemeForm.tests.js
M tests/qunit/jquery.wikibase.lexemeformview.tests.js
M tests/qunit/serialization/LexemeDeserializer.tests.js
6 files changed, 93 insertions(+), 44 deletions(-)

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



diff --git a/resources/datamodel/LexemeForm.js 
b/resources/datamodel/LexemeForm.js
index 5ef6cae..7233063 100644
--- a/resources/datamodel/LexemeForm.js
+++ b/resources/datamodel/LexemeForm.js
@@ -5,20 +5,22 @@
 * @class wikibase.lexeme.datamodel.LexemeForm
 *
 * @param {string} id
-* @param {string} representation
+* @param {wikibase.datamodel.TermMap} representations
 * @param {string[]} grammaticalFeatures
 * @param {wikibase.datamodel.StatementGroupSet} statementGroupSet
 */
var LexemeForm = util.inherit(
'LexemeForm',
-   function ( id, representation, grammaticalFeatures, 
statementGroupSet ) {
+   function ( id, representations, grammaticalFeatures, 
statementGroupSet ) {
statementGroupSet = statementGroupSet || new 
wb.datamodel.StatementGroupSet();
+   representations = representations || new 
wb.datamodel.TermMap();
this._id = id;
-   this._representation = representation;
+   this._representations = representations;
this._grammaticalFeatures = grammaticalFeatures || [];
 
if (
-   !( statementGroupSet instanceof 
wb.datamodel.StatementGroupSet )
+   !( statementGroupSet instanceof 
wb.datamodel.StatementGroupSet ) ||
+   !( representations instanceof 
wb.datamodel.TermMap )
) {
throw new Error( 'Required parameter(s) missing 
or not defined properly' );
}
@@ -33,9 +35,9 @@
_id: null,
 
/**
-* @type {string}
+* @type {wikibase.datamodel.TermMap}
 */
-   _representation: null,
+   _representations: null,
 
/**
 * @return {string[]}
@@ -56,10 +58,10 @@
},
 
/**
-* @return {string}
+* @return {wikibase.datamodel.TermMap}
 */
-   getRepresentation: function () {
-   return this._representation;
+   getRepresentations: function () {
+   return this._representations;
},
 
/**
@@ -96,7 +98,7 @@
} );
 
return this.getId() === other.getId()
-   && this.getRepresentation() === 
other.getRepresentation()
+   && this.getRepresentations().equals( 
other.getRepresentations() )
&& hasAllGrammaticalFeatures;
}
}
diff --git a/resources/jquery.wikibase.lexemeformview.js 
b/resources/jquery.wikibase.lexemeformview.js
index f4a42b4..e0c3108 100644
--- a/resources/jquery.wikibase.lexemeformview.js
+++ b/resources/jquery.wikibase.lexemeformview.js
@@ -1,7 +1,12 @@
-( function ( $, mw ) {
+( function ( $, mw, wb ) {
'use strict';
 
var PARENT = $.ui.EditableTemplatedWidget;
+
+   /** @type {wikibase.datamodel.TermMap}*/
+   var TermMap = wb.datamodel.TermMap;
+   /** @type {wikibase.datamodel.Term}*/
+   var Term = wb.datamodel.Term;
 
/**
 * Initializes StatementGroupListView on given DOM element
@@ -107,9 +112,16 @@
return this.options.value;
}
 
+   var representations = new TermMap( {
+   en: new Term(
+   'en',
+   this.$text.children( this.inputNodeName 
).val()
+   )
+   } );
+
   

[MediaWiki-commits] [Gerrit] analytics...scripts[production]: Remove revisionslider form bf list

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363203 )

Change subject: Remove revisionslider form bf list
..


Remove revisionslider form bf list

BF code removed in:
Iad2e34e2f906777c7ba0e22e245dc55891f211ae

Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 83a8731..c60a1db 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -19,7 +19,6 @@
'cx',
'read-more',
'ores-enabled',
-   'revisionslider',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
Gerrit-Branch: production
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] operations/puppet[production]: mariadb: Switch db1102 role from sanitarium3->dbstore_multii...

2017-07-04 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363204 )

Change subject: mariadb: Switch db1102 role from 
sanitarium3->dbstore_multiinstance
..

mariadb: Switch db1102 role from sanitarium3->dbstore_multiinstance

db1102 is our third sanitarium host, setup with multiple instances.
test new dbstore role by setting it with the new role.

Bug: T169514
Change-Id: I2a91a65c6c568abffb738daae21b13ba9957c83f
---
M manifests/site.pp
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/363204/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 8ac849e..b2fa1ef 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -628,8 +628,7 @@
 }
 
 node 'db1102.eqiad.wmnet' {
-role(mariadb::sanitarium)
-include ::base::firewall
+role(mariadb::dbstore_multiinstance)
 }
 
 node 'db1095.eqiad.wmnet' {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a91a65c6c568abffb738daae21b13ba9957c83f
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] analytics...scripts[master]: Remove revisionslider form bf list

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363202 )

Change subject: Remove revisionslider form bf list
..


Remove revisionslider form bf list

BF code removed in:
Iad2e34e2f906777c7ba0e22e245dc55891f211ae

Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 83a8731..c60a1db 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -19,7 +19,6 @@
'cx',
'read-more',
'ores-enabled',
-   'revisionslider',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
Gerrit-PatchSet: 2
Gerrit-Project: analytics/wmde/scripts
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] analytics...scripts[production]: Remove revisionslider form bf list

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363203 )

Change subject: Remove revisionslider form bf list
..

Remove revisionslider form bf list

BF code removed in:
Iad2e34e2f906777c7ba0e22e245dc55891f211ae

Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/scripts 
refs/changes/03/363203/1

diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 83a8731..c60a1db 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -19,7 +19,6 @@
'cx',
'read-more',
'ores-enabled',
-   'revisionslider',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
Gerrit-Branch: production
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Import constraint exceptions from statements

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362970 )

Change subject: Import constraint exceptions from statements
..


Import constraint exceptions from statements

ConstraintParameterParser gains support for parsing exception
parameters, and DelegatingConstraintChecker gets a
ConstraintParameterParser injected which it uses to parse the
exceptions. The API test needs some refactoring so it can create the
ConstraintParameterParser it now needs to inject.

Bug: T169430
Change-Id: Ie669ce13752bdff4bdb3a62ca71b126ecca5d994
---
M extension.json
M includes/ConstraintCheck/DelegatingConstraintChecker.php
M includes/ConstraintCheck/Helper/ConstraintParameterParser.php
M includes/ConstraintReportFactory.php
M tests/phpunit/Api/CheckConstraintsTest.php
M tests/phpunit/Helper/ConstraintParameterParserTest.php
6 files changed, 150 insertions(+), 8 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 86693fd..e51627d 100644
--- a/extension.json
+++ b/extension.json
@@ -104,6 +104,11 @@
"description": "The property ID of the 'property 
constraint' property (data type: item), which specifies the various constraints 
of a property.",
"public": true
},
+   "WBQualityConstraintsExceptionToConstraintId": {
+   "value": "P2303",
+   "description": "The property ID of the 'exception to 
constraint' property (data type: item), which specifies the exceptions of a 
constraint.",
+   "public": true
+   },
"WBQualityConstraintsDistinctValuesConstraintId": {
"value": "Q21502410",
"description": "The item ID of the 'distinct values 
constraint' item, which, when used in a 'property constraint' statement on a 
property, indicates that all values for this property should differ from each 
other, or, equivalently, that each value for this property should be unique to 
one item.",
diff --git a/includes/ConstraintCheck/DelegatingConstraintChecker.php 
b/includes/ConstraintCheck/DelegatingConstraintChecker.php
index 34cfe68..a49e351 100644
--- a/includes/ConstraintCheck/DelegatingConstraintChecker.php
+++ b/includes/ConstraintCheck/DelegatingConstraintChecker.php
@@ -11,6 +11,7 @@
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListProvider;
 use 
WikibaseQuality\ConstraintReport\ConstraintCheck\Helper\ConstraintParameterException;
+use 
WikibaseQuality\ConstraintReport\ConstraintCheck\Helper\ConstraintParameterParser;
 use 
WikibaseQuality\ConstraintReport\ConstraintCheck\Helper\SparqlHelperException;
 use WikibaseQuality\ConstraintReport\ConstraintCheck\Result\CheckResult;
 use WikibaseQuality\ConstraintReport\ConstraintLookup;
@@ -52,18 +53,26 @@
private $constraintLookup;
 
/**
+* @var ConstraintParameterParser
+*/
+   private $constraintParameterParser;
+
+   /**
 * @param EntityLookup $lookup
 * @param ConstraintChecker[] $checkerMap
 * @param ConstraintLookup $constraintRepository
+* @param ConstraintParameterParser $constraintParameterParser
 */
public function __construct(
EntityLookup $lookup,
array $checkerMap,
-   ConstraintLookup $constraintRepository
+   ConstraintLookup $constraintRepository,
+   ConstraintParameterParser $constraintParameterParser
) {
$this->entityLookup = $lookup;
$this->checkerMap = $checkerMap;
$this->constraintLookup = $constraintRepository;
+   $this->constraintParameterParser = $constraintParameterParser;
}
 
/**
@@ -196,10 +205,9 @@
 
foreach ( $constraints as $constraint ) {
$parameters = $constraint->getConstraintParameters();
+   $exceptions = 
$this->constraintParameterParser->parseExceptionParameter( $parameters );
 
-   if ( array_key_exists( 'known_exception', $parameters )
-   && in_array( $entityId->getSerialization(), 
explode( ',', $parameters['known_exception'] ) )
-   ) {
+   if ( in_array( $entityId, $exceptions ) ) {
$result[] = new CheckResult(
$entityId,
$statement,
diff --git a/includes/ConstraintCheck/Helper/ConstraintParameterParser.php 
b/includes/ConstraintCheck/Helper/ConstraintParameterParser.php
index 6cbced7..70bc54d 100644
--- a/includes/ConstraintCheck/Helper/ConstraintParameterParser.php
+++ 

[MediaWiki-commits] [Gerrit] analytics...scripts[master]: Remove revisionslider form bf list

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363202 )

Change subject: Remove revisionslider form bf list
..

Remove revisionslider form bf list

Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
---
M src/betafeatures/counts.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/scripts 
refs/changes/02/363202/1

diff --git a/src/betafeatures/counts.php b/src/betafeatures/counts.php
index 83a8731..c60a1db 100755
--- a/src/betafeatures/counts.php
+++ b/src/betafeatures/counts.php
@@ -19,7 +19,6 @@
'cx',
'read-more',
'ores-enabled',
-   'revisionslider',
'visualeditor-newwikitext',
'twocolconflict',
'rcenhancedfilters',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4fa68c6c1a3652c74ca7fce61ac7b607ff8438b
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/scripts
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] mediawiki...WikibaseLexeme[master]: Add browser test for multi-variant form representations.

2017-07-04 Thread Jakob (Code Review)
Jakob has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363201 )

Change subject: Add browser test for multi-variant form representations.
..

Add browser test for multi-variant form representations.

Bug: T165575
Change-Id: Ie421923a9cf263420373205154aca73fcd0e178c
---
M tests/browser/features/forms.feature
M tests/browser/features/step_definitions/forms_steps.rb
M tests/browser/features/support/pages/lexeme_page.rb
3 files changed, 53 insertions(+), 23 deletions(-)


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

diff --git a/tests/browser/features/forms.feature 
b/tests/browser/features/forms.feature
index d15175a..e6f1de0 100644
--- a/tests/browser/features/forms.feature
+++ b/tests/browser/features/forms.feature
@@ -11,7 +11,7 @@
 Then Forms header should be there
  And Forms container should be there
  And for each Form there is a representation and an ID
- And each representation is enclosed in tag having lang attribute with 
"some language" as a value
+ And each representation has a language
 
   @integration
   Scenario: View Forms grammatical features
@@ -37,20 +37,23 @@
 Then the first Form should no longer have the removed grammatical feature
 
   @integration
-  Scenario: Change representation
-   Given I have a Lexeme with a Form
+  Scenario: Change multi-variant representations
+Given I have a Lexeme with a Form
  And I am on the page of the Lexeme to test
 When I click on the first Form's edit button
- And I enter "new-representation" as the form representation
+ And I enter "colors" as the "en-us" form representation
+ And I click on the add representation button
+ And I enter "colours" as the "en-gb" form representation
  And I save the Form
-Then "new-representation" should be displayed as a representation of the 
Form
+Then "colors" should be displayed as the "en-us" representation of the Form
+ And "colours" should be displayed as the "en-gb" representation of the 
Form
 
   @integration
   Scenario: Add Form
 When I click the Forms list add button
- And I enter "whatever" as the form representation
+ And I enter "whatever" as the "en" form representation
  And I save the Form
-Then "whatever" should be displayed as a representation of the Form
+Then "whatever" should be displayed as the "en" representation of the Form
 
 
   @integration
@@ -64,7 +67,7 @@
 Given I have the following properties with datatype:
   | stringprop | string |
   And I click the Forms list add button
-  And I enter "newForm" as the form representation
+  And I enter "newForm" as the "en" form representation
   And I save the Form
  When I click add statement on the Form
   And I select the claim property stringprop
diff --git a/tests/browser/features/step_definitions/forms_steps.rb 
b/tests/browser/features/step_definitions/forms_steps.rb
index 446bb17..d561f20 100644
--- a/tests/browser/features/step_definitions/forms_steps.rb
+++ b/tests/browser/features/step_definitions/forms_steps.rb
@@ -10,11 +10,11 @@
   expect(on(LexemePage).forms.count).to be > 0
 end
 
-
 Then(/^for each Form there is a representation and an ID$/) do
-  #todo: this only checks if there is at least one id and representation
-  expect(on(LexemePage).form_representation?).to be true
-  expect(on(LexemePage).form_id?).to be true
+  on(LexemePage).forms.each do |form|
+expect(form.representations.count).to be > 0
+expect(form.id?).to be true
+  end
 end
 
 Then(/^for each Form there is a statement list$/) do
@@ -23,9 +23,12 @@
   end
 end
 
-Then(/^each representation is enclosed in tag having lang attribute with 
"(.+)" as a value$/) do |value|
-  #todo: this only checks if there is at least one lang attribute
-  on(LexemePage).form_representation_element.attribute('lang').should == value
+Then(/^each representation has a language$/) do
+  on(LexemePage).forms.each do |form|
+form.representations.each do |representation|
+  expect(representation.language?).to be true
+end
+  end
 end
 
 Given(/^for each Form there is a grammatical feature list$/) do
@@ -39,9 +42,11 @@
   @form_I_am_currently_editing = on(LexemePage).forms[-1]
 end
 
-When(/^I enter "(.+)" as the form representation$/) do |representation|
-  @form_I_am_currently_editing.representation_input_element.when_visible.clear
-  @form_I_am_currently_editing.representation_input = representation
+When(/^I enter "(.*?)" as the "(.*?)" form representation$/) do 
|representation, language|
+  last_representation = @form_I_am_currently_editing.representations[-1]
+
+  last_representation.value_input = representation
+  last_representation.language_input = language
 end
 
 When(/^I save the Form$/) do
@@ -49,8 +54,17 @@
   @form_I_am_currently_editing.save_element.when_visible.click
 end
 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable WikibaseQualityConstraints statements

2017-07-04 Thread Lucas Werkmeister (WMDE) (Code Review)
Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363200 )

Change subject: Enable WikibaseQualityConstraints statements
..

Enable WikibaseQualityConstraints statements

This setting of the WikibaseQualityConstraints extension enables a hook
that runs on each Wikibase change, and which (if the change is on an
entity of type “property”) schedules a job (“constraintsTableUpdate” job
command) which imports constraint statements on the entity into the
wbqc_constraints database table.

This allows Wikidata editors to edit constraints immediately on the
property, instead of editing the constraint template on the property
talk page and then having to wait until the next time that the templates
are imported using the UpdateConstraintsTable.php maintenance script of
the WikibaseQualityConstraints extension (in the past, this was
generally done once every few weeks or months).

Bug: T169647
Change-Id: I8201bef3fd87793944a95af7686e53e4bd1a41a9
---
M wmf-config/Wikibase-production.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/Wikibase-production.php 
b/wmf-config/Wikibase-production.php
index 08ef17a..9807117 100644
--- a/wmf-config/Wikibase-production.php
+++ b/wmf-config/Wikibase-production.php
@@ -93,6 +93,8 @@
'propertyIds' => [ 'P2302' ],
],
];
+
+   $wgWBQualityConstraintsEnableConstraintsImportFromStatements = 
true;
}
 
if ( $wgDBname === 'wikidatawiki' ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8201bef3fd87793944a95af7686e53e4bd1a41a9
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) 

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


[MediaWiki-commits] [Gerrit] operations...nginx[master]: Build-Depend on libssl11-dev | libssl-dev for jessie and str...

2017-07-04 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363199 )

Change subject: Build-Depend on libssl11-dev | libssl-dev for jessie and 
stretch compat
..

Build-Depend on libssl11-dev | libssl-dev for jessie and stretch compat

Change-Id: Ic94db95b91ca08e1fd52d92ba820119680ce38e6
---
M debian/changelog
M debian/control
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/nginx 
refs/changes/99/363199/1

diff --git a/debian/changelog b/debian/changelog
index 3ee85a7..a0328ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nginx (1.11.10-1+wmf2) UNRELEASED; urgency=medium
+
+  * Build-Depend on libssl11-dev | libssl-dev for jessie and stretch compat
+
+ -- Filippo Giunchedi   Tue, 04 Jul 2017 16:56:16 +0200
+
 nginx (1.11.10-1+wmf1) jessie-wikimedia; urgency=medium
 
 * Rebased on debian experimental branch @ 1.11.10-1~exp2
diff --git a/debian/control b/debian/control
index 7c9bab0..5d6dbe2 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,7 @@
libpam0g-dev,
libpcre3-dev,
libperl-dev,
-   libssl11-dev,
+   libssl11-dev | libssl-dev,
libxslt1-dev,
po-debconf,
quilt,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic94db95b91ca08e1fd52d92ba820119680ce38e6
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/nginx
Gerrit-Branch: master
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ipmi: add ipmitool support to ipmi_lan

2017-07-04 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363197 )

Change subject: ipmi: add ipmitool support to ipmi_lan
..


ipmi: add ipmitool support to ipmi_lan

Add support for ipmitool's output to the ipmi_lan fact, as a fallback to
FreeIPMI's bmc-config. While at it, downcase MAC addresses for
consistency with the "macaddress" fact.

Change-Id: I718d51080a944aff5f0df8cfab8e82f797d4a323
---
M modules/ipmi/lib/facter/ipmi.rb
1 file changed, 13 insertions(+), 7 deletions(-)

Approvals:
  Faidon Liambotis: Verified; Looks good to me, approved



diff --git a/modules/ipmi/lib/facter/ipmi.rb b/modules/ipmi/lib/facter/ipmi.rb
index 2f9aec5..9c64c6b 100644
--- a/modules/ipmi/lib/facter/ipmi.rb
+++ b/modules/ipmi/lib/facter/ipmi.rb
@@ -17,15 +17,21 @@
 Facter.add(:ipmi_lan) do
   confine :has_ipmi => true
   confine do
-File.exists?('/usr/sbin/bmc-config')
+File.exists?('/usr/sbin/bmc-config') || File.exists?('/usr/bin/ipmitool')
   end
 
   setcode do
 ipmi_lan = {}
-conf = Facter::Util::Resolution.exec('bmc-config -o -S Lan_Conf')
-conf.each_line do |line|
-  next unless /^\s+(?[^#][^\s]+)\s+(?[^\s]+)/ =~ line
-  case key
+if File.exists?('/usr/sbin/bmc-config')
+  cmd = '/usr/sbin/bmc-config -o -S Lan_Conf'
+else
+  cmd = '/usr/bin/ipmitool lan print'
+end
+Facter::Util::Resolution.exec(cmd).each_line do |line|
+  # compatible with both bmc-config and ipmitool's output
+  next unless /^\s*(?[^#].+[^\s])\s+:?\s(?[^\s]+)/ =~ line
+  # bmc-config uses underscores, ipmitool uses spaces; handle both
+  case key.gsub(' ', '_')
   when 'IP_Address_Source' then
 unless value == 'Static'
   ipmi_lan = nil
@@ -34,10 +40,10 @@
   when 'IP_Address' then
 ipmi_lan['ipaddress'] = value
   when 'MAC_Address' then
-ipmi_lan['macaddress'] = value
+ipmi_lan['macaddress'] = value.downcase
   when 'Subnet_Mask' then
 ipmi_lan['netmask'] = value
-  when 'Default_Gateway_IP_Address' then
+  when 'Default_Gateway_IP_Address', 'Default_Gateway_IP' then
 ipmi_lan['gateway'] = value
   end
 end

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: WIP try to fix environment

2017-07-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363198 )

Change subject: WIP try to fix environment
..

WIP try to fix environment

Change-Id: Id888e71ecd4070d560f012fb050a01d7bbbc4d23
---
M 
sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit/bootstrap.php
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/98/363198/1

diff --git 
a/sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit/bootstrap.php
 
b/sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit/bootstrap.php
index da3ae80..d3acdb9 100644
--- 
a/sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit/bootstrap.php
+++ 
b/sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit/bootstrap.php
@@ -20,7 +20,13 @@
   $descriptorSpec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 
=> STDERR);
   $oldOutput = getenv('CV_OUTPUT');
   putenv("CV_OUTPUT=json");
-  $process = proc_open($cmd, $descriptorSpec, $pipes, __DIR__);
+  $env = $_ENV + array(
+"PATH" => getenv("PATH"),
+"CIVICRM_SETTINGS" => getenv("CIVICRM_SETTINGS"),
+"CV_OUTPUT" => "json",
+"CV_CONFIG" => __DIR__ . '/cv.json',
+  );
+  $process = proc_open($cmd, $descriptorSpec, $pipes, __DIR__, $env);
   putenv("CV_OUTPUT=$oldOutput");
   fclose($pipes[0]);
   $result = stream_get_contents($pipes[1]);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id888e71ecd4070d560f012fb050a01d7bbbc4d23
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update citoid to 4090f9d

2017-07-04 Thread Mobrovac (Code Review)
Mobrovac has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363196 )

Change subject: Update citoid to 4090f9d
..


Update citoid to 4090f9d

List of changes:
f321c30 K8s: Add the Dockerfile and config for Kubernetes
e0bdcfb Remove the bad PMCID stanza from swagger spec
40b035a Fallback to crossRef for restricted URLs
7f46a41 README: add quickstart section
4090f9d Use marcXML translator in addition to dc for ISBN

Change-Id: I1b8a6081976c1f1cf7afef54e35facd86ac4527b
---
M src
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src b/src
index 6683ecd..4090f9d 16
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit 6683ecd661fbf438be7ed5ea926eace50903589c
+Subproject commit 4090f9dda5b0d4d7b4dc39d305f550ce39a986ee

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b8a6081976c1f1cf7afef54e35facd86ac4527b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac 
Gerrit-Reviewer: Mobrovac 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ipmi: add ipmitool support to ipmi_lan

2017-07-04 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363197 )

Change subject: ipmi: add ipmitool support to ipmi_lan
..

ipmi: add ipmitool support to ipmi_lan

Add support for ipmitool's output to the ipmi_lan fact, as a fallback to
FreeIPMI's bmc-config. While at it, downcase MAC addresses for
consistency with the "macaddress" fact.

Change-Id: I718d51080a944aff5f0df8cfab8e82f797d4a323
---
M modules/ipmi/lib/facter/ipmi.rb
1 file changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/363197/1

diff --git a/modules/ipmi/lib/facter/ipmi.rb b/modules/ipmi/lib/facter/ipmi.rb
index 2f9aec5..9c64c6b 100644
--- a/modules/ipmi/lib/facter/ipmi.rb
+++ b/modules/ipmi/lib/facter/ipmi.rb
@@ -17,15 +17,21 @@
 Facter.add(:ipmi_lan) do
   confine :has_ipmi => true
   confine do
-File.exists?('/usr/sbin/bmc-config')
+File.exists?('/usr/sbin/bmc-config') || File.exists?('/usr/bin/ipmitool')
   end
 
   setcode do
 ipmi_lan = {}
-conf = Facter::Util::Resolution.exec('bmc-config -o -S Lan_Conf')
-conf.each_line do |line|
-  next unless /^\s+(?[^#][^\s]+)\s+(?[^\s]+)/ =~ line
-  case key
+if File.exists?('/usr/sbin/bmc-config')
+  cmd = '/usr/sbin/bmc-config -o -S Lan_Conf'
+else
+  cmd = '/usr/bin/ipmitool lan print'
+end
+Facter::Util::Resolution.exec(cmd).each_line do |line|
+  # compatible with both bmc-config and ipmitool's output
+  next unless /^\s*(?[^#].+[^\s])\s+:?\s(?[^\s]+)/ =~ line
+  # bmc-config uses underscores, ipmitool uses spaces; handle both
+  case key.gsub(' ', '_')
   when 'IP_Address_Source' then
 unless value == 'Static'
   ipmi_lan = nil
@@ -34,10 +40,10 @@
   when 'IP_Address' then
 ipmi_lan['ipaddress'] = value
   when 'MAC_Address' then
-ipmi_lan['macaddress'] = value
+ipmi_lan['macaddress'] = value.downcase
   when 'Subnet_Mask' then
 ipmi_lan['netmask'] = value
-  when 'Default_Gateway_IP_Address' then
+  when 'Default_Gateway_IP_Address', 'Default_Gateway_IP' then
 ipmi_lan['gateway'] = value
   end
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I718d51080a944aff5f0df8cfab8e82f797d4a323
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update citoid to 4090f9d

2017-07-04 Thread Mobrovac (Code Review)
Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363196 )

Change subject: Update citoid to 4090f9d
..

Update citoid to 4090f9d

List of changes:
f321c30 K8s: Add the Dockerfile and config for Kubernetes
e0bdcfb Remove the bad PMCID stanza from swagger spec
40b035a Fallback to crossRef for restricted URLs
7f46a41 README: add quickstart section
4090f9d Use marcXML translator in addition to dc for ISBN

Change-Id: I1b8a6081976c1f1cf7afef54e35facd86ac4527b
---
M src
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid/deploy 
refs/changes/96/363196/1

diff --git a/src b/src
index 6683ecd..4090f9d 16
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit 6683ecd661fbf438be7ed5ea926eace50903589c
+Subproject commit 4090f9dda5b0d4d7b4dc39d305f550ce39a986ee

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b8a6081976c1f1cf7afef54e35facd86ac4527b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: [WIP] Support multiple instances on the mariadb module

2017-07-04 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363195 )

Change subject: [WIP] Support multiple instances on the mariadb module
..

[WIP] Support multiple instances on the mariadb module

This is just a first idea that doesn't work yet, but could be
one of the ways to implement it.

The idea is to have a common mariadb::config, and then one
resouces mariadb::instance usage for each mysql run, with its own
datadir, tmpdir, port and socket. The custom config should include
the extra config files on /etc/mysql/mysqld.config.d and either
init.d or systemd (with mariadb@.service) should be able to
handle the different configs.

Many questions are still left about the details.

Bug: T169514
Change-Id: Ib313d12e6784700e0afaccd443acb181b7a0e1d4
---
A modules/mariadb/manifests/instance.pp
A modules/mariadb/templates/instance.cnf.erb
A modules/role/manifests/mariadb/dbstore3.pp
3 files changed, 98 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/95/363195/1

diff --git a/modules/mariadb/manifests/instance.pp 
b/modules/mariadb/manifests/instance.pp
new file mode 100644
index 000..ef6474b
--- /dev/null
+++ b/modules/mariadb/manifests/instance.pp
@@ -0,0 +1,39 @@
+# Setups additional instances for hosts that hosts more
+# than one instance
+define mariadb::instance(
+$port,
+$datadir = 'undefined',
+$tmpdir  = 'undefined',
+$socket  = 'undefined',
+) {
+if $datadir == 'undefined' {
+$datadir = "/srv/sqldata.${title}",
+}
+if $tmpdir == 'undefined' {
+$tmpdir  = '/srv/tmp.${title}',
+}
+if $tmpdir == 'undefined' {
+$socket  = '/run/mysqld/mysqld.${title}.sock',
+}
+
+file { $datadir:
+ensure => directory,
+owner  => 'mysql',
+group  => 'mysql',
+mode   => '0755',
+}
+
+file { $tmpdir:
+ensure => directory,
+owner  => 'mysql',
+group  => 'mysql',
+mode   => '0755',
+}
+
+file { "/etc/mysql/mysql.conf.d/${title}.cnf"
+owner   => 'root',
+group   => 'root',
+mode=> '0644',
+content => template('mariadb/instance.cnf.erb'),
+}
+}
diff --git a/modules/mariadb/templates/instance.cnf.erb 
b/modules/mariadb/templates/instance.cnf.erb
new file mode 100644
index 000..9aefd5f
--- /dev/null
+++ b/modules/mariadb/templates/instance.cnf.erb
@@ -0,0 +1,4 @@
+[mysqld@<%= @title %>]
+datadir=<%= @datadir %>
+socket=<%= @socket %>
+port=<%= @port %>
diff --git a/modules/role/manifests/mariadb/dbstore3.pp 
b/modules/role/manifests/mariadb/dbstore3.pp
new file mode 100644
index 000..f72f94d
--- /dev/null
+++ b/modules/role/manifests/mariadb/dbstore3.pp
@@ -0,0 +1,55 @@
+class role::mariadb::dbstore3 {
+system::role { 'mariadb::core':
+description => "DBStore multi-instance Server",
+}
+
+include ::standard
+include ::base::firewall
+include role::mariadb::monitor
+#TODO: Custom firewall rules
+
+#TODO: define one group per shard
+class {'mariadb::groups':
+mysql_group => 'dbstore',
+mysql_shard => 's1',
+mysql_role  => 'slave',
+socket  => '/run/mysqld/mysqld.s1.sock',
+}
+
+class {'mariadb::packages_wmf': }
+class {'mariadb::service':
+# for now we will keep things simple, we probably should have a
+# higher-level interface with templates
+override => "[Service]\nLimitNOFILE=20",
+}
+
+# Read only forced on also for the masters of the primary datacenter
+class { 'mariadb::config':
+config   => 'role/mariadb/mysqld_config/dbstore3.my.cnf.erb',
+p_s  => 'on',
+ssl  => 'puppet-cert',
+binlog_format=> 'ROW',
+}
+
+mariadb::instance {'s1':
+port => 3311,
+}
+mariadb::instance {'s2':
+port => 3312,
+}
+mariadb::instance {'s3':
+port => 3313,
+}
+mariadb::instance {'s4':
+port => 3314,
+}
+mariadb::instance {'s5':
+port => 3315,
+}
+mariadb::instance {'s6':
+port => 3316,
+}
+mariadb::instance {'s7':
+port => 3317,
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib313d12e6784700e0afaccd443acb181b7a0e1d4
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] mediawiki...citoid[master]: Use marcXML translator in addition to dc for ISBN

2017-07-04 Thread Mobrovac (Code Review)
Mobrovac has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/355097 )

Change subject: Use marcXML translator in addition to dc for ISBN
..


Use marcXML translator in addition to dc for ISBN

Request both dublin core and marcXML data from
WorldCat, as marcXML lacks an itemType field,
and dublinCore lacks edition and publisher
fields.

Also fixes some bugs in dublin core translator
which were missing some author fields.

Add "overwriteAuthors" parameter to Translator;
this allows multiple translators to be used on a
creators field. Must be used with caution as it
make cause duplicate authors.

Fix extendGeneral method in translators/util/
which used the same key (contributors) in the
translator.

Bug: T155161
Change-Id: I58489d2959306b620f9bfa4a5bfb2a81ea7cb4a4
---
M lib/CitoidService.js
M lib/Translator.js
M lib/XMLReader.js
M lib/translators/README.md
M lib/translators/bePress.js
M lib/translators/coins.js
M lib/translators/dublinCore.js
M lib/translators/general.js
A lib/translators/marcXML.js
D lib/translators/template.js.txt
M lib/translators/util/index.js
M test/features/scraping/isbn.js
R test/features/unit/translator.js
M test/features/unit/translators/coins.js
M test/features/unit/translators/general.js
M test/features/unit/translators/util.js
16 files changed, 771 insertions(+), 183 deletions(-)

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



diff --git a/lib/CitoidService.js b/lib/CitoidService.js
index 3e234c7..b41f68e 100644
--- a/lib/CitoidService.js
+++ b/lib/CitoidService.js
@@ -517,8 +517,13 @@
 citation.format = cr.format;
 citation.doi = cr.doi;
 
-var wskeyFormat = 'dc';
 var self = this;
+
+var dcXML;
+var scrapeDC;
+
+var marcXML;
+var scrapeMARC;
 
 // Set responses if below is rejected
 function reject(){
@@ -532,16 +537,38 @@
 return cr;
 }
 
-// Make request to WorldCat srn index service
-return this.worldCatService.singleRecordRequest(citation.isbn, 'isbn', 
wskeyFormat).then(
-function(body){
-return self.scrapeXML(citation, cr, body, wskeyFormat);
+dcXML = this.worldCatService.singleRecordRequest(citation.isbn, 'isbn', 
'dc');
+marcXML = this.worldCatService.singleRecordRequest(citation.isbn, 'isbn', 
'marc');
+
+// Make concurrent requests for the data in both Dublin Core and MarcXML
+return BBPromise.all([dcXML, marcXML]).then(function(results){
+
+// Promises for scraping results from each of dc and marc
+scrapeDC =  self.scrapeXML(citation, cr, results[0], 'dc', true); // 
Boolean at end allows multiple creators translators to be used within the dc 
translator
+scrapeMARC =  self.scrapeXML(citation, cr, results[1], 'marc');
+
+// Scrape dc first because it can determine type
+return scrapeDC.then(function(){
+return scrapeMARC.then(function(){
+citation.responseCode = 200;
+citation.source.push('WorldCat');
+return cr;
+},
+// If rejected by scrapeMARC, still send 200 because DC was 
successfully added
+function(){
+citation.responseCode = 200;
+citation.source.push('WorldCat');
+return cr;
+});
 },
-// Rejection handler
+// If unable to scrape DC, reject.
 function(){
-return reject();
-}
-);
+reject();
+});
+},
+function(){
+reject();
+});
 
 
 };
@@ -622,8 +649,8 @@
  * @param  {String}   wskeyFormat  Format the XML citation will come back 
in. Can be 'dc', 'marcXML', or WorldCat's native 'openSearch' format
  * @return {Object}BBPromise for CitoidRequest object
  */
-CitoidService.prototype.scrapeXML = function(citation, cr, xml, wskeyFormat){
-return this.xml.translate(citation, cr, xml, wskeyFormat);
+CitoidService.prototype.scrapeXML = function(citation, cr, xml, wskeyFormat, 
creatorOverwrite){
+return this.xml.translate(citation, cr, xml, wskeyFormat, 
creatorOverwrite);
 };
 
 module.exports = CitoidService;
diff --git a/lib/Translator.js b/lib/Translator.js
index 8a9b562..f2dd75c 100644
--- a/lib/Translator.js
+++ b/lib/Translator.js
@@ -18,21 +18,37 @@
  * specific type, and a translator specific to that metadata type
  * @param  {Object} metadata   flat metadata object (i.e. metadata.openGraph)
  * @param  {Object} translator
+ * @param  {Boolean} creatorOverwrite whether or not unique creator 
translators can be run multiply
  */
-Translator.prototype.translate = function(citation, metadata, translator){
+Translator.prototype.translate = function(citation, metadata, translator, 
creatorOverwrite){
var logger = this.logger;
 if (!translator || !metadata){return citation;}
 var property;
-

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Bump rspec-puppet to 2.4.0

2017-07-04 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363194 )

Change subject: Bump rspec-puppet to 2.4.0
..

Bump rspec-puppet to 2.4.0

2.4.0 allows easy testing of exported resources which can be invaluable
in some cases. Bump the version in the Gemfile

Change-Id: Ic018b7857f062cd66a2384a7186170da3ff46a90
---
M Gemfile
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/Gemfile b/Gemfile
index 771ba46..d84f2e7 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,7 +3,7 @@
 gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 3.8.5'
 gem 'xmlrpc' if RUBY_VERSION >= '2.4.0'
 gem 'puppet-strings', '~> 1.0.0'
-gem 'rspec-puppet', '~> 2.3.2'
+gem 'rspec-puppet', '~> 2.4.0'
 gem 'puppetlabs_spec_helper', '< 2.0.0'
 # Puppet 3.7 fails on ruby 2.2+
 # https://tickets.puppetlabs.com/browse/PUP-3796

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic018b7857f062cd66a2384a7186170da3ff46a90
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] operations...pybal[1.13]: Add IPv6 support to all monitors, improve IdleConnection log...

2017-07-04 Thread Ema (Code Review)
Ema has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363193 )

Change subject: Add IPv6 support to all monitors, improve IdleConnection logging
..


Add IPv6 support to all monitors, improve IdleConnection logging

pybal (1.13.7) jessie-wikimedia; urgency=medium

  * Add IPv6 support to all monitors (Bug: #T82747)
  * Include IP and port information in IdleConnection logs

Bug: T82747
Bug: T154759
Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
(cherry picked from commit ee5c3e846cfc1332615f134f417550b92ae20f35)
---
M debian/changelog
M pybal/monitors/idleconnection.py
2 files changed, 13 insertions(+), 3 deletions(-)

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



diff --git a/debian/changelog b/debian/changelog
index 08150a7..f9ae90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pybal (1.13.7) jessie-wikimedia; urgency=medium
+
+  * Add IPv6 support to all monitors (Bug: #T82747)
+  * Include IP and port information in IdleConnection logs
+
+ -- Emanuele Rocca   Tue, 04 Jul 2017 15:50:28 +0200
+
 pybal (1.13.6) jessie-wikimedia; urgency=medium
 
   * Change the default behavior for LVS services from not being announced via
diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py
index 42c556d..fd105dd 100644
--- a/pybal/monitors/idleconnection.py
+++ b/pybal/monitors/idleconnection.py
@@ -61,6 +61,9 @@
 self.transport = getattr(connector, 'transport', None)
 super(IdleConnectionMonitoringProtocol, 
self).startedConnecting(connector)
 
+def _report_prefix(self):
+return "Connection to %s:%s" % (self.server.ip, self.server.port)
+
 def clientConnectionFailed(self, connector, reason):
 """Called if the connection attempt failed"""
 
@@ -70,7 +73,7 @@
 # Immediately set status to down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection failed.", level=logging.WARN)
+self.report("%s failed." % self._report_prefix(), level=logging.WARN)
 
 # Slowly reconnect
 self.retry(connector)
@@ -89,7 +92,7 @@
 # Connection lost in a non clean way. Immediately set status to 
down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection lost.", level=logging.INFO)
+self.report("%s lost." % self._report_prefix(), level=logging.INFO)
 
 # Slowly reconnect
 self.retry(connector)
@@ -113,7 +116,7 @@
 # Reset reconnection delay
 self.resetDelay()
 
-self.report("Connection established.")
+self.report("%s established." % self._report_prefix())
 
 def buildProtocol(self, addr):
 """

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: 1.13
Gerrit-Owner: Ema 
Gerrit-Reviewer: Ema 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Fix remaining "LexemeSensesView" names

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363024 )

Change subject: Fix remaining "LexemeSensesView" names
..


Fix remaining "LexemeSensesView" names

Change-Id: If00bc9274b9e871c5a4cadaf7d3b52e445d75b9f
---
M tests/phpunit/mediawiki/View/LexemeViewTest.php
M tests/phpunit/mediawiki/View/SensesViewTest.php
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/tests/phpunit/mediawiki/View/LexemeViewTest.php 
b/tests/phpunit/mediawiki/View/LexemeViewTest.php
index f0d07a8..87c7821 100644
--- a/tests/phpunit/mediawiki/View/LexemeViewTest.php
+++ b/tests/phpunit/mediawiki/View/LexemeViewTest.php
@@ -60,7 +60,7 @@
->getMock();
 
$view->method( 'getHtml' )
-   ->will( $this->returnValue( 
"lexemeSensesView->getHtml\n" ) );
+   ->will( $this->returnValue( "SensesView::getHtml\n" ) );
 
return $view;
}
@@ -177,7 +177,7 @@
$this->assertContains( 'id="wb-lexeme-' . ( $lexeme->getId() ?: 
'new' ) . '"', $html );
$this->assertContains( 'class="wikibase-entityview wb-lexeme"', 
$html );
$this->assertContains( 'lexemeFormsView->getHtml', $html );
-   $this->assertContains( 'lexemeSensesView->getHtml', $html );
+   $this->assertContains( 'SensesView::getHtml', $html );
$this->assertContains( 'statementSectionsView->getHtml', $html 
);
}
 
@@ -249,7 +249,7 @@
''
. "statementSectionsView->getHtml\n"
. "lexemeFormsView->getHtml\n"
-   . "lexemeSensesView->getHtml\n"
+   . "SensesView::getHtml\n"
. '',
$html
);
diff --git a/tests/phpunit/mediawiki/View/SensesViewTest.php 
b/tests/phpunit/mediawiki/View/SensesViewTest.php
index 4b3773a..328bca6 100644
--- a/tests/phpunit/mediawiki/View/SensesViewTest.php
+++ b/tests/phpunit/mediawiki/View/SensesViewTest.php
@@ -15,7 +15,7 @@
 use Wikibase\View\StatementSectionsView;
 
 /**
- * @covers Wikibase\Lexeme\View\LexemeSensesView
+ * @covers Wikibase\Lexeme\View\SensesView
  *
  * @group WikibaseLexeme
  *

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If00bc9274b9e871c5a4cadaf7d3b52e445d75b9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: WMDE-leszek 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations...pybal[1.13]: Add IPv6 support to all monitors, improve IdleConnection log...

2017-07-04 Thread Ema (Code Review)
Ema has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363193 )

Change subject: Add IPv6 support to all monitors, improve IdleConnection logging
..

Add IPv6 support to all monitors, improve IdleConnection logging

pybal (1.13.7) jessie-wikimedia; urgency=medium

  * Add IPv6 support to all monitors (Bug: #T82747)
  * Include IP and port information in IdleConnection logs

Bug: T82747
Bug: T154759
Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
(cherry picked from commit ee5c3e846cfc1332615f134f417550b92ae20f35)
---
M debian/changelog
M pybal/monitors/idleconnection.py
2 files changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal 
refs/changes/93/363193/1

diff --git a/debian/changelog b/debian/changelog
index 08150a7..f9ae90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pybal (1.13.7) jessie-wikimedia; urgency=medium
+
+  * Add IPv6 support to all monitors (Bug: #T82747)
+  * Include IP and port information in IdleConnection logs
+
+ -- Emanuele Rocca   Tue, 04 Jul 2017 15:50:28 +0200
+
 pybal (1.13.6) jessie-wikimedia; urgency=medium
 
   * Change the default behavior for LVS services from not being announced via
diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py
index 42c556d..fd105dd 100644
--- a/pybal/monitors/idleconnection.py
+++ b/pybal/monitors/idleconnection.py
@@ -61,6 +61,9 @@
 self.transport = getattr(connector, 'transport', None)
 super(IdleConnectionMonitoringProtocol, 
self).startedConnecting(connector)
 
+def _report_prefix(self):
+return "Connection to %s:%s" % (self.server.ip, self.server.port)
+
 def clientConnectionFailed(self, connector, reason):
 """Called if the connection attempt failed"""
 
@@ -70,7 +73,7 @@
 # Immediately set status to down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection failed.", level=logging.WARN)
+self.report("%s failed." % self._report_prefix(), level=logging.WARN)
 
 # Slowly reconnect
 self.retry(connector)
@@ -89,7 +92,7 @@
 # Connection lost in a non clean way. Immediately set status to 
down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection lost.", level=logging.INFO)
+self.report("%s lost." % self._report_prefix(), level=logging.INFO)
 
 # Slowly reconnect
 self.retry(connector)
@@ -113,7 +116,7 @@
 # Reset reconnection delay
 self.resetDelay()
 
-self.report("Connection established.")
+self.report("%s established." % self._report_prefix())
 
 def buildProtocol(self, addr):
 """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: 1.13
Gerrit-Owner: Ema 

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


[MediaWiki-commits] [Gerrit] operations...pybal[1.13]: Add IPv6 support to all monitors

2017-07-04 Thread Ema (Code Review)
Ema has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363182 )

Change subject: Add IPv6 support to all monitors
..


Add IPv6 support to all monitors

Previously, monitors would only monitor over IPv4 by picking
a random IP from the IPv4 address set only on every connection.

With this change they will *only* monitor with the primary IP
(IPv4 or IPv6, depending on the address family of the service)
that was selected to be pooled by IPVS.

Change-Id: I21c1575e180cbda792a5eacc004fafd4a624e03b
---
M pybal/monitors/dnsquery.py
M pybal/monitors/idleconnection.py
M pybal/monitors/proxyfetch.py
M pybal/test/test_monitors.py
4 files changed, 8 insertions(+), 17 deletions(-)

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



diff --git a/pybal/monitors/dnsquery.py b/pybal/monitors/dnsquery.py
index 65b7e89..b374791 100644
--- a/pybal/monitors/dnsquery.py
+++ b/pybal/monitors/dnsquery.py
@@ -52,7 +52,7 @@
 super(DNSQueryMonitoringProtocol, self).run()
 
 # Create a resolver
-self.resolver = client.createResolver([(ip, 53) for ip in 
self.server.ip4_addresses])
+self.resolver = client.createResolver([(self.server.ip, 53)])
 
 if not self.checkCall or not self.checkCall.active():
 self.checkCall = reactor.callLater(self.intvCheck, self.check)
diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py
index 1c34634..42c556d 100644
--- a/pybal/monitors/idleconnection.py
+++ b/pybal/monitors/idleconnection.py
@@ -10,7 +10,6 @@
 from twisted.internet import reactor, protocol
 import logging
 
-import random
 import socket
 
 
@@ -130,9 +129,4 @@
 def _connect(self, *args, **kwargs):
 """Starts a TCP connection attempt"""
 
-try:
-host = random.choice(self.server.ip4_addresses)
-except (TypeError, IndexError):
-host = self.server.host
-
-self.reactor.connectTCP(host, self.server.port, self, *args, **kwargs)
+self.reactor.connectTCP(self.server.ip, self.server.port, self, *args, 
**kwargs)
diff --git a/pybal/monitors/proxyfetch.py b/pybal/monitors/proxyfetch.py
index 201c2ef..3468e73 100644
--- a/pybal/monitors/proxyfetch.py
+++ b/pybal/monitors/proxyfetch.py
@@ -10,7 +10,7 @@
 from twisted.internet import reactor, defer
 from twisted.web import client
 from twisted.python.runtime import seconds
-import logging
+import logging, random
 
 log = util.log
 
@@ -96,16 +96,13 @@
 # FIXME: Use GET as a workaround for a Twisted bug with 
HEAD/Content-length
 # where it expects a body and throws a PartialDownload failure
 
-import random
 url = random.choice(self.URL)
-try:
-host = random.choice(self.server.ip4_addresses)
-except (TypeError, IndexError):
-host = self.server.host
 
 self.checkStartTime = seconds()
 self.getPageDeferred = self.getProxyPage(
-url, method='GET', host=host,
+url,
+method='GET',
+host=self.server.ip,
 port=self.server.port,
 status=self.expectedStatus,
 timeout=self.toGET,
diff --git a/pybal/test/test_monitors.py b/pybal/test/test_monitors.py
index b44d29d..c38a370 100644
--- a/pybal/test/test_monitors.py
+++ b/pybal/test/test_monitors.py
@@ -49,8 +49,8 @@
 self.monitor.run()
 connector = self.reactor.connectors.pop()
 destination = connector.getDestination()
-self.assertEquals((destination.host, destination.port),
-  (self.server.host, self.server.port))
+self.assert_((destination.host, destination.port) == 
(self.server.host, self.server.port)
+ or (destination.host, destination.port) == 
(self.server.ip, self.server.port))
 
 def testClientConnectionMade(self):
 """Test `IdleConnectionMonitoringProtocol.clientConnectionMade`."""

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I21c1575e180cbda792a5eacc004fafd4a624e03b
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: 1.13
Gerrit-Owner: Ema 
Gerrit-Reviewer: Ema 
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] operations...pybal[master]: Add IPv6 support to all monitors, improve IdleConnection log...

2017-07-04 Thread Ema (Code Review)
Ema has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363188 )

Change subject: Add IPv6 support to all monitors, improve IdleConnection logging
..


Add IPv6 support to all monitors, improve IdleConnection logging

pybal (1.13.7) jessie-wikimedia; urgency=medium

  * Add IPv6 support to all monitors (Bug: #T82747)
  * Include IP and port information in IdleConnection logs

Bug: T82747
Bug: T154759
Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
---
M debian/changelog
M pybal/monitors/idleconnection.py
2 files changed, 13 insertions(+), 3 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, but someone else must approve
  Ema: Verified; Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
index 08150a7..f9ae90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pybal (1.13.7) jessie-wikimedia; urgency=medium
+
+  * Add IPv6 support to all monitors (Bug: #T82747)
+  * Include IP and port information in IdleConnection logs
+
+ -- Emanuele Rocca   Tue, 04 Jul 2017 15:50:28 +0200
+
 pybal (1.13.6) jessie-wikimedia; urgency=medium
 
   * Change the default behavior for LVS services from not being announced via
diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py
index 42c556d..fd105dd 100644
--- a/pybal/monitors/idleconnection.py
+++ b/pybal/monitors/idleconnection.py
@@ -61,6 +61,9 @@
 self.transport = getattr(connector, 'transport', None)
 super(IdleConnectionMonitoringProtocol, 
self).startedConnecting(connector)
 
+def _report_prefix(self):
+return "Connection to %s:%s" % (self.server.ip, self.server.port)
+
 def clientConnectionFailed(self, connector, reason):
 """Called if the connection attempt failed"""
 
@@ -70,7 +73,7 @@
 # Immediately set status to down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection failed.", level=logging.WARN)
+self.report("%s failed." % self._report_prefix(), level=logging.WARN)
 
 # Slowly reconnect
 self.retry(connector)
@@ -89,7 +92,7 @@
 # Connection lost in a non clean way. Immediately set status to 
down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection lost.", level=logging.INFO)
+self.report("%s lost." % self._report_prefix(), level=logging.INFO)
 
 # Slowly reconnect
 self.retry(connector)
@@ -113,7 +116,7 @@
 # Reset reconnection delay
 self.resetDelay()
 
-self.report("Connection established.")
+self.report("%s established." % self._report_prefix())
 
 def buildProtocol(self, addr):
 """

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Ema 
Gerrit-Reviewer: Ema 
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] mediawiki...GlobalNotice[master]: Version 0.7.0: use RequestContext instead of globals where p...

2017-07-04 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363192 )

Change subject: Version 0.7.0: use RequestContext instead of globals where 
possible
..

Version 0.7.0: use RequestContext instead of globals where possible

Change-Id: Ia6eb61ddc09bb1c1ad5972eaa95b4cc5d2a142cb
---
M GlobalNotice.class.php
M extension.json
2 files changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalNotice 
refs/changes/92/363192/1

diff --git a/GlobalNotice.class.php b/GlobalNotice.class.php
index 20fedca..28ccabc 100644
--- a/GlobalNotice.class.php
+++ b/GlobalNotice.class.php
@@ -7,7 +7,7 @@
  * @author Misza 
  * @author Jack Phoenix 
  * @copyright Copyright © 2010 Misza
- * @copyright Copyright © 2010-2015 Jack Phoenix
+ * @copyright Copyright © 2010-2017 Jack Phoenix
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  * @link https://www.mediawiki.org/wiki/Extension:GlobalNotice Documentation
  */
@@ -16,11 +16,10 @@
/**
 * @param string $siteNotice Existing site notice (if any) to 
manipulate or
 * append to
+* @param Skin $skin
 * @return bool
 */
-   public static function onSiteNoticeAfter( &$siteNotice ) {
-   global $wgUser;
-
+   public static function onSiteNoticeAfter( &$siteNotice, $skin ) {
// It is possible that there is a global notice (for example, 
for all
// French-speaking users) *and* a forced global notice (for 
everyone,
// informing them of planned server maintenance etc.)
@@ -39,7 +38,7 @@
// "Forced" globalnotice -- a site-wide notice shown for *all* 
users,
// no matter what their language is
// Used only for things like server migration notices etc.
-   $forcedNotice = wfMessage( 'forced-globalnotice' )->inLanguage( 
'en' );
+   $forcedNotice = $skin->msg( 'forced-globalnotice' 
)->inLanguage( 'en' );
if ( !$forcedNotice->isDisabled() ) {
$ourSiteNotice .= '' .
$forcedNotice->parseAsBlock() . '';
@@ -48,18 +47,19 @@
// Global notice, depending on the user's language
// This can be used to show language-specific stuff to users 
with a certain
// interface language (i.e. "We need more French translators! 
Pouvez-vous nous aider ?")
-   $globalNotice = wfMessage( 'globalnotice' );
+   $globalNotice = $skin->msg( 'globalnotice' );
if ( !$globalNotice->isDisabled() ) {
// Give the global notice its own ID and center it
$ourSiteNotice .= '' .
$globalNotice->parseAsBlock() . '';
}
 
+   $user = $skin->getUser();
// Group-specific global notices
foreach ( array( 'sysop', 'bureaucrat', 'bot', 'rollback' ) as 
$group ) {
$messageName = 'globalnotice-' . $group;
-   $globalNoticeForGroup = wfMessage( $messageName );
-   $isMember = in_array( $group, 
$wgUser->getEffectiveGroups() );
+   $globalNoticeForGroup = $skin->msg( $messageName );
+   $isMember = in_array( $group, 
$user->getEffectiveGroups() );
if ( !$globalNoticeForGroup->isDisabled() && $isMember 
) {
// Give the global notice its own ID and center 
it
$ourSiteNotice .= '' .
diff --git a/extension.json b/extension.json
index 2b7979c..d586ef3 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "GlobalNotice",
-   "version": "0.6.0",
+   "version": "0.7.0",
"author": [
"Misza",
"Jack Phoenix"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6eb61ddc09bb1c1ad5972eaa95b4cc5d2a142cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalNotice
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] mediawiki...ImportUsers[master]: Tweak .md-file to work in more views

2017-07-04 Thread Kghbln (Code Review)
Kghbln has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363191 )

Change subject: Tweak .md-file to work in more views
..


Tweak .md-file to work in more views

Change-Id: I4dd5e81c193fdcc616e7414325568b3397c5db78
---
M README.md
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/README.md b/README.md
index 3e12c45..f029b16 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
 (2) Extract the files in a directory called `ImportUsers` in your 
`extensions/` folder.
 
 (3) Add the following code at the bottom of your "LocalSettings.php" file:
-```php
+```
 require_once "$IP/extensions/ImportUsers/ImportUsers.php";
 ```
 (4) Configure if desired. See the "Configuration" section below.
@@ -36,7 +36,7 @@
 to your "LocalSettings.php" file after the inclusion of the extension as 
described in the "Installation"
 section above:
 
-```php
+```
 $wgGroupPermissions['sysop']['import_users'] = true;
 ```
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4dd5e81c193fdcc616e7414325568b3397c5db78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ImportUsers
Gerrit-Branch: master
Gerrit-Owner: Kghbln 
Gerrit-Reviewer: Kghbln 

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


[MediaWiki-commits] [Gerrit] mediawiki...ImportUsers[master]: Tweak .md-file to work in more views

2017-07-04 Thread Kghbln (Code Review)
Kghbln has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363191 )

Change subject: Tweak .md-file to work in more views
..

Tweak .md-file to work in more views

Change-Id: I4dd5e81c193fdcc616e7414325568b3397c5db78
---
M README.md
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ImportUsers 
refs/changes/91/363191/1

diff --git a/README.md b/README.md
index 3e12c45..f029b16 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
 (2) Extract the files in a directory called `ImportUsers` in your 
`extensions/` folder.
 
 (3) Add the following code at the bottom of your "LocalSettings.php" file:
-```php
+```
 require_once "$IP/extensions/ImportUsers/ImportUsers.php";
 ```
 (4) Configure if desired. See the "Configuration" section below.
@@ -36,7 +36,7 @@
 to your "LocalSettings.php" file after the inclusion of the extension as 
described in the "Installation"
 section above:
 
-```php
+```
 $wgGroupPermissions['sysop']['import_users'] = true;
 ```
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4dd5e81c193fdcc616e7414325568b3397c5db78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ImportUsers
Gerrit-Branch: master
Gerrit-Owner: Kghbln 

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


[MediaWiki-commits] [Gerrit] mediawiki...ImportUsers[master]: Release version 2.1.0

2017-07-04 Thread Kghbln (Code Review)
Kghbln has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363187 )

Change subject: Release version 2.1.0
..


Release version 2.1.0

* Get changes since the last 2.0.0 release out to the public (see CHANGELOG for 
the respective changes)

Change-Id: Iba8a22b76f904d94fa8efcbec7eb214a53c0da4b
---
M CHANGELOG.md
M COPYING
M ImportUsers.php
M README.md
4 files changed, 66 insertions(+), 16 deletions(-)

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



diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c8a728..5b9625f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,22 @@
 This file documents the development changes.
 
 
-### Version 2.0.0  
+### Version 2.1.0
+
+Released: 2017-07-04  
+Authored: Kghbln
+
+* Added compatibility for MW 1.26.x and higher
+* Migrated registration of special pages to `SpecialPage::getGroupName` (by 
Umherirrender)
+* Added translations for many more languages (by translators via 
translatewiki.net)
+* Added special page alias for Bengali (by Aftabuzzaman)
+* Fix license notation to match SPDX (by Umherirrender)
+* Updated COPYING (by Kghbln)
+* Extended README.md (by Kghbln)
+* Updated file documentation (by Kghbln)
+
+
+### Version 2.0.0
 
 Released: 2016-10-28  
 Authored: Kghbln
@@ -20,19 +35,19 @@
 ### Version 1.5.4
 
 Released: 2016-10-28  
-Authored: Kghbln, translators from translatewiki.net
+Authored: Kghbln
 
-* Added translations for many more languages
+* Added translations for many more languages (by translators via 
translatewiki.net)
 
 
-### Version 1.5.3  
+### Version 1.5.3
 
-Released: 2015-09-16
-Authored: Kghbln, translators from translatewiki.net
+Released: 2015-09-16  
+Authored: Kghbln
 
 * Added PLURAL and GENDER support to system message
 * Added system message documentation
-* Added translations for many more languages
+* Added translations for many more languages (by translators via 
translatewiki.net)
 
 
 ### Version 1.5.2
diff --git a/COPYING b/COPYING
index 68fab49..68a49da 100644
--- a/COPYING
+++ b/COPYING
@@ -1 +1,24 @@
-This extension was released to public domain. You are free to use this 
extension for any reason and mutilate it to your heart's liking.
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to 
diff --git a/ImportUsers.php b/ImportUsers.php
index ce3f28f..fdfde7a 100644
--- a/ImportUsers.php
+++ b/ImportUsers.php
@@ -6,18 +6,18 @@
  * @ingroup Extensions
  * @package MediaWiki
  *
- * @version 2.0.0 2016-10-28
+ * @version 2.1.0 2017-07-04
  *
  * @links https://www.mediawiki.org/wiki/Extension:ImportUsers Homepage
  * @links 
https://phabricator.wikimedia.org/diffusion/EIUS/browse/master/README.md 
Documentation
  * @links https://www.mediawiki.org/wiki/Extension_talk:ImportUsers Support
  * @links https://phabricator.wikimedia.org/tag/importusers/ Bug tracker
- * @links 
https://phabricator.wikimedia.org/diffusion/EIUS/extensions-importusers.git 
Source code
+ * @links https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ImportUsers 
Source code
  * @links 
https://github.com/wikimedia/mediawiki-extensions-ImportUsers/releases Downloads
  *
  * @author Rouslan Zenetl, Yuriy Ilkiv (original authors)
  *
- * @license Public Domain - you are free to use this extension for any reason 
and mutilate it to your heart's liking.
+ * @license https://unlicense.org/ The Unlicense.
  */
 
 /* Ensure that the script cannot be executed outside of MediaWiki. */
@@ -29,7 +29,7 @@
 $wgExtensionCredits['specialpage'][] = [
'path' => __FILE__,
'name' => 'Import Users',
-   'version' => '2.0.0',
+   'version' => '2.1.0',
'author' => [
'Yuriy Ilkiv',
'Rouslan Zenetl',
diff --git a/README.md b/README.md
index 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt: let wmf_auto_reimage wait after the first puppet run

2017-07-04 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363189 )

Change subject: salt: let wmf_auto_reimage wait after the first puppet run
..


salt: let wmf_auto_reimage wait after the first puppet run

IOW leave time for puppet to install and start salt-minion

Bug: T169601
Change-Id: Ie2571947cb21514ea40deaf6bfe49bccf0abf1c3
---
M modules/salt/files/wmf_auto_reimage.py
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Filippo Giunchedi: Looks good to me, approved
  Volans: Looks good to me, but someone else must approve



diff --git a/modules/salt/files/wmf_auto_reimage.py 
b/modules/salt/files/wmf_auto_reimage.py
index e462b63..56a8411 100644
--- a/modules/salt/files/wmf_auto_reimage.py
+++ b/modules/salt/files/wmf_auto_reimage.py
@@ -764,7 +764,7 @@
 
 while True:
 retries += 1
-logger.debug('Wating for Puppet ({retries})'.format(retries=retries))
+logger.debug('Waiting for Puppet ({retries})'.format(retries=retries))
 if retries % WATCHER_LOG_LOOPS == 0:
 logger.info('Still waiting for Puppet after {min} minutes'.format(
 min=(retries * WATCHER_LONG_SLEEP) / 60.0))
@@ -836,7 +836,7 @@
 
 while True:
 retries += 1
-logger.debug('Wating for reboot ({retries})'.format(retries=retries))
+logger.debug('Waiting for reboot ({retries})'.format(retries=retries))
 if retries % WATCHER_LOG_LOOPS == 0:
 logger.info('Still waiting for reboot after {min} minutes'.format(
 min=(retries * WATCHER_LONG_SLEEP) / 60.0))
@@ -1031,6 +1031,9 @@
 hosts = reimage_hosts(puppetmaster_host, hosts, custom_mgmts=custom_mgmts,
   ipmi_password=ipmi_password, is_new=args.new)
 hosts = check_reimage(puppetmaster_host, hosts)
+logger.info("Waiting for the first puppet run to complete "
+"and salt minion to be online")
+time.sleep(60)
 hosts = check_uptime(
 hosts, maximum=int((datetime.now() - reimage_time).total_seconds()))
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Revert "(temporarily) disable use of client services in repo"

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362999 )

Change subject: Revert "(temporarily) disable use of client services in repo"
..


Revert "(temporarily) disable use of client services in repo"

This reverts commit 7373a102044352e7083806b8a7ddd2cd20b4f1f8.

That commit is supposed to be part of branches deployed on
the live system but should not be part of master branch.

Change-Id: I57d4cb1e592bc45250077182758573b6f686a636
---
M repo/includes/WikibaseRepo.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 849bb04..de545de 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -31,6 +31,7 @@
 use ValueFormatters\FormatterOptions;
 use ValueFormatters\ValueFormatter;
 use Wikibase\ChangeOp\ChangeOpFactoryProvider;
+use Wikibase\Client\WikibaseClient;
 use Wikibase\DataAccess\EntityDataRetrievalServiceFactory;
 use Wikibase\DataModel\DeserializerFactory;
 use Wikibase\DataModel\Entity\DispatchingEntityIdParser;
@@ -327,6 +328,12 @@
 
$dataRetrievalServices = null;
 
+   // If client functionality is enabled, use it to enable 
federation.
+   if ( WikibaseSettings::isClientEnabled() ) {
+   $dataRetrievalServices = 
WikibaseClient::getDefaultInstance()->getEntityDataRetrievalServiceFactory();
+   $repositoryDefinitions = 
WikibaseClient::getDefaultInstance()->getRepositoryDefinitions();
+   }
+
return new self(
$settings,
new DataTypeDefinitions(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I57d4cb1e592bc45250077182758573b6f686a636
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: WMDE-leszek 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: Add phan config

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363190 )

Change subject: Add phan config
..

Add phan config

Change-Id: Iafa2f82e7c31972e2b6809eb9578510b1152ab5b
---
A tests/phan/config.php
A tests/phan/stubs/README
2 files changed, 306 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter 
refs/changes/90/363190/1

diff --git a/tests/phan/config.php b/tests/phan/config.php
new file mode 100644
index 000..100b0e1
--- /dev/null
+++ b/tests/phan/config.php
@@ -0,0 +1,303 @@
+ [
+   ],
+
+   /**
+* A list of directories that should be parsed for class and
+* method information. After excluding the directories
+* defined in exclude_analysis_directory_list, the remaining
+* files will be statically analyzed for errors.
+*
+* Thus, both first-party and third-party code being used by
+* your application should be included in this list.
+*/
+   'directory_list' => [
+   'src/',
+   'tests/phan/stubs/',
+   './../../includes',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* A file list that defines files that will be excluded
+* from parsing and analysis and will not be read at all.
+*
+* This is useful for excluding hopelessly unanalyzable
+* files that can't be removed for whatever reason.
+*/
+   'exclude_file_list' => [
+   ],
+
+   /**
+* A list of directories holding code that we want
+* to parse, but not analyze. Also works for individual
+* files.
+*/
+   "exclude_analysis_directory_list" => [
+   'tests/phan/stubs/',
+   './../../includes',
+   './../../maintenance',
+   './../../vendor',
+   ],
+
+   /**
+* Backwards Compatibility Checking. This is slow
+* and expensive, but you should consider running
+* it before upgrading your version of PHP to a
+* new version that has backward compatibility
+* breaks.
+*/
+   'backward_compatibility_checks' => false,
+
+   /**
+* A set of fully qualified class-names for which
+* a call to parent::__construct() is required
+*/
+   'parent_constructor_required' => [
+   ],
+
+   /**
+* Run a quick version of checks that takes less
+* time at the cost of not running as thorough
+* an analysis. You should consider setting this
+* to true only when you wish you had more issues
+* to fix in your code base.
+*
+* In quick-mode the scanner doesn't rescan a function
+* or a method's code block every time a call is seen.
+* This means that the problem here won't be detected:
+*
+* ```php
+*  false,
+
+   /**
+* By default, Phan will not analyze all node types
+* in order to save time. If this config is set to true,
+* Phan will dig deeper into the AST tree and do an
+* analysis on all nodes, possibly finding more issues.
+*
+* See \Phan\Analysis::shouldVisit for the set of skipped
+* nodes.
+*/
+   'should_visit_all_nodes' => true,
+
+   /**
+* If enabled, check all methods that override a
+* parent method to make sure its signature is
+* compatible with the parent's. This check
+* can add quite a bit of time to the analysis.
+*/
+   'analyze_signature_compatibility' => true,
+
+   // Emit all issues. They are then suppressed via
+   // suppress_issue_types, rather than a minimum
+   // severity.
+   "minimum_severity" => 0,
+
+   /**
+* If true, missing properties will be created when
+* they are first seen. If false, we'll report an
+* error message if there is an attempt to write
+* to a class property that wasn't explicitly
+* defined.
+*/
+   'allow_missing_properties' => false,
+
+   /**
+* Allow null to be cast as any type and for any
+* type to be cast to null. Setting this to false
+* will cut down on false positives.
+*/
+   'null_casts_as_any_type' => true,
+
+   /**
+* If enabled, scalars (int, float, bool, string, null)
+* are treated as if they can cast to each other.
+*
+* MediaWiki is pretty lax and uses many scalar
+* types interchangably.
+*/
+   'scalar_implicit_cast' => true,
+
+   /**
+* If true, seemingly undeclared variables in the global
+* scope will be ignored. This is useful for projects
+* with complicated cross-file globals that you have no
+* hope of fixing.
+*/
+   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt: let wmf_auto_reimage wait after the first puppet run

2017-07-04 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363189 )

Change subject: salt: let wmf_auto_reimage wait after the first puppet run
..

salt: let wmf_auto_reimage wait after the first puppet run

IOW leave time for puppet to install and start salt-minion

Bug: T169601
Change-Id: Ie2571947cb21514ea40deaf6bfe49bccf0abf1c3
---
M modules/salt/files/wmf_auto_reimage.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/89/363189/1

diff --git a/modules/salt/files/wmf_auto_reimage.py 
b/modules/salt/files/wmf_auto_reimage.py
index e462b63..56a8411 100644
--- a/modules/salt/files/wmf_auto_reimage.py
+++ b/modules/salt/files/wmf_auto_reimage.py
@@ -764,7 +764,7 @@
 
 while True:
 retries += 1
-logger.debug('Wating for Puppet ({retries})'.format(retries=retries))
+logger.debug('Waiting for Puppet ({retries})'.format(retries=retries))
 if retries % WATCHER_LOG_LOOPS == 0:
 logger.info('Still waiting for Puppet after {min} minutes'.format(
 min=(retries * WATCHER_LONG_SLEEP) / 60.0))
@@ -836,7 +836,7 @@
 
 while True:
 retries += 1
-logger.debug('Wating for reboot ({retries})'.format(retries=retries))
+logger.debug('Waiting for reboot ({retries})'.format(retries=retries))
 if retries % WATCHER_LOG_LOOPS == 0:
 logger.info('Still waiting for reboot after {min} minutes'.format(
 min=(retries * WATCHER_LONG_SLEEP) / 60.0))
@@ -1031,6 +1031,9 @@
 hosts = reimage_hosts(puppetmaster_host, hosts, custom_mgmts=custom_mgmts,
   ipmi_password=ipmi_password, is_new=args.new)
 hosts = check_reimage(puppetmaster_host, hosts)
+logger.info("Waiting for the first puppet run to complete "
+"and salt minion to be online")
+time.sleep(60)
 hosts = check_uptime(
 hosts, maximum=int((datetime.now() - reimage_time).total_seconds()))
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2571947cb21514ea40deaf6bfe49bccf0abf1c3
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] translatewiki[master]: Add message checker and insertable for Oppia variables

2017-07-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363185 )

Change subject: Add message checker and insertable for Oppia variables
..


Add message checker and insertable for Oppia variables

Oppia has variables like <[foo]> which are currently missing a checker and 
insertables support.

Bug: T169173
Change-Id: I0fcd5b98fc8f52514d6b25e8a30a3740b482a42c
---
A groups/Oppia/Checker.php
M groups/Oppia/Oppia.yaml
A groups/Oppia/OppiaInsertablesSuggester.php
3 files changed, 65 insertions(+), 0 deletions(-)

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



diff --git a/groups/Oppia/Checker.php b/groups/Oppia/Checker.php
new file mode 100644
index 000..6772b3b
--- /dev/null
+++ b/groups/Oppia/Checker.php
@@ -0,0 +1,26 @@
+/' );
+   }
+}
diff --git a/groups/Oppia/Oppia.yaml b/groups/Oppia/Oppia.yaml
index 46765e6..78458f9 100644
--- a/groups/Oppia/Oppia.yaml
+++ b/groups/Oppia/Oppia.yaml
@@ -12,3 +12,15 @@
   sourcePattern: "%GROUPROOT%/oppia/assets/i18n/%CODE%.json"
   definitionFile: "%GROUPROOT%/oppia/assets/i18n/en.json"
   includeMetadata: false
+
+CHECKER:
+  class: OppiaMessageChecker
+  checks:
+- OppiaVariablesCheck
+
+INSERTABLES:
+  class: OppiaInsertablesSuggester
+
+AUTOLOAD:
+  OppiaMessageChecker: Checker.php
+  OppiaInsertablesSuggester: OppiaInsertablesSuggester.php
diff --git a/groups/Oppia/OppiaInsertablesSuggester.php 
b/groups/Oppia/OppiaInsertablesSuggester.php
new file mode 100644
index 000..b33c4a3
--- /dev/null
+++ b/groups/Oppia/OppiaInsertablesSuggester.php
@@ -0,0 +1,27 @@
+
+   $matches = [];
+   preg_match_all(
+   '/<\[[a-zA-Z_]+\]>/',
+   $text,
+   $matches,
+   PREG_SET_ORDER
+   );
+   $new = array_map( function( $match ) {
+   return new Insertable( $match[0], $match[0] );
+   }, $matches );
+   $insertables = array_merge( $insertables, $new );
+
+   return $insertables;
+   }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0fcd5b98fc8f52514d6b25e8a30a3740b482a42c
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations...pybal[master]: Add IPv6 support to all monitors, improve IdleConnection log...

2017-07-04 Thread Ema (Code Review)
Ema has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363188 )

Change subject: Add IPv6 support to all monitors, improve IdleConnection logging
..

Add IPv6 support to all monitors, improve IdleConnection logging

pybal (1.13.7) jessie-wikimedia; urgency=medium

  * Add IPv6 support to all monitors (Bug: #T82747)
  * Include IP and port information in IdleConnection logs

Bug: T82747
Bug: T154759
Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
---
M debian/changelog
M pybal/monitors/idleconnection.py
2 files changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal 
refs/changes/88/363188/1

diff --git a/debian/changelog b/debian/changelog
index 08150a7..f9ae90c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pybal (1.13.7) jessie-wikimedia; urgency=medium
+
+  * Add IPv6 support to all monitors (Bug: #T82747)
+  * Include IP and port information in IdleConnection logs
+
+ -- Emanuele Rocca   Tue, 04 Jul 2017 15:50:28 +0200
+
 pybal (1.13.6) jessie-wikimedia; urgency=medium
 
   * Change the default behavior for LVS services from not being announced via
diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py
index 42c556d..fd105dd 100644
--- a/pybal/monitors/idleconnection.py
+++ b/pybal/monitors/idleconnection.py
@@ -61,6 +61,9 @@
 self.transport = getattr(connector, 'transport', None)
 super(IdleConnectionMonitoringProtocol, 
self).startedConnecting(connector)
 
+def _report_prefix(self):
+return "Connection to %s:%s" % (self.server.ip, self.server.port)
+
 def clientConnectionFailed(self, connector, reason):
 """Called if the connection attempt failed"""
 
@@ -70,7 +73,7 @@
 # Immediately set status to down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection failed.", level=logging.WARN)
+self.report("%s failed." % self._report_prefix(), level=logging.WARN)
 
 # Slowly reconnect
 self.retry(connector)
@@ -89,7 +92,7 @@
 # Connection lost in a non clean way. Immediately set status to 
down
 self._resultDown(reason.getErrorMessage())
 
-self.report("Connection lost.", level=logging.INFO)
+self.report("%s lost." % self._report_prefix(), level=logging.INFO)
 
 # Slowly reconnect
 self.retry(connector)
@@ -113,7 +116,7 @@
 # Reset reconnection delay
 self.resetDelay()
 
-self.report("Connection established.")
+self.report("%s established." % self._report_prefix())
 
 def buildProtocol(self, addr):
 """

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7831e71092bc8a8e22669254ce316803b671dfc1
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Ema 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: WIP monitoring: provide basic Rspec

2017-07-04 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363186 )

Change subject: WIP monitoring: provide basic Rspec
..

WIP monitoring: provide basic Rspec

Add RSpec for monitoring module.

Change-Id: I04db8fe2051dc9f667da0e4e557c740174c352a1
---
A modules/monitoring/.fixtures.yml
A modules/monitoring/.rspec
A modules/monitoring/Rakefile
A modules/monitoring/spec/defines/monitoring_host_spec.rb
A modules/monitoring/spec/fixtures/modules/bacula
A modules/monitoring/spec/fixtures/modules/base
A modules/monitoring/spec/fixtures/modules/stdlib
A modules/monitoring/spec/fixtures/modules/wmflib
A modules/monitoring/spec/spec_helper.rb
9 files changed, 133 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/86/363186/1

diff --git a/modules/monitoring/.fixtures.yml b/modules/monitoring/.fixtures.yml
new file mode 100644
index 000..ef1bcbf
--- /dev/null
+++ b/modules/monitoring/.fixtures.yml
@@ -0,0 +1,8 @@
+fixtures:
+symlinks:
+monitoring: "#{source_dir}"
+icinga: "../../../../icinga"
+nagios_common: "../../../../nagios_common"
+wmflib: "../../../../wmflib"
+logrotate: "../../../../logrotate"
+secret: "../../../../../../labs/private/modules/secret"
diff --git a/modules/monitoring/.rspec b/modules/monitoring/.rspec
new file mode 100644
index 000..f449dae
--- /dev/null
+++ b/modules/monitoring/.rspec
@@ -0,0 +1,2 @@
+--format doc
+--color
diff --git a/modules/monitoring/Rakefile b/modules/monitoring/Rakefile
new file mode 100644
index 000..cd3d379
--- /dev/null
+++ b/modules/monitoring/Rakefile
@@ -0,0 +1 @@
+require 'puppetlabs_spec_helper/rake_tasks'
diff --git a/modules/monitoring/spec/defines/monitoring_host_spec.rb 
b/modules/monitoring/spec/defines/monitoring_host_spec.rb
new file mode 100644
index 000..f863008
--- /dev/null
+++ b/modules/monitoring/spec/defines/monitoring_host_spec.rb
@@ -0,0 +1,109 @@
+require 'spec_helper'
+
+describe 'monitoring::host' do
+  context 'with a standard physical host' do
+let(:facts) {
+  {
+:hostname=> 'ahost',
+:operatingsystem => 'Debian',
+:ipaddress   => '1.2.3.4',
+:is_virtual  => false,
+:lldp_parent => 'ahosts_parent',
+  }
+}
+let(:title) { 'ahost' }
+it { should compile }
+describe 'with no parameters' do
+  subject { exported_resources }
+  it do
+should contain_nagios_host('ahost').with(
+  'host_name'  => 'ahost',
+  'parents'=> 'ahosts_parent',
+  'icon_image' => 'vendors/debian.png',
+  'address'=> '1.2.3.4',
+)
+end
+end
+describe 'with a parents parameters' do
+  let(:params) {
+{
+  :parents => 'aparent',
+}
+  }
+  subject { exported_resources }
+  it do
+should contain_nagios_host('ahost').with(
+  'host_name'  => 'ahost',
+  'parents'=> 'aparent',
+  'icon_image' => 'vendors/debian.png',
+  'address'=> '1.2.3.4',
+)
+  end
+end
+  end
+  context 'with a standard virtual host' do
+let(:facts) {
+  {
+:hostname=> 'ahost',
+:operatingsystem => 'Debian',
+:ipaddress   => '1.2.3.4',
+:is_virtual  => true,
+:lldp_parent => 'ahosts_parent',
+  }
+}
+let(:title) { 'ahost' }
+it { should compile }
+describe 'with no parameters' do
+  subject { exported_resources }
+  it do
+should contain_nagios_host('ahost').with(
+  'host_name'  => 'ahost',
+  'parents'=> nil,
+  'icon_image' => 'vendors/debian.png',
+  'address'=> '1.2.3.4',
+)
+  end
+end
+describe 'with a parents parameters' do
+  let(:params) {
+{
+  :parents => 'aparent',
+}
+  }
+  subject { exported_resources }
+  it do
+should contain_nagios_host('ahost').with(
+  'host_name'  => 'ahost',
+  'parents'=> 'aparent',
+  'icon_image' => 'vendors/debian.png',
+  'address'=> '1.2.3.4',
+)
+  end
+end
+  end
+  context 'with an icinga host monitoring itself' do
+let(:facts) {
+  {
+:hostname=> 'ahost',
+:operatingsystem => 'Debian',
+:ipaddress   => '1.2.3.4',
+:is_virtual  => false,
+:lldp_parent => 'ahosts_parent',
+  }
+}
+let(:title) { 'ahost' }
+let(:pre_condition) { 'include icinga'}
+it { should compile }
+describe 'with no parameters' do
+  subject { exported_resources }
+  it do
+should contain_nagios_host('ahost').with(
+  'host_name'  => 'ahost',
+  'parents'=> 'ahosts_parent',
+  'icon_image' => 

[MediaWiki-commits] [Gerrit] mediawiki...ImportUsers[master]: Release version 2.1.0

2017-07-04 Thread Kghbln (Code Review)
Kghbln has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363187 )

Change subject: Release version 2.1.0
..

Release version 2.1.0

* Get changes since the last 2.0.0 release out to the public (see CHANGELOG for 
the respective changes)

Change-Id: Iba8a22b76f904d94fa8efcbec7eb214a53c0da4b
---
M CHANGELOG.md
M COPYING
M ImportUsers.php
M README.md
4 files changed, 64 insertions(+), 14 deletions(-)


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

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c8a728..5fd9190 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,21 @@
 This file documents the development changes.
 
 
+### Version 2.1.0
+
+Released: 2017-07-04  
+Authored: Kghbln
+
+* Added compatibility for MW 1.26.x and higher
+* Migrated registration of special pages to `SpecialPage::getGroupName` (by 
Umherirrender)
+* Added translations for many more languages (by translators via 
translatewiki.net)
+* Added special page alias for Bengali (by Aftabuzzaman)
+* Fix license notation to match SPDX (by Umherirrender)
+* Updated COPYING (by Kghbln)
+* Extended README.md (by Kghbln)
+* Updated file documentation (by Kghbln)
+
+
 ### Version 2.0.0  
 
 Released: 2016-10-28  
@@ -20,19 +35,19 @@
 ### Version 1.5.4
 
 Released: 2016-10-28  
-Authored: Kghbln, translators from translatewiki.net
+Authored: Kghbln
 
-* Added translations for many more languages
+* Added translations for many more languages (by translators via 
translatewiki.net)
 
 
 ### Version 1.5.3  
 
-Released: 2015-09-16
-Authored: Kghbln, translators from translatewiki.net
+Released: 2015-09-16  
+Authored: Kghbln
 
 * Added PLURAL and GENDER support to system message
 * Added system message documentation
-* Added translations for many more languages
+* Added translations for many more languages (by translators via 
translatewiki.net)
 
 
 ### Version 1.5.2
diff --git a/COPYING b/COPYING
index 68fab49..68a49da 100644
--- a/COPYING
+++ b/COPYING
@@ -1 +1,24 @@
-This extension was released to public domain. You are free to use this 
extension for any reason and mutilate it to your heart's liking.
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to 
diff --git a/ImportUsers.php b/ImportUsers.php
index ce3f28f..fdfde7a 100644
--- a/ImportUsers.php
+++ b/ImportUsers.php
@@ -6,18 +6,18 @@
  * @ingroup Extensions
  * @package MediaWiki
  *
- * @version 2.0.0 2016-10-28
+ * @version 2.1.0 2017-07-04
  *
  * @links https://www.mediawiki.org/wiki/Extension:ImportUsers Homepage
  * @links 
https://phabricator.wikimedia.org/diffusion/EIUS/browse/master/README.md 
Documentation
  * @links https://www.mediawiki.org/wiki/Extension_talk:ImportUsers Support
  * @links https://phabricator.wikimedia.org/tag/importusers/ Bug tracker
- * @links 
https://phabricator.wikimedia.org/diffusion/EIUS/extensions-importusers.git 
Source code
+ * @links https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ImportUsers 
Source code
  * @links 
https://github.com/wikimedia/mediawiki-extensions-ImportUsers/releases Downloads
  *
  * @author Rouslan Zenetl, Yuriy Ilkiv (original authors)
  *
- * @license Public Domain - you are free to use this extension for any reason 
and mutilate it to your heart's liking.
+ * @license https://unlicense.org/ The Unlicense.
  */
 
 /* Ensure that the script cannot be executed outside of MediaWiki. */
@@ -29,7 +29,7 @@
 $wgExtensionCredits['specialpage'][] = [
'path' => __FILE__,
'name' => 'Import Users',
-   'version' => '2.0.0',
+   'version' => '2.1.0',
'author' => [
'Yuriy Ilkiv',
'Rouslan Zenetl',
diff --git a/README.md b/README.md
index 308aa2c..3e12c45 100644
--- 

[MediaWiki-commits] [Gerrit] translatewiki[master]: Add message checker and insertable for Oppia variables

2017-07-04 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363185 )

Change subject: Add message checker and insertable for Oppia variables
..

Add message checker and insertable for Oppia variables

Oppia has variables like <[foo]> which are currently missing a checker and 
insertables support.

Bug: T169173
Change-Id: I0fcd5b98fc8f52514d6b25e8a30a3740b482a42c
---
A groups/Oppia/Checker.php
M groups/Oppia/Oppia.yaml
A groups/Oppia/OppiaInsertablesSuggester.php
3 files changed, 65 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/85/363185/1

diff --git a/groups/Oppia/Checker.php b/groups/Oppia/Checker.php
new file mode 100644
index 000..e902b94
--- /dev/null
+++ b/groups/Oppia/Checker.php
@@ -0,0 +1,26 @@
+/' );
+   }
+}
\ No newline at end of file
diff --git a/groups/Oppia/Oppia.yaml b/groups/Oppia/Oppia.yaml
index 46765e6..78458f9 100644
--- a/groups/Oppia/Oppia.yaml
+++ b/groups/Oppia/Oppia.yaml
@@ -12,3 +12,15 @@
   sourcePattern: "%GROUPROOT%/oppia/assets/i18n/%CODE%.json"
   definitionFile: "%GROUPROOT%/oppia/assets/i18n/en.json"
   includeMetadata: false
+
+CHECKER:
+  class: OppiaMessageChecker
+  checks:
+- OppiaVariablesCheck
+
+INSERTABLES:
+  class: OppiaInsertablesSuggester
+
+AUTOLOAD:
+  OppiaMessageChecker: Checker.php
+  OppiaInsertablesSuggester: OppiaInsertablesSuggester.php
diff --git a/groups/Oppia/OppiaInsertablesSuggester.php 
b/groups/Oppia/OppiaInsertablesSuggester.php
new file mode 100644
index 000..b33c4a3
--- /dev/null
+++ b/groups/Oppia/OppiaInsertablesSuggester.php
@@ -0,0 +1,27 @@
+
+   $matches = [];
+   preg_match_all(
+   '/<\[[a-zA-Z_]+\]>/',
+   $text,
+   $matches,
+   PREG_SET_ORDER
+   );
+   $new = array_map( function( $match ) {
+   return new Insertable( $match[0], $match[0] );
+   }, $matches );
+   $insertables = array_merge( $insertables, $new );
+
+   return $insertables;
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fcd5b98fc8f52514d6b25e8a30a3740b482a42c
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MtDu 

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Change signature of SpecialNewLexeme::createSummary

2017-07-04 Thread WMDE-leszek (Code Review)
WMDE-leszek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363184 )

Change subject: Change signature of SpecialNewLexeme::createSummary
..

Change signature of SpecialNewLexeme::createSummary

Following changes in SpecialNewEntity in
I745ba0bf28fee0368925dc8bde2099036f44ad73.

Change-Id: If75446667bbb1964fac5387707200588d497d8a4
---
M src/Specials/SpecialNewLexeme.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/84/363184/1

diff --git a/src/Specials/SpecialNewLexeme.php 
b/src/Specials/SpecialNewLexeme.php
index 2adfd31..57a9462 100644
--- a/src/Specials/SpecialNewLexeme.php
+++ b/src/Specials/SpecialNewLexeme.php
@@ -156,7 +156,7 @@
 *
 * @return Summary
 */
-   protected function createSummary( $lexeme ) {
+   protected function createSummary( EntityDocument $lexeme ) {
$uiLanguageCode = $this->getLanguage()->getCode();
 
$summary = new Summary( 'wbeditentity', 'create' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If75446667bbb1964fac5387707200588d497d8a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek 

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


[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: ImportPlanValidator, perform checks in UploadBase::getTitle

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363183 )

Change subject: ImportPlanValidator, perform checks in UploadBase::getTitle
..

ImportPlanValidator, perform checks in UploadBase::getTitle

Bug: T163500
Change-Id: I23db191d39121985ad9674248978595b1bb2a249
---
M i18n/en.json
M i18n/qqq.json
M src/Services/FileImporterUploadBase.php
M src/Services/ImportPlanValidator.php
M src/Services/Importer.php
M tests/phpunit/MediaWiki/FileImporterUploadBaseTest.php
M tests/phpunit/Services/ImportPlanValidatorTest.php
7 files changed, 54 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter 
refs/changes/83/363183/1

diff --git a/i18n/en.json b/i18n/en.json
index fb18d23..972661c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -19,6 +19,9 @@
"fileimporter-cantimportmissingfile": "Can't import a missing file.",
"fileimporter-badtoken": "CSRF token does not match",
"fileimporter-badimporthash": "Import hash does not match. Please 
restart the import.",
+   "fileimporter-filenameerror-default" : "There is an unknown issue with 
your filename.",
+   "fileimporter-filenameerror-illegal" : "The file name you are currently 
trying to import to is illegal.",
+   "fileimporter-filenameerror-toolong" : "The file name you are currently 
trying to import to is too long.",
"fileimporter-localtitleexists" : "The title you are currently trying 
to import to already exists on this wiki.",
"fileimporter-sourcetitleexists" : "The title you are currently trying 
to import to already exists on the source wiki.",
"fileimporter-illegalfilenamechars" : "The title you are currently 
trying to import to contains illegal filename characters.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ed4d6e7..5fe8273 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -21,6 +21,9 @@
"fileimporter-cantimportmissingfile": "Error message when the file 
import target is missing.",
"fileimporter-badtoken": "Error message shown on the special page when 
the CSRF token for the request does not match the expected token.",
"fileimporter-badimporthash": "Error message shown on the special page 
when the import hash for the request does not match the expected hash.",
+   "fileimporter-filenameerror-default" : "Error message shown on the 
special page when the file name to be imported to has an issue we have no 
special handling for.",
+   "fileimporter-filenameerror-illegal" : "Error message shown on the 
special page when the file name to be imported to is reported as illegal by 
MediaWiki.",
+   "fileimporter-filenameerror-toolong" : "Error message shown on the 
special page when the file name to be imported to is reported as too long by 
MediaWiki.",
"fileimporter-localtitleexists": "Error message shown on the special 
page when the title to be imported to already exists on the local wiki.",
"fileimporter-sourcetitleexists": "Error message shown on the special 
page when the title to be imported to already exists on the source wiki.",
"fileimporter-illegalfilenamechars" : "Error message shown on the 
special page when the title to be imported to contains illegal characters as 
defined by MediaWiki.",
diff --git a/src/Services/FileImporterUploadBase.php 
b/src/Services/FileImporterUploadBase.php
index ee76a07..7646253 100644
--- a/src/Services/FileImporterUploadBase.php
+++ b/src/Services/FileImporterUploadBase.php
@@ -35,26 +35,32 @@
}
 
/**
+* @return bool|int check success or integer error code
+*/
+   public function performTitleChecks() {
+   if ( $this->getTitle() === null ) {
+   return $this->mTitleError;
+   }
+
+   return true;
+   }
+
+   /**
 * @return bool were the checks successful & can we upload this file?
 */
-   public function performChecks() {
-   $title = $this->getTitle();
+   public function performFileChecks() {
$fileVerification = $this->verifyFile();
-   $checkSuccess = $title !== null && $fileVerification === true;
 
-   if ( !$checkSuccess ) {
+   if ( $fileVerification !== true ) {
// TODO throw a more informative exception?
-   $logContext = [
-   'title' => $title,
-   'mTitleError' => $this->mTitleError,
-   'fileVerification' => $fileVerification,
-   ];
+   $logContext = [ 'fileVerification' => 
$fileVerification, ];
$this->logger->info(
__METHOD__ . ' checks failed: ' . json_encode( 
$logContext ), $logContext
);
+   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert "base: cleanup unneeded ipmi packages/checks"

2017-07-04 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362980 )

Change subject: Revert "base: cleanup unneeded ipmi packages/checks"
..


Revert "base: cleanup unneeded ipmi packages/checks"

Did its job, not needed anymore.

This reverts commit 82fe99a24d3e705597b6f34fa7edc8bf2b7842ad.

Change-Id: I95dcc2620dd3de475a2dedafae5160dac53703fc
---
M modules/profile/manifests/base.pp
1 file changed, 0 insertions(+), 13 deletions(-)

Approvals:
  Faidon Liambotis: Verified; Looks good to me, approved



diff --git a/modules/profile/manifests/base.pp 
b/modules/profile/manifests/base.pp
index ee63fe7..7567265 100644
--- a/modules/profile/manifests/base.pp
+++ b/modules/profile/manifests/base.pp
@@ -84,19 +84,6 @@
 
 if $facts['has_ipmi'] {
 class { '::ipmi::monitor': }
-} else {
-# temporary, cleanup
-package { 'freeipmi-tools':
-ensure => absent,
-}
-
-file { '/usr/local/lib/nagios/plugins/check_ipmi_sensor':
-ensure => absent,
-}
-}
-# temporary, cleanup
-package { ['freeipmi-ipmidetect', 'freeipmi-bmc-watchdog']:
-ensure => absent,
 }
 
 if os_version('debian >= jessie') {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I95dcc2620dd3de475a2dedafae5160dac53703fc
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Faidon Liambotis 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations...pybal[1.13]: Add IPv6 support to all monitors

2017-07-04 Thread Ema (Code Review)
Ema has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363182 )

Change subject: Add IPv6 support to all monitors
..

Add IPv6 support to all monitors

Previously, monitors would only monitor over IPv4 by picking
a random IP from the IPv4 address set only on every connection.

With this change they will *only* monitor with the primary IP
(IPv4 or IPv6, depending on the address family of the service)
that was selected to be pooled by IPVS.

Change-Id: I21c1575e180cbda792a5eacc004fafd4a624e03b
---
M pybal/monitors/dnsquery.py
M pybal/monitors/idleconnection.py
M pybal/monitors/proxyfetch.py
M pybal/test/test_monitors.py
4 files changed, 8 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal 
refs/changes/82/363182/1

diff --git a/pybal/monitors/dnsquery.py b/pybal/monitors/dnsquery.py
index 65b7e89..b374791 100644
--- a/pybal/monitors/dnsquery.py
+++ b/pybal/monitors/dnsquery.py
@@ -52,7 +52,7 @@
 super(DNSQueryMonitoringProtocol, self).run()
 
 # Create a resolver
-self.resolver = client.createResolver([(ip, 53) for ip in 
self.server.ip4_addresses])
+self.resolver = client.createResolver([(self.server.ip, 53)])
 
 if not self.checkCall or not self.checkCall.active():
 self.checkCall = reactor.callLater(self.intvCheck, self.check)
diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py
index 1c34634..42c556d 100644
--- a/pybal/monitors/idleconnection.py
+++ b/pybal/monitors/idleconnection.py
@@ -10,7 +10,6 @@
 from twisted.internet import reactor, protocol
 import logging
 
-import random
 import socket
 
 
@@ -130,9 +129,4 @@
 def _connect(self, *args, **kwargs):
 """Starts a TCP connection attempt"""
 
-try:
-host = random.choice(self.server.ip4_addresses)
-except (TypeError, IndexError):
-host = self.server.host
-
-self.reactor.connectTCP(host, self.server.port, self, *args, **kwargs)
+self.reactor.connectTCP(self.server.ip, self.server.port, self, *args, 
**kwargs)
diff --git a/pybal/monitors/proxyfetch.py b/pybal/monitors/proxyfetch.py
index 201c2ef..3468e73 100644
--- a/pybal/monitors/proxyfetch.py
+++ b/pybal/monitors/proxyfetch.py
@@ -10,7 +10,7 @@
 from twisted.internet import reactor, defer
 from twisted.web import client
 from twisted.python.runtime import seconds
-import logging
+import logging, random
 
 log = util.log
 
@@ -96,16 +96,13 @@
 # FIXME: Use GET as a workaround for a Twisted bug with 
HEAD/Content-length
 # where it expects a body and throws a PartialDownload failure
 
-import random
 url = random.choice(self.URL)
-try:
-host = random.choice(self.server.ip4_addresses)
-except (TypeError, IndexError):
-host = self.server.host
 
 self.checkStartTime = seconds()
 self.getPageDeferred = self.getProxyPage(
-url, method='GET', host=host,
+url,
+method='GET',
+host=self.server.ip,
 port=self.server.port,
 status=self.expectedStatus,
 timeout=self.toGET,
diff --git a/pybal/test/test_monitors.py b/pybal/test/test_monitors.py
index b44d29d..c38a370 100644
--- a/pybal/test/test_monitors.py
+++ b/pybal/test/test_monitors.py
@@ -49,8 +49,8 @@
 self.monitor.run()
 connector = self.reactor.connectors.pop()
 destination = connector.getDestination()
-self.assertEquals((destination.host, destination.port),
-  (self.server.host, self.server.port))
+self.assert_((destination.host, destination.port) == 
(self.server.host, self.server.port)
+ or (destination.host, destination.port) == 
(self.server.ip, self.server.port))
 
 def testClientConnectionMade(self):
 """Test `IdleConnectionMonitoringProtocol.clientConnectionMade`."""

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21c1575e180cbda792a5eacc004fafd4a624e03b
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: 1.13
Gerrit-Owner: Ema 
Gerrit-Reviewer: Mark Bergsma 

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


[MediaWiki-commits] [Gerrit] mediawiki...AJAXPoll[master]: IGNORE duplicate key errors

2017-07-04 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363181 )

Change subject: IGNORE duplicate key errors
..

IGNORE duplicate key errors

Probably a stupid solution.

Bug: T163625
Change-Id: Ic0d8185352c4515c00b3536df23d02f032f16b7b
---
M AJAXPoll_body.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AJAXPoll 
refs/changes/81/363181/1

diff --git a/AJAXPoll_body.php b/AJAXPoll_body.php
index 46ea142..34bdfc5 100644
--- a/AJAXPoll_body.php
+++ b/AJAXPoll_body.php
@@ -100,7 +100,9 @@
'poll_txt' => $input,
'poll_date' => wfTimestampNow(),
],
-   __METHOD__
+   __METHOD__,
+   // @see 
https://phabricator.wikimedia.org/T163625
+   [ 'IGNORE' ]
);
} else {
$dbw->update(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0d8185352c4515c00b3536df23d02f032f16b7b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AJAXPoll
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

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


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

2017-07-04 Thread Aude (Code Review)
Aude has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363180 )

Change subject: Update my ssh key
..

Update my ssh key

back to the one on my old WMDE macbook, which I use
for now until I fix or replace my personal laptop.

https://gerrit.wikimedia.org/r/#/c/207079/2/modules/admin/data/data.yaml

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/80/363180/1

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 11794d0..b619d7f 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -814,8 +814,7 @@
 gid: 500
 name: aude
 realname: Katie Filbert
-ssh_keys: [ssh-rsa 
B3NzaC1yc2EDAQABAAACAQC4isIiXTX8cAcOD30Pb5Auy/NqidYSEqzrybfEti/qbJf0cTuqPzrNnp3cPK76yTwW+6aTjH8LC71GjaM7gHs2hn4xQJDJVPvH8FHd+RWjndigIOAEPlKtlyXPRor32lNhDFjNDMwS0gJgwJWGyzdDSPap4A9oAYvOlXHMbwF86gPoTKTCIhKSwryUyn9XXYKpa3nwYHchJ0ugVrxo31KHu107YbGpquocEg3I+fPftJHRxDlhVho09OnzZedTKacNJvAkH+8F9AWEl8mQRYxA/5Bpm4ty1spCHcPU0LEpMFFRnSjb13p1e3Xh+rhwLg3NREW+nRI9DKHassaUvkfQnVipCjNpFy3gX70LS0u+M+vg8wUM88AYVMn1VohN9RbXFPnMHHZACeWJCClCj08qI/Z5WDEUCKBAv4B3nrlYHxMGsa+HAKHREvH+YQI3l4WauIq1Ri5qCVkhEZQKEKVH5uMny1bE3XMolsi1jwxQTiRWbctmGOPjUtXeSBe9N8yWzWmcduzbd60ipItclRqD8gh6FvE1Nb5AtWTkR1wdu691VZpN1BNf14joYz8eq8I6W2JupB4EYUnru3PQS0wQI+/RqWApCvWG4ajtp8hOTicwPSrXRhsYBWbg+HNzhI/KlQelwhm4MnZAESRtm+VgOl1g2kRpicHoiS+oGh1iXQ==
-katie@katie-UX303LNB]
+ssh_keys: [ssh-rsa 
B3NzaC1yc2EDAQABAAABAQC+OiQ1ptiP6VqmiP8IOp0sKET9pQHOJxscK6bAvAmAP72DL9MgLIBaWpaL9iWsb/DMXI2CQpEnu88VMVXCSgiqw+Gy6Q93pAquAQWAzkMnDD+QvxTm23oFCxP795IEP3JMHuONNg2x3NU3jYaOADOGZX41nRhbkO4yl32jQCTF9i670KS+CFDHxRzmOMzNhlytWJYyVPS6iqUGykaFcebFNThMtRtQF+pWJNreCFxZoXp1TyzkiJE1rX98tj2yhVQmET6mENuGXuAES/Atzpxp8zvsckHn06Mm1RZZmIExEqn/JdK6nHs1UoSNpsI195ltzkKSEWdFdYKRLZNFuRBL
 aude.w...@gmail.com]
 uid: 1185
 email: aude.w...@gmail.com
   awight:

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: salt: drop the saltversion fact, use os_version()

2017-07-04 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363169 )

Change subject: salt: drop the saltversion fact, use os_version()
..


salt: drop the saltversion fact, use os_version()

We currently use either SHA256 and MD5 fingerprints depending on the
output of the "saltversion" fact (this was changed in 7037c9696f0).

While this is a better approach than relying on distribution versions,
it's buggy in the first puppet run, as in that run when facter runs
there is no package installed.

Revert that particular change and rely on os_version() instead. For our
purposes it doesn't matter, as we the distribution versions and salt
match (and Salt won't be around for much longer anyway).

Change-Id: Ie1847adf5ba6cca0e6da286d30eb36206235ba7e
---
M modules/role/manifests/salt/minions.pp
D modules/salt/lib/facter/saltversion.rb
2 files changed, 6 insertions(+), 17 deletions(-)

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



diff --git a/modules/role/manifests/salt/minions.pp 
b/modules/role/manifests/salt/minions.pp
index e446bdc..1179a56 100644
--- a/modules/role/manifests/salt/minions.pp
+++ b/modules/role/manifests/salt/minions.pp
@@ -7,10 +7,10 @@
 $labs_master = hiera('saltmaster')
 
 # On older systems (e.g. jessie) use MD5 fingerprint
-if versioncmp($::saltversion, '2016.3') < 0 {
-$labs_finger   = 'c5:b1:35:45:3e:0a:19:70:aa:5f:3a:cf:bf:a0:61:dd'
-} else {
+if os_version('debian >= stretch') {
 $labs_finger   = 
'a3:29:31:ac:79:4e:a3:9a:74:d3:c8:d6:92:08:00:50:c9:e1:b3:c8:4a:4b:03:3a:58:32:29:c6:67:4e:b5:fd'
+} else {
+$labs_finger   = 'c5:b1:35:45:3e:0a:19:70:aa:5f:3a:cf:bf:a0:61:dd'
 }
 $master= pick($salt_master, $labs_master)
 $master_finger = pick($salt_finger, $labs_finger)
@@ -20,12 +20,12 @@
 }
 } else {
 $master = 'neodymium.eqiad.wmnet'
-if versioncmp($::saltversion, '2016.3') < 0 {
-$master_finger = 'f6:1d:a7:1f:7e:12:10:40:75:d5:73:af:0c:be:7d:7c'
-} else {
+if os_version('debian >= stretch') {
 # stretch's salt-minion uses SHA256 instead of MD5 by default.
 # while it's possible to set 'hash_type: md5', this is preferrable
 $master_finger = 
'f6:36:06:73:ca:54:55:c4:68:17:66:13:47:4b:cf:3e:32:71:7a:70:2d:69:b4:e8:3b:f0:d0:ae:d0:4b:4c:f5'
+} else {
+$master_finger = 'f6:1d:a7:1f:7e:12:10:40:75:d5:73:af:0c:be:7d:7c'
 }
 }
 $client_id = $::fqdn
diff --git a/modules/salt/lib/facter/saltversion.rb 
b/modules/salt/lib/facter/saltversion.rb
deleted file mode 100644
index 207bf2e..000
--- a/modules/salt/lib/facter/saltversion.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# saltversion.rb
-#
-# This fact fetches the installed salt-minion version from dpkg
-
-require 'facter'
-
-Facter.add(:saltversion) do
-  setcode do
-Facter::Util::Resolution.exec("dpkg-query -W -f='${Version}' salt-minion")
-  end
-end

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1847adf5ba6cca0e6da286d30eb36206235ba7e
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 
Gerrit-Reviewer: Andrew Bogott 
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] mediawiki...FileImporter[master]: WIP rolling back failed imports

2017-07-04 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363179 )

Change subject: WIP rolling back failed imports
..

WIP rolling back failed imports

Bug: T147451
Change-Id: I109520afdb96c87fb196c06e4746d022d973ea88
---
M extension.json
A src/Interfaces/ImportOperation.php
A src/Remote/MediaWiki/Operations/FileRevisionFromRemoteApi.php
M src/ServiceWiring.php
M src/Services/HttpRequestExecutor.php
M src/Services/HttpRequestFileChunkSaver.php
M src/Services/Importer.php
7 files changed, 181 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FileImporter 
refs/changes/79/363179/1

diff --git a/extension.json b/extension.json
index e739e1b..9bca9c8 100644
--- a/extension.json
+++ b/extension.json
@@ -41,6 +41,7 @@
"FileImporter\\Exceptions\\SourceUrlException": 
"src/Exceptions/SourceUrlException.php",
"FileImporter\\Exceptions\\TitleException": 
"src/Exceptions/TitleException.php",
"FileImporter\\Interfaces\\DetailRetriever": 
"src/Interfaces/DetailRetriever.php",
+   "FileImporter\\Interfaces\\ImportOperation": 
"src/Interfaces/ImportOperation.php",
"FileImporter\\Interfaces\\ImportTitleChecker": 
"src/Interfaces/ImportTitleChecker.php",
"FileImporter\\Interfaces\\SourceUrlChecker": 
"src/Interfaces/SourceUrlChecker.php",
"FileImporter\\Services\\DuplicateFileRevisionChecker": 
"src/Services/DuplicateFileRevisionChecker.php",
diff --git a/src/Interfaces/ImportOperation.php 
b/src/Interfaces/ImportOperation.php
new file mode 100644
index 000..16c3522
--- /dev/null
+++ b/src/Interfaces/ImportOperation.php
@@ -0,0 +1,26 @@
+plannedTitle = $plannedTitle;
+   $this->fileRevision = $fileRevision;
+   $this->httpRequestExecutor = $httpRequestExecutor;
+   $this->wikiRevisionFactory = $wikiRevisionFactory;
+   }
+
+   /**
+* Method to prepare an operation. This will not commit anything to any 
persistent storage.
+* For example, this could make API calls and validate data.
+* @return bool success
+*/
+   public function prepare() {
+   $fileUrl = $this->fileRevision->getField( 'url' );
+   if ( !Http::isValidURI( $fileUrl ) ) {
+   // invalid URL detected
+   return false;
+   }
+
+   $tmpFile = TempFSFile::factory( 'fileimporter_', '', 
wfTempDir() );
+   $tmpFile->bind( $this );
+
+   $this->httpRequestExecutor->executeAndSave( $fileUrl, 
$tmpFile->getPath() );
+
+   $this->wikiRevision = 
$this->wikiRevisionFactory->newFromFileRevision(
+   $this->fileRevision,
+   $tmpFile->getPath(),
+   true
+   );
+
+   // TODO this could have a logger injected?
+   $base = new FileImporterUploadBase( $this->plannedTitle, 
$this->wikiRevision->getFileSrc() );
+   $checkSuccess = $base->performChecks();
+
+   // FIXME: this will return null on some invalid / too long 
titles not currently checked earlier
+   $this->wikiRevision->setTitle( $base->getTitle() );
+
+   return $checkSuccess;
+   }
+
+   /**
+* Commit this operation to persistent storage.
+* @return bool success
+*/
+   public function commit() {
+   return $this->wikiRevision->importUpload();
+   }
+
+   /**
+* Rollback this operation to persistent storage.
+* @return bool success
+*/
+   public function rollback() {
+   // TODO: Implement rollback() method.
+   return false;
+   }
+}
\ No newline at end of file
diff --git a/src/ServiceWiring.php b/src/ServiceWiring.php
index 5c5c06b..5a98380 100644
--- a/src/ServiceWiring.php
+++ b/src/ServiceWiring.php
@@ -28,7 +28,8 @@
},
 
'FileImporterHttpRequestExecutor' => function ( MediaWikiServices 
$services ) {
-   $service = new HttpRequestExecutor();
+   $maxUploadSize = UploadBase::getMaxUploadSize( 'import' );
+   $service = new HttpRequestExecutor( $maxUploadSize );
$service->setLogger( LoggerFactory::getInstance( 'FileImporter' 
) );
return $service;
},
diff --git a/src/Services/HttpRequestExecutor.php 
b/src/Services/HttpRequestExecutor.php
index a70395c..2bdcfbf 100644
--- a/src/Services/HttpRequestExecutor.php
+++ b/src/Services/HttpRequestExecutor.php
@@ -21,8 +21,17 @@
 */
private $requestFactoryCallable;
 
-   public function __construct() {
+   /**
+* @var int|null
+*/
+   private $maxUploadSize;
+
+   /**
+* @param int|null $maxUploadSize in bytes, null for no 

[MediaWiki-commits] [Gerrit] operations...nodepool[debian]: 0.1.1-wmf8: add nodes with SSH host key verification

2017-07-04 Thread Hashar (Code Review)
Hashar has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363174 )

Change subject: 0.1.1-wmf8: add nodes with SSH host key verification
..


0.1.1-wmf8: add nodes with SSH host key verification

Antoine Musso (1):
  WMF: add nodes with SSH host key verification

Bug: T164543
Change-Id: If9d1795182a4de6d278bd2a5312e820af459039b
---
M debian/changelog
A debian/patches/0010-WMF-add-nodes-with-SSH-host-key-verification.patch
M debian/patches/series
3 files changed, 68 insertions(+), 0 deletions(-)

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



diff --git a/debian/changelog b/debian/changelog
index 3fc8cf9..f02618e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+nodepool (0.1.1-wmf8) jessie-wikimedia; urgency=medium
+
+  * Set SSH host key verification strategy to automatically trust it on
+initial connection.
+
+  0010-WMF-add-nodes-with-SSH-host-key-verification.patch
+  [60818fa] WMF: add nodes with SSH host key verification
+Antoine Musso 
+  Fix https://phabricator.wikimedia.org/T164543
+
+ -- Antoine Musso   Tue, 04 Jul 2017 13:45:59 +0200
+
 nodepool (0.1.1-wmf7) jessie-wikimedia; urgency=medium
 
   * constrain python-pbr to 0.8 from jessie
diff --git 
a/debian/patches/0010-WMF-add-nodes-with-SSH-host-key-verification.patch 
b/debian/patches/0010-WMF-add-nodes-with-SSH-host-key-verification.patch
new file mode 100644
index 000..9418b53
--- /dev/null
+++ b/debian/patches/0010-WMF-add-nodes-with-SSH-host-key-verification.patch
@@ -0,0 +1,55 @@
+From: Antoine Musso 
+Date: Tue, 4 Jul 2017 13:21:07 +0200
+Subject: WMF: add nodes with SSH host key verification
+
+Jenkins Ssh Slave plugin can checks the instances SSH host key on
+connection. There are four strategies available:
+
+1) Known hosts file Verification Strategy
+The default, reads ~/.ssh/known_hosts.  We can not collect them via
+puppet (there is no puppetmaster).
+
+2) Manually provided key Verification Strategy
+The ssh host key is provided on slave creation. Nodepool does not
+collect them when it polls the instance for SSH.
+
+3) Manually trusty key Verification Strategy
+Default to automatically trust the key on first connection.
+(strategy selected by this change)
+
+4) Non verifying Verification Strategy
+Does not verify anything.
+
+This patch change the node creation to pick (3) which would cause the
+SSH slave plugin to automatically trust the connection on the first
+connection.
+
+That should dismiss the security warning shown in Jenkins GUI:
+
+> SSH Host Key Verifiers are not configured for all SSH slaves on this
+> Jenkins instance. This could leave these slaves open to
+> man-in-the-middle attacks. Update your slave configuration to resolve
+> this.
+
+Bug: T164543
+Change-Id: Id2007ce6dc3b8b1e5aafe7dcc305c5abc143c79d
+---
+ nodepool/jenkins_manager.py | 5 +
+ 1 file changed, 5 insertions(+)
+
+diff --git a/nodepool/jenkins_manager.py b/nodepool/jenkins_manager.py
+index 92f3e0e..6ab1fbe 100644
+--- a/nodepool/jenkins_manager.py
 b/nodepool/jenkins_manager.py
+@@ -35,6 +35,11 @@ class CreateNodeTask(Task):
+'username': self.args['username'],
+'privatekey': self.args['private_key'],
+'host': self.args['host']}
++launcher_params['sshHostKeyVerificationStrategy'] = {
++'stapler-class': 
'hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy',
++# Auto accept host key on first connection
++'requireInitialManualTrust': False,
++}
+ args = dict(
+ name=self.args['name'],
+ numExecutors=self.args['executors'],
diff --git a/debian/patches/series b/debian/patches/series
index 8ce45db..5d12cc0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 0007-node-deletion-delay-is-now-configurable.patch
 0008-WMF-stop-triggering-ListFloatingIPsTask-entirely.patch
 0009-WMF-force-Jenkins-queries-to-use-POST.patch
+0010-WMF-add-nodes-with-SSH-host-key-verification.patch

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If9d1795182a4de6d278bd2a5312e820af459039b
Gerrit-PatchSet: 2
Gerrit-Project: operations/debs/nodepool
Gerrit-Branch: debian
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Muehlenhoff 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations...nodepool[patch-queue/debian]: WMF: add nodes with SSH host key verification

2017-07-04 Thread Hashar (Code Review)
Hashar has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363170 )

Change subject: WMF: add nodes with SSH host key verification
..


WMF: add nodes with SSH host key verification

Jenkins Ssh Slave plugin can checks the instances SSH host key on
connection. There are four strategies available:

1) Known hosts file Verification Strategy
The default, reads ~/.ssh/known_hosts.  We can not collect them via
puppet (there is no puppetmaster).

2) Manually provided key Verification Strategy
The ssh host key is provided on slave creation. Nodepool does not
collect them when it polls the instance for SSH.

3) Manually trusty key Verification Strategy
Default to automatically trust the key on first connection.
(strategy selected by this change)

4) Non verifying Verification Strategy
Does not verify anything.

This patch change the node creation to pick (3) which would cause the
SSH slave plugin to automatically trust the connection on the first
connection.

That should dismiss the security warning shown in Jenkins GUI:

> SSH Host Key Verifiers are not configured for all SSH slaves on this
> Jenkins instance. This could leave these slaves open to
> man-in-the-middle attacks. Update your slave configuration to resolve
> this.

Bug: T164543
Change-Id: Id2007ce6dc3b8b1e5aafe7dcc305c5abc143c79d
---
M nodepool/jenkins_manager.py
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/nodepool/jenkins_manager.py b/nodepool/jenkins_manager.py
index 92f3e0e..6ab1fbe 100644
--- a/nodepool/jenkins_manager.py
+++ b/nodepool/jenkins_manager.py
@@ -35,6 +35,11 @@
'username': self.args['username'],
'privatekey': self.args['private_key'],
'host': self.args['host']}
+launcher_params['sshHostKeyVerificationStrategy'] = {
+'stapler-class': 
'hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy',
+# Auto accept host key on first connection
+'requireInitialManualTrust': False,
+}
 args = dict(
 name=self.args['name'],
 numExecutors=self.args['executors'],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2007ce6dc3b8b1e5aafe7dcc305c5abc143c79d
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/nodepool
Gerrit-Branch: patch-queue/debian
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Muehlenhoff 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   >