[MediaWiki-commits] [Gerrit] labs/striker[master]: Add links to user's accounts to membership request

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

Change subject: Add links to user's accounts to membership request
..


Add links to user's accounts to membership request

Make checking up on the validity of a membership request a bit easier by
providing links to the user's wikitech user page, and if known their SUL
account status and phabricator profile.

Bug: T162508
Change-Id: Ic052c413c57306d96c249e6edd80400e66fd2086
---
M striker/templates/tools/membership/status.html
M striker/tools/views.py
2 files changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/striker/templates/tools/membership/status.html 
b/striker/templates/tools/membership/status.html
index f697fd7..2bc658b 100644
--- a/striker/templates/tools/membership/status.html
+++ b/striker/templates/tools/membership/status.html
@@ -19,7 +19,16 @@
 
   
 {% trans "User" %}
-{{ app.user }}
+{{ app.user }} ({{ app.user.shellname }})
+
+  {% trans "wikitech" %}
+  {% if app.user.sulname %}
+  | {% trans "SUL" %}
+  {% endif %}
+  {% if app.user.phaburl %}
+  | {% trans "phab" %}
+  {% endif %}
+
 {% trans "Status" %}
 {{ app.get_status_display }}
 {% trans "Reason" %}
diff --git a/striker/tools/views.py b/striker/tools/views.py
index d0afa28..1541beb 100644
--- a/striker/tools/views.py
+++ b/striker/tools/views.py
@@ -340,5 +340,7 @@
 ctx = {
 'app': request,
 'form': form,
+'wikitech': settings.WIKITECH_URL,
+'meta': settings.OAUTH_MWURL,
 }
 return shortcuts.render(req, 'tools/membership/status.html', ctx)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic052c413c57306d96c249e6edd80400e66fd2086
Gerrit-PatchSet: 2
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Andrew Bogott 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Madhuvishy 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Tim Landscheidt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable EtcdConfig in production

2017-04-30 Thread Tim Starling (Code Review)
Tim Starling has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351132 )

Change subject: Enable EtcdConfig in production
..

Enable EtcdConfig in production

Ideally, Iae175401da8d should be present before deployment, but failing
that, the relevant variables can just be set to false instead of null.

Before this change is deployed, I3391f700328cdf02d should be merged and
deployed, and the etcd keys initialised.

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


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 2794a57..09ea4b0 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -99,13 +99,8 @@
 # Shorthand when we have no master-slave situation to keep into account
 $wmfLocalServices = $wmfAllServices[$wmfDatacenter];
 
-# Labs-only for testing, eventually etcd.php will be used in production as well
-if ( $wmfRealm === 'labs' ) {
-   # Get configuration from etcd. This gives us the correct 
$wmfMasterDatacenter
-   require "$wmfConfigDir/etcd.php";
-} else {
-   $wmfMasterDatacenter = 'codfw';
-}
+# Get configuration from etcd. This gives us the correct $wmfMasterDatacenter
+require "$wmfConfigDir/etcd.php";
 
 $wmfMasterServices = $wmfAllServices[$wmfMasterDatacenter];
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74b332c6c4af72085bd21479009ff2f2dadbb9eb
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Tim Starling 

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Create SWAT gate and submit pipeline

2017-04-30 Thread Thcipriani (Code Review)
Thcipriani has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351131 )

Change subject: Create SWAT gate and submit pipeline
..

Create SWAT gate and submit pipeline

This creates a new pipeline for wmf branches. Using branch regular
expressions with a negative lookahead allows you to duplicate the
gate and submit pipeline for all job templates and if the change is
being made to a wmf branch, then have that change be handled in a
different pipeline. This ensures that during SWAT changes to wmf
branches will fall into the gate-and-submit-swat pipeline while still
allowing changes to run as normal on the gate-and-submit pipeline.

Bug: T160668

Change-Id: I7f1ececaef4acf5729c8f3d9ba93c0617f27ca0c
---
M tests/test_zuul_scheduler.py
M zuul/layout.yaml
2 files changed, 81 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/31/351131/1

diff --git a/tests/test_zuul_scheduler.py b/tests/test_zuul_scheduler.py
index b41aa54..926bf31 100644
--- a/tests/test_zuul_scheduler.py
+++ b/tests/test_zuul_scheduler.py
@@ -343,6 +343,23 @@
 self.assertEquals(expected, actual,
   "No project have unsafe jobs in check* pipelines")
 
+def test_gate_and_submit_swat(self):
+gs_swat_manager = self.getPipeline('gate-and-submit-swat').manager
+gs_manager = self.getPipeline('gate-and-submit').manager
+
+change = zuul.model.Change('mediawiki/core')
+change.branch = 'wmf/1.29.0-wmf.20'
+
+event = zuul.model.TriggerEvent()
+event.type = 'comment-added'
+event.comment = 'Patch Set 1: Code-Review+2'
+event.branch = change.branch
+event.approvals = [{
+'description': 'Code-Review', 'type': 'CRVW', 'value': '2'}]
+
+self.assertTrue(gs_swat_manager.eventMatches(event, change))
+self.assertFalse(gs_manager.eventMatches(event, change))
+
 def test_recheck_comment_trusted_user(self):
 test_manager = self.getPipeline('test').manager
 
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 1cb74ce..9576270 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -559,7 +559,8 @@
   #
   # WARNING: Also update the "gate" pipeline when changing this one.
   #
-  - name: gate-and-submit
+  - _and_submit_pipeline
+name: gate-and-submit
 description: >
   Patchsets that have been reviewed. Will be merged by Jenkins if tests 
pass.
 manager: DependentPipelineManager
@@ -570,7 +571,8 @@
 trigger:
   gerrit:
 - event: comment-added
-  branch: (?!^refs/meta/config)
+  branch:
+   - (?!^(refs/meta/config|wmf/\d\.\d{2}\.\d-wmf\.\d{1,2}))
   email:
- ^(?!l10n-bot@translatewiki\.net).*$
   approval:
@@ -588,6 +590,17 @@
 failure:
   gerrit:
 verified: -1
+
+  - !!merge : *gate_and_submit_pipeline
+name: gate-and-submit-swat
+trigger:
+  gerrit:
+- event: comment-added
+  branch: wmf/\d\.\d{2}\.\d-wmf\.\d{1,2}
+  email:
+   - ^(?!l10n-bot@translatewiki\.net).*$
+  approval:
+- code-review: 2
 
   - name: postmerge
 description: Jobs triggered after a change has been merged.
@@ -889,10 +902,11 @@
  - mwext-testextension-hhvm-composer-jessie
 php5:
  - mwext-testextension-php55-composer-trusty
-gate-and-submit:
+gate-and-submit: 
  - mwgate-php55lint
  - mwext-testextension-php55-composer-trusty
  - mwext-testextension-hhvm-composer-jessie
+gate-and-submit-swat: *extension-unittests-composer-gate-and-submit
 experimental:
  - mwext-qunit-composer-jessie
  - mwgate-npm-node-6-jessie
@@ -911,8 +925,11 @@
 php5:
  - mwext-testextension-php55-composer-trusty-non-voting
 gate-and-submit:
+ 
  - mwgate-php55lint
  - mwgate-composer-validate
+gate-and-submit-swat:
+ *extension-unittests-composer-non-voting-gate-and-submit
 experimental:
  - mwext-qunit-composer-jessie
  - mwgate-composer-hhvm-jessie
@@ -930,12 +947,13 @@
  - mwgate-composer-validate
 php5:
  - mwext-testextension-php55-trusty
-gate-and-submit:
+gate-and-submit: 
  - mwgate-php55lint
  # Extensions tests with core+vendor
  - mwext-testextension-php55-trusty
  - mwext-testextension-hhvm-jessie
  - mwgate-composer-validate
+gate-and-submit-swat: *extension-unittests-generic-gate-and-submit
 experimental:
   - mediawiki-extensions-hhvm-jessie
   - mediawiki-extensions-qunit-jessie
@@ -956,10 +974,11 @@
  - mwgate-composer-validate
 php5:
  - mwext-testextension-php55-trusty-non-voting
-gate-and-submit:
+gate-and-submit: 
  - noop
  - mwgate-php55lint
  - mwgate-composer-validate
+gate-and-submit-swat: *extension-unittests-non-voting-gate-and-submit
 experimental:
 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Use EtcdConfig in beta cluster only

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

Change subject: Use EtcdConfig in beta cluster only
..


Use EtcdConfig in beta cluster only

Prototype for production deployment.

Fetch $wgReadOnly and $wmfMasterDatacenter from etcd. Avoid MultiConfig
for now, to avoid slowing down Config::get() calls.

Bug: T156924
Bug: T163398
Change-Id: I23d4e7da0544e27bb3a4ad84f6f2ef195162fb2c
---
A docroot/noc/conf/etcd.php.txt
M docroot/noc/createTxtFileSymlinks.sh
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
M wmf-config/LabsServices.php
M wmf-config/ProductionServices.php
A wmf-config/etcd.php
7 files changed, 62 insertions(+), 24 deletions(-)

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



diff --git a/docroot/noc/conf/etcd.php.txt b/docroot/noc/conf/etcd.php.txt
new file mode 12
index 000..173e8a7
--- /dev/null
+++ b/docroot/noc/conf/etcd.php.txt
@@ -0,0 +1 @@
+../../../wmf-config/etcd.php
\ No newline at end of file
diff --git a/docroot/noc/createTxtFileSymlinks.sh 
b/docroot/noc/createTxtFileSymlinks.sh
index db9fa37..982aca1 100755
--- a/docroot/noc/createTxtFileSymlinks.sh
+++ b/docroot/noc/createTxtFileSymlinks.sh
@@ -17,6 +17,7 @@
db-codfw.php
db-eqiad.php
db-labs.php
+   etcd.php
FeaturedFeedsWMF.php
filebackend.php
flaggedrevs.php
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 839e219..2794a57 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -51,10 +51,6 @@
 
 set_include_path( "$IP:/usr/local/lib/php:/usr/share/php" );
 
-# Master datacenter
-# The datacenter from which we serve traffic.
-$wmfMasterDatacenter = 'codfw';
-
 ### List of some service hostnames
 # 'meta': meta wiki for user editable content
 # 'upload'  : hostname where files are hosted
@@ -100,6 +96,19 @@
require "$wmfConfigDir/ProductionServices.php";
 }
 
+# Shorthand when we have no master-slave situation to keep into account
+$wmfLocalServices = $wmfAllServices[$wmfDatacenter];
+
+# Labs-only for testing, eventually etcd.php will be used in production as well
+if ( $wmfRealm === 'labs' ) {
+   # Get configuration from etcd. This gives us the correct 
$wmfMasterDatacenter
+   require "$wmfConfigDir/etcd.php";
+} else {
+   $wmfMasterDatacenter = 'codfw';
+}
+
+$wmfMasterServices = $wmfAllServices[$wmfMasterDatacenter];
+
 # Must be set before InitialiseSettings.php:
 $wmfUdp2logDest = $wmfLocalServices['udp2log'];
 
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index fdee8f9..775e521 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4765,14 +4765,6 @@
'wikivoyage' => 'wikivoyage',
 ],
 
-'wgReadOnly' => [
-   'default' => null,
-],
-
-'wgReadOnlyFile' => [
-   'default' => false,
-],
-
 # wgTranslateNumerals @{
 'wgTranslateNumerals' => [
'default' => true,
diff --git a/wmf-config/LabsServices.php b/wmf-config/LabsServices.php
index 4476505..5453d95 100644
--- a/wmf-config/LabsServices.php
+++ b/wmf-config/LabsServices.php
@@ -33,6 +33,7 @@
'rdb1' => '10.68.16.177', // 
deployment-redis01.deployment-prep.eqiad.wmflabs
'rdb2' => '10.68.16.231', // 
deployment-redis02.deployment-prep.eqiad.wmflabs
],
+   'etcd' => 'deployment-etcd-01.deployment-prep.eqiad.wmflabs:2379',
 ];
 
 ### Logstash
@@ -53,9 +54,3 @@
 $wmfAllServices['eqiad']['poolcounter'] = [
'10.68.17.48', # deployment-poolcounter04.deployment-prep.eqiad.wmflabs
 ];
-
-
-# Shorthand when we have no master-slave situation to keep into account
-$wmfLocalServices = $wmfAllServices['eqiad'];
-
-$wmfMasterServices = $wmfAllServices['eqiad'];
diff --git a/wmf-config/ProductionServices.php 
b/wmf-config/ProductionServices.php
index fb7a32a..e32d91d 100644
--- a/wmf-config/ProductionServices.php
+++ b/wmf-config/ProductionServices.php
@@ -23,6 +23,7 @@
'eventbus' => 'http://eventbus.discovery.wmnet:8085',
'upload' => 'upload.svc.eqiad.wmnet',
'cxserver' => 'http://cxserver.discovery.wmnet:8080',
+   'etcd' => '_etcd._tcp.eqiad.wmnet',
 ];
 
 $wmfAllServices['codfw'] = [
@@ -37,6 +38,7 @@
'eventbus' => 'http://eventbus.discovery.wmnet:8085',
'upload' => 'upload.svc.codfw.wmnet',
'cxserver' => 'http://cxserver.discovery.wmnet:8080',
+   'etcd' => '_etcd._tcp.codfw.wmnet',
 ];
 
 ### Logstash
@@ -138,9 +140,3 @@
'rdb2003.codfw.wmnet:6378', // fallback
'rdb2005.codfw.wmnet:6378', // fallback
 ];
-
-
-# Shorthand when we have no master-slave situation to keep into account
-$wmfLocalServices = $wmfAllServices[$wmfDatacenter];
-
-$wmfMasterServices = $wmfAllServices[$wmfMasterDatacenter];
diff --git a/wmf-config/etcd.php b/wmf-config/etcd.php
new 

[MediaWiki-commits] [Gerrit] integration/config[master]: Add TerraCodes to CI whitelist

2017-04-30 Thread EddieGP (Code Review)
EddieGP has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351130 )

Change subject: Add TerraCodes to CI whitelist
..

Add TerraCodes to CI whitelist

(S)he's doing some mass migration work, see
https://gerrit.wikimedia.org/r/#/q/owner:terracodes

While at it, also move myself around (sort alphabetically by start of
mail adress, not user name).

Change-Id: If87a403b2aac943917835a9eb7e15b6520681e68
---
M zuul/layout.yaml
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/30/351130/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 1cb74ce..d9b2d47 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -207,6 +207,7 @@
 | strigiwm@gmail\.com
 | sucheta\.ghoshal@gmail\.com
 | tamaraslosarek@gmail\.com
+| terracodes@outlook\.com
 | tasneem\.lo\.31@gmail\.com
 | thalia\.e\.chan@googlemail\.com
 | thomasmulhall410@yahoo\.com
@@ -347,7 +348,6 @@
- ^dereckson@espace-win\.org$
- ^devunt@gmail\.com$
- ^ebrahim@gnu\.org$
-   - ^wikimedia\.org@eddie-sh\.de$ # EddieGP
- ^eloquence@gmail\.com$
- ^eranroz89@gmail\.com$ # Eran Roz
- ^federicoleva@tiscali\.it$ # Nemo bis
@@ -421,6 +421,7 @@
- ^thomasmulhall410@yahoo\.com$ # Paladox T114528
- ^thomaspt@hotmail\.fr$
- ^at\.light@live\.com\.au$ # This, that and the other
+   - ^terracodes@outlook\.com$ # TerraCodes
- ^tomasz@twkozlowski\.com$
- ^01tonythomas@gmail\.com$
- ^tim@tim-landscheidt\.de$
@@ -434,6 +435,7 @@
- ^w@mzmcbride\.com$
- ^wctaiwan@gmail\.com$
- ^wiki@physikerwelt\.de$
+   - ^wikimedia\.org@eddie-sh\.de$ # EddieGP
- ^wirth@hallowelt\.biz$ # Pwirth
- ^yaron57@gmail\.com$
- ^zhorishna@gmail\.com$ # Isarra

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Further removal of class_api3 call in favour of civicrm_api3.

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

Change subject: Further removal of class_api3 call in favour of civicrm_api3.
..

Further removal of class_api3 call in favour of civicrm_api3.

In this case fix the initial option value creation routine

This should only really affect dev instances as this is all 'done' on live.

Change-Id: If4e0c50705c4ea8da9db0d6eeb2f3daf88ea96f0
---
M sites/all/modules/wmf_civicrm/bootstrap.inc
1 file changed, 12 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/28/351128/1

diff --git a/sites/all/modules/wmf_civicrm/bootstrap.inc 
b/sites/all/modules/wmf_civicrm/bootstrap.inc
index 4bba64b..7e93088 100644
--- a/sites/all/modules/wmf_civicrm/bootstrap.inc
+++ b/sites/all/modules/wmf_civicrm/bootstrap.inc
@@ -93,32 +93,22 @@
  */
 function wmf_civicrm_create_option_values_detailed($group_name, $values)
 {
-$api = wmf_civicrm_bootstrap_civi();
-
-$api->OptionGroup->Get(array(
-  'name' => $group_name,
-));
-$result = $api->values();
-$option_group = array_pop($result);
+civicrm_initialize();
 foreach ($values as $key => $value)
 {
-$params = array_merge(array(
-  'option_group_id' => $option_group->id,
+$params = array(
+  'option_group_id' => $group_name,
   'name' => $key,
-  'label' => $key,
-  'is_active' => 1,
-), $value);
+  'debug' => 1,
+  'values' => array(array_merge(array(
+'option_group_id' => $group_name,
+'name' => $key,
+'label' => $key,
+'is_active' => 1,
+  ), $value))
+);
 
-$api->OptionValue->Get(array(
-  'option_group_id' => $option_group->id,
-  'name' => $params['name'],
-));
-
-$result = $api->values();
-if (empty($result))
-{
-$api->OptionValue->Create($params);
-}
+civicrm_api3('OptionValue', 'replace', $params);
 }
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Further removal of class_api3 call in favour of civicrm_api3.

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

Change subject: Further removal of class_api3 call in favour of civicrm_api3.
..

Further removal of class_api3 call in favour of civicrm_api3.

Change-Id: Ie512256c49b0fb1438d8004571b7f9fbbf63cf7e
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 19 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/29/351129/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index ef2b81f..71cac41 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -294,21 +294,20 @@
 
 // Look up soft credit contact.
 if ( !empty( $msg['soft_credit_to'] ) ) {
-$api = civicrm_api_classapi();
-$success = $api->Contact->Get( array(
-'organization_name' => $msg['soft_credit_to'],
 
-'version' => 3,
+$result = civicrm_api3('Contact', 'Get', array(
+'organization_name' => $msg['soft_credit_to'],
+'sequential' => 1,
 ) );
-if ( count( $api->values ) !== 1 ) {
+if ( $result['count'] !== 1 ) {
 throw new WmfException(
 'INVALID_MESSAGE',
 "Bad soft credit target, [${msg['soft_credit_to']}]"
 );
 }
-$soft_credit_contact = $api->values[0];
+$soft_credit_contact = $result['values'][0];
 # FIXME: awkward to have the two fields.
-$msg['soft_credit_to_id'] = $soft_credit_contact->id;
+$msg['soft_credit_to_id'] = $soft_credit_contact['id'];
 }
 
 // Insert the contribution record.
@@ -2966,18 +2965,19 @@
$contact_id = $contribution->contact_id;
$total_amount = $contribution->total_amount;
} else {
-   $api = civicrm_api_classapi();
-   $result = $api->Contribution->get( array(
-   'id' => $contribution->id,
-   ) );
-   if ( !$result || count( $api->values ) != 1 ) {
-   // can't get the data, skip wmf_donor updates
-   break;
-   }
-   $db_contribution = $api->values[0];
-   $receive_date = $db_contribution->receive_date;
-   $contact_id = $db_contribution->contact_id;
-   $total_amount = $db_contribution->total_amount;
+ try {
+$db_contribution = civicrm_api3('Contribution', 'getsingle', array(
+  'id' => $contribution->id,
+  'return' => array('contact_id', 'total_amount', 'receive_date'),
+));
+  }
+  catch (CiviCRM_API3_Exception $e) {
+// can't get the data, skip wmf_donor updates
+break;
+  }
+   $receive_date = $db_contribution['receive_date'];
+   $contact_id = $db_contribution['contact_id'];
+   $total_amount = $db_contribution['total_amount'];
}
 
// Update the wmf_donor data.  Set the is__donor column to 
true

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Further removal of class_api3 call in favour of civicrm_api3

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

Change subject: Further removal of class_api3 call in favour of civicrm_api3
..

Further removal of class_api3 call in favour of civicrm_api3

class_api is causing test failures when the updated mysqli driver tries to free 
memory

This replacement promotes the use of wmf_civicrm_get_option() as a cached 
methodology
to retrieve an option for any field. There is actually caching at the api level
so the extra caching here is probably of marginal benefit, but I am replacing a 
statically cached call.

Change-Id: I2b78783f87a5f352b85b3adce2dbd8f203682136
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 21 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/27/351127/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index ef2b81f..eb08c4b 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -83,7 +83,7 @@
 
 function civicrm_api_contribution_status($key = null)
 {
-   return civicrm_api_option_group('contribution_status', $key);
+return wmf_civicrm_get_option('Contribution', 'contribution_status_id', 
$key);
 }
 
 function civicrm_api_classapi()
@@ -3423,8 +3423,26 @@
  * @throws \CiviCRM_API3_Exception
  */
 function wmf_civicrm_get_options($entity, $field) {
-$options = civicrm_api3($entity, 'getoptions', array('field' => $field));
-return $options['values'];
+if (!isset(\Civi::$statics['wmf_civicrm'][$entity][$field])) {
+  $options = civicrm_api3($entity, 'getoptions', array('field' => $field));
+  \Civi::$statics['wmf_civicrm'][$entity][$field] = $options['values'];
+}
+return \Civi::$statics['wmf_civicrm'][$entity][$field];
+}
+
+/**
+ * Get options for a field.
+ *
+ * @param string $entity
+ * @param string $field
+ * @param string $key
+ *
+ * @return array
+ * @throws \CiviCRM_API3_Exception
+ */
+function wmf_civicrm_get_option($entity, $field, $key) {
+  $options = wmf_civicrm_get_options($entity, $field);
+  return array_search($key, $options);
 }
 
 /**

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Further removal of class_api3 call in favour of civicrm_api3.

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

Change subject: Further removal of class_api3 call in favour of civicrm_api3.
..

Further removal of class_api3 call in favour of civicrm_api3.

class_api is causing test failures when the updated mysqli driver tries to free 
memory

Change-Id: If4540d942f4c35399c38d908d4ee42fe59099622
---
M sites/all/modules/queue2civicrm/recurring/RecurringQueueConsumer.php
1 file changed, 17 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/26/351126/1

diff --git 
a/sites/all/modules/queue2civicrm/recurring/RecurringQueueConsumer.php 
b/sites/all/modules/queue2civicrm/recurring/RecurringQueueConsumer.php
index eb366ca..22e0fad 100644
--- a/sites/all/modules/queue2civicrm/recurring/RecurringQueueConsumer.php
+++ b/sites/all/modules/queue2civicrm/recurring/RecurringQueueConsumer.php
@@ -153,7 +153,6 @@
}
 
// update subscription record with next payment date
-   $api = civicrm_api_classapi();
if ( isset( $msg['date'] ) ) {
$date = $msg['date'];
} else {
@@ -163,10 +162,8 @@
$update_params = array(
'next_sched_contribution_date' => 
wmf_common_date_unix_to_civicrm( strtotime( "+" . 
$recur_record->frequency_interval . " " . $recur_record->frequency_unit, $date 
)),
'id' => $recur_record->id,
-
-   'version' => 3,
);
-   $api->ContributionRecur->Create( $update_params );
+   civicrm_api3('ContributionRecur', 'Create', $update_params);
 
// construct an array of useful info to invocations of 
queue2civicrm_import
$contribution_info = array(
@@ -233,26 +230,23 @@
// Insert the location record
wmf_civicrm_message_location_insert( $msg, $contact );
 
-   $api = civicrm_api_classapi();
-   $insert_params = array(
-   'contact_id' => $contact[ 'id' ],
-   'currency' => $msg[ 'original_currency' ],
-   'amount' => $msg[ 'original_gross' ],
-   'frequency_unit' => $msg[ 'frequency_unit' ],
-   'frequency_interval' => $msg[ 'frequency_interval' ],
-   'installments' => $msg[ 'installments' ],
-   'start_date' => wmf_common_date_unix_to_civicrm( $msg[ 
'start_date' ] ),
-   'create_date' => wmf_common_date_unix_to_civicrm( $msg[ 
'create_date' ] ),
-   'trxn_id' => $msg[ 'subscr_id' ],
-
-   'version' => 3,
-   );
-
-   if ( !$api->ContributionRecur->Create( $insert_params ) ) {
-   throw new WmfException( 'IMPORT_CONTRIB', 'Failed 
inserting subscriber signup for subscriber id: ' . print_r( $msg['subscr_id'], 
true ) . ': ' . $api->errorMsg() );
-   } else {
+try {
+  $result = civicrm_api3('ContributionRecur', 'create', array(
+'contact_id' => $contact['id'],
+'currency' => $msg['original_currency'],
+'amount' => $msg['original_gross'],
+'frequency_unit' => $msg['frequency_unit'],
+'frequency_interval' => $msg['frequency_interval'],
+'installments' => $msg['installments'],
+'start_date' => wmf_common_date_unix_to_civicrm($msg['start_date']),
+'create_date' => wmf_common_date_unix_to_civicrm($msg['create_date']),
+'trxn_id' => $msg['subscr_id'],
+  ));
+}
+catch (\CiviCRM_API3_Exception $e) {
+  throw new WmfException( 'IMPORT_CONTRIB', 'Failed inserting subscriber 
signup for subscriber id: ' . print_r( $msg['subscr_id'], true ) . ': ' . 
$e->getMessage());
+}
watchdog( 'recurring', 'Succesfully inserted 
subscription signup for subscriber id: %subscr_id ', array( '%subscr_id' => 
print_r( $msg[ 'subscr_id' ], true )), WATCHDOG_NOTICE );
-   }
}
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Refreshed[master]: Allowing on-site override of default logged-in/anon icons, c...

2017-04-30 Thread MtMNC (Code Review)
MtMNC has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351125 )

Change subject: Allowing on-site override of default logged-in/anon icons, 
cleanup
..

Allowing on-site override of default logged-in/anon icons, cleanup

This commit allows the default logged-in/anon icons to be overriden through two 
system messages (refreshed-icon-logged-in and refreshed-icon-logged-out). If 
the appropriate message for the current situation is not empty (and 
SocialProfile is not installed), the message's contents are placed in the src 
of the avatar img element, overriding the default WikiFont logged-in/anon 
icons. The avatar logic has also been cleaned up to reduce redundancy. Finally, 
the avatar img element no longer has a hard-coded width attribute as this is 
already handled with CSS (which allows for more on-site customization).

Bug: T163961
Change-Id: I7851c5f63282b951c6b0b5baa59f84f8fa088d48
---
M Refreshed.skin.php
M skin.json
2 files changed, 28 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Refreshed 
refs/changes/25/351125/1

diff --git a/Refreshed.skin.php b/Refreshed.skin.php
index 851aa06..37f30c0 100644
--- a/Refreshed.skin.php
+++ b/Refreshed.skin.php
@@ -296,35 +296,44 @@
 


+   
data['loggedin'] 
? $user->getName() : $this->getMsg( 'login' )->text();
// Show the user's avatar image in the 
top left drop-down
// menu, but only if SocialProfile is 
installed
if ( class_exists( 'wAvatar' ) ) {
$avatar = new wAvatar( 
$user->getId(), 'l' );
-   $avatarImage = 
$avatar->getAvatarURL( array(
-   'width' => 30,
+   $avatarElement = 
$avatar->getAvatarURL( array(
'class' => 'avatar'
) );
-   ?>
-   
-   
-   getName() ?>
-   data['loggedin'] ) { 
// if no SocialProfile but user is logged in
-   ?>
-   
-   
-   getName() ?>
-   getMsg( 
'refreshed-icon-logged-in' )->isBlank() ) { //if wiki has not set a custom 
image for logged in users
+   $avatarElement = 
Html::element( 'span', array(
+   'class' => 
'avatar-no-socialprofile wikiglyph wikiglyph-user-smile'
+   ) );
+   } else { //if wiki has set 
custom image for logged in users
+   $avatarElement = 
Html::element( 'img', array(
+   'src' => 
$this->getMsg( 'refreshed-icon-logged-in' )->escaped(),
+   'class' => 
'avatar'
+   ) );
+   }
} else { // if no SocialProfile but 
user is not logged in
-   ?>
-   
-   
-   getMsg( 'login' )->text() 
?>
-   getMsg( 
'refreshed-icon-logged-out' )->isBlank() ) { //if wiki has not set a custom 
image for logged out users
+   $avatarElement = 
Html::element( 'span', array(
+   'class' => 
'avatar-no-socialprofile wikiglyph wikiglyph-user-sleep'
+   ) );
+   } else { //if wiki has set 
custom image for logged in users
+   $avatarElement = 
Html::element( 'img', array(
+   'src' => 
$this->getMsg( 'refreshed-icon-logged-out' )->escaped(),
+

[MediaWiki-commits] [Gerrit] operations/puppet[production]: toollabs: ensure default hhvm service is stopped

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

Change subject: toollabs: ensure default hhvm service is stopped
..

toollabs: ensure default hhvm service is stopped

We have HHVM installed on all exec nodes. The deb file sets up a demon
process running hhvm as the www-data user that we are not actually using
for anything.

Bug: T78783
Change-Id: I0e8ef377cdb17b566dfd9328dd9d24e350231632
---
M modules/toollabs/manifests/exec_environ.pp
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/24/351124/1

diff --git a/modules/toollabs/manifests/exec_environ.pp 
b/modules/toollabs/manifests/exec_environ.pp
index 29b3365..42874ba 100644
--- a/modules/toollabs/manifests/exec_environ.pp
+++ b/modules/toollabs/manifests/exec_environ.pp
@@ -414,4 +414,11 @@
 'vm.overcommit_ratio'  => 95,
 },
 }
+
+# The hhvm deb starts a demon process automatically that we don't need
+# running.
+service { 'hhvm':
+ensure  => 'stopped',
+require => Package['hhvm'],
+}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikispeech[master]: Hotfix for c40dbee

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

Change subject: Hotfix for c40dbee
..


Hotfix for c40dbee

Implemented some feedback that was given after the merge:
* Changed back to using POST instead of GET.
* Changed callback functions from deprecated ones.

Change-Id: I2fd4a09b8b79df51130435e421aae58d0bfc97b4
---
M modules/ext.wikispeech.js
M tests/qunit/ext.wikispeech.test.js
2 files changed, 12 insertions(+), 11 deletions(-)

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



diff --git a/modules/ext.wikispeech.js b/modules/ext.wikispeech.js
index e828851..298e2df 100644
--- a/modules/ext.wikispeech.js
+++ b/modules/ext.wikispeech.js
@@ -780,6 +780,7 @@
var serverUrl = mw.config.get( 'wgWikispeechServerUrl' 
);
$.ajax( {
url: serverUrl,
+   method: 'POST',
data: {
// jscs:disable 
requireCamelCaseOrUpperCaseIdentifiers
lang: mw.config.get( 
'wgPageContentLanguage' ),
@@ -789,23 +790,23 @@
},
dataType: 'json',
beforeSend: function ( jqXHR, settings ) {
-   mw.log( 'Sending request:', 
settings.url );
+   mw.log( 'Sending request: ' + 
settings.url + '?' + settings.data );
$utterance.prop( 'waitingForResponse', 
true );
-   },
-   success: function ( data ) {
+   }
+   } )
+   .done( function ( data ) {
mw.log( 'Response received:', data );
callback( data );
-   },
-   error: function ( jqXHR, textStatus ) {
+   } )
+   .fail( function ( jqXHR, textStatus ) {
mw.log.warn(
'Request failed, error type "' 
+ textStatus + '":',
this.url
);
-   },
-   complete: function () {
+   } )
+   .always( function () {
$utterance.prop( 'waitingForResponse', 
false );
-   }
-   } );
+   } );
};
 
/**
diff --git a/tests/qunit/ext.wikispeech.test.js 
b/tests/qunit/ext.wikispeech.test.js
index 147a25c..21c13aa 100644
--- a/tests/qunit/ext.wikispeech.test.js
+++ b/tests/qunit/ext.wikispeech.test.js
@@ -166,8 +166,8 @@
 
assert.strictEqual( wikispeech.requestTts.called, true );
assert.strictEqual(
-   server.requests[ 0 ].url,
-   
'http://server.url/wikispeech/?lang=en_type=text=An%20utterance.'
+   server.requests[ 0 ].requestBody,
+   'lang=en_type=text=An+utterance.'
);
} );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fd4a09b8b79df51130435e421aae58d0bfc97b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikispeech
Gerrit-Branch: master
Gerrit-Owner: Sebastian Berlin (WMSE) 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Lokal Profil 
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...LoginNotify[master]: Switch TestingAccessWrapper to librarized version

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

Change subject: Switch TestingAccessWrapper to librarized version
..


Switch TestingAccessWrapper to librarized version

Bug: T163434
Change-Id: I3bd4a725291c8d0d10ff002c481064fe67f8df39
Depends-On: I52cc257e593da3d6c3b01a909e554a950225aec8
---
M tests/phpunit/LoginNotifyTests.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/tests/phpunit/LoginNotifyTests.php 
b/tests/phpunit/LoginNotifyTests.php
index 7999aca..0d85b0a 100644
--- a/tests/phpunit/LoginNotifyTests.php
+++ b/tests/phpunit/LoginNotifyTests.php
@@ -1,5 +1,7 @@
 https://gerrit.wikimedia.org/r/349101
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3bd4a725291c8d0d10ff002c481064fe67f8df39
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Krinkle 
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] operations/puppet[production]: Make mediawiki-firejail-ghostscript quiet

2017-04-30 Thread Code Review
Gergő Tisza has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351123 )

Change subject: Make mediawiki-firejail-ghostscript quiet
..

Make mediawiki-firejail-ghostscript quiet

It seems that firejail uses stdout to output status information
which causes a major mess when the output is piped.

Bug: T164145
Change-Id: I87fe9b8ee762af94ebd52e71c8c75f4f7ca36f70
---
M modules/mediawiki/files/mediawiki-firejail-ghostscript
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/23/351123/1

diff --git a/modules/mediawiki/files/mediawiki-firejail-ghostscript 
b/modules/mediawiki/files/mediawiki-firejail-ghostscript
index da5ba0f..8ec2795 100755
--- a/modules/mediawiki/files/mediawiki-firejail-ghostscript
+++ b/modules/mediawiki/files/mediawiki-firejail-ghostscript
@@ -2,4 +2,4 @@
 # -*- coding: utf-8 -*-
 
 import sys, subprocess
-subprocess.call(['/usr/bin/firejail', 
'--profile=/etc/firejail/mediawiki-converters.profile', '/usr/bin/gs'] + 
sys.argv[1:])
+subprocess.call(['/usr/bin/firejail', '--quiet', 
'--profile=/etc/firejail/mediawiki-converters.profile', '/usr/bin/gs'] + 
sys.argv[1:])

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87fe9b8ee762af94ebd52e71c8c75f4f7ca36f70
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: MediaWiki theme: Provide focus indicator to TagMultiselectWi...

2017-04-30 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351121 )

Change subject: MediaWiki theme: Provide focus indicator to TagMultiselectWidget
..

MediaWiki theme: Provide focus indicator to TagMultiselectWidget

Bug: T164175
Change-Id: I57b239a063bb9c62576805437fe987b07d93a9b1
---
M src/themes/mediawiki/widgets.less
M src/widgets/TagMultiselectWidget.js
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/21/351121/1

diff --git a/src/themes/mediawiki/widgets.less 
b/src/themes/mediawiki/widgets.less
index 2dd2e7c..21fc3c8 100644
--- a/src/themes/mediawiki/widgets.less
+++ b/src/themes/mediawiki/widgets.less
@@ -1694,7 +1694,7 @@
border-color: @border-color-input-hover;
}
 
-   &.oo-ui-tagMultiselectWidget-open 
.oo-ui-tagMultiselectWidget-handle {
+   
&.oo-ui-tagMultiselectWidget-focus.oo-ui-tagMultiselectWidget-inlined 
.oo-ui-tagMultiselectWidget-handle {
border-color: @border-color-default-focus;
outline: 0;
box-shadow: @box-shadow-widget-focus;
diff --git a/src/widgets/TagMultiselectWidget.js 
b/src/widgets/TagMultiselectWidget.js
index bb05768..04ecd25 100644
--- a/src/widgets/TagMultiselectWidget.js
+++ b/src/widgets/TagMultiselectWidget.js
@@ -292,12 +292,16 @@
 /**
  * Respond to input focus event
  */
-OO.ui.TagMultiselectWidget.prototype.onInputFocus = function () {};
+OO.ui.TagMultiselectWidget.prototype.onInputFocus = function () {
+   this.$element.addClass( 'oo-ui-tagMultiselectWidget-focus' );
+};
 
 /**
  * Respond to input blur event
  */
-OO.ui.TagMultiselectWidget.prototype.onInputBlur = function () {};
+OO.ui.TagMultiselectWidget.prototype.onInputBlur = function () {
+   this.$element.removeClass( 'oo-ui-tagMultiselectWidget-focus' );
+};
 
 /**
  * Perform an action after the enter key on the input

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57b239a063bb9c62576805437fe987b07d93a9b1
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: VolkerE 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_28]: Bump version to 1.28.2 for new point release

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

Change subject: Bump version to 1.28.2 for new point release
..


Bump version to 1.28.2 for new point release

Change-Id: I0a4d6f7e596d01035cbe00791be2c99c2f0cfa84
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index df0d63f..3435f0b 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -75,7 +75,7 @@
  * MediaWiki version number
  * @since 1.2
  */
-$wgVersion = '1.28.1';
+$wgVersion = '1.28.2';
 
 /**
  * Name of the site. It must be changed in LocalSettings.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a4d6f7e596d01035cbe00791be2c99c2f0cfa84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_28
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
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[REL1_27]: Bump version number for new point release

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

Change subject: Bump version number for new point release
..


Bump version number for new point release

Change-Id: I07770b031c6035cf2c72e62ddfe9597a42dbd480
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index b63bcad..4292387 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -75,7 +75,7 @@
  * MediaWiki version number
  * @since 1.2
  */
-$wgVersion = '1.27.2';
+$wgVersion = '1.27.3';
 
 /**
  * Name of the site. It must be changed in LocalSettings.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I07770b031c6035cf2c72e62ddfe9597a42dbd480
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_27
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make registerTempTableOperation() more robust

2017-04-30 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351120 )

Change subject: Make registerTempTableOperation() more robust
..

Make registerTempTableOperation() more robust

Detect TRUNCATE operations and clean up return value

Change-Id: I6094624fc594b23b1df6107f7ac1c3d93f609ebc
---
M includes/libs/rdbms/database/Database.php
1 file changed, 9 insertions(+), 2 deletions(-)


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

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 88a883a..ac72350 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -817,7 +817,7 @@
 
/**
 * @param string $sql A SQL query
-* @return bool Whether $sql is SQL for creating/dropping a new 
TEMPORARY table
+* @return bool Whether $sql is SQL for TEMPORARY table operation
 */
protected function registerTempTableOperation( $sql ) {
if ( preg_match(
@@ -833,9 +833,16 @@
$sql,
$matches
) ) {
+   $isTemp = isset( $this->mSessionTempTables[$matches[1]] 
);
unset( $this->mSessionTempTables[$matches[1]] );
 
-   return true;
+   return $isTemp;
+   } elseif ( preg_match(
+   
'/^TRUNCATE\s+(?:TEMPORARY\s+)?TABLE\s+(?:IF\s+EXISTS\s+)?[`"\']?(\w+)[`"\']?/i',
+   $sql,
+   $matches
+   ) ) {
+   return isset( $this->mSessionTempTables[$matches[1]] );
} elseif ( preg_match(

'/^(?:INSERT\s+(?:\w+\s+)?INTO|UPDATE|DELETE\s+FROM)\s+[`"\']?(\w+)[`"\']?/i',
$sql,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Bump version number for new point release

2017-04-30 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351119 )

Change subject: Bump version number for new point release
..

Bump version number for new point release

Change-Id: I07770b031c6035cf2c72e62ddfe9597a42dbd480
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/351119/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index b63bcad..4292387 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -75,7 +75,7 @@
  * MediaWiki version number
  * @since 1.2
  */
-$wgVersion = '1.27.2';
+$wgVersion = '1.27.3';
 
 /**
  * Name of the site. It must be changed in LocalSettings.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07770b031c6035cf2c72e62ddfe9597a42dbd480
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_27
Gerrit-Owner: Chad 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_28]: Bump version to 1.28.2 for new point release

2017-04-30 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351118 )

Change subject: Bump version to 1.28.2 for new point release
..

Bump version to 1.28.2 for new point release

Change-Id: I0a4d6f7e596d01035cbe00791be2c99c2f0cfa84
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/351118/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index df0d63f..3435f0b 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -75,7 +75,7 @@
  * MediaWiki version number
  * @since 1.2
  */
-$wgVersion = '1.28.1';
+$wgVersion = '1.28.2';
 
 /**
  * Name of the site. It must be changed in LocalSettings.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a4d6f7e596d01035cbe00791be2c99c2f0cfa84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_28
Gerrit-Owner: Chad 

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure the dependencies are loaded

2017-04-30 Thread Sophivorus (Code Review)
Sophivorus has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351117 )

Change subject: Make sure the dependencies are loaded
..

Make sure the dependencies are loaded

Don't init ProveIt until all the dependencies are loaded
Also minor comment update
And update of my username

Change-Id: Ib0ce8079c62ddc327c2ec19195081429837202e7
---
M README.md
M i18n/de.json
M i18n/en.json
M i18n/es.json
M i18n/it.json
M i18n/pt.json
M i18n/qqq.json
M proveit.js
8 files changed, 31 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/17/351117/1

diff --git a/README.md b/README.md
index d615074..fb1c206 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # ProveIt
 
-ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and delete 
references when editing articles.
+ProveIt is powerful reference manager for Wikipedia
 
 Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
\ No newline at end of file
diff --git a/i18n/de.json b/i18n/de.json
index 0c2d9a3..68c29dd 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Metalhead64"
]
},
diff --git a/i18n/en.json b/i18n/en.json
index 9680617..f2903c8 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone"
+   "Sophivorus"
]
},
"proveit-list-tab": "List ($1)",
diff --git a/i18n/es.json b/i18n/es.json
index c076ed1..8823f73 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Macofe"
]
},
diff --git a/i18n/it.json b/i18n/it.json
index 44b4867..ca6c868 100644
--- a/i18n/it.json
+++ b/i18n/it.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Beta16"
]
},
diff --git a/i18n/pt.json b/i18n/pt.json
index c3531df..efc86f1 100644
--- a/i18n/pt.json
+++ b/i18n/pt.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"He7d3r"
]
},
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 87a0a46..dc0dae2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Liuxinyu970226",
"Robby"
]
diff --git a/proveit.js b/proveit.js
index fe3818a..d845724 100755
--- a/proveit.js
+++ b/proveit.js
@@ -1,10 +1,10 @@
 /**
- * ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and 
delete references when editing articles.
+ * ProveIt is a powerful reference manager for Wikipedia
  * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
  *
  * Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 
30332-0415, ALL RIGHTS RESERVED
  * Copyright 2011- Matthew Flaschen
- * Rewritten, internationalized, enhanced and maintained by Felipe Schenone 
since 2014
+ * Rewritten, internationalized, enhanced and maintained by Sophivorus since 
2014
  *
  * ProveIt is available under the GNU Free Documentation License 
(http://www.gnu.org/copyleft/fdl.html),
  * the Creative Commons Attribution/Share-Alike License 3.0 
(http://creativecommons.org/licenses/by-sa/3.0/),
@@ -204,20 +204,18 @@
 
// Make the GUI draggable
var dragged = false;
-   mw.loader.using( 'jquery.ui.draggable' ).then( function () {
-   gui.draggable({
-   handle: header,
-   containment: 'window',
-   start: function ( event ) {
-   if ( event.originalEvent.target.id !== 
'proveit-header' ) {
-   dragged = true;
-   }
-   gui.css({
-   'right': 'auto',
-   'bottom': 'auto'
-   });
+   gui.draggable({
+   handle: header,
+   containment: 'window',
+   start: function ( event ) {
+ 

[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure the dependencies are loaded

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

Change subject: Make sure the dependencies are loaded
..


Make sure the dependencies are loaded

Don't init ProveIt until all the dependencies are loaded
Also minor comment update
And update of my username

Change-Id: Ib0ce8079c62ddc327c2ec19195081429837202e7
---
M README.md
M i18n/de.json
M i18n/en.json
M i18n/es.json
M i18n/it.json
M i18n/pt.json
M i18n/qqq.json
M proveit.js
8 files changed, 31 insertions(+), 26 deletions(-)

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



diff --git a/README.md b/README.md
index d615074..fb1c206 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # ProveIt
 
-ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and delete 
references when editing articles.
+ProveIt is powerful reference manager for Wikipedia
 
 Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
\ No newline at end of file
diff --git a/i18n/de.json b/i18n/de.json
index 0c2d9a3..68c29dd 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Metalhead64"
]
},
diff --git a/i18n/en.json b/i18n/en.json
index 9680617..f2903c8 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone"
+   "Sophivorus"
]
},
"proveit-list-tab": "List ($1)",
diff --git a/i18n/es.json b/i18n/es.json
index c076ed1..8823f73 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Macofe"
]
},
diff --git a/i18n/it.json b/i18n/it.json
index 44b4867..ca6c868 100644
--- a/i18n/it.json
+++ b/i18n/it.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Beta16"
]
},
diff --git a/i18n/pt.json b/i18n/pt.json
index c3531df..efc86f1 100644
--- a/i18n/pt.json
+++ b/i18n/pt.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"He7d3r"
]
},
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 87a0a46..dc0dae2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -1,7 +1,7 @@
 {
"@metadata": {
"authors": [
-   "Felipe Schenone",
+   "Sophivorus",
"Liuxinyu970226",
"Robby"
]
diff --git a/proveit.js b/proveit.js
index fe3818a..d845724 100755
--- a/proveit.js
+++ b/proveit.js
@@ -1,10 +1,10 @@
 /**
- * ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and 
delete references when editing articles.
+ * ProveIt is a powerful reference manager for Wikipedia
  * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt
  *
  * Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 
30332-0415, ALL RIGHTS RESERVED
  * Copyright 2011- Matthew Flaschen
- * Rewritten, internationalized, enhanced and maintained by Felipe Schenone 
since 2014
+ * Rewritten, internationalized, enhanced and maintained by Sophivorus since 
2014
  *
  * ProveIt is available under the GNU Free Documentation License 
(http://www.gnu.org/copyleft/fdl.html),
  * the Creative Commons Attribution/Share-Alike License 3.0 
(http://creativecommons.org/licenses/by-sa/3.0/),
@@ -204,20 +204,18 @@
 
// Make the GUI draggable
var dragged = false;
-   mw.loader.using( 'jquery.ui.draggable' ).then( function () {
-   gui.draggable({
-   handle: header,
-   containment: 'window',
-   start: function ( event ) {
-   if ( event.originalEvent.target.id !== 
'proveit-header' ) {
-   dragged = true;
-   }
-   gui.css({
-   'right': 'auto',
-   'bottom': 'auto'
-   });
+   gui.draggable({
+   handle: header,
+   containment: 'window',
+   start: function ( event ) {
+   if ( 

[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure wikiEditor is loaded

2017-04-30 Thread Sophivorus (Code Review)
Sophivorus has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351116 )

Change subject: Make sure wikiEditor is loaded
..

Make sure wikiEditor is loaded

Per a bug reported by a user on my talk page

Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb
---
M proveit.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/16/351116/1

diff --git a/proveit.js b/proveit.js
index 510d22c..fe3818a 100755
--- a/proveit.js
+++ b/proveit.js
@@ -127,7 +127,7 @@
 
// Replace the Reference button for the ProveIt button in the 
new toolbar
if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
-   proveit.getTextbox().on( 
'wikiEditor-toolbar-doneInitialSections', function () {
+   mw.loader.using( 'ext.wikiEditor.toolbar', function () {
proveit.getTextbox().wikiEditor( 
'removeFromToolbar', {
'section': 'main',
'group': 'insert',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Sophivorus 

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure wikiEditor is loaded

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

Change subject: Make sure wikiEditor is loaded
..


Make sure wikiEditor is loaded

Per a bug reported by a user on my talk page

Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb
---
M proveit.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/proveit.js b/proveit.js
index 510d22c..fe3818a 100755
--- a/proveit.js
+++ b/proveit.js
@@ -127,7 +127,7 @@
 
// Replace the Reference button for the ProveIt button in the 
new toolbar
if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
-   proveit.getTextbox().on( 
'wikiEditor-toolbar-doneInitialSections', function () {
+   mw.loader.using( 'ext.wikiEditor.toolbar', function () {
proveit.getTextbox().wikiEditor( 
'removeFromToolbar', {
'section': 'main',
'group': 'insert',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Sophivorus 
Gerrit-Reviewer: Sophivorus 

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


[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Put a couple of checks in place

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

Change subject: Put a couple of checks in place
..


Put a couple of checks in place

Bug: T163563
Change-Id: I29d18d2fd565cd1a861d3a65c1d31a2b33e0ead2
---
M proveit.js
1 file changed, 33 insertions(+), 29 deletions(-)

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



diff --git a/proveit.js b/proveit.js
index ac2c768..510d22c 100755
--- a/proveit.js
+++ b/proveit.js
@@ -127,27 +127,29 @@
 
// Replace the Reference button for the ProveIt button in the 
new toolbar
if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
-   proveit.getTextbox().wikiEditor( 'removeFromToolbar', {
-   'section': 'main',
-   'group': 'insert',
-   'tool': 'reference'
-   });
-   proveit.getTextbox().wikiEditor( 'addToToolbar', {
-   'section': 'main',
-   'group': 'insert',
-   'tools': {
-   'proveit': {
-   'label': 'ProveIt',
-   'type': 'button',
-   'icon': proveit.ICON,
-   'action': {
-   'type': 'callback',
-   'execute': function () {
-   $( '#proveit' 
).toggle();
+   proveit.getTextbox().on( 
'wikiEditor-toolbar-doneInitialSections', function () {
+   proveit.getTextbox().wikiEditor( 
'removeFromToolbar', {
+   'section': 'main',
+   'group': 'insert',
+   'tool': 'reference'
+   });
+   proveit.getTextbox().wikiEditor( 
'addToToolbar', {
+   'section': 'main',
+   'group': 'insert',
+   'tools': {
+   'proveit': {
+   'label': 'ProveIt',
+   'type': 'button',
+   'icon': proveit.ICON,
+   'action': {
+   'type': 
'callback',
+   'execute': 
function () {
+   $( 
'#proveit' ).toggle();
+   }
}
}
}
-   }
+   });
});
// Add the ProveIt button in the old toolbar
} else if ( mw.user.options.get( 'showtoolbar' ) === 1 ) {
@@ -202,18 +204,20 @@
 
// Make the GUI draggable
var dragged = false;
-   gui.draggable({
-   handle: header,
-   containment: 'window',
-   start: function ( event ) {
-   if ( event.originalEvent.target.id !== 
'proveit-header' ) {
-   dragged = true;
+   mw.loader.using( 'jquery.ui.draggable' ).then( function () {
+   gui.draggable({
+   handle: header,
+   containment: 'window',
+   start: function ( event ) {
+   if ( event.originalEvent.target.id !== 
'proveit-header' ) {
+   dragged = true;
+   }
+   gui.css({
+   'right': 'auto',
+   'bottom': 'auto'
+   });
}
-   gui.css({
-   'right': 'auto',
-   'bottom': 'auto'
-   });
-   }
+   });
});
 
// Lastly, bind 

[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Put a couple of checks in place

2017-04-30 Thread Sophivorus (Code Review)
Sophivorus has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351115 )

Change subject: Put a couple of checks in place
..

Put a couple of checks in place

Bug: T163563
Change-Id: I29d18d2fd565cd1a861d3a65c1d31a2b33e0ead2
---
M proveit.js
1 file changed, 33 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/15/351115/1

diff --git a/proveit.js b/proveit.js
index ac2c768..510d22c 100755
--- a/proveit.js
+++ b/proveit.js
@@ -127,27 +127,29 @@
 
// Replace the Reference button for the ProveIt button in the 
new toolbar
if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) {
-   proveit.getTextbox().wikiEditor( 'removeFromToolbar', {
-   'section': 'main',
-   'group': 'insert',
-   'tool': 'reference'
-   });
-   proveit.getTextbox().wikiEditor( 'addToToolbar', {
-   'section': 'main',
-   'group': 'insert',
-   'tools': {
-   'proveit': {
-   'label': 'ProveIt',
-   'type': 'button',
-   'icon': proveit.ICON,
-   'action': {
-   'type': 'callback',
-   'execute': function () {
-   $( '#proveit' 
).toggle();
+   proveit.getTextbox().on( 
'wikiEditor-toolbar-doneInitialSections', function () {
+   proveit.getTextbox().wikiEditor( 
'removeFromToolbar', {
+   'section': 'main',
+   'group': 'insert',
+   'tool': 'reference'
+   });
+   proveit.getTextbox().wikiEditor( 
'addToToolbar', {
+   'section': 'main',
+   'group': 'insert',
+   'tools': {
+   'proveit': {
+   'label': 'ProveIt',
+   'type': 'button',
+   'icon': proveit.ICON,
+   'action': {
+   'type': 
'callback',
+   'execute': 
function () {
+   $( 
'#proveit' ).toggle();
+   }
}
}
}
-   }
+   });
});
// Add the ProveIt button in the old toolbar
} else if ( mw.user.options.get( 'showtoolbar' ) === 1 ) {
@@ -202,18 +204,20 @@
 
// Make the GUI draggable
var dragged = false;
-   gui.draggable({
-   handle: header,
-   containment: 'window',
-   start: function ( event ) {
-   if ( event.originalEvent.target.id !== 
'proveit-header' ) {
-   dragged = true;
+   mw.loader.using( 'jquery.ui.draggable' ).then( function () {
+   gui.draggable({
+   handle: header,
+   containment: 'window',
+   start: function ( event ) {
+   if ( event.originalEvent.target.id !== 
'proveit-header' ) {
+   dragged = true;
+   }
+   gui.css({
+   'right': 'auto',
+   'bottom': 'auto'
+   });
}
-   gui.css({
-   'right': 'auto',
-   'bottom': 'auto'
-   });
-   }
+   });
});
 

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update restbase to 55872ad

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

Change subject: Update restbase to 55872ad
..


Update restbase to 55872ad

List of changes:
8a9959f Blacklist zh.wikipedia.org/Draft:日本人工湖列表

Change-Id: I19a184ef1e2534f73905abd95b58f4a999e7d626
---
M restbase
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/restbase b/restbase
index 56dc7a9..55872ad 16
--- a/restbase
+++ b/restbase
@@ -1 +1 @@
-Subproject commit 56dc7a9a2859c9bbcd215841df4debe380a4
+Subproject commit 55872ad0ed601c987b955fa6679fc1aeb9a6a61c

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I19a184ef1e2534f73905abd95b58f4a999e7d626
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/restbase/deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko 
Gerrit-Reviewer: Ppchelko 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update restbase to 55872ad

2017-04-30 Thread Ppchelko (Code Review)
Ppchelko has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351114 )

Change subject: Update restbase to 55872ad
..

Update restbase to 55872ad

List of changes:
8a9959f Blacklist zh.wikipedia.org/Draft:日本人工湖列表

Change-Id: I19a184ef1e2534f73905abd95b58f4a999e7d626
---
M restbase
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/restbase/deploy 
refs/changes/14/351114/1

diff --git a/restbase b/restbase
index 56dc7a9..55872ad 16
--- a/restbase
+++ b/restbase
@@ -1 +1 @@
-Subproject commit 56dc7a9a2859c9bbcd215841df4debe380a4
+Subproject commit 55872ad0ed601c987b955fa6679fc1aeb9a6a61c

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19a184ef1e2534f73905abd95b58f4a999e7d626
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/restbase/deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko 

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


[MediaWiki-commits] [Gerrit] operations...service-checker[master]: Parallelize url fetching

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

Change subject: Parallelize url fetching
..

Parallelize url fetching

This should allow us to avoid failures when some endpoints are a bit
slower than normal.

Change-Id: I5f53e1d4a09c89efab23248c6d23a7e7bd5f930b
---
M servicechecker/swagger.py
1 file changed, 40 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/service-checker 
refs/changes/10/351110/1

diff --git a/servicechecker/swagger.py b/servicechecker/swagger.py
index b96e08e..3cbd0ee 100755
--- a/servicechecker/swagger.py
+++ b/servicechecker/swagger.py
@@ -1,12 +1,13 @@
 #!/usr/bin/env python
-from servicechecker import CheckerBase, fetch_url, CheckError
-
 import argparse
-from collections import namedtuple
+import functools
 import json
-import yaml
 import re
 import sys
+import yaml
+
+from collections import namedtuple
+from multiprocessing.pool import Pool
 
 # python 2 vs python 3 imports
 try:
@@ -16,11 +17,35 @@
 import urllib.parse as urlparse
 from urllib.parse import quote_plus
 
+from servicechecker import CheckerBase, fetch_url, CheckError
+
 try:
 reload(sys)  # noqa
 sys.setdefaultencoding('utf-8')
 except:
 pass
+
+
+# Functions passed to multiprocessing are better not
+# inside classes
+def _check_endpoint(payload, client=None, url=None, http_host=None):
+"""
+Actually performs the checks on each single endpoint
+"""
+endpoint, data = payload
+req = data.get('request', {})
+req['http_host'] = http_host
+er = EndpointRequest(
+data.get('title',
+ "test for {}".format(endpoint)),
+url,
+data['http_method'],
+endpoint,
+req,
+data.get('response')
+)
+er.run(client)
+return (er.status, er.msg)
 
 
 class CheckService(CheckerBase):
@@ -136,9 +161,18 @@
 res = []
 status = 'OK'
 idx = self.nagios_codes.index(status)
+check_function = functools.partial(
+_check_endpoint,
+client=self._spawn_downloader(),
+url=self._url,
+http_host=self.http_host,
+)
+
 try:
-for endpoint, data in self.get_endpoints():
-ep_status, msg = self._check_endpoint(endpoint, data)
+payloads = [(endpoint, data) for endpoint, data in 
self.get_endpoints()]
+pool = Pool(len(payloads))
+results = pool.map(check_function, payloads)
+for ep_status, msg in results:
 if ep_status != 'OK':
 res.append("{} ({}) is {}: {}".format(
 endpoint, data.get('title', 'no title'),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f53e1d4a09c89efab23248c6d23a7e7bd5f930b
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/service-checker
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] pywikibot/core[master]: Remove comments etc. when parsing template

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

Change subject: Remove comments etc. when parsing template
..


Remove comments etc. when parsing template

Bug: T127691
Change-Id: I63a621d149582732af23e701f85e527e9c4bfba2
---
M scripts/harvest_template.py
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index a431bfd..71c2145 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -53,7 +53,7 @@
 signal.signal(signal.SIGINT, _signal_handler)
 
 import pywikibot
-from pywikibot import pagegenerators as pg, textlib, WikidataBot
+from pywikibot import pagegenerators as pg, WikidataBot
 
 docuReplacements = {'': pywikibot.pagegenerators.parameterHelp}
 
@@ -140,8 +140,7 @@
  'Skipping.' % (page, item.title()))
 return
 
-pagetext = page.get()
-templates = textlib.extract_templates_and_params(pagetext)
+templates = page.raw_extracted_templates
 for (template, fielddict) in templates:
 # Clean up template
 try:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63a621d149582732af23e701f85e527e9c4bfba2
Gerrit-PatchSet: 8
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Matěj Suchánek 
Gerrit-Reviewer: Multichill 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: templatesWithParams: cache and standardise params

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

Change subject: templatesWithParams: cache and standardise params
..


templatesWithParams: cache and standardise params

extract_templates_and_params has two implementations
(regex and mwparserfromhell) which have had different
settings for handling of unnecessary whitespace and
disabled wikitext.

Page.templatesWithParams previously used either
implementation, as-is, and therefore its returned value
varied depending on the implementation in use.

Combined with 84bd04258, this change ensures that
Page.templatesWithParams uses a consistent approach
by always removing unnecessary whitespace and disabled
wikitext, irrespective of the textlib implementation used.

This changeset means that the Page.templatesWithParams
returned values can different slightly to the result it
previously returned.

The Page.templatesWithParams results are now also cached.

Bug: T113892
Change-Id: Id36011c93af673d07cb6169a7b43b562b985a102
---
M pywikibot/page.py
1 file changed, 33 insertions(+), 3 deletions(-)

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



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 0f30b58..98954ce 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -637,6 +637,8 @@
 @param value: basestring
 """
 self._text = None if value is None else unicode(value)
+if hasattr(self, '_raw_extracted_templates'):
+del self._raw_extracted_templates
 
 @text.deleter
 def text(self):
@@ -645,6 +647,8 @@
 del self._text
 if hasattr(self, '_expanded_text'):
 del self._expanded_text
+if hasattr(self, '_raw_extracted_templates'):
+del self._raw_extracted_templates
 
 def preloadText(self):
 """
@@ -2220,20 +2224,46 @@
  'if source is a Site.')
 super(Page, self).__init__(source, title, ns)
 
+@property
+def raw_extracted_templates(self):
+"""
+Extract templates using L{textlib.extract_templates_and_params}.
+
+Disabled parts and whitespace are stripped, except for
+whitespace in anonymous positional arguments.
+
+This value is cached.
+
+@rtype: list of (str, OrderedDict)
+"""
+if not hasattr(self, '_raw_extracted_templates'):
+templates = textlib.extract_templates_and_params(
+self.text, True, True)
+self._raw_extracted_templates = templates
+
+return self._raw_extracted_templates
+
 @deprecate_arg("get_redirect", None)
 def templatesWithParams(self):
 """
 Return templates used on this Page.
 
-@return: a list that contains a tuple for each use of a template
+The templates are extracted by L{textlib.extract_templates_and_params},
+with positional arguments placed first in order, and each named
+argument appearing as 'name=value'.
+
+All parameter keys and values for each template are stripped of
+whitespace.
+
+@return: a list of tuples with one tuple for each template invocation
 in the page, with the template Page as the first entry and a list 
of
 parameters as the second entry.
-@rtype: list
+@rtype: list of (Page, list)
 """
 # WARNING: may not return all templates used in particularly
 # intricate cases such as template substitution
 titles = [t.title() for t in self.templates()]
-templates = textlib.extract_templates_and_params(self.text)
+templates = self.raw_extracted_templates
 # backwards-compatibility: convert the dict returned as the second
 # element into a list in the format used by old scripts
 result = []

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id36011c93af673d07cb6169a7b43b562b985a102
Gerrit-PatchSet: 7
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Matěj Suchánek 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: XZise 
Gerrit-Reviewer: Xqt 
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...Nuke[master]: Updated the message in Special:Nuke

2017-04-30 Thread Wassan.anmol (Code Review)
Wassan.anmol has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351108 )

Change subject: Updated the message in Special:Nuke
..

Updated the message in Special:Nuke

If there are 0 new pages, the message is updated to "There are no page titles 
matching your search."

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Nuke 
refs/changes/08/351108/1

diff --git a/i18n/en.json b/i18n/en.json
index d8f29a2..9b9ab92 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -26,7 +26,7 @@
"nuke-not-deleted": "Page [[:$1]] '''could not''' be deleted.",
"nuke-delete-more": "[[Special:Nuke|Delete more pages]]",
"nuke-pattern": "Pattern for the page name:",
-   "nuke-nopages-global": "There are no new pages in 
[[Special:RecentChanges|recent changes]].",
+   "nuke-nopages-global": "There are no page titles matching your search.",
"nuke-viewchanges": "view changes",
"nuke-namespace": "Limit to namespace:",
"nuke-linkoncontribs": "mass delete",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I625fca21bcd667efb1420a0f23c42706d838cc66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Nuke
Gerrit-Branch: master
Gerrit-Owner: Wassan.anmol 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Fix minor lint errors and typos

2017-04-30 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351105 )

Change subject: Fix minor lint errors and typos
..

Fix minor lint errors and typos

* Commas that should be semicolons
* Unnecessary 'call's

Change-Id: I11a80702b5396a36e3deecc6e706a397cc354bd8
---
M modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
4 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js 
b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
index 816bf46..a8c100f 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js
@@ -157,7 +157,7 @@
var contentNodes;
 
if ( ve.getProp( response, 'visualeditor', 'result' ) !== 'success' ) {
-   return this.onParseError.call( this, deferred );
+   return this.onParseError( deferred );
}
 
// Work around https://github.com/jquery/jquery/issues/1997
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js
index f208c47..ff96631 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js
@@ -93,7 +93,7 @@
typeofAttrs.splice( errorIndex, 1 );
}
 
-   types = this.rdfaToTypes[ typeofAttrs[ 0 ] ],
+   types = this.rdfaToTypes[ typeofAttrs[ 0 ] ];
 
attributes = {
mediaClass: types.mediaClass,
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js
index 5fe790e..0187c7a 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js
@@ -63,7 +63,7 @@
typeofAttrs.splice( errorIndex, 1 );
}
 
-   types = this.rdfaToTypes[ typeofAttrs[ 0 ] ],
+   types = this.rdfaToTypes[ typeofAttrs[ 0 ] ];
 
attributes = {
mediaClass: types.mediaClass,
diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js 
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index e033b48..caa9ea8 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -1424,7 +1424,7 @@
return new mw.Api().postWithToken( 'csrf', postData, { 
contentType: 'multipart/form-data' } );
}
 
-   preparedCacheKey = this.getPreparedCacheKey( doc ),
+   preparedCacheKey = this.getPreparedCacheKey( doc );
data = ve.extendObject( {}, options, { format: 'json' } );
 
function ajaxRequest( cachekey, isRetried ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: MWSignatureNode/Tool: Avoid global variables

2017-04-30 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351106 )

Change subject: MWSignatureNode/Tool: Avoid global variables
..

MWSignatureNode/Tool: Avoid global variables

Change-Id: I0596b33e797830f3718f4edbe34075fdaced0831
---
M modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js
M modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js
2 files changed, 54 insertions(+), 26 deletions(-)


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

diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js 
b/modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js
index 4989eef..cdf65da 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWSignatureNode.js
@@ -5,23 +5,6 @@
  * @license The MIT License (MIT); see LICENSE.txt
  */
 
-// Update the timestamp on inserted signatures every minute.
-var liveSignatures = [];
-setInterval( function () {
-   var updatedSignatures, i, sig;
-   updatedSignatures = [];
-   for ( i = 0; i < liveSignatures.length; i++ ) {
-   sig = liveSignatures[ i ];
-   try {
-   sig.forceUpdate();
-   updatedSignatures.push( sig );
-   } catch ( er ) {
-   // Do nothing
-   }
-   }
-   liveSignatures = updatedSignatures;
-}, 60 * 1000 );
-
 /**
  * ContentEditable MediaWiki signature node. This defines the behavior of the 
signature node
  * inserted into the ContentEditable document.
@@ -45,9 +28,6 @@
// the width changing when using the Sequence.
this.$element.text( '' );
}
-
-   // Keep track for magical text updating
-   liveSignatures.push( this );
 };
 
 /* Inheritance */
@@ -62,11 +42,59 @@
 
 ve.ce.MWSignatureNode.static.primaryCommandName = 'mwSignature';
 
+ve.ce.MWSignatureNode.static.liveSignatures = [];
+
+// Update the timestamp on inserted signatures every minute.
+setInterval( function () {
+   var updatedSignatures, i, sig,
+   liveSignatures = ve.ce.MWSignatureNode.static.liveSignatures;
+
+   updatedSignatures = [];
+   for ( i = 0; i < liveSignatures.length; i++ ) {
+   sig = liveSignatures[ i ];
+   try {
+   sig.forceUpdate();
+   updatedSignatures.push( sig );
+   } catch ( er ) {
+   // Do nothing
+   }
+   }
+   liveSignatures = updatedSignatures;
+}, 60 * 1000 );
+
 /* Methods */
 
 /**
  * @inheritdoc
  */
+ve.ce.MWSignatureNode.prototype.onSetup = function () {
+   // Parent method
+   ve.ce.MWSignatureNode.super.prototype.onSetup.call( this );
+
+   // Keep track for regular updating of timestamp
+   this.constructor.static.liveSignatures.push( this );
+};
+
+/**
+ * @inheritdoc
+ */
+ve.ce.MWSignatureNode.prototype.onTeardown = function () {
+   var index,
+   liveSignatures = this.constructor.static.liveSignatures;
+
+   // Parent method
+   ve.ce.MWSignatureNode.super.prototype.onTeardown.call( this );
+
+   // Stop tracking
+   index = liveSignatures.indexOf( this );
+   if ( index !== -1 ) {
+   liveSignatures.splice( index, 1 );
+   }
+};
+
+/**
+ * @inheritdoc
+ */
 ve.ce.MWSignatureNode.prototype.generateContents = function () {
var wikitext, signatureNode, api, deferred, xhr;
// Parsoid doesn't support pre-save transforms. PHP parser doesn't 
support Parsoid's
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js
index b50081f..f908711 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWSignatureTool.js
@@ -5,11 +5,6 @@
  * @license The MIT License (MIT); see LICENSE.txt
  */
 
-var allowsSignatures = $.inArray(
-   new mw.Title( mw.config.get( 'wgRelevantPageName' ) ).getNamespaceId(),
-   mw.config.get( 'wgVisualEditorConfig' ).signatureNamespaces
-) !== -1;
-
 /**
  * MediaWiki UserInterface signature tool. This defines the menu button and 
its action.
  *
@@ -36,7 +31,12 @@
 
 ve.ui.toolFactory.register( ve.ui.MWSignatureTool );
 
-if ( allowsSignatures ) {
+if (
+   $.inArray(
+   new mw.Title( mw.config.get( 'wgRelevantPageName' ) 
).getNamespaceId(),
+   mw.config.get( 'wgVisualEditorConfig' ).signatureNamespaces
+   ) !== -1
+) {
// Command to insert signature node.
ve.ui.commandRegistry.register(
new ve.ui.Command( 'mwSignature', 'content', 'insert', {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0596b33e797830f3718f4edbe34075fdaced0831
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Avoid global variables in tests and build

2017-04-30 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351107 )

Change subject: Avoid global variables in tests and build
..

Avoid global variables in tests and build

Change-Id: I44dd3c3980f88e660798962c4aa0229b62760796
---
M Gruntfile.js
M 
modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
2 files changed, 5 insertions(+), 4 deletions(-)


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

diff --git a/Gruntfile.js b/Gruntfile.js
index e13d0ef..2e6bd55 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -14,7 +14,7 @@
timeout: 4,
require: [
function () {
-   // eslint-disable-next-line no-undef
+   // eslint-disable-next-line no-undef, 
no-implicit-globals
langs = [ 'en' ];
}
]
@@ -24,7 +24,7 @@
timeout: 4,
require: [
function () {
-   // eslint-disable-next-line no-undef
+   // eslint-disable-next-line no-undef, 
no-implicit-globals
langs = require( 
'./build/tasks/screenshotLangs.json' ).langs;
}
]
diff --git 
a/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
 
b/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
index 08c9d90..f6eda3e 100644
--- 
a/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
+++ 
b/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
@@ -3,12 +3,13 @@
  *
  * @copyright 2011-2017 VisualEditor Team and others; see 
http://ve.mit-license.org
  */
-var MWWIKITEXT_MOCK_API = true;
+
+window.MWWIKITEXT_MOCK_API = true;
 
 QUnit.module( 've.ui.MWWikitextStringTransferHandler', QUnit.newMwEnvironment( 
{
setup: function () {
// Mock XHR for mw.Api()
-   this.server = MWWIKITEXT_MOCK_API ? 
this.sandbox.useFakeServer() : null;
+   this.server = window.MWWIKITEXT_MOCK_API ? 
this.sandbox.useFakeServer() : null;
ve.test.utils.mwEnvironment.setup.call( this );
},
teardown: ve.test.utils.mwEnvironment.teardown

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: eslint: Remove duplicate rule (no-alert)

2017-04-30 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351104 )

Change subject: eslint: Remove duplicate rule (no-alert)
..

eslint: Remove duplicate rule (no-alert)

Change-Id: I040689ddf8fa67c89f8b7bf154be8c1ceff2e5b8
---
M .eslintrc.json
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/.eslintrc.json b/.eslintrc.json
index e9898ab..abc20e2 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -16,7 +16,6 @@
},
"rules": {
"dot-notation": [ "error", { "allowKeywords": true } ],
-   "valid-jsdoc": 0,
-   "no-alert": "error"
+   "valid-jsdoc": 0
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: Change from jshint to eslint

2017-04-30 Thread Fomafix (Code Review)
Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351103 )

Change subject: Change from jshint to eslint
..

Change from jshint to eslint

Change-Id: I9d8a31c8048f9d80e8395a637573272ca5f9fea5
---
A .eslintrc.json
D .jshintrc
M Gruntfile.js
M package.json
4 files changed, 18 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CategoryTree 
refs/changes/03/351103/1

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 000..4843240
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,10 @@
+{
+   "extends": "wikimedia",
+   "env": {
+   "browser": true,
+   "jquery": true
+   },
+   "globals": {
+   "mediaWiki": false
+   }
+}
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 1dad4f0..000
--- a/.jshintrc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-   // Enforcing
-   "bitwise": true,
-   "eqeqeq": true,
-   "es3": true,
-   "freeze": true,
-   "latedef": true,
-   "noarg": true,
-   "nonew": true,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-
-   // Relaxing
-   "laxbreak": true,
-   "multistr": true,
-
-   // Environment
-   "browser": true,
-
-   "globals": {
-   "mediaWiki": true,
-   "jQuery": false
-   }
-}
diff --git a/Gruntfile.js b/Gruntfile.js
index 6f3befc..d985906 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -4,22 +4,21 @@
  * @package CategoryTree
  */
 
-/*jshint node:true */
+/* eslint-env node */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-jsonlint' );
-   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-stylelint' );
 
grunt.initConfig( {
banana: {
-   all: ['i18n/']
+   all: [ 'i18n/' ]
},
-   jshint: {
+   eslint: {
all: [
'**/*.js',
-   '!node_modules/**',
-   '!vendor/**'
+   '!node_modules/**'
]
},
jsonlint: {
@@ -37,6 +36,6 @@
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana', 'jshint', 
'stylelint' ] );
+   grunt.registerTask( 'test', [ 'jsonlint', 'banana', 'eslint', 
'stylelint' ] );
grunt.registerTask( 'default', 'test' );
 };
diff --git a/package.json b/package.json
index 359909b..8552d1c 100644
--- a/package.json
+++ b/package.json
@@ -4,9 +4,10 @@
 "test": "grunt test"
   },
   "devDependencies": {
+"eslint-config-wikimedia": "0.3.0",
 "grunt": "1.0.1",
 "grunt-banana-checker": "0.4.0",
-"grunt-contrib-jshint": "1.1.0",
+"grunt-eslint": "19.0.0",
 "grunt-jsonlint": "1.0.7",
 "grunt-stylelint": "0.6.0",
 "stylelint-config-wikimedia": "0.4.1"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d8a31c8048f9d80e8395a637573272ca5f9fea5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: Fomafix 

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Rewrite claimit.py

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

Change subject: Rewrite claimit.py
..


Rewrite claimit.py

Fix -exists argument, replace exception with an error message, use
Claim.target_equals().

There's already a patch at I4c1c0b8b7 which has been stale for two
years, so I went ahead and tried not to make greater changes.

Bug: T69284
Change-Id: I1c3d13d51ca9f409173f046e5ac8ec4604b34917
---
M scripts/claimit.py
1 file changed, 60 insertions(+), 71 deletions(-)

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



diff --git a/scripts/claimit.py b/scripts/claimit.py
index 19142df..e85a941 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -35,12 +35,12 @@
 
 Suppose the claim you want to add has the same property as an existing claim
 and the "-exists:p" argument is used. Now, claimit.py will not add the claim
-if it has the same target, sources, and/or qualifiers as the existing claim.
+if it has the same target, source, and/or the existing claim has qualifiers.
 To override this behavior, add 't' (target), 's' (sources), or 'q' (qualifiers)
 to the 'exists' argument.
 
 For instance, to add the claim to each page even if one with the same
-property, target, and qualifiers already exists:
+property and target and some qualifiers already exists:
 
 python pwb.py claimit [pagegenerators] P246 "string example" -exists:ptq
 
@@ -50,7 +50,7 @@
 """
 #
 # (C) Legoktm, 2013
-# (C) Pywikibot team, 2013-2014
+# (C) Pywikibot team, 2013-2017
 #
 # Distributed under the terms of the MIT license.
 #
@@ -87,80 +87,67 @@
 super(ClaimRobot, self).__init__(use_from_page=None)
 self.generator = generator
 self.claims = claims
-self.exists_arg = exists_arg
+self.exists_arg = ''.join(x for x in exists_arg.lower() if x in 'pqst')
 self.cacheSources()
 if self.exists_arg:
-pywikibot.output('\'exists\' argument set to \'%s\'' % 
self.exists_arg)
+pywikibot.output("'exists' argument set to '%s'" % self.exists_arg)
 
 def treat(self, page, item):
 """Treat each page."""
 self.current_page = page
+# The generator might yield pages from multiple sites
+source = self.getSource(page.site)
 
-if item:
-for claim in self.claims:
-skip = False
+for claim in self.claims:
+# Existing claims on page of same property
+for existing in item.claims.get(claim.getID(), []):
 # If claim with same property already exists...
-if claim.getID() in item.claims:
-if self.exists_arg is None or 'p' not in self.exists_arg:
-pywikibot.log(
-'Skipping %s because claim with same property '
-'already exists' % (claim.getID(),))
-pywikibot.log(
-'Use -exists:p option to override this behavior')
-skip = True
-else:
-# Existing claims on page of same property
-existing_claims = item.claims[claim.getID()]
-for existing in existing_claims:
-skip = True  # Default value
-# If some attribute of the claim being added
-# matches some attribute in an existing claim of
-# the same property, skip the claim, unless the
-# 'exists' argument overrides it.
-if (claim.getTarget() == existing.getTarget() and
-'t' not in self.exists_arg):
-pywikibot.log(
-'Skipping %s because claim with same 
target already exists'
-% (claim.getID(),))
-pywikibot.log(
-'Append \'t\' to -exists argument to 
override this behavior')
-break
-if (listsEqual(claim.getSources(), 
existing.getSources()) and
-'s' not in self.exists_arg):
-pywikibot.log(
-'Skipping %s because claim with same 
sources already exists'
-% (claim.getID(),))
-pywikibot.log(
-'Append \'s\' to -exists argument to 
override this behavior')
-break
-if (listsEqual(claim.qualifiers, 
existing.qualifiers) and
-'q' not in self.exists_arg):
-

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Provide site to WbTime via WbTime.fromWikibase

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

Change subject: Provide site to WbTime via WbTime.fromWikibase
..


Provide site to WbTime via WbTime.fromWikibase

And rename the argument to be consistent with other fromWikibase
classmethods.

Change-Id: Id11f6e3db71d489a0d9e00af40aa85998ecd1874
---
M pywikibot/__init__.py
M pywikibot/page.py
2 files changed, 9 insertions(+), 7 deletions(-)

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



diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index cec265f..55f3a4f 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -658,17 +658,19 @@
 return json
 
 @classmethod
-def fromWikibase(cls, ts):
+def fromWikibase(cls, wb, site=None):
 """
 Create a WbTime from the JSON data given by the Wikibase API.
 
-@param ts: Wikibase JSON
-@type ts: dict
+@param wb: Wikibase JSON
+@type wb: dict
+@param site: The Wikibase site
+@type site: pywikibot.site.DataSite
 @rtype: pywikibot.WbTime
 """
-return cls.fromTimestr(ts[u'time'], ts[u'precision'],
-   ts[u'before'], ts[u'after'],
-   ts[u'timezone'], ts[u'calendarmodel'])
+return cls.fromTimestr(wb['time'], wb['precision'],
+   wb['before'], wb['after'],
+   wb['timezone'], wb['calendarmodel'], site)
 
 
 class WbQuantity(_WbRepresentation):
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 3794ee0..17557ff 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4519,7 +4519,7 @@
 FilePage(pywikibot.Site('commons', 'commons'), value),  # T90492
 'globe-coordinate': pywikibot.Coordinate.fromWikibase,
 'geo-shape': pywikibot.WbGeoShape.fromWikibase,
-'time': lambda value, site: pywikibot.WbTime.fromWikibase(value),
+'time': pywikibot.WbTime.fromWikibase,
 'quantity': pywikibot.WbQuantity.fromWikibase,
 'monolingualtext': lambda value, site:
 pywikibot.WbMonolingualText.fromWikibase(value)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id11f6e3db71d489a0d9e00af40aa85998ecd1874
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: Lokal Profil 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Matěj Suchánek 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Assign object to Tkdialog if it cannot be imported from gui ...

2017-04-30 Thread Dalba (Code Review)
Dalba has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351102 )

Change subject: Assign object to Tkdialog if it cannot be imported from gui 
module
..

Assign object to Tkdialog if it cannot be imported from gui module

Bug: T164163
Change-Id: I62d28206c4061ec1907b5e6b852aab3d0901a761
---
M scripts/imagecopy.py
M scripts/imagecopy_self.py
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/02/351102/1

diff --git a/scripts/imagecopy.py b/scripts/imagecopy.py
index 1e2f454..fc5b6b9 100644
--- a/scripts/imagecopy.py
+++ b/scripts/imagecopy.py
@@ -113,7 +113,7 @@
 try:
 from pywikibot.userinterfaces.gui import Tkdialog
 except ImportError as _tk_error:
-Tkdialog = None
+Tkdialog = object
 
 NL = ''
 
diff --git a/scripts/imagecopy_self.py b/scripts/imagecopy_self.py
index f0ec351..36d883e 100644
--- a/scripts/imagecopy_self.py
+++ b/scripts/imagecopy_self.py
@@ -80,7 +80,7 @@
 try:
 from pywikibot.userinterfaces.gui import Tkdialog
 except ImportError as _tk_error:
-Tkdialog = None
+Tkdialog = object
 
 NL = ''
 

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: tools_tests.py: Take care of windows line endings

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

Change subject: tools_tests.py: Take care of windows line endings
..


tools_tests.py: Take care of windows line endings

Depending on git configuration, line-ending of checked-out files
may be "\r\n" instead of "\n" for windows users. This causes the
hash values of files to change and tests will fail. Add hash
values for windows line-endings.

Replace b'\r\n' with b'\n' in the content of uncompressed files.

Change-Id: I5babeb7b3ea5d1800449e37a8a2b2c358eec663a
---
M tests/tools_tests.py
1 file changed, 34 insertions(+), 13 deletions(-)

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



diff --git a/tests/tools_tests.py b/tests/tools_tests.py
index abf00b8..c0e916c 100644
--- a/tests/tools_tests.py
+++ b/tests/tools_tests.py
@@ -98,12 +98,12 @@
 super(OpenArchiveTestCase, cls).setUpClass()
 cls.base_file = join_xml_data_path('article-pyrus.xml')
 with open(cls.base_file, 'rb') as f:
-cls.original_content = f.read()
+cls.original_content = f.read().replace(b'\r\n', b'\n')
 
 def _get_content(self, *args, **kwargs):
 """Use open_archive and return content using a with-statement."""
 with tools.open_archive(*args, **kwargs) as f:
-return f.read()
+return f.read().replace(b'\r\n', b'\n')
 
 def test_open_archive_normal(self):
 """Test open_archive with no compression in the standard library."""
@@ -176,7 +176,7 @@
 kwargs['use_extension'] = True
 
 with tools.open_compressed(*args, **kwargs) as f:
-content = f.read()
+content = f.read().replace(b'\r\n', b'\n')
 self.assertOneDeprecation(self.INSTEAD)
 return content
 
@@ -193,7 +193,7 @@
 super(OpenArchiveWriteTestCase, cls).setUpClass()
 cls.base_file = join_xml_data_path('article-pyrus.xml')
 with open(cls.base_file, 'rb') as f:
-cls.original_content = f.read()
+cls.original_content = f.read().replace(b'\r\n', b'\n')
 
 def _write_content(self, suffix):
 try:
@@ -754,7 +754,12 @@
 
 class TestFileShaCalculator(TestCase):
 
-"""Test calculator of sha of a file."""
+r"""Test calculator of sha of a file.
+
+There are two possible hash values for each test. The second one is for
+files with windows line endings (\r\n).
+
+"""
 
 net = False
 
@@ -767,37 +772,53 @@
 def test_md5_complete_calculation(self):
 """Test md5 of complete file."""
 res = tools.compute_file_hash(self.filename, sha='md5')
-self.assertEqual(res, '5d7265e290e6733e1e2020630262a6f3')
+self.assertIn(res, (
+'5d7265e290e6733e1e2020630262a6f3',
+'2c941f2fa7e6e629d165708eb02b67f7',
+))
 
 def test_md5_partial_calculation(self):
 """Test md5 of partial file (1024 bytes)."""
 res = tools.compute_file_hash(self.filename, sha='md5',
   bytes_to_read=1024)
-self.assertEqual(res, 'edf6e1accead082b6b831a0a600704bc')
+self.assertIn(res, (
+'edf6e1accead082b6b831a0a600704bc',
+'be0227b6d490baa49e6d7e131c7f596b',
+))
 
 def test_sha1_complete_calculation(self):
 """Test sha1 of complete file."""
 res = tools.compute_file_hash(self.filename, sha='sha1')
-self.assertEqual(res, '1c12696e1119493a625aa818a35c41916ce32d0c')
+self.assertIn(res, (
+'1c12696e1119493a625aa818a35c41916ce32d0c',
+'146121e6d0461916c9a0fab00dc718acdb6a6b14',
+))
 
 def test_sha1_partial_calculation(self):
 """Test sha1 of partial file (1024 bytes)."""
 res = tools.compute_file_hash(self.filename, sha='sha1',
   bytes_to_read=1024)
-self.assertEqual(res, 'e56fa7bd5cfdf6bb7e2d8649dd9216c03e7271e6')
+self.assertIn(res, (
+'e56fa7bd5cfdf6bb7e2d8649dd9216c03e7271e6',
+'617ce7d539848885b52355ed597a042dae1e726f',
+))
 
 def test_sha224_complete_calculation(self):
 """Test sha224 of complete file."""
 res = tools.compute_file_hash(self.filename, sha='sha224')
-self.assertEqual(
-res, '3d350d9d9eca074bd299cb5ffe1b325a9f589b2bcd7ba1c033ab4d33')
+self.assertIn(res, (
+'3d350d9d9eca074bd299cb5ffe1b325a9f589b2bcd7ba1c033ab4d33',
+'4a2cf33b7da01f7b0530b2cc624e1180c8651b20198e9387aee0c767',
+))
 
 def test_sha224_partial_calculation(self):
 """Test sha224 of partial file (1024 bytes)."""
 res = tools.compute_file_hash(self.filename, sha='sha224',
   bytes_to_read=1024)
-self.assertEqual(
-res,