[MediaWiki-commits] [Gerrit] operations/puppet[production]: Toolforge: Update motd banners for rebranding

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

Change subject: Toolforge: Update motd banners for rebranding
..

Toolforge: Update motd banners for rebranding

Rename Tool Labs to Toolforge in motd banners shown on project
instances.

Bug: T168480
Change-Id: I03d6906a76065de3f900deb535f4f21e87375eed
---
M modules/toollabs/files/40-tools-bastion-banner.sh
M modules/toollabs/files/40-tools-exechost-banner.sh
M modules/toollabs/files/40-tools-infrastructure-banner.sh
M modules/toollabs/files/40-tools-submithost-banner.sh
R modules/toollabs/files/40-tools-sudoers-no-warning
M modules/toollabs/files/40-toolsbeta-bastion-banner.sh
M modules/toollabs/files/40-toolsbeta-exechost-banner.sh
M modules/toollabs/files/40-toolsbeta-infrastructure-banner.sh
M modules/toollabs/files/40-toolsbeta-submithost-banner.sh
M modules/toollabs/manifests/init.pp
10 files changed, 33 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/07/364007/1

diff --git a/modules/toollabs/files/40-tools-bastion-banner.sh 
b/modules/toollabs/files/40-tools-bastion-banner.sh
index f3505d8..04bc49d 100644
--- a/modules/toollabs/files/40-tools-bastion-banner.sh
+++ b/modules/toollabs/files/40-tools-bastion-banner.sh
@@ -5,20 +5,19 @@
 #
 
 cat <#  #Wikimedia projects and 
their users.
- #.  (   \   .#  
- ##  #)   #  ##  
- ##  '   """###  ##  
- ##  ### # ###   #<<###  ##  Use of this system is 
subject to the Tool Labs
-  ##  ### ### ,# #  ##   Terms of Use and Privacy 
Policies:
-   ###    ###- 
https://tools.wmflabs.org/?Rules
-   ##    
-  #  #   General guidance and help can 
be found at:
-     - 
https://tools.wmflabs.org/?Help
+Use of this system is subject to the Toolforge Terms of Use,
+Code of Conduct, and Privacy Policies:
+- https://tools.wmflabs.org/?Rules
+
+General guidance and help can be found at:
+- https://tools.wmflabs.org/?Help
 
 EOF
diff --git a/modules/toollabs/files/40-tools-exechost-banner.sh 
b/modules/toollabs/files/40-tools-exechost-banner.sh
index 27e8e5f..8cb1f7d 100644
--- a/modules/toollabs/files/40-tools-exechost-banner.sh
+++ b/modules/toollabs/files/40-tools-exechost-banner.sh
@@ -6,7 +6,7 @@
 
 cat <#  #Wikimedia projects and 
their users.
- #.  (   \   .#  
- ##  #)   #  ##  
- ##  '   """###  ##  
- ##  ### # ###   #<<###  ##  Use of this system is 
subject to the Tool Labs
-  ##  ### ### ,# #  ##   Terms of Use and Privacy 
Policies:
-   ###    ###- 
https://tools.wmflabs.org/?Rules
-   ##    
-  #  #   General guidance and help can 
be found at:
-     - 
https://tools.wmflabs.org/?Help
+Use of this system is subject to the Toolforge Terms of Use,
+Code of Conduct, and Privacy Policies:
+- https://tools.wmflabs.org/?Rules
+
+General guidance and help can be found at:
+- https://tools.wmflabs.org/?Help
 
 EOF
diff --git a/modules/toollabs/files/40-toolsbeta-exechost-banner.sh 
b/modules/toollabs/files/40-toolsbeta-exechost-banner.sh
index 27e8e5f..8cb1f7d 100644
--- a/modules/toollabs/files/40-toolsbeta-exechost-banner.sh
+++ b/modules/toollabs/files/40-toolsbeta-exechost-banner.sh
@@ -6,7 +6,7 @@
 
 cat < '0440',
 owner  => 'root',
 group  => 'root',
-source => 'puppet:///modules/toollabs/40-tools-sudoers-no-warning.sh',
+source => 'puppet:///modules/toollabs/40-tools-sudoers-no-warning',
 }
 
 file { '/usr/local/bin/log-command-invocation':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03d6906a76065de3f900deb535f4f21e87375eed
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] labs/striker[master]: Change #wikimedia-labs to #wikimedia-cloud

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

Change subject: Change #wikimedia-labs to #wikimedia-cloud
..


Change #wikimedia-labs to #wikimedia-cloud

Bug: T166420
Change-Id: I7807036db63f08926fc2f7634f858f742600779d
---
M striker/templates/400.html
M striker/templates/403.html
M striker/templates/500.html
3 files changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/striker/templates/400.html b/striker/templates/400.html
index 369b93d..3fb744f 100644
--- a/striker/templates/400.html
+++ b/striker/templates/400.html
@@ -17,7 +17,7 @@
   
 
   Your client has made an invalid request for the URI {{ request_path 
}}.
-  You may be able to get further information in the #wikimedia-labs channel on 
the Freenode IRC network.
+  You may be able to get further information in the #wikimedia-cloud channel on 
the Freenode IRC network.
 
   
 If you report this error, please include the details below.
diff --git a/striker/templates/403.html b/striker/templates/403.html
index 8164b96..a92527a 100644
--- a/striker/templates/403.html
+++ b/striker/templates/403.html
@@ -16,7 +16,7 @@
   
 
   You are not currently authorized to view the URI {{ request_path 
}}.
-  You may be able to get further information in the #wikimedia-labs channel on 
the Freenode IRC network.
+  You may be able to get further information in the #wikimedia-cloud channel on 
the Freenode IRC network.
 
   
 If you report this error, please include the details below.
diff --git a/striker/templates/500.html b/striker/templates/500.html
index 94877f2..6922f45 100644
--- a/striker/templates/500.html
+++ b/striker/templates/500.html
@@ -17,7 +17,7 @@
   
 
   An unexpected technical problem has occured while handing the requested 
URI {{ request_path }}. This is probably temporary and should be 
fixed soon. Please try again later.
-  You may be able to get further information in the #wikimedia-labs channel on 
the Freenode IRC network.
+  You may be able to get further information in the #wikimedia-cloud channel on 
the Freenode IRC network.
 
   
 If you report this error, please include the details below.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7807036db63f08926fc2f7634f858f742600779d
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.loader: Log unknown modules in load() to console

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

Change subject: mw.loader: Log unknown modules in load() to console
..

mw.loader: Log unknown modules in load() to console

Follows-up If8ff31b530dfbd882. Now that we have resolveStubbornly,
we don't need to filter out unknown modules ahead of time.

Aside from removing the needless filter condition, it also has
the benefit of causing a message to be logged to the console,
which can help discover problems. Previously these were silently
ignored.

Change-Id: I700db4931dfd0a412a8eca66c4a74b8831ab0086
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
2 files changed, 20 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/364006/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 91e75d9..01ab322 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -2083,7 +2083,7 @@
// Filter out top-level modules that 
are unknown or failed to load before.
filtered = $.grep( modules, function ( 
module ) {
var state = mw.loader.getState( 
module );
-   return state !== null && state 
!== 'error' && state !== 'missing';
+   return state !== 'error' && 
state !== 'missing';
} );
// Resolve remaining list using the 
known dependency tree.
// This also filters out modules with 
unknown dependencies. (T36853)
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
index 9dc9e5d..a00b3cb 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
@@ -230,9 +230,25 @@
).always( done );
} );
 
-   QUnit.test( '.load() - Error: Unregistered (ignored)', function ( 
assert ) {
-   assert.expect( 0 );
-   mw.loader.load( 'test.using.unreg2' );
+   QUnit.test( '.load() - Error: Unregistered', function ( assert ) {
+   var capture = [];
+   this.sandbox.stub( mw, 'track', function ( topic, data ) {
+   capture.push( {
+   topic: topic,
+   error: data.exception && data.exception.message,
+   source: data.source
+   } );
+   } );
+
+   mw.loader.load( 'test.load.unreg' );
+   assert.deepEqual(
+   [ {
+   topic: 'resourceloader.exception',
+   error: 'Unknown dependency: test.load.unreg',
+   source: 'resolve'
+   } ],
+   capture
+   );
} );
 
// Regression test for T36853

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.loader: Skip modules in load() with unknown dependencies

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

Change subject: mw.loader: Skip modules in load() with unknown dependencies
..

mw.loader: Skip modules in load() with unknown dependencies

We already skip unknown modules at the top-level, but dependencies
still cause a run-time exception from sortDependencies, resulting
in the entire queue not being loaded.

Bug: T36853
Change-Id: If8ff31b530dfbd8823c47ffd827fcdba807c05b3
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
2 files changed, 89 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/364005/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index d172a39..91e75d9 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -754,6 +754,7 @@
 * is used)
 *   - load-callback: exception thrown by user callback
 *   - module-execute: exception thrown by module code
+*   - resolve: failed to sort dependencies for a 
module in mw.loader.load
 *   - store-eval: could not evaluate module code 
cached in localStorage
 *   - store-localstorage-init: localStorage or JSON 
parse error in mw.loader.store.init
 *   - store-localstorage-json: JSON conversion error 
in mw.loader.store.set
@@ -1165,6 +1166,33 @@
var i, resolved = [];
for ( i = 0; i < modules.length; i++ ) {
sortDependencies( modules[ i ], 
resolved );
+   }
+   return resolved;
+   }
+
+   /**
+* Like #resolve(), except it will silently ignore 
modules that
+* are missing or have missing dependencies.
+*
+* @private
+* @param {string[]} modules Array of string module 
names
+* @return {Array} List of dependencies.
+*/
+   function resolveStubbornly( modules ) {
+   var i, saved, resolved = [];
+   for ( i = 0; i < modules.length; i++ ) {
+   saved = resolved.slice();
+   try {
+   sortDependencies( modules[ i ], 
resolved );
+   } catch ( err ) {
+   // This module is unknown or 
has unknown dependencies.
+   // Undo any incomplete 
resolutinos made and keep going.
+   resolved = saved;
+   mw.track( 
'resourceloader.exception', {
+   exception: err,
+   source: 'resolve'
+   } );
+   }
}
return resolved;
}
@@ -2012,6 +2040,15 @@
/**
 * Load an external script or one or more 
modules.
 *
+* This method takes a list of unrelated 
modules. Use cases:
+*
+* - A web page will be composed of many 
different widgets. These widgets independently
+*   queue their ResourceLoader modules 
(`OutputPage::addModules()`). If any of them
+*   have problems, or are no longer known 
(e.g. cached HTML), the other modules
+*   should stil be loaded.
+* - This method is used for preloading, which 
must not throw. Later code that
+*   calls #using() will handle the error.
+*
 * @param {string|Array} modules Either the 
name of a module, array of modules,
 *  or a URL of an external script or style
 * @param {string} [type='text/javascript'] 
MIME type to use if calling with a URL of an
@@ -2043,25 +2080,21 @@
modules = [ modules ];
}
 
- 

[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Added delete scripts

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

Change subject: Added delete scripts
..


Added delete scripts

Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
---
A delete_wiki.yml
A roles/delete_wiki_on_db_host/tasks/main.yml
A roles/delete_wiki_on_mw_host/tasks/main.yml
3 files changed, 33 insertions(+), 0 deletions(-)

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



diff --git a/delete_wiki.yml b/delete_wiki.yml
new file mode 100644
index 000..264ef89
--- /dev/null
+++ b/delete_wiki.yml
@@ -0,0 +1,13 @@
+- name: Delete a wiki - DB tasks
+
+  hosts: "{{ DB_HOST | default(MW_HOST) }}"
+
+  roles:
+- delete_wiki_on_db_host
+
+- name: Delete a wiki - MediaWiki tasks
+
+  hosts: "{{ MW_HOST }}"
+
+  roles:
+- delete_wiki_on_mw_host
diff --git a/roles/delete_wiki_on_db_host/tasks/main.yml 
b/roles/delete_wiki_on_db_host/tasks/main.yml
new file mode 100644
index 000..47bb519
--- /dev/null
+++ b/roles/delete_wiki_on_db_host/tasks/main.yml
@@ -0,0 +1,6 @@
+- name: delete wiki schema
+  mysql_db:
+name={{ WIKI_NAME }}
+login_user=root
+login_password={{ MYSQL_ROOT_PASSWORD }}
+state=absent
diff --git a/roles/delete_wiki_on_mw_host/tasks/main.yml 
b/roles/delete_wiki_on_mw_host/tasks/main.yml
new file mode 100644
index 000..c6a54f2
--- /dev/null
+++ b/roles/delete_wiki_on_mw_host/tasks/main.yml
@@ -0,0 +1,14 @@
+- name: delete wiki Apache configuration file
+  file:
+path={{ APACHE_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}.conf
+state=absent
+
+- name: restart Apache
+  service:
+name=httpd
+state=restarted
+
+- name: delete instance directory
+  file:
+path={{ MW_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}
+state=absent

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

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


[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Added delete scripts

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

Change subject: Added delete scripts
..

Added delete scripts

Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
---
A delete_wiki.yml
A roles/delete_wiki_on_db_host/tasks/main.yml
A roles/delete_wiki_on_mw_host/tasks/main.yml
3 files changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/ansible-wikifarm 
refs/changes/04/364004/1

diff --git a/delete_wiki.yml b/delete_wiki.yml
new file mode 100644
index 000..264ef89
--- /dev/null
+++ b/delete_wiki.yml
@@ -0,0 +1,13 @@
+- name: Delete a wiki - DB tasks
+
+  hosts: "{{ DB_HOST | default(MW_HOST) }}"
+
+  roles:
+- delete_wiki_on_db_host
+
+- name: Delete a wiki - MediaWiki tasks
+
+  hosts: "{{ MW_HOST }}"
+
+  roles:
+- delete_wiki_on_mw_host
diff --git a/roles/delete_wiki_on_db_host/tasks/main.yml 
b/roles/delete_wiki_on_db_host/tasks/main.yml
new file mode 100644
index 000..47bb519
--- /dev/null
+++ b/roles/delete_wiki_on_db_host/tasks/main.yml
@@ -0,0 +1,6 @@
+- name: delete wiki schema
+  mysql_db:
+name={{ WIKI_NAME }}
+login_user=root
+login_password={{ MYSQL_ROOT_PASSWORD }}
+state=absent
diff --git a/roles/delete_wiki_on_mw_host/tasks/main.yml 
b/roles/delete_wiki_on_mw_host/tasks/main.yml
new file mode 100644
index 000..c6a54f2
--- /dev/null
+++ b/roles/delete_wiki_on_mw_host/tasks/main.yml
@@ -0,0 +1,14 @@
+- name: delete wiki Apache configuration file
+  file:
+path={{ APACHE_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}.conf
+state=absent
+
+- name: restart Apache
+  service:
+name=httpd
+state=restarted
+
+- name: delete instance directory
+  file:
+path={{ MW_INSTANCE_DIRECTORY }}/{{ WIKI_NAME }}
+state=absent

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibdd1da62c09f4118cf78b94d86e6b1864983c213
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

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


[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: Show Right option in the header of quiz

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

Change subject: Show Right option in the header of quiz
..

Show Right option in the header of quiz

Currently the right option is not visible in the header due to no text
inside the html.This change adds the using wfMessage.

Bug:T170035
Change-Id: I0ed2308717f2337ab4e47b4a66e30e3b952dc406
---
M templates/Setting.mustache
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/templates/Setting.mustache b/templates/Setting.mustache
index 15f30a4..f6496d4 100644
--- a/templates/Setting.mustache
+++ b/templates/Setting.mustache
@@ -6,7 +6,7 @@
{{/ notSimple}}
{{# corrected}}

-   {{ 
wf.Message.quiz_colorRight }}
+   {{ 
wfMessage.quiz_colorRight }}
{{/corrected}}
{{# error}}
{{^ corrected}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ed2308717f2337ab4e47b4a66e30e3b952dc406
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Harjotsingh 

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


[MediaWiki-commits] [Gerrit] mediawiki...ansible-wikifarm[master]: Fix bug in clone when changing wiki name

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

Change subject: Fix bug in clone when changing wiki name
..


Fix bug in clone when changing wiki name

Change-Id: Ibbfe3c74bd5e386f7e990d846972076142fa3ba3
---
M clone_wiki_push.yml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/clone_wiki_push.yml b/clone_wiki_push.yml
index c713d38..aee468b 100644
--- a/clone_wiki_push.yml
+++ b/clone_wiki_push.yml
@@ -55,7 +55,7 @@
 dest={{ CLONE_DIRECTORY }}
 
 - name: archive destination wiki instance directory
-  shell: tar cfj {{ CLONE_DIRECTORY }}/{{ TO_WIKI_NAME | 
default(FROM_WIKI_NAME) }}-{{ TO_MW_HOST }}.tar.bz2 -C {{ MW_INSTANCE_DIRECTORY 
}} {{ FROM_WIKI_NAME }}
+  shell: tar cfj {{ CLONE_DIRECTORY }}/{{ TO_WIKI_NAME | 
default(FROM_WIKI_NAME) }}-{{ TO_MW_HOST }}.tar.bz2 -C {{ MW_INSTANCE_DIRECTORY 
}} {{ TO_WIKI_NAME | default(FROM_WIKI_NAME) }}
 
 - name: remove destination wiki instance directory
   file:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbfe3c74bd5e386f7e990d846972076142fa3ba3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/ansible-wikifarm
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Add unit tests for ResourceLoaderSkinModule

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

Change subject: resourceloader: Add unit tests for ResourceLoaderSkinModule
..

resourceloader: Add unit tests for ResourceLoaderSkinModule

Change-Id: I299eff8f5172e047c0d54d9c824b17529dd6d190
---
A tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php
1 file changed, 67 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/364002/1

diff --git 
a/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php 
b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php
new file mode 100644
index 000..c567698
--- /dev/null
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php
@@ -0,0 +1,67 @@
+ [],
+   'expected' => [
+   'all' => [ '.mw-wiki-logo { 
background-image: url(/logo.png); }' ],
+   ],
+   ],
+   [
+   'parent' => [
+   'screen' => '.example {}',
+   ],
+   'expected' => [
+   'screen' => [ '.example {}' ],
+   'all' => [ '.mw-wiki-logo { 
background-image: url(/logo.png); }' ],
+   ],
+   ],
+   ];
+   }
+
+   /**
+* @dataProvider provideGetStyles
+* @covers ResourceLoaderSkinModule::normalizeStyles
+* @covers ResourceLoaderSkinModule::getStyles
+*/
+   public function testGetStyles( $parent, $expected ) {
+   $module = $this->getMockBuilder( 
ResourceLoaderSkinModule::class )
+   ->disableOriginalConstructor()
+   ->setMethods( [ 'readStyleFiles' ] )
+   ->getMock();
+   $module->expects( $this->once() )->method( 'readStyleFiles' )
+   ->willReturn( $parent );
+   $module->setConfig( new HashConfig( [
+   'ResourceBasePath' => '/w',
+   'Logo' => '/logo.png',
+   'LogoHD' => false,
+   ] ) );
+
+   $ctx = $this->getMockBuilder( ResourceLoaderContext::class )
+   ->disableOriginalConstructor()->getMock();
+
+   $this->assertEquals(
+   $module->getStyles( $ctx ),
+   $expected
+   );
+   }
+
+   /**
+* @covers ResourceLoaderSkinModule::isKnownEmpty
+*/
+   public function testIsKnownEmpty() {
+   $module = $this->getMockBuilder( 
ResourceLoaderSkinModule::class )
+   ->disableOriginalConstructor()->setMethods( null 
)->getMock();
+   $ctx = $this->getMockBuilder( ResourceLoaderContext::class )
+   ->disableOriginalConstructor()->getMock();
+
+   $this->assertFalse( $module->isKnownEmpty( $ctx ) );
+   }
+}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: statsd: Rename MediawikiStatsdDataFactory to IBufferingStats...

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

Change subject: statsd: Rename MediawikiStatsdDataFactory to 
IBufferingStatsdDataFactory
..


statsd: Rename MediawikiStatsdDataFactory to IBufferingStatsdDataFactory

Follows-up I2874175647e (7fdc3d09a3b).

* Avoid "MediaWiki" in class names. If unavoidable, always camelcase.
* Use a more descriptive name, matching the implementing the class 
("Buffering").
* Use "I" prefix for consistency with other MediaWiki-provided interfaces.
  (Avoid "Interface" suffix, which is foreign to MediaWiki and is only used
  in the StatsdClient namespace, which this interface is not in).

Bug: T166354
Change-Id: I06de59122625f9c23e7c1a1bfa69a7ddabbf379e
---
M autoload.php
M includes/MediaWikiServices.php
M includes/context/ContextSource.php
M includes/context/DerivativeContext.php
M includes/context/IContextSource.php
M includes/context/RequestContext.php
M includes/libs/stats/BufferingStatsdDataFactory.php
R includes/libs/stats/IBufferingStatsdDataFactory.php
M includes/libs/stats/NullStatsdDataFactory.php
M tests/phpunit/includes/MediaWikiServicesTest.php
10 files changed, 14 insertions(+), 12 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 2560bdb..88b6170 100644
--- a/autoload.php
+++ b/autoload.php
@@ -604,6 +604,7 @@
'HttpError' => __DIR__ . '/includes/exception/HttpError.php',
'HttpStatus' => __DIR__ . '/includes/libs/HttpStatus.php',
'IApiMessage' => __DIR__ . '/includes/api/ApiMessage.php',
+   'IBufferingStatsdDataFactory' => __DIR__ . 
'/includes/libs/stats/IBufferingStatsdDataFactory.php',
'ICacheHelper' => __DIR__ . '/includes/cache/CacheHelper.php',
'IContextSource' => __DIR__ . '/includes/context/IContextSource.php',
'IDBAccessObject' => __DIR__ . '/includes/dao/IDBAccessObject.php',
@@ -964,7 +965,6 @@
'MediaWiki\\Widget\\TitleInputWidget' => __DIR__ . 
'/includes/widget/TitleInputWidget.php',
'MediaWiki\\Widget\\UserInputWidget' => __DIR__ . 
'/includes/widget/UserInputWidget.php',
'MediaWiki\\Widget\\UsersMultiselectWidget' => __DIR__ . 
'/includes/widget/UsersMultiselectWidget.php',
-   'MediawikiStatsdDataFactory' => __DIR__ . 
'/includes/libs/stats/MediawikiStatsdDataFactory.php',
'MemCachedClientforWiki' => __DIR__ . 
'/includes/compat/MemcachedClientCompat.php',
'MemcLockManager' => __DIR__ . 
'/includes/libs/lockmanager/MemcLockManager.php',
'MemcachedBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedBagOStuff.php',
diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index ea0ec15..84fc959 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -9,7 +9,7 @@
 use GenderCache;
 use GlobalVarConfig;
 use Hooks;
-use MediawikiStatsdDataFactory;
+use IBufferingStatsdDataFactory;
 use Wikimedia\Rdbms\LBFactory;
 use LinkCache;
 use Wikimedia\Rdbms\LoadBalancer;
@@ -447,7 +447,7 @@
 
/**
 * @since 1.27
-* @return MediawikiStatsdDataFactory
+* @return IBufferingStatsdDataFactory
 */
public function getStatsdDataFactory() {
return $this->getService( 'StatsdDataFactory' );
diff --git a/includes/context/ContextSource.php 
b/includes/context/ContextSource.php
index 36d6df2..434201a 100644
--- a/includes/context/ContextSource.php
+++ b/includes/context/ContextSource.php
@@ -170,7 +170,7 @@
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
 * @since 1.25
-* @return MediawikiStatsdDataFactory
+* @return IBufferingStatsdDataFactory
 */
public function getStats() {
return MediaWikiServices::getInstance()->getStatsdDataFactory();
diff --git a/includes/context/DerivativeContext.php 
b/includes/context/DerivativeContext.php
index 9c3c42a..0d0c149 100644
--- a/includes/context/DerivativeContext.php
+++ b/includes/context/DerivativeContext.php
@@ -109,7 +109,7 @@
 *
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
-* @return MediawikiStatsdDataFactory
+* @return IBufferingStatsdDataFactory
 */
public function getStats() {
return MediaWikiServices::getInstance()->getStatsdDataFactory();
diff --git a/includes/context/IContextSource.php 
b/includes/context/IContextSource.php
index d13e1a5..895e9e4 100644
--- a/includes/context/IContextSource.php
+++ b/includes/context/IContextSource.php
@@ -131,7 +131,7 @@
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
 * @since 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Revert "Localisation updates from https://translatewiki.net."

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

Change subject: Revert "Localisation updates from https://translatewiki.net.;
..


Revert "Localisation updates from https://translatewiki.net.;

This reverts commit b158c5a81347c4c2f3218f673d5a9a645a099961.

Change-Id: I1d1592f98c4a7327923c9289abfcfadf726b3004
---
M i18n/nb.json
M i18n/qqq.json
M i18n/sv.json
D i18n/th.json
4 files changed, 6 insertions(+), 62 deletions(-)

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



diff --git a/i18n/nb.json b/i18n/nb.json
index 018255d..08be381 100644
--- a/i18n/nb.json
+++ b/i18n/nb.json
@@ -2,8 +2,7 @@
"@metadata": {
"authors": [
"Kingu",
-   "Jeblad",
-   "Danmichaelo"
+   "Jeblad"
]
},
"wbqc-constraintreport": "Rapporterte begrensinger",
@@ -13,68 +12,21 @@
"wbqc-constraintreport-result-headline": "Resultat for",
"wbqc-constraintreport-invalid-entity-id": "Ugyldig ID for entiteten.",
"wbqc-constraintreport-not-existent-entity": "Entiteten finnes ikke.",
-   "wbqc-constraintreport-empty-result": "Ingen begrensninger er definert 
for denne entiteten.",
"wbqc-constraintreport-status-violation": "Brudd",
"wbqc-constraintreport-status-compliance": "Samsvar",
"wbqc-constraintreport-status-exception": "Unntak",
"wbqc-constraintreport-status-todo": "Å gjøre",
-   "wbqc-constraintreport-status-bad-parameters": "Ugyldige parametre",
"wbqc-constraintreport-result-table-header-status": "Status",
"wbqc-constraintreport-result-table-header-claim": "Påstand",
"wbqc-constraintreport-result-table-header-constraint": "Begrensing",
"wbqc-constraintreport-result-link-to-claim": "gå til påstand",
"wbqc-constraintreport-result-link-to-constraint": "gå til begrensing",
"wbqc-constraintreport-no-parameter": "ingen",
-   "wbqc-potentialissues-short": "Mulige problemer",
-   "wbqc-potentialissues-long": "Dette utsagnet har mulige problemer.",
"wbq-subextension-name-wbqc": "Begrensing",
"wbqc-violation-header-parameters": "Parametre:",
"wbqc-violations-group": "Begrensing",
-   "wbqc-violation-message-value-needed": "Egenskapen med begrensningen 
«$1» må ha en verdi.",
-   "wbqc-violation-message-value-needed-of-type": "Egenskapen med 
begrensningen «$1» må ha en verdier av type «$2».",
-   "wbqc-violation-message-value-needed-of-types-2": "Egenskaper med 
begrensningen «$1» må ha en verdier av type «$2» eller «$3».",
-   "wbqc-violation-message-parameter-needed": "Egenskaper med 
begrensningen «$1» trenger en parameter «$2».",
-   "wbqc-violation-message-parameters-needed-3": "Egenskaper med 
begrensningen «$1» trenger parametre «$2», «$3» og «$4».",
"wbqc-violation-message-target-entity-must-exist": "Målentiteten må 
eksistere.",
-   "wbqc-violation-message-value-entity-must-exist": "Verdien må være en 
eksisterende entitet.",
-   "wbqc-violation-message-parameter-value": "Parameteren «$1» må ha en 
bestemt verdi, ikke \"ingen verdi\" eller \"ukjent verdi\".",
-   "wbqc-violation-message-parameter-value-or-novalue": "Parameteren «$1» 
kan ha en bestemt verdi eller \"ingen verdi\", men ikke \"ukjent verdi\".",
-   "wbqc-violation-message-parameter-entity": "Verdien til parameteren 
«$1» må være en entitet, ikke «$2».",
-   "wbqc-violation-message-parameter-item": "Verdien til parameteren «$1» 
må være et element, ikke «$2».",
-   "wbqc-violation-message-parameter-property": "Verdien til parameteren 
«$1» må være en egenskap, ikke «$2».",
-   "wbqc-violation-message-parameter-string": "Verdien til parameteren 
«$1» må være en streng, ikke «$2».",
-   "wbqc-violation-message-parameter-single": "Verdien til parameteren 
«$1» skal kun bestå av én enkelt verdi.",
-   "wbqc-violation-message-parameter-oneof": "Parameteren «$1» må være 
{{PLURAL:$2|1=$4.|2=enten $4 eller $5.|én av følgende:$3}}",
-   "wbqc-violation-message-sparql-error": "SPARQL-spørringen feilet.",
-   "wbqc-violation-message-commons-link-no-existent": "Lenka til Commons 
bør eksistere.",
-   "wbqc-violation-message-commons-link-not-well-formed": "Lenka til 
Commons bør være en gyldig URL.",
-   "wbqc-violation-message-conflicts-with-property": "En entitet skal 
aldri ha utsagn for både $1 og $2.",
-   "wbqc-violation-message-conflicts-with-claim": "En entitet skal ikke ha 
et utsagn for $1 hvis den også har et utsagn for $2 med verdi $3.",
-   "wbqc-violation-message-diff-within-range": "Forskjellen mellom $3 ($4) 
og $1 ($2) bør være mellom $5 og $6 ([$5; $6]).",
-   "wbqc-violation-message-diff-within-range-leftopen": "Forskjellen 
mellom $3 ($4) og $1 ($2) 

[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Revert "Localisation updates from https://translatewiki.net."

2017-07-07 Thread Krinkle (Code Review)
Hello L10n-bot,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Revert "Localisation updates from https://translatewiki.net.;
..

Revert "Localisation updates from https://translatewiki.net.;

This reverts commit b158c5a81347c4c2f3218f673d5a9a645a099961.

Change-Id: I1d1592f98c4a7327923c9289abfcfadf726b3004
---
M i18n/nb.json
M i18n/qqq.json
M i18n/sv.json
D i18n/th.json
4 files changed, 6 insertions(+), 62 deletions(-)


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

diff --git a/i18n/nb.json b/i18n/nb.json
index 018255d..08be381 100644
--- a/i18n/nb.json
+++ b/i18n/nb.json
@@ -2,8 +2,7 @@
"@metadata": {
"authors": [
"Kingu",
-   "Jeblad",
-   "Danmichaelo"
+   "Jeblad"
]
},
"wbqc-constraintreport": "Rapporterte begrensinger",
@@ -13,68 +12,21 @@
"wbqc-constraintreport-result-headline": "Resultat for",
"wbqc-constraintreport-invalid-entity-id": "Ugyldig ID for entiteten.",
"wbqc-constraintreport-not-existent-entity": "Entiteten finnes ikke.",
-   "wbqc-constraintreport-empty-result": "Ingen begrensninger er definert 
for denne entiteten.",
"wbqc-constraintreport-status-violation": "Brudd",
"wbqc-constraintreport-status-compliance": "Samsvar",
"wbqc-constraintreport-status-exception": "Unntak",
"wbqc-constraintreport-status-todo": "Å gjøre",
-   "wbqc-constraintreport-status-bad-parameters": "Ugyldige parametre",
"wbqc-constraintreport-result-table-header-status": "Status",
"wbqc-constraintreport-result-table-header-claim": "Påstand",
"wbqc-constraintreport-result-table-header-constraint": "Begrensing",
"wbqc-constraintreport-result-link-to-claim": "gå til påstand",
"wbqc-constraintreport-result-link-to-constraint": "gå til begrensing",
"wbqc-constraintreport-no-parameter": "ingen",
-   "wbqc-potentialissues-short": "Mulige problemer",
-   "wbqc-potentialissues-long": "Dette utsagnet har mulige problemer.",
"wbq-subextension-name-wbqc": "Begrensing",
"wbqc-violation-header-parameters": "Parametre:",
"wbqc-violations-group": "Begrensing",
-   "wbqc-violation-message-value-needed": "Egenskapen med begrensningen 
«$1» må ha en verdi.",
-   "wbqc-violation-message-value-needed-of-type": "Egenskapen med 
begrensningen «$1» må ha en verdier av type «$2».",
-   "wbqc-violation-message-value-needed-of-types-2": "Egenskaper med 
begrensningen «$1» må ha en verdier av type «$2» eller «$3».",
-   "wbqc-violation-message-parameter-needed": "Egenskaper med 
begrensningen «$1» trenger en parameter «$2».",
-   "wbqc-violation-message-parameters-needed-3": "Egenskaper med 
begrensningen «$1» trenger parametre «$2», «$3» og «$4».",
"wbqc-violation-message-target-entity-must-exist": "Målentiteten må 
eksistere.",
-   "wbqc-violation-message-value-entity-must-exist": "Verdien må være en 
eksisterende entitet.",
-   "wbqc-violation-message-parameter-value": "Parameteren «$1» må ha en 
bestemt verdi, ikke \"ingen verdi\" eller \"ukjent verdi\".",
-   "wbqc-violation-message-parameter-value-or-novalue": "Parameteren «$1» 
kan ha en bestemt verdi eller \"ingen verdi\", men ikke \"ukjent verdi\".",
-   "wbqc-violation-message-parameter-entity": "Verdien til parameteren 
«$1» må være en entitet, ikke «$2».",
-   "wbqc-violation-message-parameter-item": "Verdien til parameteren «$1» 
må være et element, ikke «$2».",
-   "wbqc-violation-message-parameter-property": "Verdien til parameteren 
«$1» må være en egenskap, ikke «$2».",
-   "wbqc-violation-message-parameter-string": "Verdien til parameteren 
«$1» må være en streng, ikke «$2».",
-   "wbqc-violation-message-parameter-single": "Verdien til parameteren 
«$1» skal kun bestå av én enkelt verdi.",
-   "wbqc-violation-message-parameter-oneof": "Parameteren «$1» må være 
{{PLURAL:$2|1=$4.|2=enten $4 eller $5.|én av følgende:$3}}",
-   "wbqc-violation-message-sparql-error": "SPARQL-spørringen feilet.",
-   "wbqc-violation-message-commons-link-no-existent": "Lenka til Commons 
bør eksistere.",
-   "wbqc-violation-message-commons-link-not-well-formed": "Lenka til 
Commons bør være en gyldig URL.",
-   "wbqc-violation-message-conflicts-with-property": "En entitet skal 
aldri ha utsagn for både $1 og $2.",
-   "wbqc-violation-message-conflicts-with-claim": "En entitet skal ikke ha 
et utsagn for $1 hvis den også har et utsagn for $2 med verdi $3.",
-   "wbqc-violation-message-diff-within-range": "Forskjellen mellom $3 ($4) 
og $1 ($2) bør være mellom $5 og $6 ([$5; $6]).",
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Only build tag list when experimental views are e...

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

Change subject: RCFilters: Only build tag list when experimental views are 
enabled
..


RCFilters: Only build tag list when experimental views are enabled

Follows-up 7725c755867ac1.

It's a waste otherwise, and buildChangeTagList() has perf issues.

Change-Id: Ifd7f81792fd7b5ee6e41ada756abbf0248f3eb36
---
M includes/specials/SpecialRecentchanges.php
1 file changed, 10 insertions(+), 5 deletions(-)

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



diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 4f21586..2fe56f9 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -177,6 +177,9 @@
)
);
 
+   $experimentalStructuredChangeFilters =
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableExperimentalViews' );
+
$out->addJsConfigVars( 'wgStructuredChangeFilters', 
$jsData['groups'] );
$out->addJsConfigVars(
'wgStructuredChangeFiltersEnableSaving',
@@ -184,16 +187,18 @@
);
$out->addJsConfigVars(

'wgStructuredChangeFiltersEnableExperimentalViews',
-   $this->getConfig()->get( 
'StructuredChangeFiltersEnableExperimentalViews' )
+   $experimentalStructuredChangeFilters
);
$out->addJsConfigVars(
'wgStructuredChangeFiltersEnableLiveUpdate',
$this->getConfig()->get( 
'StructuredChangeFiltersEnableLiveUpdate' )
);
-   $out->addJsConfigVars(
-   'wgRCFiltersChangeTags',
-   $this->buildChangeTagList()
-   );
+   if ( $experimentalStructuredChangeFilters ) {
+   $out->addJsConfigVars(
+   'wgRCFiltersChangeTags',
+   $this->buildChangeTagList()
+   );
+   }
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd7f81792fd7b5ee6e41ada756abbf0248f3eb36
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Mooeypoo 
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...SpamBlacklist[master]: Unbreak BaseBlacklist::getTypeFromTitle() and add tests

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

Change subject: Unbreak BaseBlacklist::getTypeFromTitle() and add tests
..


Unbreak BaseBlacklist::getTypeFromTitle() and add tests

The first part of the title is supposed to be capitalized, so call
ucfirst on it, and then make blacklist and whitelist lowercase. Add
tests to verify the known blacklist and whitelist types are recognized
correctly.

This will make validation of SpamBlacklist messages upon edit work
again.

Bug: T169838
Change-Id: I98688362f222ab65115fbec46e0f67587d19022d
---
M BaseBlacklist.php
A tests/phpunit/BaseBlacklistTest.php
2 files changed, 56 insertions(+), 2 deletions(-)

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



diff --git a/BaseBlacklist.php b/BaseBlacklist.php
index 77d4545..883d949 100644
--- a/BaseBlacklist.php
+++ b/BaseBlacklist.php
@@ -179,12 +179,15 @@
/**
 * Returns the type of blacklist from the given title
 *
+* @todo building a regex for this is pretty overkill
 * @param Title $title
 * @return bool|string
 */
public static function getTypeFromTitle( Title $title ) {
-   $types = array_map( 'preg_quote', array_keys( 
self::$blacklistTypes ), [ '/' ] );
-   $regex = '/(' . implode( '|', $types ).  
')-(?:Blacklist|Whitelist)/';
+   global $wgContLang;
+
+   $types = array_map( [ $wgContLang, 'ucfirst' ], array_keys( 
self::$blacklistTypes ) );
+   $regex = '/(' . implode( '|', $types ).  
')-(?:blacklist|whitelist)/';
 
if ( preg_match( $regex, $title->getDBkey(), $m ) ) {
return strtolower( $m[1] );
diff --git a/tests/phpunit/BaseBlacklistTest.php 
b/tests/phpunit/BaseBlacklistTest.php
new file mode 100644
index 000..634a266
--- /dev/null
+++ b/tests/phpunit/BaseBlacklistTest.php
@@ -0,0 +1,51 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * @covers BaseBlacklist
+ */
+class BaseBlacklistTest extends MediaWikiTestCase {
+
+   /**
+* @return array
+*/
+   public static function provideGetTypeFromTitle() {
+   return [
+   [ 'MediaWiki:Spam-blacklist', 'spam' ],
+   [ 'MediaWiki:Spam-whitelist', 'spam' ],
+   [ 'MediaWiki:Email-whitelist', 'email' ],
+   [ 'MediaWiki:Email-blacklist', 'email' ],
+   [ 'MediaWiki:A random page', false ],
+   [ 'Another random page', false ],
+   ];
+   }
+
+   /**
+* @dataProvider provideGetTypeFromTitle
+* @param string $title
+* @param string|bool $expected
+*/
+   public function testGetTypeFromTitle( $title, $expected ) {
+   $title = Title::newFromText( $title );
+   $output = BaseBlacklist::getTypeFromTitle( $title );
+   $this->assertEquals( $expected, $output );
+   }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I98688362f222ab65115fbec46e0f67587d19022d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SpamBlacklist
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Tim Starling 
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...CodeMirror[master]: Use a better page for the beta feature discussion link

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

Change subject: Use a better page for the beta feature discussion link
..


Use a better page for the beta feature discussion link

Change-Id: I5ce29e4bf47abf509afde0a57f64b5d1189f1234
---
M CodeMirror.hooks.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index 39a16e5..fd8e3a4 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -157,8 +157,8 @@
],
'info-link' => 
'https://meta.wikimedia.org/wiki/' .

'Community_Tech/Wikitext_editor_syntax_highlighting',
-   'discussion-link' => 
'https://meta.wikimedia.org/wiki/' .
-   
'Talk:Community_Tech/Wikitext_editor_syntax_highlighting'
+   'discussion-link' => 
'https://www.mediawiki.org/wiki/' .
+   'Extension_talk:CodeMirror'
];
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ce29e4bf47abf509afde0a57f64b5d1189f1234
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Niharika29 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...ortiz[master]: Add lint checking & update doc formatting

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

Change subject: Add lint checking & update doc formatting
..

Add lint checking & update doc formatting

This is mostly just to test CI.

Bug: T153856
Change-Id: I605a2a1e221850752517cccb9db1ed3c90fcb31a
---
A .lintr
M DESCRIPTION
M R/dwell.R
M R/ortiz.R
M man/dwell_time.Rd
M tests/testthat.R
A tests/testthat/test-syntax.R
7 files changed, 60 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/ortiz 
refs/changes/00/364000/1

diff --git a/.lintr b/.lintr
new file mode 100644
index 000..30b9cf8
--- /dev/null
+++ b/.lintr
@@ -0,0 +1,5 @@
+linters: with_defaults(line_length_linter(120), object_usage_linter = NULL, 
closed_curly_linter = NULL, open_curly_linter = NULL)
+exclusions: list("R/RcppExports.R")
+exclude: "# Exclude Linting"
+exclude_start: "# Begin Exclude Linting"
+exclude_end: "# End Exclude Linting"
diff --git a/DESCRIPTION b/DESCRIPTION
index 4168ee5..8ccc758 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,10 @@
 Package: ortiz
 Title: Speedy User Satisfaction Computations
-Version: 0.0.3
-Author: Oliver Keyes
-Maintainer: Mikhail Popov 
+Version: 0.0.4
+Authors@R: c(
+person("Mikhail", "Popov", email = "mikh...@wikimedia.org", role = 
c("aut", "cre")),
+person("Oliver", "Keyes", role = "aut", comment = "No longer employed at 
the Foundation")
+)
 Description: Speedily computes various user satisfaction-related metrics for
 Search.
 License: MIT + file LICENSE
@@ -11,6 +13,9 @@
 projects=Discovery
 LinkingTo: Rcpp
 Imports: Rcpp
-Suggests: testthat
+Suggests:
+lintr,
+testthat
 LazyData: true
+Roxygen: list(markdown = TRUE)
 RoxygenNote: 6.0.1
diff --git a/R/dwell.R b/R/dwell.R
index 3b5e705..d3361ef 100644
--- a/R/dwell.R
+++ b/R/dwell.R
@@ -1,21 +1,28 @@
-#'@title Identify User Satisfaction Rate Based on Dwell Time
+#' @title Identify User Satisfaction Rate Based on Dwell Time
+#' @description One simple satisfaction heuristic is to look at the dwell time
+#'  a user has on each page in a session and whether any one of those
+#'  dwell-times exceeds a certain threshold. If it does, that session is deemed
+#'  to be one in which the user was satisfied. `dwell_time` calculates
+#'  that for a data.frame of user sessions.
+#' @param data a `data.frame` containing session data
+#' @param id_col the name or index of the column containing unique session IDs
+#' @param ts_col the name or index of the column containing timestamps
+#' @param dwell_threshold the value (in seconds) to use to indicate a
+#'  "successful" session
+#' @examples
+#' # Data:
+#' ts <- as.POSIXct(
+#'   c("2016-03-01T06:52:49Z", "2016-03-01T06:53:19Z", "2016-03-01T06:53:39Z"),
+#'   format = "%Y-%m-%dT%H:%M:%SZ", tz = "UTC"
+#' )
+#' x <- data.frame(timestamp = ts, session_id = "0024c4506bf92e1c")
 #'
-#'@description One simple satisfaction heuristic is to look at the dwell time
-#'a user has on each page in a session and whether any one of those
-#'dwell-times exceeds a certain threshold. If it does, that session is deemed
-#'to be one in which the user was satisfied. \code{dwell_time} calculates
-#'that for a data.frame of user sessions.
+#' # Use default threshold:
+#' dwell_time(x, "session_id", "timestamp")
 #'
-#'@param data a data.frame containing session data
-#'
-#'@param id_col the name or index of the column containing unique session IDs
-#'
-#'@param ts_col the name or index of the column containing timestamps
-#'
-#'@param dwell_threshold the value (in seconds) to use to indicate a 
"successful"
-#'session.
-#'
-#'@export
+#' # Use 10s threshold:
+#' dwell_time(x, "session_id", "timestamp", 10)
+#' @export
 dwell_time <- function(data, id_col, ts_col, dwell_threshold = 100) {
 
   # Check type. We need timestamps to end up as numeric seconds 
representations,
diff --git a/R/ortiz.R b/R/ortiz.R
index 38696be..541ed55 100644
--- a/R/ortiz.R
+++ b/R/ortiz.R
@@ -1,8 +1,5 @@
-
 #' @title Speedy User Satisfaction Computations
-#'
 #' @description Speedily computes various user satisfaction-related metrics 
for Search.
-#'
 #' @docType package
 #' @name ortiz
 #' @useDynLib ortiz
diff --git a/man/dwell_time.Rd b/man/dwell_time.Rd
index 989f413..a1f5ae3 100644
--- a/man/dwell_time.Rd
+++ b/man/dwell_time.Rd
@@ -7,14 +7,14 @@
 dwell_time(data, id_col, ts_col, dwell_threshold = 100)
 }
 \arguments{
-\item{data}{a data.frame containing session data}
+\item{data}{a \code{data.frame} containing session data}
 
 \item{id_col}{the name or index of the column containing unique session IDs}
 
 \item{ts_col}{the name or index of the column containing timestamps}
 
-\item{dwell_threshold}{the value (in seconds) to use to indicate a "successful"
-session.}
+\item{dwell_threshold}{the value (in seconds) to use to indicate a
+"successful" session}
 }
 \description{
 One 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Autodiscover parser tests for extensions, deprecate $wgParse...

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

Change subject: Autodiscover parser tests for extensions, deprecate 
$wgParserTestFiles
..


Autodiscover parser tests for extensions, deprecate $wgParserTestFiles

This implements autodiscovery of extension parser tests that are located
in the tests/parser/ directory. Any *.txt file in that directory tree
will be treated as a parser test.

Core parser tests are now defined in ParserTestRunner::$coreTestFiles,
and $wgParserTestFiles is marked as deprecated.

Bug: T143976
Change-Id: Ia24fd8ef52e6732c698153b17bb679a5f511a2a7
---
M includes/DefaultSettings.php
M tests/parser/ParserTestRunner.php
M tests/parser/parserTests.php
M tests/phpunit/suites/ParserTestTopLevelSuite.php
4 files changed, 61 insertions(+), 10 deletions(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 0548d8b..11f08b2 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6333,15 +6333,16 @@
  * Parser test suite files to be run by parserTests.php when no specific
  * filename is passed to it.
  *
- * Extensions may add their own tests to this array, or site-local tests
- * may be added via LocalSettings.php
+ * Extensions using extension.json will have any *.txt file in a
+ * tests/parser/ directory automatically run.
+ *
+ * Core tests can be added to ParserTestRunner::$coreTestFiles.
  *
  * Use full paths.
+ *
+ * @deprecated since 1.30
  */
-$wgParserTestFiles = [
-   "$IP/tests/parser/parserTests.txt",
-   "$IP/tests/parser/extraParserTests.txt"
-];
+$wgParserTestFiles = [];
 
 /**
  * Allow running of javascript test suites via [[Special:JavaScriptTest]] 
(such as QUnit).
diff --git a/tests/parser/ParserTestRunner.php 
b/tests/parser/ParserTestRunner.php
index 9dce73f..9255733 100644
--- a/tests/parser/ParserTestRunner.php
+++ b/tests/parser/ParserTestRunner.php
@@ -34,6 +34,18 @@
  * @ingroup Testing
  */
 class ParserTestRunner {
+
+   /**
+* MediaWiki core parser test files, paths
+* will be prefixed with __DIR__ . '/'
+*
+* @var array
+*/
+   private static $coreTestFiles = [
+   'parserTests.txt',
+   'extraParserTests.txt',
+   ];
+
/**
 * @var bool $useTemporaryTables Use temporary tables for the temporary 
database
 */
@@ -147,6 +159,43 @@
}
}
 
+   /**
+* Get list of filenames to extension and core parser tests
+*
+* @return array
+*/
+   public static function getParserTestFiles() {
+   global $wgParserTestFiles;
+
+   // Add core test files
+   $files = array_map( function( $item ) {
+   return __DIR__ . "/$item";
+   }, self::$coreTestFiles );
+
+   // Plus legacy global files
+   $files = array_merge( $files, $wgParserTestFiles );
+
+   // Auto-discover extension parser tests
+   $registry = ExtensionRegistry::getInstance();
+   foreach ( $registry->getAllThings() as $info ) {
+   $dir = dirname( $info['path'] ) . '/tests/parser';
+   if ( !file_exists( $dir ) ) {
+   continue;
+   }
+   $dirIterator = new RecursiveIteratorIterator(
+   new RecursiveDirectoryIterator( $dir )
+   );
+   foreach ( $dirIterator as $fileInfo ) {
+   /** @var SplFileInfo $fileInfo */
+   if ( substr( $fileInfo->getFilename(), -4 ) === 
'.txt' ) {
+   $files[] = $fileInfo->getPathname();
+   }
+   }
+   }
+
+   return array_unique( $files );
+   }
+
public function getRecorder() {
return $this->recorder;
}
diff --git a/tests/parser/parserTests.php b/tests/parser/parserTests.php
index 1d0867a..2735f93 100644
--- a/tests/parser/parserTests.php
+++ b/tests/parser/parserTests.php
@@ -80,7 +80,7 @@
}
 
public function execute() {
-   global $wgParserTestFiles, $wgDBtype;
+   global $wgDBtype;
 
// Cases of weird db corruption were encountered when running 
tests on earlyish
// versions of SQLite
@@ -167,7 +167,7 @@
}
 
// Default parser tests and any set from extensions or local 
config
-   $files = $this->getOption( 'file', $wgParserTestFiles );
+   $files = $this->getOption( 'file', 
ParserTestRunner::getParserTestFiles() );
 
$norm = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use Sanitizer::stripAllTags( $x ) instead of html_entity_dec...

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

Change subject: Use Sanitizer::stripAllTags( $x ) instead of 
html_entity_decode( strip_tags( $x ) )
..


Use Sanitizer::stripAllTags( $x ) instead of html_entity_decode( strip_tags( $x 
) )

We have a utility function for this, so let's use it.

What I don't understand though is why Sanitizer uses custom PHP implementations
for both tag stripping and entity decoding, instead of the built-in functions.
If there's a security reason for this or the built-ins are inadequate, that's
fine, but then that should be documented (and we should possibly ban usage
of the built-ins).

Change-Id: I2ba2ecd388cb3d9cd2360ecaa236f3d444f0eabf
---
M includes/api/ApiErrorFormatter.php
M includes/exception/LocalizedException.php
M includes/installer/CliInstaller.php
M includes/specials/SpecialRecentchanges.php
4 files changed, 7 insertions(+), 9 deletions(-)

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



diff --git a/includes/api/ApiErrorFormatter.php 
b/includes/api/ApiErrorFormatter.php
index 5484a78..7fb1352 100644
--- a/includes/api/ApiErrorFormatter.php
+++ b/includes/api/ApiErrorFormatter.php
@@ -254,7 +254,7 @@
$ret = preg_replace( '!!', '"', $text );
 
// Strip tags and decode.
-   $ret = html_entity_decode( strip_tags( $ret ), ENT_QUOTES | 
ENT_HTML5 );
+   $ret = Sanitizer::stripAllTags( $ret );
 
return $ret;
}
diff --git a/includes/exception/LocalizedException.php 
b/includes/exception/LocalizedException.php
index cbdb53e..d2cb5d1 100644
--- a/includes/exception/LocalizedException.php
+++ b/includes/exception/LocalizedException.php
@@ -56,7 +56,7 @@
// customizations, and make a basic attempt to turn markup into 
text.
$msg = $this->getMessageObject()->inLanguage( 'en' 
)->useDatabase( false )->text();
$msg = preg_replace( '!!', '"', $msg );
-   $msg = html_entity_decode( strip_tags( $msg ), ENT_QUOTES | 
ENT_HTML5 );
+   $msg = Sanitizer::stripAllTags( $msg );
parent::__construct( $msg, $code, $previous );
}
 
diff --git a/includes/installer/CliInstaller.php 
b/includes/installer/CliInstaller.php
index 661c3ec..af55dbb 100644
--- a/includes/installer/CliInstaller.php
+++ b/includes/installer/CliInstaller.php
@@ -180,7 +180,7 @@
 
$text = preg_replace( '/(.*?)<\/a>/', '$2 
$1', $text );
 
-   return html_entity_decode( strip_tags( $text ), ENT_QUOTES );
+   return Sanitizer::stripAllTags( $text );
}
 
/**
diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index d856d4b..e7d5e66 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -202,10 +202,6 @@
 * @return Array Tag data
 */
protected function buildChangeTagList() {
-   function stripAllHtml( $input ) {
-   return trim( html_entity_decode( strip_tags( $input ) ) 
);
-   }
-
$explicitlyDefinedTags = array_fill_keys( 
ChangeTags::listExplicitlyDefinedTags(), 0 );
$softwareActivatedTags = array_fill_keys( 
ChangeTags::listSoftwareActivatedTags(), 0 );
$tagStats = ChangeTags::tagUsageStatistics();
@@ -228,8 +224,10 @@
 
$result[] = [
'name' => $tagName,
-   'label' => stripAllHtml( 
ChangeTags::tagDescription( $tagName, $this->getContext() ) ),
-   'description' => $desc ? stripAllHtml( 
$desc->parse() ) : '',
+   'label' => Sanitizer::stripAllTags(
+   ChangeTags::tagDescription( 
$tagName, $this->getContext() )
+   ),
+   'description' => $desc ? 
Sanitizer::stripAllTags( $desc->parse() ) : '',
'cssClass' => Sanitizer::escapeClass( 
'mw-tag-' . $tagName ),
'hits' => $hits,
];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ba2ecd388cb3d9cd2360ecaa236f3d444f0eabf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: 

[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Rewrite VE<->CM synchronizer using transaction op walking

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

Change subject: Rewrite VE<->CM synchronizer using transaction op walking
..


Rewrite VE<->CM synchronizer using transaction op walking

Previous hacky method fell apart with multi-line transactions.

Depends-On: I465a3f6a8afcd6536293999eb40c01daeb9d905b
Depends-On: I800085eb3a5f7332eab356b62a34bfc603a29839
Change-Id: I66946d7e3f425d8dbbdae720756a7978fbe25582
---
M resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
1 file changed, 50 insertions(+), 32 deletions(-)

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



diff --git a/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js 
b/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
index effe1de..14d49d7 100644
--- a/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
+++ b/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
@@ -65,11 +65,11 @@
 
// As the action is regenerated each time, we need to store the 
bound listener
// in the mirror for later disconnection.
-   surface.mirror.veTransactionListener = 
this.onDocumentTransact.bind( this, surface );
+   surface.mirror.veTransactionListener = 
this.onDocumentPrecommit.bind( this );
 
-   doc.on( 'transact', surface.mirror.veTransactionListener );
+   doc.on( 'precommit', surface.mirror.veTransactionListener );
} else if ( surface.mirror && enable !== true ) {
-   doc.off( 'transact', surface.mirror.veTransactionListener );
+   doc.off( 'precommit', surface.mirror.veTransactionListener );
 
surfaceView.$documentNode.removeClass(
've-ce-documentNode-codeEditor-webkit-hide 
ve-ce-documentNode-codeEditor-webkit'
@@ -83,37 +83,55 @@
return true;
 };
 
-ve.ui.CodeMirrorAction.prototype.onDocumentTransact = function ( surface, tx ) 
{
-   var node, textRange, line,
-   doc = surface.getModel().getDocument(),
-   mirror = surface.mirror,
-   modifiedRange = tx.getModifiedRange( doc ),
-   nodes = doc.selectNodes( modifiedRange, 'leaves' );
+/**
+ * Handle precommit events from the document.
+ *
+ * The document is still in it's 'old' state before the transaction
+ * has been applied at this point.
+ *
+ * @param {ve.dm.Transaction} tx [description]
+ */
+ve.ui.CodeMirrorAction.prototype.onDocumentPrecommit = function ( tx ) {
+   var i,
+   offset = 0,
+   replacements = [],
+   linearData = this.surface.getModel().getDocument().data,
+   store = linearData.getStore(),
+   mirror = this.surface.mirror;
 
-   // TODO: Iterate over operations and perform a replaceRange for each 
replace operation
-   if ( nodes.length === 1 && nodes[ 0 ].node instanceof ve.dm.TextNode ) {
-   node = nodes[ 0 ].node.parent;
-   textRange = nodes[ 0 ].nodeRange;
-   line = node.parent.children.indexOf( node );
-   if ( tx.operations.every( function ( op ) {
-   return op.type === 'retain' || ( op.type === 'replace' 
&& op.remove.length === 0 );
-   } ) ) {
-   // Single line insert
-   mirror.replaceRange(
-   doc.data.getText( true, modifiedRange ),
-   { line: line, ch: modifiedRange.start - 
textRange.start }
-   );
-   } else {
-   // Single line replace
-   mirror.replaceRange(
-   doc.data.getText( true, textRange ),
-   { line: line, ch: 0 },
-   { line: line, ch: mirror.getLine( line ).length 
}
-   );
+   /**
+* Convert a VE offset to a 2D CodeMirror position
+*
+* @private
+* @param {Number} veOffset VE linear model offset
+* @return {Object} Code mirror position, containing 'line' and 'ch'
+*/
+   function convertOffset( veOffset ) {
+   var cmOffset = linearData.getSourceText( new ve.Range( 0, 
veOffset ) ).length;
+   return mirror.posFromIndex( cmOffset );
+   }
+
+   tx.operations.forEach( function ( op ) {
+   if ( op.type === 'retain' ) {
+   offset += op.length;
+   } else if ( op.type === 'replace' ) {
+   replacements.push( {
+   start: convertOffset( offset ),
+   // Don't bother recalculating end offset if not 
a removal, replaceRange works with just one arg
+   end: op.remove.length ? convertOffset( offset + 
op.remove.length ) : undefined,
+   

[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Update VE core submodule to master (5d7b23762)

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

Change subject: Update VE core submodule to master (5d7b23762)
..


Update VE core submodule to master (5d7b23762)

New changes:
34999f2ce Move linear model -> source text conversion to ElementLinearData
a2ab4fa95 build: Bump grunt clean and stylelint to latest
dab49847a Fix infinite loop in ve.BranchNode#getNodeFromOffset
b4319e29d LanguageInputWidget: optionally suppress directionality input

Change-Id: I800085eb3a5f7332eab356b62a34bfc603a29839
---
M lib/ve
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/lib/ve b/lib/ve
index 1934b77..5d7b237 16
--- a/lib/ve
+++ b/lib/ve
@@ -1 +1 @@
-Subproject commit 1934b77e72f79d7bceb9d21dd6c0a90dadc61b0e
+Subproject commit 5d7b2376224cc8e016ff77d5489b730bca909b48

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I800085eb3a5f7332eab356b62a34bfc603a29839
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Catrope 
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]: qunit: Remove redundant conditional for sandbox teardown

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

Change subject: qunit: Remove redundant conditional for sandbox teardown
..

qunit: Remove redundant conditional for sandbox teardown

Follows-up 0a208911a257.

Change-Id: Ib17bbbef45b2bd0247979cf0fa8aed17800c54a0
---
M tests/qunit/data/testrunner.js
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/363999/1

diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js
index d7da5a0..087603e 100644
--- a/tests/qunit/data/testrunner.js
+++ b/tests/qunit/data/testrunner.js
@@ -85,9 +85,7 @@
localEnv.teardown.call( this );
}
 
-   if ( this.sandbox ) {
-   this.sandbox.verifyAndRestore();
-   }
+   this.sandbox.verifyAndRestore();
}
}, executeNow );
};

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialRecentchanges: Globals for config are bad, m'kay

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

Change subject: SpecialRecentchanges: Globals for config are bad, m'kay
..


SpecialRecentchanges: Globals for config are bad, m'kay

Change-Id: I9ca7aead42ffee1e891525fc80f3438157f4fb2f
---
M includes/specials/SpecialRecentchanges.php
1 file changed, 3 insertions(+), 7 deletions(-)

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



diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index bec87c5..05bcc4d 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -138,10 +138,6 @@
 * @param string $subpage
 */
public function execute( $subpage ) {
-   global $wgStructuredChangeFiltersEnableSaving,
-   $wgStructuredChangeFiltersEnableExperimentalViews,
-   $wgStructuredChangeFiltersEnableLiveUpdate;
-
// Backwards-compatibility: redirect to new feed URLs
$feedFormat = $this->getRequest()->getVal( 'feed' );
if ( !$this->including() && $feedFormat ) {
@@ -184,15 +180,15 @@
$out->addJsConfigVars( 'wgStructuredChangeFilters', 
$jsData['groups'] );
$out->addJsConfigVars(
'wgStructuredChangeFiltersEnableSaving',
-   $wgStructuredChangeFiltersEnableSaving
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableSaving' )
);
$out->addJsConfigVars(

'wgStructuredChangeFiltersEnableExperimentalViews',
-   
$wgStructuredChangeFiltersEnableExperimentalViews
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableExperimentalViews' )
);
$out->addJsConfigVars(
'wgStructuredChangeFiltersEnableLiveUpdate',
-   $wgStructuredChangeFiltersEnableLiveUpdate
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableLiveUpdate' )
);
$out->addJsConfigVars(
'wgRCFiltersChangeTags',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ca7aead42ffee1e891525fc80f3438157f4fb2f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Update typehint for MediaWikiServices::getStatsdDataFactory

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

Change subject: Update typehint for MediaWikiServices::getStatsdDataFactory
..

Update typehint for MediaWikiServices::getStatsdDataFactory

Follows-up I6897f8243ce (a10bd20059).

Depends-On: I06de59122625f9c23e7c1a1bfa69a7ddabbf379e
Change-Id: I734505a1b3daf46f816888c1955d64632a2084c5
---
M includes/ConstraintCheck/Helper/SparqlHelper.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/ConstraintCheck/Helper/SparqlHelper.php 
b/includes/ConstraintCheck/Helper/SparqlHelper.php
index 474214e..11a877b 100644
--- a/includes/ConstraintCheck/Helper/SparqlHelper.php
+++ b/includes/ConstraintCheck/Helper/SparqlHelper.php
@@ -4,7 +4,7 @@
 
 use Config;
 use Http;
-use MediawikiStatsdDataFactory;
+use IBufferingStatsdDataFactory;
 use MediaWiki\MediaWikiServices;
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\EntityIdParsingException;
@@ -42,7 +42,7 @@
private $entityIdParser;
 
/**
-* @var MediawikiStatsdDataFactory
+* @var IBufferingStatsdDataFactory
 */
private $dataFactory;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I734505a1b3daf46f816888c1955d64632a2084c5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Basic implementation of live updates

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

Change subject: RCFilters: Basic implementation of live updates
..


RCFilters: Basic implementation of live updates

Adds a live updates button that refreshes the changes list every 3 seconds.
For now this is pretty dumb in that it re-requests the entire list every time;
the next step would be to make it only load new changes using the =
query parameter.

Bug: T167743
Change-Id: Ic2ddea840e5c46f42b32ae4fff91138cacc28ec0
---
M includes/DefaultSettings.php
M includes/specials/SpecialRecentchanges.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.ChangesListViewModel.js
M resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
A 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.LiveUpdateButtonWidget.less
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
A resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.LiveUpdateButtonWidget.js
11 files changed, 159 insertions(+), 6 deletions(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 1459ab6..0548d8b 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6779,6 +6779,11 @@
 $wgStructuredChangeFiltersEnableExperimentalViews = false;
 
 /**
+ * Whether to allow users to use the experimental live update feature in the 
new RecentChanges UI
+ */
+$wgStructuredChangeFiltersEnableLiveUpdate = false;
+
+/**
  * Use new page patrolling to check new pages on Special:Newpages
  */
 $wgUseNPPatrol = true;
diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index d856d4b..bec87c5 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -139,7 +139,8 @@
 */
public function execute( $subpage ) {
global $wgStructuredChangeFiltersEnableSaving,
-   $wgStructuredChangeFiltersEnableExperimentalViews;
+   $wgStructuredChangeFiltersEnableExperimentalViews,
+   $wgStructuredChangeFiltersEnableLiveUpdate;
 
// Backwards-compatibility: redirect to new feed URLs
$feedFormat = $this->getRequest()->getVal( 'feed' );
@@ -190,6 +191,10 @@

$wgStructuredChangeFiltersEnableExperimentalViews
);
$out->addJsConfigVars(
+   'wgStructuredChangeFiltersEnableLiveUpdate',
+   $wgStructuredChangeFiltersEnableLiveUpdate
+   );
+   $out->addJsConfigVars(
'wgRCFiltersChangeTags',
$this->buildChangeTagList()
);
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 7d107d9..9447de6 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1446,6 +1446,7 @@
"rcfilters-view-namespaces-tooltip": "Filter results by namespace",
"rcfilters-view-tags-tooltip": "Filter results using edit tags",
"rcfilters-view-return-to-default-tooltip": "Return to main filter 
menu",
+   "rcfilters-liveupdates-button": "Live updates",
"rcnotefrom": "Below {{PLURAL:$5|is the change|are the changes}} since 
$3, $4 (up to $1 shown).",
"rclistfromreset": "Reset date selection",
"rclistfrom": "Show new changes starting from $2, $3",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 4d854d9..7c995f0 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1636,6 +1636,7 @@
"rcfilters-view-namespaces-tooltip": "Tooltip for the button that loads 
the namespace view in [[Special:RecentChanges]]",
"rcfilters-view-tags-tooltip": "Tooltip for the button that loads the 
tags view in [[Special:RecentChanges]]",
"rcfilters-view-return-to-default-tooltip": "Tooltip for the button 
that returns to the default filter view in [[Special:RecentChanges]]",
+   "rcfilters-liveupdates-button": "Label for the button to enable or 
disable live updates on [[Special:RecentChanges]]",
"rcnotefrom": "This message is displayed at [[Special:RecentChanges]] 
when viewing recentchanges from some specific time.\n\nThe corresponding 
message is {{msg-mw|Rclistfrom}}.\n\nParameters:\n* $1 - the maximum number of 
changes that are displayed\n* $2 - (Optional) a date and time\n* $3 - a date\n* 
$4 - a time\n* $5 - Number of changes are displayed, for use with PLURAL",
"rclistfromreset": "Used on [[Special:RecentChanges]] to 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: statsd: Rename MediawikiStatsdDataFactory to IBufferingStats...

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

Change subject: statsd: Rename MediawikiStatsdDataFactory to 
IBufferingStatsdDataFactory
..

statsd: Rename MediawikiStatsdDataFactory to IBufferingStatsdDataFactory

Follows-up I2874175647e (7fdc3d09a3b).

* Avoid "MediaWiki" in class names. If unavoidable, always camelcase.
* Use a more descriptive name, matching the implementing the class 
("Buffering").
* Use "I" prefix for consistency with other MediaWiki-provided interfaces.
  (Avoid "Interface" suffix, which is foreign to MediaWiki and is only used
  in the StatsdClient namespace, which this interface is not in).

Bug: T166354
Change-Id: I06de59122625f9c23e7c1a1bfa69a7ddabbf379e
---
M autoload.php
M includes/MediaWikiServices.php
M includes/context/ContextSource.php
M includes/context/DerivativeContext.php
M includes/context/IContextSource.php
M includes/context/RequestContext.php
M includes/libs/stats/BufferingStatsdDataFactory.php
R includes/libs/stats/IBufferingStatsdDataFactory.php
M includes/libs/stats/NullStatsdDataFactory.php
M tests/phpunit/includes/MediaWikiServicesTest.php
10 files changed, 14 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/363997/1

diff --git a/autoload.php b/autoload.php
index 2560bdb..88b6170 100644
--- a/autoload.php
+++ b/autoload.php
@@ -604,6 +604,7 @@
'HttpError' => __DIR__ . '/includes/exception/HttpError.php',
'HttpStatus' => __DIR__ . '/includes/libs/HttpStatus.php',
'IApiMessage' => __DIR__ . '/includes/api/ApiMessage.php',
+   'IBufferingStatsdDataFactory' => __DIR__ . 
'/includes/libs/stats/IBufferingStatsdDataFactory.php',
'ICacheHelper' => __DIR__ . '/includes/cache/CacheHelper.php',
'IContextSource' => __DIR__ . '/includes/context/IContextSource.php',
'IDBAccessObject' => __DIR__ . '/includes/dao/IDBAccessObject.php',
@@ -964,7 +965,6 @@
'MediaWiki\\Widget\\TitleInputWidget' => __DIR__ . 
'/includes/widget/TitleInputWidget.php',
'MediaWiki\\Widget\\UserInputWidget' => __DIR__ . 
'/includes/widget/UserInputWidget.php',
'MediaWiki\\Widget\\UsersMultiselectWidget' => __DIR__ . 
'/includes/widget/UsersMultiselectWidget.php',
-   'MediawikiStatsdDataFactory' => __DIR__ . 
'/includes/libs/stats/MediawikiStatsdDataFactory.php',
'MemCachedClientforWiki' => __DIR__ . 
'/includes/compat/MemcachedClientCompat.php',
'MemcLockManager' => __DIR__ . 
'/includes/libs/lockmanager/MemcLockManager.php',
'MemcachedBagOStuff' => __DIR__ . 
'/includes/libs/objectcache/MemcachedBagOStuff.php',
diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index ea0ec15..84fc959 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -9,7 +9,7 @@
 use GenderCache;
 use GlobalVarConfig;
 use Hooks;
-use MediawikiStatsdDataFactory;
+use IBufferingStatsdDataFactory;
 use Wikimedia\Rdbms\LBFactory;
 use LinkCache;
 use Wikimedia\Rdbms\LoadBalancer;
@@ -447,7 +447,7 @@
 
/**
 * @since 1.27
-* @return MediawikiStatsdDataFactory
+* @return IBufferingStatsdDataFactory
 */
public function getStatsdDataFactory() {
return $this->getService( 'StatsdDataFactory' );
diff --git a/includes/context/ContextSource.php 
b/includes/context/ContextSource.php
index 36d6df2..434201a 100644
--- a/includes/context/ContextSource.php
+++ b/includes/context/ContextSource.php
@@ -170,7 +170,7 @@
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
 * @since 1.25
-* @return MediawikiStatsdDataFactory
+* @return IBufferingStatsdDataFactory
 */
public function getStats() {
return MediaWikiServices::getInstance()->getStatsdDataFactory();
diff --git a/includes/context/DerivativeContext.php 
b/includes/context/DerivativeContext.php
index 9c3c42a..0d0c149 100644
--- a/includes/context/DerivativeContext.php
+++ b/includes/context/DerivativeContext.php
@@ -109,7 +109,7 @@
 *
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
-* @return MediawikiStatsdDataFactory
+* @return IBufferingStatsdDataFactory
 */
public function getStats() {
return MediaWikiServices::getInstance()->getStatsdDataFactory();
diff --git a/includes/context/IContextSource.php 
b/includes/context/IContextSource.php
index d13e1a5..895e9e4 100644
--- a/includes/context/IContextSource.php
+++ b/includes/context/IContextSource.php
@@ -131,7 +131,7 @@
 * @deprecated since 1.27 use a StatsdDataFactory from 
MediaWikiServices (preferably injected)
 *
 * @since 1.25
-* @return MediawikiStatsdDataFactory
+* 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Don't call html_entity_decode() on a URL query string

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

Change subject: Don't call html_entity_decode() on a URL query string
..


Don't call html_entity_decode() on a URL query string

Follows-up 2e96b6a47bd9f.

There is no reason why HTML entities should need to be decoded in URLs,
certainly not in a function whose only job is to remove one
query string parameter and otherwise leave the query string alone.

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

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



diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 734f0ef..d9471d5 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -947,7 +947,7 @@
 */
protected function updateDesktopUrlQuery( &$parsedUrl ) {
if ( isset( $parsedUrl['query'] ) && strpos( 
$parsedUrl['query'], 'useformat' ) !== false ) {
-   $query = wfCgiToArray( html_entity_decode( 
$parsedUrl['query'] ) );
+   $query = wfCgiToArray( $parsedUrl['query'] );
unset( $query['useformat'] );
$parsedUrl['query'] = wfArrayToCgi( $query );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1edacd6001ab70ce18b74cf2e029d653d6a2e8b6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Replace EchoDiscussionParser::htmlToText with Sanitizer::str...

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

Change subject: Replace EchoDiscussionParser::htmlToText with 
Sanitizer::stripAllTags()
..


Replace EchoDiscussionParser::htmlToText with Sanitizer::stripAllTags()

The latter doesn't trim(), so add trim() calls in some cases.
User input is trimmed, parsed i18n messages are not.

Change-Id: I933a6a929bf7d3e2d1623ea537227dc8c731cb6f
---
M includes/DiscussionParser.php
M includes/formatters/EchoPlainTextDigestEmailFormatter.php
M includes/formatters/EchoPlainTextEmailFormatter.php
3 files changed, 6 insertions(+), 14 deletions(-)

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



diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php
index eba108f..a1b1ea8 100644
--- a/includes/DiscussionParser.php
+++ b/includes/DiscussionParser.php
@@ -1155,7 +1155,7 @@
static function getTextSnippet( $text, Language $lang, $length = 150, 
$title = null ) {
// Parse wikitext
$html = MessageCache::singleton()->parse( $text, $title 
)->getText();
-   $plaintext = self::htmlToText( $html );
+   $plaintext = trim( Sanitizer::stripAllTags( $html ) );
return $lang->truncate( $plaintext, $length );
}
 
@@ -1169,16 +1169,8 @@
static function getTextSnippetFromSummary( $text, Language $lang, 
$length = 150 ) {
// Parse wikitext with summary parser
$html = Linker::formatLinksInComment( 
Sanitizer::escapeHtmlAllowEntities( $text ) );
-   $plaintext = self::htmlToText( $html );
+   $plaintext = trim( Sanitizer::stripAllTags( $html ) );
return $lang->truncate( $plaintext, $length );
-   }
-
-   /**
-* @param string $html
-* @return string text version of the given html string
-*/
-   public static function htmlToText( $html ) {
-   return trim( html_entity_decode( strip_tags( $html ), 
ENT_QUOTES ) );
}
 
/**
diff --git a/includes/formatters/EchoPlainTextDigestEmailFormatter.php 
b/includes/formatters/EchoPlainTextDigestEmailFormatter.php
index e6d4b7e..88d9c5f 100644
--- a/includes/formatters/EchoPlainTextDigestEmailFormatter.php
+++ b/includes/formatters/EchoPlainTextDigestEmailFormatter.php
@@ -21,7 +21,7 @@
protected function formatModels( array $models ) {
$content = [];
foreach ( $models as $model ) {
-   $content[$model->getCategory()][] = 
EchoDiscussionParser::htmlToText( $model->getHeaderMessage()->parse() );
+   $content[$model->getCategory()][] = 
Sanitizer::stripAllTags( $model->getHeaderMessage()->parse() );
}
 
ksort( $content );
diff --git a/includes/formatters/EchoPlainTextEmailFormatter.php 
b/includes/formatters/EchoPlainTextEmailFormatter.php
index 6e1e03a..34fdc7d 100644
--- a/includes/formatters/EchoPlainTextEmailFormatter.php
+++ b/includes/formatters/EchoPlainTextEmailFormatter.php
@@ -2,15 +2,15 @@
 
 class EchoPlainTextEmailFormatter extends EchoEventFormatter {
protected function formatModel( EchoEventPresentationModel $model ) {
-   $subject = EchoDiscussionParser::htmlToText( 
$model->getSubjectMessage()->parse() );
+   $subject = Sanitizer::stripAllTags( 
$model->getSubjectMessage()->parse() );
 
-   $text = EchoDiscussionParser::htmlToText( 
$model->getHeaderMessage()->parse() );
+   $text = Sanitizer::stripAllTags( 
$model->getHeaderMessage()->parse() );
 
$text .= "\n\n";
 
$bodyMsg = $model->getBodyMessage();
if ( $bodyMsg ) {
-   $text .= EchoDiscussionParser::htmlToText( 
$bodyMsg->parse() );
+   $text .= Sanitizer::stripAllTags( $bodyMsg->parse() );
}
 
$primaryLink = $model->getPrimaryLinkWithMarkAsRead();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I933a6a929bf7d3e2d1623ea537227dc8c731cb6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: objectcache: Use a separate postgres connection in SqlBagOStuff

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

Change subject: objectcache: Use a separate postgres connection in SqlBagOStuff
..


objectcache: Use a separate postgres connection in SqlBagOStuff

The flags to the driver use new connections for new LBs since
fda4d46fc4f810. This makes it consistent with what we do for
MySQL already.

This should fix warnings about TransactionProfiler in objectcache,
as well as warnings about "Pending writes" in WANObjectCache.

Bug: T167946
Bug: T154424
Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
(cherry picked from commit f24b3899e383829cce6808cd527fff7222e685c9)
---
M includes/objectcache/SqlBagOStuff.php
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index a4a6ba8..19e0c6c 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -148,7 +148,7 @@
protected function getSeparateMainLB() {
global $wgDBtype;
 
-   if ( $wgDBtype === 'mysql' && $this->usesMainDB() ) {
+   if ( $this->usesMainDB() && $wgDBtype !== 'sqlite' ) {
if ( !$this->separateMainLB ) {
// We must keep a separate connection to MySQL 
in order to avoid deadlocks
$lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
@@ -156,8 +156,7 @@
}
return $this->separateMainLB;
} else {
-   // However, SQLite has an opposite behavior. And 
PostgreSQL needs to know
-   // if we are in transaction or not (@TODO: find some 
PostgreSQL work-around).
+   // However, SQLite has an opposite behavior due to 
DB-level locking
return null;
}
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: Chad 
Gerrit-Reviewer: Aaron Schulz 
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] wikidata...rdf[master]: Update GUI

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

Change subject: Update GUI
..


Update GUI

Change-Id: Ife08ebc83101507eb94f3853d7a948990e32fe9e
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/gui b/gui
index 919fdf1..f9380cc 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 919fdf18e7cdfd576f67b44c81cd9a16bbaa8f7a
+Subproject commit f9380cc6e3cef74d9c53bf76c8015a81fb239eb8

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ife08ebc83101507eb94f3853d7a948990e32fe9e
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Smalyshev 
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...CirrusSearch[wmf/1.30.0-wmf.7]: Ignore archive records with null page_id

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

Change subject: Ignore archive records with null page_id
..

Ignore archive records with null page_id

Bug: T169977
Change-Id: If221c90cdadb32ab75cd5aae0346fb5fcd0822d3
(cherry picked from commit c5f0e129c586debe68e4e3e99552e378dc2a62b0)
---
M maintenance/forceSearchIndex.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index c64e310..5441485 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -357,6 +357,7 @@
 
$this->attachPageConditions( $dbr, $it, 'ar' );
$this->attachTimestampConditions( $dbr, $it, 'ar' );
+   $it->addConditions( [ 'ar_page_id IS NOT NULL' ] );
 
$it->setFetchColumns( [ 'ar_timestamp', 'ar_namespace', 
'ar_title', 'ar_page_id' ] );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If221c90cdadb32ab75cd5aae0346fb5fcd0822d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.30.0-wmf.7
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: objectcache: Use a separate postgres connection in SqlBagOStuff

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

Change subject: objectcache: Use a separate postgres connection in SqlBagOStuff
..

objectcache: Use a separate postgres connection in SqlBagOStuff

The flags to the driver use new connections for new LBs since
fda4d46fc4f810. This makes it consistent with what we do for
MySQL already.

This should fix warnings about TransactionProfiler in objectcache,
as well as warnings about "Pending writes" in WANObjectCache.

Bug: T167946
Bug: T154424
Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
(cherry picked from commit f24b3899e383829cce6808cd527fff7222e685c9)
---
M includes/objectcache/SqlBagOStuff.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/363995/1

diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index a4a6ba8..19e0c6c 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -148,7 +148,7 @@
protected function getSeparateMainLB() {
global $wgDBtype;
 
-   if ( $wgDBtype === 'mysql' && $this->usesMainDB() ) {
+   if ( $this->usesMainDB() && $wgDBtype !== 'sqlite' ) {
if ( !$this->separateMainLB ) {
// We must keep a separate connection to MySQL 
in order to avoid deadlocks
$lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
@@ -156,8 +156,7 @@
}
return $this->separateMainLB;
} else {
-   // However, SQLite has an opposite behavior. And 
PostgreSQL needs to know
-   // if we are in transaction or not (@TODO: find some 
PostgreSQL work-around).
+   // However, SQLite has an opposite behavior due to 
DB-level locking
return null;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: Chad 
Gerrit-Reviewer: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Use Sanitizer::stripAllTags( $x ) instead of html_entity_dec...

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

Change subject: Use Sanitizer::stripAllTags( $x ) instead of 
html_entity_decode( strip_tags( $x ) )
..

Use Sanitizer::stripAllTags( $x ) instead of html_entity_decode( strip_tags( $x 
) )

MW core has a utility function for this, let's use it.

Change-Id: Ic0d86f2df92a38b2b0ff5de83c067340d47cc402
---
M includes/Conversion/Utils.php
M includes/Templating.php
M tests/phpunit/api/ApiFlowEditHeaderTest.php
M tests/phpunit/api/ApiFlowEditPostTest.php
M tests/phpunit/api/ApiFlowEditTopicSummaryTest.php
M tests/phpunit/api/ApiFlowReplyTest.php
M tests/phpunit/api/ApiFlowViewHeaderTest.php
7 files changed, 13 insertions(+), 8 deletions(-)


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

diff --git a/includes/Conversion/Utils.php b/includes/Conversion/Utils.php
index c109463..9ba0018 100644
--- a/includes/Conversion/Utils.php
+++ b/includes/Conversion/Utils.php
@@ -70,7 +70,7 @@
/** @var Language $wgLang */
global $wgLang;
 
-   $plain = trim( html_entity_decode( strip_tags( $html ), 
ENT_QUOTES ) );
+   $plain = trim( Sanitizer::stripAllTags( $html ) );
 
if ( $truncateLength === null ) {
return $plain;
diff --git a/includes/Templating.php b/includes/Templating.php
index d7421ad..fa8dd06 100644
--- a/includes/Templating.php
+++ b/includes/Templating.php
@@ -158,7 +158,7 @@
 
$content = wfMessage( 'flow-stub-post-content' 
)->parse();
if ( !in_array( $format, [ 'html', 'fixed-html' ] ) ) {
-   $content = strip_tags( $content );
+   $content = Santiizer::stripAllTags( $content );
}
}
 
diff --git a/tests/phpunit/api/ApiFlowEditHeaderTest.php 
b/tests/phpunit/api/ApiFlowEditHeaderTest.php
index 21c90b1..8669424 100644
--- a/tests/phpunit/api/ApiFlowEditHeaderTest.php
+++ b/tests/phpunit/api/ApiFlowEditHeaderTest.php
@@ -1,6 +1,7 @@
 assertEquals( 'create-header', $revision['changeType'], 
$debug );
$this->assertEquals(
'(._.)',
-   trim( strip_tags( $revision['content']['content'] ) ),
+   trim( Sanitizer::stripAllTags( 
$revision['content']['content'] ) ),
$debug
);
$this->assertEquals( 'html', $revision['content']['format'], 
$debug );
diff --git a/tests/phpunit/api/ApiFlowEditPostTest.php 
b/tests/phpunit/api/ApiFlowEditPostTest.php
index 151331e..0b2b7ac 100644
--- a/tests/phpunit/api/ApiFlowEditPostTest.php
+++ b/tests/phpunit/api/ApiFlowEditPostTest.php
@@ -1,6 +1,7 @@
 assertEquals( 'edit-post', $revision['changeType'], 
$debug );
$this->assertEquals(
'⎛ ゚∩゚⎞⎛ ⍜⌒⍜⎞⎛ ゚⌒゚⎞',
-   trim( strip_tags( $revision['content']['content'] ) ),
+   trim( Sanitizer::stripAllTags( 
$revision['content']['content'] ) ),
$debug
);
$this->assertEquals( 'html', $revision['content']['format'], 
$debug );
diff --git a/tests/phpunit/api/ApiFlowEditTopicSummaryTest.php 
b/tests/phpunit/api/ApiFlowEditTopicSummaryTest.php
index 439cf31..a89467f 100644
--- a/tests/phpunit/api/ApiFlowEditTopicSummaryTest.php
+++ b/tests/phpunit/api/ApiFlowEditTopicSummaryTest.php
@@ -1,6 +1,7 @@
 assertEquals( 'create-topic-summary', 
$revision['changeType'], $debug );
$this->assertEquals(
$summaryText,
-   trim( strip_tags( $revision['content']['content'] ) ),
+   trim( Sanitizer::stripAllTags( 
$revision['content']['content'] ) ),
$debug
);
$this->assertEquals( 'html', $revision['content']['format'], 
$debug );
@@ -57,7 +58,7 @@
 
$this->assertEquals(
$summaryText,
-   trim( strip_tags( 
$topicRevision['summary']['revision']['content']['content'] ) ),
+   trim( Sanitizer::stripAllTags( 
$topicRevision['summary']['revision']['content']['content'] ) ),
'Summary content present with correct structure in 
view-topic response'
);
}
diff --git a/tests/phpunit/api/ApiFlowReplyTest.php 
b/tests/phpunit/api/ApiFlowReplyTest.php
index c08c534..e45d9d1 100644
--- a/tests/phpunit/api/ApiFlowReplyTest.php
+++ b/tests/phpunit/api/ApiFlowReplyTest.php
@@ -1,6 +1,7 @@
 assertEquals( 'reply', $revision['changeType'], $debug );
$this->assertEquals(
'⎛ ゚∩゚⎞⎛ ⍜⌒⍜⎞⎛ ゚⌒゚⎞',
-   trim( strip_tags( $revision['content']['content'] ) ),
+   

[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Use Sanitizer::stripAllTags( $x ) instead of html_entity_dec...

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

Change subject: Use Sanitizer::stripAllTags( $x ) instead of 
html_entity_decode( strip_tags( $x ) )
..


Use Sanitizer::stripAllTags( $x ) instead of html_entity_decode( strip_tags( $x 
) )

Change-Id: I4869a56b20d989a94020f9aaebaa5ef5790cead3
---
M includes/ArticleMetadata.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/includes/ArticleMetadata.php b/includes/ArticleMetadata.php
index 17c2889..0b729ca 100755
--- a/includes/ArticleMetadata.php
+++ b/includes/ArticleMetadata.php
@@ -830,9 +830,9 @@
$attempt++;
}
 
-   $text = trim( strip_tags( htmlspecialchars_decode(
+   $text = trim( Sanitizer::stripAllTags(
MessageCache::singleton()->parse( $text )->getText()
-   ) ) );
+   ) );
// strip out non-useful data for snippet
$text = str_replace( [ '{', '}', '[edit]' ], '', $text );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4869a56b20d989a94020f9aaebaa5ef5790cead3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Replace EchoDiscussionParser::htmlToText with Sanitizer::str...

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

Change subject: Replace EchoDiscussionParser::htmlToText with 
Sanitizer::stripAllTags()
..

Replace EchoDiscussionParser::htmlToText with Sanitizer::stripAllTags()

The latter doesn't trim(), so add trim() calls in some cases.
User input is trimmed, parsed i18n messages are not.

Change-Id: I933a6a929bf7d3e2d1623ea537227dc8c731cb6f
---
M includes/DiscussionParser.php
M includes/formatters/EchoPlainTextDigestEmailFormatter.php
M includes/formatters/EchoPlainTextEmailFormatter.php
3 files changed, 6 insertions(+), 14 deletions(-)


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

diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php
index eba108f..a1b1ea8 100644
--- a/includes/DiscussionParser.php
+++ b/includes/DiscussionParser.php
@@ -1155,7 +1155,7 @@
static function getTextSnippet( $text, Language $lang, $length = 150, 
$title = null ) {
// Parse wikitext
$html = MessageCache::singleton()->parse( $text, $title 
)->getText();
-   $plaintext = self::htmlToText( $html );
+   $plaintext = trim( Sanitizer::stripAllTags( $html ) );
return $lang->truncate( $plaintext, $length );
}
 
@@ -1169,16 +1169,8 @@
static function getTextSnippetFromSummary( $text, Language $lang, 
$length = 150 ) {
// Parse wikitext with summary parser
$html = Linker::formatLinksInComment( 
Sanitizer::escapeHtmlAllowEntities( $text ) );
-   $plaintext = self::htmlToText( $html );
+   $plaintext = trim( Sanitizer::stripAllTags( $html ) );
return $lang->truncate( $plaintext, $length );
-   }
-
-   /**
-* @param string $html
-* @return string text version of the given html string
-*/
-   public static function htmlToText( $html ) {
-   return trim( html_entity_decode( strip_tags( $html ), 
ENT_QUOTES ) );
}
 
/**
diff --git a/includes/formatters/EchoPlainTextDigestEmailFormatter.php 
b/includes/formatters/EchoPlainTextDigestEmailFormatter.php
index e6d4b7e..88d9c5f 100644
--- a/includes/formatters/EchoPlainTextDigestEmailFormatter.php
+++ b/includes/formatters/EchoPlainTextDigestEmailFormatter.php
@@ -21,7 +21,7 @@
protected function formatModels( array $models ) {
$content = [];
foreach ( $models as $model ) {
-   $content[$model->getCategory()][] = 
EchoDiscussionParser::htmlToText( $model->getHeaderMessage()->parse() );
+   $content[$model->getCategory()][] = 
Sanitizer::stripAllTags( $model->getHeaderMessage()->parse() );
}
 
ksort( $content );
diff --git a/includes/formatters/EchoPlainTextEmailFormatter.php 
b/includes/formatters/EchoPlainTextEmailFormatter.php
index 6e1e03a..34fdc7d 100644
--- a/includes/formatters/EchoPlainTextEmailFormatter.php
+++ b/includes/formatters/EchoPlainTextEmailFormatter.php
@@ -2,15 +2,15 @@
 
 class EchoPlainTextEmailFormatter extends EchoEventFormatter {
protected function formatModel( EchoEventPresentationModel $model ) {
-   $subject = EchoDiscussionParser::htmlToText( 
$model->getSubjectMessage()->parse() );
+   $subject = Sanitizer::stripAllTags( 
$model->getSubjectMessage()->parse() );
 
-   $text = EchoDiscussionParser::htmlToText( 
$model->getHeaderMessage()->parse() );
+   $text = Sanitizer::stripAllTags( 
$model->getHeaderMessage()->parse() );
 
$text .= "\n\n";
 
$bodyMsg = $model->getBodyMessage();
if ( $bodyMsg ) {
-   $text .= EchoDiscussionParser::htmlToText( 
$bodyMsg->parse() );
+   $text .= Sanitizer::stripAllTags( $bodyMsg->parse() );
}
 
$primaryLink = $model->getPrimaryLinkWithMarkAsRead();

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Don't call html_entity_decode() on a URL query string

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

Change subject: Don't call html_entity_decode() on a URL query string
..

Don't call html_entity_decode() on a URL query string

There is no reason why HTML entities should need to be decoded in URLs,
certainly not in a function whose only job is to remove one
query string parameter and otherwise leave the query string alone.

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


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

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 734f0ef..d9471d5 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -947,7 +947,7 @@
 */
protected function updateDesktopUrlQuery( &$parsedUrl ) {
if ( isset( $parsedUrl['query'] ) && strpos( 
$parsedUrl['query'], 'useformat' ) !== false ) {
-   $query = wfCgiToArray( html_entity_decode( 
$parsedUrl['query'] ) );
+   $query = wfCgiToArray( $parsedUrl['query'] );
unset( $query['useformat'] );
$parsedUrl['query'] = wfArrayToCgi( $query );
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Use Sanitizer::stripAllTags( $x ) instead of html_entity_dec...

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

Change subject: Use Sanitizer::stripAllTags( $x ) instead of 
html_entity_decode( strip_tags( $x ) )
..

Use Sanitizer::stripAllTags( $x ) instead of html_entity_decode( strip_tags( $x 
) )

Change-Id: I4869a56b20d989a94020f9aaebaa5ef5790cead3
---
M includes/ArticleMetadata.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/ArticleMetadata.php b/includes/ArticleMetadata.php
index 17c2889..0b729ca 100755
--- a/includes/ArticleMetadata.php
+++ b/includes/ArticleMetadata.php
@@ -830,9 +830,9 @@
$attempt++;
}
 
-   $text = trim( strip_tags( htmlspecialchars_decode(
+   $text = trim( Sanitizer::stripAllTags(
MessageCache::singleton()->parse( $text )->getText()
-   ) ) );
+   ) );
// strip out non-useful data for snippet
$text = str_replace( [ '{', '}', '[edit]' ], '', $text );
 

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Update GUI

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

Change subject: Update GUI
..

Update GUI

Change-Id: Ife08ebc83101507eb94f3853d7a948990e32fe9e
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf 
refs/changes/89/363989/1

diff --git a/gui b/gui
index 919fdf1..f9380cc 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 919fdf18e7cdfd576f67b44c81cd9a16bbaa8f7a
+Subproject commit f9380cc6e3cef74d9c53bf76c8015a81fb239eb8

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife08ebc83101507eb94f3853d7a948990e32fe9e
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use Sanitizer::stripAllTags( $x ) instead of html_entity_dec...

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

Change subject: Use Sanitizer::stripAllTags( $x ) instead of 
html_entity_decode( strip_tags( $x ) )
..

Use Sanitizer::stripAllTags( $x ) instead of html_entity_decode( strip_tags( $x 
) )

We have a utility function for this, so let's use it.

What I don't understand though is why Sanitizer uses custom PHP implementations
for both tag stripping and entity decoding, instead of the built-in functions.
If there's a security reason for this or the built-ins are inadequate, that's
fine, but then that should be documented (and we should possibly ban usage
of the built-ins).

Change-Id: I2ba2ecd388cb3d9cd2360ecaa236f3d444f0eabf
---
M includes/api/ApiErrorFormatter.php
M includes/exception/LocalizedException.php
M includes/installer/CliInstaller.php
M includes/specials/SpecialRecentchanges.php
4 files changed, 5 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/87/363987/1

diff --git a/includes/api/ApiErrorFormatter.php 
b/includes/api/ApiErrorFormatter.php
index 5484a78..7fb1352 100644
--- a/includes/api/ApiErrorFormatter.php
+++ b/includes/api/ApiErrorFormatter.php
@@ -254,7 +254,7 @@
$ret = preg_replace( '!!', '"', $text );
 
// Strip tags and decode.
-   $ret = html_entity_decode( strip_tags( $ret ), ENT_QUOTES | 
ENT_HTML5 );
+   $ret = Sanitizer::stripAllTags( $ret );
 
return $ret;
}
diff --git a/includes/exception/LocalizedException.php 
b/includes/exception/LocalizedException.php
index cbdb53e..d2cb5d1 100644
--- a/includes/exception/LocalizedException.php
+++ b/includes/exception/LocalizedException.php
@@ -56,7 +56,7 @@
// customizations, and make a basic attempt to turn markup into 
text.
$msg = $this->getMessageObject()->inLanguage( 'en' 
)->useDatabase( false )->text();
$msg = preg_replace( '!!', '"', $msg );
-   $msg = html_entity_decode( strip_tags( $msg ), ENT_QUOTES | 
ENT_HTML5 );
+   $msg = Sanitizer::stripAllTags( $msg );
parent::__construct( $msg, $code, $previous );
}
 
diff --git a/includes/installer/CliInstaller.php 
b/includes/installer/CliInstaller.php
index 661c3ec..af55dbb 100644
--- a/includes/installer/CliInstaller.php
+++ b/includes/installer/CliInstaller.php
@@ -180,7 +180,7 @@
 
$text = preg_replace( '/(.*?)<\/a>/', '$2 
$1', $text );
 
-   return html_entity_decode( strip_tags( $text ), ENT_QUOTES );
+   return Sanitizer::stripAllTags( $text );
}
 
/**
diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index d856d4b..11b2954 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -202,10 +202,6 @@
 * @return Array Tag data
 */
protected function buildChangeTagList() {
-   function stripAllHtml( $input ) {
-   return trim( html_entity_decode( strip_tags( $input ) ) 
);
-   }
-
$explicitlyDefinedTags = array_fill_keys( 
ChangeTags::listExplicitlyDefinedTags(), 0 );
$softwareActivatedTags = array_fill_keys( 
ChangeTags::listSoftwareActivatedTags(), 0 );
$tagStats = ChangeTags::tagUsageStatistics();
@@ -228,8 +224,8 @@
 
$result[] = [
'name' => $tagName,
-   'label' => stripAllHtml( 
ChangeTags::tagDescription( $tagName, $this->getContext() ) ),
-   'description' => $desc ? stripAllHtml( 
$desc->parse() ) : '',
+   'label' => Sanitizer::stripAllTags( 
ChangeTags::tagDescription( $tagName, $this->getContext() ) ),
+   'description' => $desc ? 
Sanitizer::stripAllTags( $desc->parse() ) : '',
'cssClass' => Sanitizer::escapeClass( 
'mw-tag-' . $tagName ),
'hits' => $hits,
];

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...release[master]: Fix a billion things wrong with branch handling and submodules

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

Change subject: Fix a billion things wrong with branch handling and submodules
..


Fix a billion things wrong with branch handling and submodules

Change-Id: Idd113e6506dbf909bba8668bd364e077db0bc38b
---
M make-release/make-release.py
1 file changed, 17 insertions(+), 7 deletions(-)

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



diff --git a/make-release/make-release.py b/make-release/make-release.py
index 228a0e4..8641b21 100755
--- a/make-release/make-release.py
+++ b/make-release/make-release.py
@@ -413,6 +413,14 @@
 logging.error("git checkout failed, exiting")
 sys.exit(1)
 
+logging.debug("Checking out submodules in %s...", dir)
+proc = subprocess.Popen(['git', 'submodule', 'update', '--init',
+ '--recursive'])
+
+if proc.wait() != 0:
+logging.error("git submodule update failed, exiting")
+sys.exit(1)
+
 os.chdir(oldDir)
 
 def export(self, gitRef, module, exportDir, patches=[]):
@@ -422,9 +430,6 @@
 self.getGit('core', dir, gitRef)
 for patch in patches:
 self.applyPatch(patch, dir)
-# 1.25+ has composer dependencies and needs mediawiki/vendor.
-if self.version.major >= '1.25' or self.version.major == 'snapshot':
-self.getGit('vendor', dir + '/vendor', self.version.branch)
 
 logging.info('Done with exporting core')
 
@@ -432,8 +437,10 @@
 # We started doing them as submodules instead
 if self.version.major < '1.29':
 self.getGit(extension, dir + '/' + extension, branch)
+
 for patch in patches:
 self.applyPatch(patch, dir + '/' + extension)
+
 logging.info('Done with exporting %s', extension)
 
 def makePatch(self, destDir, patchFileName, dir1, dir2, type):
@@ -539,13 +546,16 @@
 package = 'mediawiki-' + version.raw
 
 # Export the target
-patches = self.get_patches_for_repo('core', patchDir)
-self.export(tag, package, buildDir, patches)
+self.export(tag, package, buildDir,
+self.get_patches_for_repo('core', patchDir))
+
+self.exportExtension(branch, 'vendor', package,
+ self.get_patches_for_repo('vendor', patchDir))
 
 extExclude = []
 for ext in self.get_extensions_for_version(version, extensions):
-patches = self.get_patches_for_repo(ext, patchDir)
-self.exportExtension(branch, ext, package, patches)
+self.exportExtension(branch, ext, package,
+ self.get_patches_for_repo(ext, patchDir))
 extExclude.append("--exclude")
 extExclude.append(ext)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd113e6506dbf909bba8668bd364e077db0bc38b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
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...release[master]: Fix a billion things wrong with branch handling and submodules

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

Change subject: Fix a billion things wrong with branch handling and submodules
..

Fix a billion things wrong with branch handling and submodules

Change-Id: Idd113e6506dbf909bba8668bd364e077db0bc38b
---
M make-release/make-release.py
1 file changed, 17 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/release 
refs/changes/86/363986/1

diff --git a/make-release/make-release.py b/make-release/make-release.py
index 228a0e4..8641b21 100755
--- a/make-release/make-release.py
+++ b/make-release/make-release.py
@@ -413,6 +413,14 @@
 logging.error("git checkout failed, exiting")
 sys.exit(1)
 
+logging.debug("Checking out submodules in %s...", dir)
+proc = subprocess.Popen(['git', 'submodule', 'update', '--init',
+ '--recursive'])
+
+if proc.wait() != 0:
+logging.error("git submodule update failed, exiting")
+sys.exit(1)
+
 os.chdir(oldDir)
 
 def export(self, gitRef, module, exportDir, patches=[]):
@@ -422,9 +430,6 @@
 self.getGit('core', dir, gitRef)
 for patch in patches:
 self.applyPatch(patch, dir)
-# 1.25+ has composer dependencies and needs mediawiki/vendor.
-if self.version.major >= '1.25' or self.version.major == 'snapshot':
-self.getGit('vendor', dir + '/vendor', self.version.branch)
 
 logging.info('Done with exporting core')
 
@@ -432,8 +437,10 @@
 # We started doing them as submodules instead
 if self.version.major < '1.29':
 self.getGit(extension, dir + '/' + extension, branch)
+
 for patch in patches:
 self.applyPatch(patch, dir + '/' + extension)
+
 logging.info('Done with exporting %s', extension)
 
 def makePatch(self, destDir, patchFileName, dir1, dir2, type):
@@ -539,13 +546,16 @@
 package = 'mediawiki-' + version.raw
 
 # Export the target
-patches = self.get_patches_for_repo('core', patchDir)
-self.export(tag, package, buildDir, patches)
+self.export(tag, package, buildDir,
+self.get_patches_for_repo('core', patchDir))
+
+self.exportExtension(branch, 'vendor', package,
+ self.get_patches_for_repo('vendor', patchDir))
 
 extExclude = []
 for ext in self.get_extensions_for_version(version, extensions):
-patches = self.get_patches_for_repo(ext, patchDir)
-self.exportExtension(branch, ext, package, patches)
+self.exportExtension(branch, ext, package,
+ self.get_patches_for_repo(ext, patchDir))
 extExclude.append("--exclude")
 extExclude.append(ext)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd113e6506dbf909bba8668bd364e077db0bc38b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Chad 

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


[MediaWiki-commits] [Gerrit] mediawiki...LdapAuthentication[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: Ice6b2418ff5a6baf642b0a7952eaa866790c23c3
---
M LdapAuthentication.php
M LdapAuthenticationPlugin.php
M composer.json
M phpcs.xml
4 files changed, 9 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LdapAuthentication 
refs/changes/85/363985/1

diff --git a/LdapAuthentication.php b/LdapAuthentication.php
index dc7df51..6e7bc1c 100644
--- a/LdapAuthentication.php
+++ b/LdapAuthentication.php
@@ -164,6 +164,7 @@
$wgAuth->printDebug( "wgLDAPAutoAuthUsername and 
wgLDAPAutoAuthDomain is not null, adding hooks.", NONSENSITIVE );
$wgHooks['UserLoadAfterLoadFromSession'][] = 
'LdapAutoAuthentication::Authenticate';
 
-   $wgHooks['PersonalUrls'][] = 
'LdapAutoAuthentication::NoLogout'; /* Disallow logout link */
+   // Disallow logout link
+   $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout';
}
 }
diff --git a/LdapAuthenticationPlugin.php b/LdapAuthenticationPlugin.php
index a769257..aa04669 100644
--- a/LdapAuthenticationPlugin.php
+++ b/LdapAuthenticationPlugin.php
@@ -603,7 +603,6 @@
}
 
if ( $this->connect() ) {
-
$this->userdn = $this->getSearchString( $username );
 
// It is possible that getSearchString will return an
@@ -1516,7 +1515,6 @@
$usertopass = $this->userdn;
} else {
if ( $this->getConf( 
'GroupUseRetrievedUsername' ) && $this->LDAPUsername != '' ) {
-
$usertopass = $this->LDAPUsername;
} else {
$usertopass = $username;
@@ -1705,7 +1703,7 @@
}
 
$entries = LdapAuthenticationPlugin::ldap_get_entries( 
$this->ldapconn, $info );
-   if ( $entries ){
+   if ( $entries ) {
// We need to shift because the first entry will be a 
count
array_shift( $entries );
// Let's get a list of both full dn groups and 
shortname groups
@@ -1797,7 +1795,8 @@
# so as the user is currently not a 
member of the ldap group, he shall be removed from the local group
$user->removeGroup( $cGroup );
}
-   } else { # no, but maybe the user has recently been 
added to the ldap group?
+   } else {
+   # no, but maybe the user has recently been 
added to the ldap group?
$this->printDebug( "Checking to see if user is 
in: $cGroup", NONSENSITIVE );
if ( $this->hasLDAPGroup( $cGroup ) ) {
$this->printDebug( "Adding user to: 
$cGroup", NONSENSITIVE );
diff --git a/composer.json b/composer.json
index eed8ae7..00ef0de 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2"
+   "mediawiki/mediawiki-codesniffer": "0.10.0"
},
"scripts": {
"fix": "phpcbf",
diff --git a/phpcs.xml b/phpcs.xml
index 18af257..c87ec1c 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,6 +2,9 @@
 


+   
+   
+   




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice6b2418ff5a6baf642b0a7952eaa866790c23c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LdapAuthentication
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Remove unused function with outdated comment

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

Change subject: Remove unused function with outdated comment
..


Remove unused function with outdated comment

Change-Id: I86411262e4606d7eab727ebbdd9d8f2c8f387ddd
---
M CodeMirror.hooks.php
1 file changed, 0 insertions(+), 12 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index cf735f5..df753e8 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -32,18 +32,6 @@
}
 
/**
-* This function are used by the MobileFrontend extension only and will 
be
-* removed
-* @deprecated since version 4.0.0
-* @todo Remove usage in MobileFrontend and this function some time 
later
-* @return array
-*/
-   public static function getGlobalVariables() {
-   MWDebug::deprecated( __METHOD__ );
-   return [];
-   }
-
-   /**
 * Returns an array of variables for CodeMirror to work (tags and so on)
 *
 * @param IContextSource $context The current ContextSource object

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I86411262e4606d7eab727ebbdd9d8f2c8f387ddd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Niharika29 
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...VisualEditor[master]: Update VE core submodule to master (5d7b23762)

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

Change subject: Update VE core submodule to master (5d7b23762)
..

Update VE core submodule to master (5d7b23762)

New changes:
34999f2ce Move linear model -> source text conversion to ElementLinearData
a2ab4fa95 build: Bump grunt clean and stylelint to latest
dab49847a Fix infinite loop in ve.BranchNode#getNodeFromOffset
b4319e29d LanguageInputWidget: optionally suppress directionality input

Change-Id: I800085eb3a5f7332eab356b62a34bfc603a29839
---
M lib/ve
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/lib/ve b/lib/ve
index 1934b77..5d7b237 16
--- a/lib/ve
+++ b/lib/ve
@@ -1 +1 @@
-Subproject commit 1934b77e72f79d7bceb9d21dd6c0a90dadc61b0e
+Subproject commit 5d7b2376224cc8e016ff77d5489b730bca909b48

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Update BetaFeatures icon, use new template and cleanup slightly

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

Change subject: Update BetaFeatures icon, use new template and cleanup slightly
..


Update BetaFeatures icon, use new template and cleanup slightly

Change-Id: I29b596aef4a203d0b5e5bad5616d3a52284e147b
---
M CodeMirror.hooks.php
D resources/images/codemirror-beta-LTR.svg
D resources/images/codemirror-beta-RTL.svg
A resources/images/codemirror-beta-ltr.svg
A resources/images/codemirror-beta-rtl.svg
5 files changed, 118 insertions(+), 199 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index cf735f5..c321a20 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -164,10 +164,8 @@
'label-message' => 'codemirror-beta-title',
'desc-message' => 'codemirror-beta-desc',
'screenshot' => [
-   'ltr' => $wgExtensionAssetsPath .
-   
'/CodeMirror/resources/images/codemirror-beta-LTR.svg',
-   'rtl' => $wgExtensionAssetsPath .
-   
'/CodeMirror/resources/images/codemirror-beta-RTL.svg'
+   'ltr' => $wgExtensionAssetsPath . 
'/CodeMirror/resources/images/codemirror-beta-ltr.svg',
+   'rtl' => $wgExtensionAssetsPath . 
'/CodeMirror/resources/images/codemirror-beta-rtl.svg'
],
'info-link' => 
'https://meta.wikimedia.org/wiki/' .

'Community_Tech/Wikitext_editor_syntax_highlighting',
diff --git a/resources/images/codemirror-beta-LTR.svg 
b/resources/images/codemirror-beta-LTR.svg
deleted file mode 100644
index 36e08df..000
--- a/resources/images/codemirror-beta-LTR.svg
+++ /dev/null
@@ -1,97 +0,0 @@
-http://www.w3.org/2000/svg; viewBox="0 0 264 162" width="264" 
height="162">
-
-   .st0{fill:#3466CC;}
-   .st1{fill:#E5E5E5;}
-   .st2{fill:#FF;}
-   .st3{opacity:6.00e-02;enable-background:new;}
-   .st4{opacity:7.00e-02;enable-background:new;}
-   
.st5{opacity:0.25;fill:none;stroke:#FF;stroke-width:0.5;stroke-miterlimit:10;enable-background:new
;}
-   .st6{fill:#00AF89;}
-   .st7{opacity:0.23;fill:#F5A623;enable-background:new;}
-   .st8{fill:#F5A623;}
-
-
-   
-   
-
-
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-
-
-   
-   
-
-
-   
-   
-
-
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-
-
-
-
-
-
-
-
-
-   
-
-
-   
-   
-   
-   
-   
-   
-   
-
-
diff --git a/resources/images/codemirror-beta-RTL.svg 
b/resources/images/codemirror-beta-RTL.svg
deleted file mode 100644
index c791296..000
--- a/resources/images/codemirror-beta-RTL.svg
+++ /dev/null
@@ -1,98 +0,0 @@
-http://www.w3.org/2000/svg; viewBox="0 0 264 162" width="264" 
height="162">
-
-   .st0{fill:#3466CC;}
-   .st1{fill:#E5E5E5;}
-   .st2{fill:#FF;}
-   .st3{opacity:6.00e-02;enable-background:new;}
-   .st4{opacity:7.00e-02;enable-background:new;}
-   
.st5{opacity:0.25;fill:none;stroke:#FF;stroke-width:0.5;stroke-miterlimit:10;enable-background:new
;}
-   .st6{fill:#00AF89;}
-   .st7{opacity:0.23;fill:#F5A623;enable-background:new;}
-   .st8{fill:#F5A623;}
-
-
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-   
-

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: DO NOT MERGE: What if I replace these home-made functions?

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

Change subject: DO NOT MERGE: What if I replace these home-made functions?
..

DO NOT MERGE: What if I replace these home-made functions?

Change-Id: Ib9e4e77232ed1cd2c5cee39e027dce7f27c185a2
---
M includes/Sanitizer.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/363983/1

diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index dd4a314..885edde 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -1842,10 +1842,10 @@
 */
static function stripAllTags( $text ) {
# Actual 
-   $text = StringUtils::delimiterReplace( '<', '>', '', $text );
+   $text = strip_tags($text);//StringUtils::delimiterReplace( '<', 
'>', '', $text );
 
# Normalize  and whitespace
-   $text = self::decodeCharReferences( $text );
+   $text = html_entity_decode($text);//self::decodeCharReferences( 
$text );
$text = self::normalizeWhitespace( $text );
 
return $text;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...TemplateSandbox[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: Id4f135128af68b08c865539e740e17feefd3ff9c
---
M TemplateSandboxLogic.php
M composer.json
M phpcs.xml
3 files changed, 5 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateSandbox 
refs/changes/82/363982/1

diff --git a/TemplateSandboxLogic.php b/TemplateSandboxLogic.php
index b7917ca..0bdad0c 100644
--- a/TemplateSandboxLogic.php
+++ b/TemplateSandboxLogic.php
@@ -27,7 +27,6 @@
$this->prefixes = $prefixes;
$this->title = $title;
$this->content = $content;
-
}
 
/**
diff --git a/composer.json b/composer.json
index 86cf2e1..4e6525f 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2",
+   "mediawiki/mediawiki-codesniffer": "0.10.0",
"jakub-onderka/php-console-highlighter": "0.3.2"
},
"scripts": {
diff --git a/phpcs.xml b/phpcs.xml
index b21da71..7fa9f44 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,9 @@
 
 
-   
+   
+   
+   
+   
.



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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4f135128af68b08c865539e740e17feefd3ff9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateSandbox
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Make sure $wgPygmentizePath is sane only when we need it

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

Change subject: Make sure $wgPygmentizePath is sane only when we need it
..


Make sure $wgPygmentizePath is sane only when we need it

This avoids having an extension function, which runs on every request,
regardless of whether it uses syntax highlighting or not.

Change-Id: I890348b73af956819300cce64d0672dcdb209c19
---
M SyntaxHighlight.class.php
M extension.json
M maintenance/updateCSS.php
M maintenance/updateLexerList.php
4 files changed, 17 insertions(+), 21 deletions(-)

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



diff --git a/SyntaxHighlight.class.php b/SyntaxHighlight.class.php
index 0ab8f03..1c16d56 100644
--- a/SyntaxHighlight.class.php
+++ b/SyntaxHighlight.class.php
@@ -41,15 +41,6 @@
'text/xml' => 'xml',
];
 
-   public static function onSetup() {
-   global $wgPygmentizePath;
-
-   // If $wgPygmentizePath is unset, use the bundled copy.
-   if ( $wgPygmentizePath === false ) {
-   $wgPygmentizePath = __DIR__ . '/pygments/pygmentize';
-   }
-   }
-
/**
 * Get the Pygments lexer name for a particular language.
 *
@@ -188,6 +179,20 @@
}
 
/**
+* @return string
+*/
+   public static function getPygmentizePath() {
+   global $wgPygmentizePath;
+
+   // If $wgPygmentizePath is unset, use the bundled copy.
+   if ( $wgPygmentizePath === false ) {
+   $wgPygmentizePath = __DIR__ . '/pygments/pygmentize';
+   }
+
+   return $wgPygmentizePath;
+   }
+
+   /**
 * Highlight a code-block using a particular lexer.
 *
 * @param string $code Code to highlight.
@@ -203,8 +208,6 @@
 *  code as its value.
 */
public static function highlight( $code, $lang = null, $args = [] ) {
-   global $wgPygmentizePath;
-
$status = new Status;
 
$lexer = self::getLexer( $lang );
@@ -287,7 +290,7 @@
$optionPairs[] = "{$k}={$v}";
}
$builder = new ProcessBuilder();
-   $builder->setPrefix( $wgPygmentizePath );
+   $builder->setPrefix( self::getPygmentizePath() );
$process = $builder
->add( '-l' )->add( $lexer )
->add( '-f' )->add( 'html' )
diff --git a/extension.json b/extension.json
index c32c6cc..dd753f3 100644
--- a/extension.json
+++ b/extension.json
@@ -30,9 +30,6 @@
"ResourceLoaderGeSHiVisualEditorModule": 
"ResourceLoaderSyntaxHighlightVisualEditorModule.php",
"ResourceLoaderSyntaxHighlightVisualEditorModule": 
"ResourceLoaderSyntaxHighlightVisualEditorModule.php"
},
-   "ExtensionFunctions": [
-   "SyntaxHighlight::onSetup"
-   ],
"ResourceFileModulePaths": {
"localBasePath": "modules",
"remoteExtPath": "SyntaxHighlight_GeSHi/modules"
diff --git a/maintenance/updateCSS.php b/maintenance/updateCSS.php
index 95fc6fc..ce953cb 100644
--- a/maintenance/updateCSS.php
+++ b/maintenance/updateCSS.php
@@ -36,13 +36,11 @@
}
 
public function execute() {
-   global $wgPygmentizePath;
-
$target = __DIR__ . '/../modules/pygments.generated.css';
$css = "/* Stylesheet generated by updateCSS.php */\n";
 
$builder = new ProcessBuilder();
-   $builder->setPrefix( $wgPygmentizePath );
+   $builder->setPrefix( SyntaxHighlight_GeSHi::getPygmentizePath() 
);
 
$process = $builder
->add( '-f' )->add( 'html' )
diff --git a/maintenance/updateLexerList.php b/maintenance/updateLexerList.php
index 0b3e5e3..00ee8a4 100644
--- a/maintenance/updateLexerList.php
+++ b/maintenance/updateLexerList.php
@@ -35,8 +35,6 @@
}
 
public function execute() {
-   global $wgPygmentizePath;
-
function lang_filter( $val ) {
return preg_match( '/^[a-zA-Z0-9\-_]+$/', $val );
}
@@ -46,7 +44,7 @@
$lexers = [];
 
$builder = new ProcessBuilder();
-   $builder->setPrefix( $wgPygmentizePath );
+   $builder->setPrefix( SyntaxHighlight_GeSHi::getPygmentizePath() 
);
 
$process = $builder->add( '-L' )->add( 'lexer' )->getProcess();
$process->run();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Don't use deprecated Parser::$mUniqPrefix

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

Change subject: Don't use deprecated Parser::$mUniqPrefix
..


Don't use deprecated Parser::$mUniqPrefix

Change-Id: I3e739427fe90d01f81417cf9dc1e5d13f0edfdf4
---
M SyntaxHighlight.class.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/SyntaxHighlight.class.php b/SyntaxHighlight.class.php
index 0ab8f03..df92a92 100644
--- a/SyntaxHighlight.class.php
+++ b/SyntaxHighlight.class.php
@@ -172,7 +172,7 @@
 
// Use 'nowiki' strip marker to prevent list processing 
(also known as doBlockLevels()).
// However, leave the wrapping  outside to 
prevent -wrapping.
-   $marker = $parser->mUniqPrefix . 
'-syntaxhighlightinner-' .
+   $marker = $parser::MARKER_PREFIX . 
'-syntaxhighlightinner-' .
sprintf( '%08X', $parser->mMarkerIndex++ ) . 
$parser::MARKER_SUFFIX;
$parser->mStripState->addNoWiki( $marker, $out );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e739427fe90d01f81417cf9dc1e5d13f0edfdf4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] eventlogging[master]: Test batching of events for sql insertion

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

Change subject: Test batching of events for sql insertion
..

Test batching of events for sql insertion

Events are batched given a schema id, version and topic
Events that share schemas but not topics should be
in different batches

Bug: T150369

Change-Id: I5feaeb297a690f0b1896ea11c31de1e47096caca
---
M requirements.txt
M tests/test_handlers.py
2 files changed, 57 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/eventlogging 
refs/changes/81/363981/1

diff --git a/requirements.txt b/requirements.txt
index fd3d7b3..b22e00f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,6 +2,7 @@
 jsonschema>=0.7
 confluent-kafka>=0.9.1.2
 kafka-python>=1.3.0
+mock==1.0.0
 mysqlclient>=1.3.7
 pygments>=1.5
 psutil>=2.1.1
diff --git a/tests/test_handlers.py b/tests/test_handlers.py
index a6e4895..add3f98 100644
--- a/tests/test_handlers.py
+++ b/tests/test_handlers.py
@@ -10,11 +10,13 @@
 
 import os
 import unittest
+from mock import patch, Mock, MagicMock
 
 import eventlogging
 import eventlogging.handlers
 import eventlogging.factory
 
+from .fixtures import _get_event
 
 def echo_writer(uri, **kwargs):
 values = []
@@ -51,7 +53,60 @@
 reader = eventlogging.get_reader('test://localhost/?value=secret')
 self.assertEqual(next(reader), 'secret')
 
-
+class SQLHandlerTestCase(unittest.TestCase):
+
+def test_sql_batching_happy_case_same_schema(self):  
+"""
+Send several events that will get batched together
+as they belong to the same schema
+"""
+
+# Patching works in teh scope of the function
+@patch('eventlogging.handlers.store_sql_events')
+def mock_holder(mock_store_sql_events):
+
+writer = 
eventlogging.get_writer('sqlite://?batch_size=3_time=10')
+event = _get_event().next()
+
+writer.send(event)
+writer.send(event)
+self.assertEqual(mock_store_sql_events.call_count, 0, 'No call to 
insert should happened, batch size not reached')
+# the two events belong to the same batch the store_sql_events 
should have
+writer.send(event)
+self.assertEqual(mock_store_sql_events.call_count, 1, 'Reached 
batch size, should have inserted')
+writer.send(event)
+self.assertEqual(mock_store_sql_events.call_count, 1, 'No call to 
insert should happened, batch size not reached')
+
+mock_holder();
+
+def test_sql_batching_schemas_and_topics(self):  
+"""
+Send several events that will get batched separately
+as they belong to different topics
+"""
+@patch('eventlogging.handlers.store_sql_events')
+def mock_holder(mock_store_sql_events):
+writer = 
eventlogging.get_writer('sqlite://?batch_size=3_time=10')
+event_topic1 = _get_event().next()
+event_topic2 = _get_event().next()
+
+event_topic2['topic'] = 'different_test_topic'
+writer.send(event_topic1)
+writer.send(event_topic1)
+writer.send(event_topic2)
+writer.send(event_topic2)
+
+self.assertEqual(mock_store_sql_events.call_count, 0, 'No call to 
insert should happened, batch size not reached')
+# now add a new event on second topic 
+writer.send(event_topic2)
+self.assertEqual(mock_store_sql_events.call_count, 1, 'Reached 
batch size, should have inserted')
+# add a new topic1 event
+writer.send(event_topic1)
+self.assertEqual(mock_store_sql_events.call_count, 2, 'Reached 
batch size, should have inserted')
+
+mock_holder();
+
+ 
 class PluginTestCase(unittest.TestCase):
 """Test case for the plug-in loader."""
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5feaeb297a690f0b1896ea11c31de1e47096caca
Gerrit-PatchSet: 1
Gerrit-Project: eventlogging
Gerrit-Branch: master
Gerrit-Owner: Nuria 

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: Use MediaWiki-like escaping for section link

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

Change subject: Use MediaWiki-like escaping for section link
..


Use MediaWiki-like escaping for section link

Previously, an automatic edit summary like "/* External link */"
resulted in a link to "/wiki/Page_name#External link" without
any escaping.

* Remove the duplicate htmlspecialchars() call.
* Add unit tests.

Bug: T165549
Change-Id: I4516d5a7ef03c4c046ac4b24a96bf0d64728251c
---
M .gitignore
M composer.json
A phpunit.xml.dist
M src/App.php
M src/Wiki.php
A tests/WikiTest.php
6 files changed, 64 insertions(+), 6 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 4210414..834faf0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
-vendor
-composer.lock
-cache/*.json
+/cache/*.json
+/composer.lock
+/coverage
+/vendor
diff --git a/composer.json b/composer.json
index 9c5eb1d..574aa02 100644
--- a/composer.json
+++ b/composer.json
@@ -15,12 +15,15 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2",
-   "squizlabs/php_codesniffer": "^2.7.1"
+   "squizlabs/php_codesniffer": "^2.7.1",
+   "phpunit/phpunit": "4.8.*"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor",
+   "phpunit",
"phpcs -p -s"
-   ]
+   ],
+   "cover": "phpunit --coverage-html coverage/"
}
 }
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 000..d3772cd
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,13 @@
+
+
+   
+   
+   ./tests
+   
+   
+   
+   
+   ./src
+   
+   
+
diff --git a/src/App.php b/src/App.php
index c1ae19c..db38076 100644
--- a/src/App.php
+++ b/src/App.php
@@ -174,8 +174,11 @@
 $section = str_replace(']]', '', $section);
 // See MediaWiki/Sanitizer::normalizeSectionNameWhitespace() 
and Language::getArrow()
 $section =  trim(preg_replace('/[ _]+/', ' ', $section));
+// See MediaWiki/Sanitizer::escapeId() – called by 
Linker::makeCommentLink(),
+// via LinkerRenderer, via Title::escapeFragmentForURL().
 $link = '→';
 
 if ($isPost) {
diff --git a/src/Wiki.php b/src/Wiki.php
index 9649a47..09b847f 100644
--- a/src/Wiki.php
+++ b/src/Wiki.php
@@ -95,6 +95,24 @@
 }
 
 /**
+ * Based on MediaWiki's Sanitizer::escapeId()
+ *
+ * @param string $id
+ * @return string
+ */
+public static function escapeId($id) {
+// HTML4-style escaping
+static $replace = [
+'%3A' => ':',
+'%' => '.',
+];
+
+$id = urlencode(strtr($id, ' ', '_'));
+$id = strtr($id, $replace);
+return $id;
+}
+
+/**
  * Based on MediaWiki 1.25's Sanitizer::escapeHtmlAllowEntities
  *
  * @param string $wikitext
diff --git a/tests/WikiTest.php b/tests/WikiTest.php
new file mode 100644
index 000..f3096bd
--- /dev/null
+++ b/tests/WikiTest.php
@@ -0,0 +1,20 @@
+assertEquals($expected, Wiki::escapeId($input));
+}
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4516d5a7ef03c4c046ac4b24a96bf0d64728251c
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PerformanceInspector[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: I25413051a90fb1cf217443c1f58ef88af520bfcc
---
M composer.json
M phpcs.xml
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PerformanceInspector 
refs/changes/80/363980/1

diff --git a/composer.json b/composer.json
index 2b92ff4..79ab22d 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2",
+   "mediawiki/mediawiki-codesniffer": "0.10.0",
"jakub-onderka/php-console-highlighter": "0.3.2"
},
"license": "GPL-2+",
diff --git a/phpcs.xml b/phpcs.xml
index b21da71..2da2ec6 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,8 @@
 
 
-   
+   
+   
+   
.



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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25413051a90fb1cf217443c1f58ef88af520bfcc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PerformanceInspector
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] labs...guc[master]: Use MediaWiki-like escaping for section link

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

Change subject: Use MediaWiki-like escaping for section link
..

Use MediaWiki-like escaping for section link

Previously, an automatic edit summary like "/* External link */"
resulted in a link to "/wiki/Page_name#External link" without
any escaping.

* Remove the duplicate htmlspecialchars() call.
* Add unit tests.

Bug: T165549
Change-Id: I4516d5a7ef03c4c046ac4b24a96bf0d64728251c
---
M .gitignore
M composer.json
A phpunit.xml.dist
M src/App.php
M src/Wiki.php
A tests/WikiTest.php
6 files changed, 64 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/guc 
refs/changes/79/363979/1

diff --git a/.gitignore b/.gitignore
index 4210414..834faf0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
-vendor
-composer.lock
-cache/*.json
+/cache/*.json
+/composer.lock
+/coverage
+/vendor
diff --git a/composer.json b/composer.json
index 9c5eb1d..574aa02 100644
--- a/composer.json
+++ b/composer.json
@@ -15,12 +15,15 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2",
-   "squizlabs/php_codesniffer": "^2.7.1"
+   "squizlabs/php_codesniffer": "^2.7.1",
+   "phpunit/phpunit": "4.8.*"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor",
+   "phpunit",
"phpcs -p -s"
-   ]
+   ],
+   "cover": "phpunit --coverage-html coverage/"
}
 }
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 000..d3772cd
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,13 @@
+
+
+   
+   
+   ./tests
+   
+   
+   
+   
+   ./src
+   
+   
+
diff --git a/src/App.php b/src/App.php
index c1ae19c..db38076 100644
--- a/src/App.php
+++ b/src/App.php
@@ -174,8 +174,11 @@
 $section = str_replace(']]', '', $section);
 // See MediaWiki/Sanitizer::normalizeSectionNameWhitespace() 
and Language::getArrow()
 $section =  trim(preg_replace('/[ _]+/', ' ', $section));
+// See MediaWiki/Sanitizer::escapeId() – called by 
Linker::makeCommentLink(),
+// via LinkerRenderer, via Title::escapeFragmentForURL().
 $link = '→';
 
 if ($isPost) {
diff --git a/src/Wiki.php b/src/Wiki.php
index 9649a47..09b847f 100644
--- a/src/Wiki.php
+++ b/src/Wiki.php
@@ -95,6 +95,24 @@
 }
 
 /**
+ * Based on MediaWiki's Sanitizer::escapeId()
+ *
+ * @param string $id
+ * @return string
+ */
+public static function escapeId($id) {
+// HTML4-style escaping
+static $replace = [
+'%3A' => ':',
+'%' => '.',
+];
+
+$id = urlencode(strtr($id, ' ', '_'));
+$id = strtr($id, $replace);
+return $id;
+}
+
+/**
  * Based on MediaWiki 1.25's Sanitizer::escapeHtmlAllowEntities
  *
  * @param string $wikitext
diff --git a/tests/WikiTest.php b/tests/WikiTest.php
new file mode 100644
index 000..f3096bd
--- /dev/null
+++ b/tests/WikiTest.php
@@ -0,0 +1,20 @@
+assertEquals($expected, Wiki::escapeId($input));
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4516d5a7ef03c4c046ac4b24a96bf0d64728251c
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki...PoolCounter[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: I1e607870c1bb9be3b9246ae088b2a592817f005a
---
M composer.json
M phpcs.xml
2 files changed, 5 insertions(+), 3 deletions(-)


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

diff --git a/composer.json b/composer.json
index b8f68fb..4f55859 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2"
+   "mediawiki/mediawiki-codesniffer": "0.10.0"
},
"scripts": {
"fix": "phpcbf",
diff --git a/phpcs.xml b/phpcs.xml
index f87c295..d39264b 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,11 +1,13 @@
 
 
-   
+   

+   
+   

.

-   
+   
PoolCounter.php
vendor
node_modules

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e607870c1bb9be3b9246ae088b2a592817f005a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PoolCounter
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki...timeline[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: Ie083ee067f91c141fb8d13a9fa29dc702e6210da
---
M Timeline.body.php
M Timeline.php
M composer.json
M phpcs.xml
4 files changed, 17 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/timeline 
refs/changes/77/363977/1

diff --git a/Timeline.body.php b/Timeline.body.php
index a69a744..3603279 100644
--- a/Timeline.body.php
+++ b/Timeline.body.php
@@ -79,12 +79,15 @@
$tmpFile = TempFSFile::factory( 'timeline_' );
if ( $tmpFile ) {
$tmpPath = $tmpFile->getPath();
-   file_put_contents( $tmpPath, $timelinesrc ); // 
store plot data to file
+   // store plot data to file
+   file_put_contents( $tmpPath, $timelinesrc );
 
-   $filesCollect = []; // temp files to clean up
+   // temp files to clean up
+   $filesCollect = [];
foreach ( [ 'map', 'png', 'svg', 'err' ] as 
$ext ) {
$fileCollect = new TempFSFile( 
"{$tmpPath}.{$ext}" );
-   $fileCollect->autocollect(); // clean 
this up
+   // clean this up
+   $fileCollect->autocollect();
$filesCollect[] = $fileCollect;
}
 
@@ -148,12 +151,14 @@
}
}
if ( !$backend->doQuickOperations( $ops 
)->isOK() ) {
+   // FIXME Hard coded english text
return "Timeline error. "
-   . "Could not store output 
files"; // ugh
+   . "Could not store output 
files";
}
} else {
+   // FIXME Hard coded english text
return "Timeline error. "
-   . "Could not create temp 
file"; // ugh
+   . "Could not create temp 
file";
}
 
if ( $ret == "" || $retVal > 0 ) {
diff --git a/Timeline.php b/Timeline.php
index 2226c97..b7a2aeb 100644
--- a/Timeline.php
+++ b/Timeline.php
@@ -5,7 +5,8 @@
// Keep i18n globals so mergeMessageFileList.php doesn't break
$wgMessagesDirs['Timeline'] = __DIR__ . '/i18n';
 /* wfWarn(
-   'Deprecated PHP entry point used for Timeline extension. Please 
use wfLoadExtension instead, ' .
+   'Deprecated PHP entry point used for Timeline extension. ' .
+   'Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
);
 */
@@ -13,4 +14,3 @@
 } else {
die( 'This version of the Timeline extension requires MediaWiki 1.28+' 
);
 }
-
diff --git a/composer.json b/composer.json
index 3e676f3..1366381 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2",
+   "mediawiki/mediawiki-codesniffer": "0.10.0",
"jakub-onderka/php-console-highlighter": "0.3.2"
},
"scripts": {
diff --git a/phpcs.xml b/phpcs.xml
index 3e4aafb..18ef00c 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,9 +1,11 @@
 
 
-   
+   
+   
+   
.

-   
+   
vendor/
node_modules/
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie083ee067f91c141fb8d13a9fa29dc702e6210da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/timeline
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialRecentchanges: Globals for config are bad, m'kay

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

Change subject: SpecialRecentchanges: Globals for config are bad, m'kay
..

SpecialRecentchanges: Globals for config are bad, m'kay

Change-Id: I9ca7aead42ffee1e891525fc80f3438157f4fb2f
---
M includes/specials/SpecialRecentchanges.php
1 file changed, 3 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/363976/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index bec87c5..05bcc4d 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -138,10 +138,6 @@
 * @param string $subpage
 */
public function execute( $subpage ) {
-   global $wgStructuredChangeFiltersEnableSaving,
-   $wgStructuredChangeFiltersEnableExperimentalViews,
-   $wgStructuredChangeFiltersEnableLiveUpdate;
-
// Backwards-compatibility: redirect to new feed URLs
$feedFormat = $this->getRequest()->getVal( 'feed' );
if ( !$this->including() && $feedFormat ) {
@@ -184,15 +180,15 @@
$out->addJsConfigVars( 'wgStructuredChangeFilters', 
$jsData['groups'] );
$out->addJsConfigVars(
'wgStructuredChangeFiltersEnableSaving',
-   $wgStructuredChangeFiltersEnableSaving
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableSaving' )
);
$out->addJsConfigVars(

'wgStructuredChangeFiltersEnableExperimentalViews',
-   
$wgStructuredChangeFiltersEnableExperimentalViews
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableExperimentalViews' )
);
$out->addJsConfigVars(
'wgStructuredChangeFiltersEnableLiveUpdate',
-   $wgStructuredChangeFiltersEnableLiveUpdate
+   $this->getConfig()->get( 
'StructuredChangeFiltersEnableLiveUpdate' )
);
$out->addJsConfigVars(
'wgRCFiltersChangeTags',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove deprecated $wgUseTidy in favour of $wgTidyConfig

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

Change subject: Remove deprecated $wgUseTidy in favour of $wgTidyConfig
..


Remove deprecated $wgUseTidy in favour of $wgTidyConfig

Bug: T168671
Change-Id: I064fd17d2a3308cbfa62a3f9115c30ab10bd6e08
---
M includes/api/ApiMobileView.php
M tests/phpunit/api/ApiParseExtenderTest.php
2 files changed, 8 insertions(+), 6 deletions(-)

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



diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php
index d1beb22..bec4f2c 100644
--- a/includes/api/ApiMobileView.php
+++ b/includes/api/ApiMobileView.php
@@ -645,8 +645,9 @@
'refsections' => [],
];
} else {
-   $data = $this->parseSectionsData( $html, $title, 
$parserOutput,
-   $mfConfig->get( 'MFTidyMobileViewSections' ) && 
$this->getConfig()->get( 'UseTidy' ), $latest );
+   $useTidy = $this->getConfig()->get( 'TidyConfig' ) !== 
null
+   && $mfConfig->get( 'MFTidyMobileViewSections' );
+   $data = $this->parseSectionsData( $html, $title, 
$parserOutput, $useTidy, $latest );
if ( $this->usePageImages ) {
$image = $this->getPageImage( $title );
if ( $image ) {
diff --git a/tests/phpunit/api/ApiParseExtenderTest.php 
b/tests/phpunit/api/ApiParseExtenderTest.php
index f598417..f52323d 100644
--- a/tests/phpunit/api/ApiParseExtenderTest.php
+++ b/tests/phpunit/api/ApiParseExtenderTest.php
@@ -14,18 +14,19 @@
 * @covers ApiParseExtender::onAPIAfterExecute
 */
public function testApi( array $params, $expected ) {
-   global $wgUseTidy;
+   global $wgTidyConfig;
 
$this->setMwGlobals( 'wgMFRemovableClasses',
[
'base' => [ '.nomobile' ]
]
);
-   if ( $wgUseTidy ) {
+   if ( $wgTidyConfig !== null ) {
+   $oldTidyConfig = $wgTidyConfig;
// Should work both with Tidy and without it
-   $this->setMwGlobals( 'wgUseTidy', false );
+   $this->setMwGlobals( 'wgTidyConfig', null );
$this->doTest( $params, $expected );
-   $wgUseTidy = true;
+   $wgTidyConfig = $oldTidyConfig;
}
$this->doTest( $params, $expected );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I064fd17d2a3308cbfa62a3f9115c30ab10bd6e08
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Pmiazga 
Gerrit-Reviewer: Jdlrobson 
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...CodeMirror[master]: Remove i18n shim

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

Change subject: Remove i18n shim
..

Remove i18n shim

Change-Id: I187328ea888589aa33500dda25c73cff18261e07
---
D CodeMirror.i18n.php
M phpcs.xml
2 files changed, 0 insertions(+), 36 deletions(-)


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

diff --git a/CodeMirror.i18n.php b/CodeMirror.i18n.php
deleted file mode 100644
index f0db7ff..000
--- a/CodeMirror.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = [];
-if ( !function_exists( 'wfJsonI18nShimfe179a89caef8049' ) ) {
-   function wfJsonI18nShimfe179a89caef8049( $cache, $code, &$cachedData ) {
-   $codeSequence = array_merge( [ $code ], 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = __DIR__ . "/i18n/$csCode.json";
-   if ( is_readable( $fileName ) ) {
-   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-   foreach ( array_keys( $data ) as $key ) {
-   if ( $key === '' || $key[0] === '@' ) {
-   unset( $data[$key] );
-   }
-   }
-   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-   }
-
-   $cachedData['deps'][] = new FileDependency( $fileName );
-   }
-   return true;
-   }
-
-   $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimfe179a89caef8049';
-}
diff --git a/phpcs.xml b/phpcs.xml
index 29fb515..df8c2b5 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,7 +1,6 @@
 
 

-   




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I187328ea888589aa33500dda25c73cff18261e07
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Remove unused function with outdated comment

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

Change subject: Remove unused function with outdated comment
..

Remove unused function with outdated comment

Change-Id: I86411262e4606d7eab727ebbdd9d8f2c8f387ddd
---
M CodeMirror.hooks.php
1 file changed, 0 insertions(+), 12 deletions(-)


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

diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index cf735f5..df753e8 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -32,18 +32,6 @@
}
 
/**
-* This function are used by the MobileFrontend extension only and will 
be
-* removed
-* @deprecated since version 4.0.0
-* @todo Remove usage in MobileFrontend and this function some time 
later
-* @return array
-*/
-   public static function getGlobalVariables() {
-   MWDebug::deprecated( __METHOD__ );
-   return [];
-   }
-
-   /**
 * Returns an array of variables for CodeMirror to work (tags and so on)
 *
 * @param IContextSource $context The current ContextSource object

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86411262e4606d7eab727ebbdd9d8f2c8f387ddd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...FundraiserLandingPage[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: I85ac8a333b8a6e2a4b378ae137c6acdd3a1ed7c8
---
M FundraiserLandingPage.body.php
M FundraiserLandingPage.hooks.php
M FundraiserRedirector.body.php
M composer.json
M phpcs.xml
5 files changed, 19 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FundraiserLandingPage 
refs/changes/73/363973/1

diff --git a/FundraiserLandingPage.body.php b/FundraiserLandingPage.body.php
index 07eaf8f..034326f 100644
--- a/FundraiserLandingPage.body.php
+++ b/FundraiserLandingPage.body.php
@@ -5,7 +5,7 @@
  *
  * @author Peter Gehres 
  */
-class FundraiserLandingPage extends UnlistedSpecialPage  {
+class FundraiserLandingPage extends UnlistedSpecialPage {
function __construct() {
parent::__construct( 'FundraiserLandingPage' );
}
@@ -17,7 +17,7 @@
 
if ( $wgContributionTrackingFundraiserMaintenance
|| $wgContributionTrackingFundraiserMaintenanceUnsched
-   ){
+   ) {
$this->getOutput()->redirect(
Title::newFromText( 
'Special:FundraiserMaintenance' )->getFullURL(), '302'
);
@@ -122,10 +122,10 @@
 * Country, Root. It is assumed that all parts of the title are 
separated
 * with '/'.
 *
-* @param Parser $parser   Reference to the WM parser object
-* @param string $page The template page root to load
+* @param Parser $parser Reference to the WM parser object
+* @param string $page The template page root to load
 * @param string $language The language to attempt to localize onto
-* @param string $country  The country to attempt to localize onto
+* @param string $country The country to attempt to localize onto
 *
 * @return string The wikitext template
 */
@@ -156,9 +156,9 @@
 * Language, Root. It is assumed that all parts of the title are 
separated
 * with '/'.
 *
-* @param Parser $parser   Reference to the WM parser object
-* @param string $page The template page root to load
-* @param string $country  The country to attempt to localize onto
+* @param Parser $parser Reference to the WM parser object
+* @param string $page The template page root to load
+* @param string $country The country to attempt to localize onto
 * @param string $language The language to attempt to localize onto
 *
 * @return string The wikitext template
diff --git a/FundraiserLandingPage.hooks.php b/FundraiserLandingPage.hooks.php
index dee6a63..25f6136 100644
--- a/FundraiserLandingPage.hooks.php
+++ b/FundraiserLandingPage.hooks.php
@@ -4,7 +4,7 @@
 * Register the parser function hooks 'switchlanguage' and 
'switchcountry'
 * with the MW backend.
 *
-* @param $parser Parser The MW parser object to hook into.
+* @param Parser &$parser The MW parser object to hook into.
 *
 * @return bool Always true
 */
diff --git a/FundraiserRedirector.body.php b/FundraiserRedirector.body.php
index f548e55..a1becd2 100644
--- a/FundraiserRedirector.body.php
+++ b/FundraiserRedirector.body.php
@@ -47,7 +47,8 @@
if ( in_array( $tryLanguage, $mwLanguages ) ) {
// use the language if it is supported 
in MediaWiki
$language = $tryLanguage;
-   break; // don't search further
+   // don't search further
+   break;
}
}
}
@@ -76,22 +77,22 @@
 
// if the country is covered by a payment-processing chapter, 
redirect
// the donor to the chapter's default landing page
-   if ( array_key_exists( $params['country'], 
$wgFundraiserLandingPageChapters ) ){
+   if ( array_key_exists( $params['country'], 
$wgFundraiserLandingPageChapters ) ) {
// Get the message key for the chapter's landing page
$message_key = $wgFundraiserLandingPageChapters[ 
$params['country'] ];
// Get the url for the chapter's landing page
$message = $this->msg( $message_key )->plain();
// if the message is not equal to the default message 
that is returned
// for a missing message, set the redirect URL to the 
message

[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: Remove deprecated $wgUseTidy in favour of $wgTidyConfig

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

Change subject: Remove deprecated $wgUseTidy in favour of $wgTidyConfig
..


Remove deprecated $wgUseTidy in favour of $wgTidyConfig

Bug: T168671
Change-Id: I27f5bee2448797c3a5a8cb886cee0e518b199ebe
---
M includes/ApiQueryExtracts.php
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index 2a84bae..45aece8 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -342,7 +342,9 @@
 * @return string
 */
private function tidy( $text ) {
-   if ( $this->getConfig()->get( 'UseTidy' ) && 
!$this->params['plaintext'] ) {
+   $tidyConfig = $this->getConfig()->get( 'TidyConfig' );
+
+   if ( $tidyConfig !== null && !$this->params['plaintext'] ) {
$text = trim( MWTidy::tidy( $text ) );
}
return $text;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I27f5bee2448797c3a5a8cb886cee0e518b199ebe
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: Pmiazga 
Gerrit-Reviewer: Jdlrobson 
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...ParserMigration[master]: Change "article" to "page"

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

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


Change "article" to "page"

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

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

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



diff --git a/i18n/en.json b/i18n/en.json
index 6e0a2a9..53e2cba 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,7 +9,7 @@
"parsermigration-current": "Current",
"parsermigration-new": "New",
"parsermigration-pref-label": "Enable parser migration tool",
-   "parsermigration-pref-help": "This adds a sidebar link giving access to 
[https://www.mediawiki.org/wiki/Extension:ParserMigration a tool] for migrating 
article text to new versions of the MediaWiki parser.",
+   "parsermigration-pref-help": "This adds a sidebar link giving access to 
[https://www.mediawiki.org/wiki/Extension:ParserMigration a tool] for migrating 
page text to new versions of the MediaWiki parser.",
"parsermigration-toolbox-label": "Edit with migration tool"
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie4e9d873914ef2d1bf8a912610d565c8d9ead871
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParserMigration
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Raimond Spekking 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: Return empty extract for articles in File namespace

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

Change subject: Return empty extract for articles in File namespace
..


Return empty extract for articles in File namespace

Bug: T114418
Change-Id: I2dfccbcf27284ecfdd0669b004151824ece79b73
---
M i18n/en.json
M i18n/qqq.json
M includes/ApiQueryExtracts.php
3 files changed, 18 insertions(+), 6 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 567f72c..c84dba3 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,5 +13,6 @@
"apihelp-query+extracts-param-sectionformat": "How to format sections 
in plaintext mode:\n;plain:No formatting.\n;wiki:Wikitext-style formatting (== 
like this ==).\n;raw:This module's internal representation (section titles 
prefixed with ASCII 1ASCII 2section levelASCII 
2ASCII 1).",
"apihelp-query+extracts-example-1": "Get a 175-character extract",
"apiwarn-textextracts-limit": "exlimit was too large for a 
whole article extracts request, lowered to $1.",
-   "apiwarn-textextracts-unsupportedmodel": "$1 has content model $2, 
which is not supported; returning an empty extract."
+   "apiwarn-textextracts-unsupportedmodel": "$1 has content model $2, 
which is not supported; returning an empty extract.",
+   "apiwarn-textextracts-title-in-file-namespace": "Extract for a title in 
File namespace was requested, none returned."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 66c2d1b..8b86f0e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -15,5 +15,6 @@
"apihelp-query+extracts-param-sectionformat": 
"{{doc-apihelp-param|query+extracts|sectionformat}}",
"apihelp-query+extracts-example-1": 
"{{doc-apihelp-example|query+extracts}}",
"apiwarn-textextracts-limit": "{{doc-apierror}}\n\nParameters:\n* $1 - 
Limit that will be used",
-   "apiwarn-textextracts-unsupportedmodel": 
"{{doc-apierror}}\n\nParameters:\n* $1 - Page title\n* $2 - Content model"
+   "apiwarn-textextracts-unsupportedmodel": 
"{{doc-apierror}}\n\nParameters:\n* $1 - Page title\n* $2 - Content model",
+   "apiwarn-textextracts-title-in-file-namespace": 
"{{doc-apierror}}\n\nWarning message displayed when an extract for a title in 
File namespace is requested."
 }
diff --git a/includes/ApiQueryExtracts.php b/includes/ApiQueryExtracts.php
index 2a84bae..04e833e 100644
--- a/includes/ApiQueryExtracts.php
+++ b/includes/ApiQueryExtracts.php
@@ -90,16 +90,23 @@
$titles = array_slice( $titles, $continue, null, true );
}
$count = 0;
+   $titleInFileNamespace = false;
/** @var Title $t */
foreach ( $titles as $id => $t ) {
if ( ++$count > $limit ) {
$this->setContinueEnumParameter( 'continue', 
$continue + $count - 1 );
break;
}
-   $text = $this->getExtract( $t );
-   $text = $this->truncate( $text );
-   if ( $this->params['plaintext'] ) {
-   $text = $this->doSections( $text );
+
+   if ( $t->inNamespace( NS_FILE ) ) {
+   $text = '';
+   $titleInFileNamespace = true;
+   } else {
+   $text = $this->getExtract( $t );
+   $text = $this->truncate( $text );
+   if ( $this->params['plaintext'] ) {
+   $text = $this->doSections( $text );
+   }
}
 
if ( $isXml ) {
@@ -112,6 +119,9 @@
break;
}
}
+   if ( $titleInFileNamespace ) {
+   $this->addWarning( 
'apiwarn-textextracts-title-in-file-namespace' );
+   }
}
 
public function getCacheMode( $params ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2dfccbcf27284ecfdd0669b004151824ece79b73
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/TextExtracts
Gerrit-Branch: master
Gerrit-Owner: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
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...CodeMirror[master]: Add phpcs and make pass

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

Change subject: Add phpcs and make pass
..


Add phpcs and make pass

Change-Id: Ibddce88a08cdd59f6f7b60a297e37952c2f01b62
---
M CodeMirror.hooks.php
M CodeMirror.i18n.php
M composer.json
A phpcs.xml
4 files changed, 42 insertions(+), 18 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index 34364fa..cf735f5 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -23,7 +23,8 @@
in_array( Action::getActionName( 
$context ), [ 'edit', 'submit' ] ) &&
$wgCodeMirrorBetaFeature &&

ExtensionRegistry::getInstance()->isLoaded( 'BetaFeatures' ) &&
-   BetaFeatures::isFeatureEnabled( 
$context->getUser(), 'codemirror-syntax-highlight' );
+   BetaFeatures::isFeatureEnabled(
+   $context->getUser(), 
'codemirror-syntax-highlight' );
}
}
 
@@ -35,7 +36,6 @@
 * removed
 * @deprecated since version 4.0.0
 * @todo Remove usage in MobileFrontend and this function some time 
later
-* @param IContextSource $context
 * @return array
 */
public static function getGlobalVariables() {
@@ -58,6 +58,7 @@
// if we already created these variable array, return it
if ( !$config ) {
$contObj = $context->getLanguage();
+   $registry = ExtensionRegistry::getInstance();
 
if ( !isset( $wgParser->mFunctionSynonyms ) ) {
$wgParser->initialiseVariables();
@@ -66,8 +67,8 @@
 
// initialize configuration
$config = [
-   'pluginModules' => 
ExtensionRegistry::getInstance()->getAttribute( 'CodeMirrorPluginModules' ),
-   'tagModes' => 
ExtensionRegistry::getInstance()->getAttribute( 'CodeMirrorTagModes' ),
+   'pluginModules' => $registry->getAttribute( 
'CodeMirrorPluginModules' ),
+   'tagModes' => $registry->getAttribute( 
'CodeMirrorTagModes' ),
'tags' => array_fill_keys( 
$wgParser->getTags(), true ),
'doubleUnderscore' => [ [], [] ],
'functionSynonyms' => 
$wgParser->mFunctionSynonyms,
@@ -80,7 +81,8 @@
if ( isset( $mw[$name] ) ) {
$caseSensitive = array_shift( 
$mw[$name] ) == 0 ? 0 : 1;
foreach ( $mw[$name] as $n ) {
-   
$config['doubleUnderscore'][$caseSensitive][ $caseSensitive ? $n : 
$contObj->lc( $n ) ] = $name;
+   $n = $caseSensitive ? $n : 
$contObj->lc( $n );
+   
$config['doubleUnderscore'][$caseSensitive][$n] = $name;
}
} else {
$config['doubleUnderscore'][0][] = 
$name;
@@ -91,7 +93,8 @@
if ( isset( $mw[$name] ) ) {
$caseSensitive = array_shift( 
$mw[$name] ) == 0 ? 0 : 1;
foreach ( $mw[$name] as $n ) {
-   
$config['functionSynonyms'][$caseSensitive][ $caseSensitive ? $n : 
$contObj->lc( $n ) ] = $name;
+   $n = $caseSensitive ? $n : 
$contObj->lc( $n );
+   
$config['functionSynonyms'][$caseSensitive][$n] = $name;
}
}
}
@@ -112,7 +115,7 @@
public static function onMakeGlobalVariablesScript( array &$vars, 
OutputPage $out ) {
$context = $out->getContext();
// add CodeMirror vars on edit pages, or if VE is installed
-   if ( self::isCodeMirrorEnabled( $context ) || class_exists( 
'VisualEditorHooks' )  ) {
+   if ( self::isCodeMirrorEnabled( $context ) || class_exists( 
'VisualEditorHooks' ) ) {
$vars['extCodeMirrorConfig'] = self::getConfiguraton( 
$context );
}
}
@@ -140,8 +143,8 @@
 * @param array $defaultPreferences
 */
public static function onGetPreferences( User $user, 
&$defaultPreferences ) {
-   // CodeMirror 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Ignore archive records with null page_id

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

Change subject: Ignore archive records with null page_id
..


Ignore archive records with null page_id

Bug: T169977
Change-Id: If221c90cdadb32ab75cd5aae0346fb5fcd0822d3
---
M maintenance/forceSearchIndex.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index c64e310..5441485 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -357,6 +357,7 @@
 
$this->attachPageConditions( $dbr, $it, 'ar' );
$this->attachTimestampConditions( $dbr, $it, 'ar' );
+   $it->addConditions( [ 'ar_page_id IS NOT NULL' ] );
 
$it->setFetchColumns( [ 'ar_timestamp', 'ar_namespace', 
'ar_title', 'ar_page_id' ] );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If221c90cdadb32ab75cd5aae0346fb5fcd0822d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Revert "Revert "Merge branch 'master' into deployment""

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

Change subject: Revert "Revert "Merge branch 'master' into deployment""
..

Revert "Revert "Merge branch 'master' into deployment""

Basically re-applying all the stuff we reverted, since the
problems have fixes

This reverts commit f8314476c2d391e992725686cb106f4b4488c7d6.

Change-Id: Ie7e641537cf2495e1282e447934838865c2f4d02
---
M DonationInterface.alias.php
M adyen_gateway/adyen.adapter.php
M amazon_gateway/amazon.adapter.php
M amazon_gateway/amazon.api.php
M amazon_gateway/i18n/en.json
M amazon_gateway/i18n/fr.json
M amazon_gateway/i18n/qqq.json
M amazon_gateway/i18n/ru.json
M amazon_gateway/i18n/uk.json
M extras/FraudFilter.php
M extras/banner_history/BannerHistoryLogIdProcessor.php
M gateway_common/DonationData.php
M gateway_common/DonationQueue.php
M gateway_common/GatewayType.php
M gateway_common/NationalCurrencies.php
M gateway_common/WmfFramework.drupal.php
M gateway_common/WmfFramework.mediawiki.php
M gateway_common/gateway.adapter.php
M gateway_common/i18n/interface/ast.json
M gateway_common/i18n/interface/bg.json
M gateway_common/i18n/interface/bn.json
M gateway_common/i18n/interface/bs.json
M gateway_common/i18n/interface/en.json
M gateway_common/i18n/interface/es.json
M gateway_common/i18n/interface/fr.json
M gateway_common/i18n/interface/hr.json
M gateway_common/i18n/interface/ia.json
M gateway_common/i18n/interface/it.json
M gateway_common/i18n/interface/jv.json
M gateway_common/i18n/interface/lt.json
M gateway_common/i18n/interface/mk.json
M gateway_common/i18n/interface/nb.json
M gateway_common/i18n/interface/pt.json
M gateway_common/i18n/interface/qqq.json
M gateway_common/i18n/interface/ru.json
M gateway_common/i18n/interface/sv.json
M gateway_common/i18n/interface/uk.json
M gateway_common/i18n/interface/ur.json
M gateway_common/i18n/interface/yi.json
M gateway_common/i18n/interface/zh-hans.json
M gateway_common/i18n/interface/zh-hant.json
M gateway_forms/mustache/forms.css
M globalcollect_gateway/globalcollect_resultswitcher.body.php
M globalcollect_gateway/i18n/es.json
M globalcollect_gateway/orphan.adapter.php
M paypal_gateway/express_checkout/paypal_express.adapter.php
46 files changed, 306 insertions(+), 301 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/71/363971/1

diff --git a/DonationInterface.alias.php b/DonationInterface.alias.php
index 725754d..060dee0 100644
--- a/DonationInterface.alias.php
+++ b/DonationInterface.alias.php
@@ -1,11 +1,9 @@
  array( 'GatewayFormChooser' ),
-   'SystemStatus' => array( 'SystemStatus' ),
-);
+$specialPageAliases['en'] = [
+   'GatewayFormChooser' => [ 'GatewayFormChooser' ],
+   'SystemStatus' => [ 'SystemStatus' ],
+];
diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php
index c86adb5..8129c3e 100644
--- a/adyen_gateway/adyen.adapter.php
+++ b/adyen_gateway/adyen.adapter.php
@@ -215,8 +215,8 @@
 * whether to capture the payment or leave it for manual review.
 * @return array
 */
-   protected function getStompTransaction() {
-   $transaction = parent::getStompTransaction();
+   protected function getQueueDonationMessage() {
+   $transaction = parent::getQueueDonationMessage();
$transaction['risk_score'] = $this->risk_score;
return $transaction;
}
diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index 8d4473a..08e499a 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -199,7 +199,7 @@
) );
// Stash their info in pending queue and logs to fill in data 
for
// audit and IPN messages
-   $details = $this->getStompTransaction();
+   $details = $this->getQueueDonationMessage();
$this->logger->info( 'Got info for Amazon donation: ' . 
json_encode( $details ) );
$this->sendPendingMessage();
}
diff --git a/amazon_gateway/amazon.api.php b/amazon_gateway/amazon.api.php
index 740b912..3b9cd54 100644
--- a/amazon_gateway/amazon.api.php
+++ b/amazon_gateway/amazon.api.php
@@ -24,7 +24,9 @@
),
);
 
-   $adapter = new AmazonAdapter( $adapterParams );
+   $adapterClass = DonationInterface::getAdapterClassForGateway( 
'amazon' );
+   // @var AmazonAdapter
+   $adapter = new $adapterClass( $adapterParams );
 
if ( $adapter->getErrorState()->hasErrors() ) {
$output->addValue(
diff --git a/amazon_gateway/i18n/en.json b/amazon_gateway/i18n/en.json
index d0ba913..4b1ef57 100644
--- a/amazon_gateway/i18n/en.json
+++ b/amazon_gateway/i18n/en.json
@@ -4,6 +4,7 @@
},
"amazon_gateway-desc": 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment

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

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

de328fa8 Move fraud filter config to TestConfiguration
655a931c Fix antifraud messages, add tests
4c4fdbe6 Fix function visibility in default getRequestProcessId
a249c8be Allow CUIT for Argentina
e257265d Localisation updates from https://translatewiki.net.
4438f41b Add one more yahoo tld
c8a675e4 Test cleanup - closures can use $this, fix PP test assert
1d95a7ac One more bit of $that = $this cleanup

Change-Id: I95d4dbd09b532a2d4a9d62c209dce13de92f9bb6
---
M gateway_common/gateway.adapter.php
D tests/phpunit/Adapter/Amazon/AmazonTest.php
D tests/phpunit/Adapter/AstroPay/AstroPayTest.php
D tests/phpunit/Adapter/GlobalCollect/GlobalCollectFormLoadTest.php
D tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php
D tests/phpunit/Adapter/GlobalCollect/ResultSwitcherTest.php
D tests/phpunit/Adapter/PayPal/PayPalExpressTest.php
D tests/phpunit/Adapter/PayPal/PayPalLegacyTest.php
D tests/phpunit/DataValidatorTest.php
D tests/phpunit/FormChooserTest.php
D tests/phpunit/FraudFiltersTest.php
D tests/phpunit/TestConfiguration.php
D tests/phpunit/includes/test_gateway/TestingPaypalExpressAdapter.php
13 files changed, 0 insertions(+), 2,765 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/72/363972/1

diff --git a/gateway_common/gateway.adapter.php 
b/gateway_common/gateway.adapter.php
index 50ea23b..e34988d 100644
--- a/gateway_common/gateway.adapter.php
+++ b/gateway_common/gateway.adapter.php
@@ -1460,11 +1460,7 @@
 * @param array $requestValues
 * @return int|string Order id
 */
-<<< HEAD   (a977e5 Revert "Revert "Merge branch 'master' into deployment"")
-   protected function getRequestProcessId( $requestValues ) {
-===
public function getRequestProcessId( $requestValues ) {
->>> BRANCH (3ce4f1 Merge "One more bit of $that = $this cleanup")
return null;
}
 
diff --git a/tests/phpunit/Adapter/Amazon/AmazonTest.php 
b/tests/phpunit/Adapter/Amazon/AmazonTest.php
deleted file mode 100644
index 1846e5f..000
--- a/tests/phpunit/Adapter/Amazon/AmazonTest.php
+++ /dev/null
@@ -1,294 +0,0 @@
-<<< HEAD   (a977e5 Revert "Revert "Merge branch 'master' into deployment"")
-===
-testAdapterClass = 'TestingAmazonAdapter';
-   }
-
-   public function setUp() {
-   parent::setUp();
-   DonationInterface::initializeSmashPig( 'amazon' );
-
-   TestingAmazonAdapter::$mockClient = new MockAmazonClient();
-
-   $this->setMwGlobals( array(
-   'wgAmazonGatewayEnabled' => true,
-   'wgDonationInterfaceAllowedHtmlForms' => array(
-   'amazon' => array(
-   'gateway' => 'amazon',
-   'payment_methods' => array('amazon' => 
'ALL'),
-   'redirect',
-   ),
-   'amazon-recurring' => array(
-   'gateway' => 'amazon',
-   'payment_methods' => array('amazon' => 
'ALL'),
-   'redirect',
-   'recurring',
-   ),
-   ),
-   ) );
-   }
-
-   public function tearDown() {
-   TestingAmazonAdapter::$fakeGlobals = array();
-   parent::tearDown();
-   }
-
-   /**
-* Integration test to verify that the Amazon gateway converts Canadian
-* dollars before redirecting
-*
-* FIXME: Merge with currency fallback tests?
-*
-* @dataProvider canadaLanguageProvider
-*/
-   function testCanadianDollarConversion( $language ) {
-   $init = $this->getDonorTestData( 'CA' );
-   unset( $init['order_id'] );
-   $init['payment_method'] = 'amazon';
-   $init['ffname'] = 'amazon';
-   $init['language'] = $language;
-   $rates = CurrencyRates::getCurrencyRates();
-   $cadRate = $rates['CAD'];
-
-   $expectedAmount = floor( $init['amount'] / $cadRate );
-
-   TestingAmazonAdapter::$fakeGlobals = array(
-   'FallbackCurrency' => 'USD',
-   'NotifyOnConvert' => true,
-   );
-
-   $expectedNotification = wfMessage(
-   'donate_interface-fallback-currency-notice',
-   'USD'
-   )->inLanguage( $language )->text();
-
-   $locale = $init['language'] . '_' . 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: WIP: Simple wrapper around updating the interwiki cache

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

Change subject: WIP: Simple wrapper around updating the interwiki cache
..

WIP: Simple wrapper around updating the interwiki cache

Change-Id: I4a709e8379f7054b1a21a8aff0487403f661b055
---
A scap/plugins/updateinterwikicache.py
1 file changed, 51 insertions(+), 0 deletions(-)


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

diff --git a/scap/plugins/updateinterwikicache.py 
b/scap/plugins/updateinterwikicache.py
new file mode 100644
index 000..29170f6
--- /dev/null
+++ b/scap/plugins/updateinterwikicache.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+"""
+scap.plugins.updateinterwikicache
+~
+For updating + syncing the interwiki cache
+"""
+import os
+import subprocess
+
+import scap.cli as cli
+import scap.main as main
+import scap.tasks as tasks
+import scap.utils as utils
+
+
+@cli.command('update-interwiki-cache')
+class UpdateInterwikiCache(main.SyncFile):
+""" Scap sub-command to update and sync the interwiki cache """
+
+def main(self, *extra_args):
+""" Update the latest interwiki cache! """
+self.arguments.message = 'Updating interwiki cache'
+return super(UpdateInterwikiCache, self).main(*extra_args)
+
+def _before_cluster_sync(self):
+interwikifile = os.path.join(self.config['stage_dir'], 'wmf-config',
+ 'interwiki.php')
+self.include = os.path.relpath(interwikifile, self.config['stage_dir'])
+
+with open(interwikifile) as outfile:
+subprocess.check_call(
+['/usr/local/bin/mwscript',
+ 'extensions/WikimediaMaintenance/dumpInterwiki.php'],
+stdout=outfile
+)
+
+# This shouldn't happen, but let's be safe
+tasks.check_valid_syntax(interwikifile)
+
+subprocess.check_call(['/usr/bin/git', 'commit', '-q', '-m',
+   self.arguments.message, self.arguments.include])
+
+subprocess.check_call(['/usr/bin/git', 'push', '-q', 'origin',
+   'HEAD:refs/for/master%l=Code-Review+2'])
+
+if not utils.confirm('Has Jenkins merged your gerrit change yet?'):
+subprocess.check_call(['/usr/bin/git', 'reset', '--hard',
+   'origin/master'])
+raise RuntimeError('Aborting, you should not sync unmerged code')
+
+subprocess.check_call('/usr/bin/git', 'pull')

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a709e8379f7054b1a21a8aff0487403f661b055
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
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_29]: Push all DeferredUpdates to POSTSEND queue when running that...

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

Change subject: Push all DeferredUpdates to POSTSEND queue when running that 
queue
..


Push all DeferredUpdates to POSTSEND queue when running that queue

This avoids putting updates in the PRESEND queue at a point where they
may never get run later in the request. The peculiarity lead to a
regression in 24842cfac.

Move "enqueue" logic to runUpdate() to simplify execute(). If job
insertion batching is strongly desired for a class, then it can use
MergeableUpdate.

Removed unused "update" field in $executeContext.

Bug: T168723
Change-Id: I40d16f6cd0adc8583797b99d859b76a836d362a8
(cherry picked from commit 3daad1264bb80babc359f95843bd9b3d8ddc01e6)
---
M includes/deferred/DeferredUpdates.php
M tests/phpunit/includes/deferred/DeferredUpdatesTest.php
2 files changed, 48 insertions(+), 23 deletions(-)

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



diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index d035521..499c576 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -76,9 +76,12 @@
public static function addUpdate( DeferrableUpdate $update, $stage = 
self::POSTSEND ) {
global $wgCommandLineMode;
 
-   // This is a sub-DeferredUpdate, run it right after its parent 
update
if ( self::$executeContext && self::$executeContext['stage'] >= 
$stage ) {
+   // This is a sub-DeferredUpdate; run it right after its 
parent update.
+   // Also, while post-send updates are running, push any 
"pre-send" jobs to the
+   // active post-send queue to make sure they get run 
this round (or at all).
self::$executeContext['subqueue'][] = $update;
+
return;
}
 
@@ -183,16 +186,6 @@
while ( $updates ) {
$queue = []; // clear the queue
 
-   if ( $mode === 'enqueue' ) {
-   try {
-   // Push enqueuable updates to the job 
queue and get the rest
-   $updates = self::enqueueUpdates( 
$updates );
-   } catch ( Exception $e ) {
-   // Let other updates have a chance to 
run if this failed
-   
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
-   }
-   }
-
// Order will be DataUpdate followed by generic 
DeferrableUpdate tasks
$updatesByType = [ 'data' => [], 'generic' => [] ];
foreach ( $updates as $du ) {
@@ -212,13 +205,9 @@
// Execute all remaining tasks...
foreach ( $updatesByType as $updatesForType ) {
foreach ( $updatesForType as $update ) {
-   self::$executeContext = [
-   'update' => $update,
-   'stage' => $stage,
-   'subqueue' => []
-   ];
+   self::$executeContext = [ 'stage' => 
$stage, 'subqueue' => [] ];
/** @var DeferrableUpdate $update */
-   $guiError = self::runUpdate( $update, 
$lbFactory, $stage );
+   $guiError = self::runUpdate( $update, 
$lbFactory, $mode, $stage );
$reportableError = $reportableError ?: 
$guiError;
// Do the subqueue updates for $update 
until there are none
while ( 
self::$executeContext['subqueue'] ) {
@@ -230,7 +219,7 @@

$subUpdate->setTransactionTicket( $ticket );
}
 
-   $guiError = self::runUpdate( 
$subUpdate, $lbFactory, $stage );
+   $guiError = self::runUpdate( 
$subUpdate, $lbFactory, $mode, $stage );
$reportableError = 
$reportableError ?: $guiError;
}
self::$executeContext = null;
@@ -248,16 +237,26 @@
/**
 * @param DeferrableUpdate $update
 * @param LBFactory $lbFactory
+* @param string $mode
 * @param integer $stage
 * @return 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Only build tag list when experimental views are e...

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

Change subject: RCFilters: Only build tag list when experimental views are 
enabled
..

RCFilters: Only build tag list when experimental views are enabled

It's a waste otherwise, and buildChangeTagList() has perf issues.

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


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

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index d856d4b..6e5b400 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -189,10 +189,12 @@

'wgStructuredChangeFiltersEnableExperimentalViews',

$wgStructuredChangeFiltersEnableExperimentalViews
);
-   $out->addJsConfigVars(
-   'wgRCFiltersChangeTags',
-   $this->buildChangeTagList()
-   );
+   if ( $wgStructuredChangeFiltersEnableExperimentalViews 
) {
+   $out->addJsConfigVars(
+   'wgRCFiltersChangeTags',
+   $this->buildChangeTagList()
+   );
+   }
}
}
 

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

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

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


[MediaWiki-commits] [Gerrit] IPSet[master]: Bump minimum PHP version to 5.5.9

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

Change subject: Bump minimum PHP version to 5.5.9
..


Bump minimum PHP version to 5.5.9

Change-Id: If5d10bd7ccef7d82b396ad13c24ea7aeabf77493
---
M .travis.yml
M composer.json
2 files changed, 1 insertion(+), 6 deletions(-)

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



diff --git a/.travis.yml b/.travis.yml
index 1aad8d1..f7dcbac 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,16 +1,11 @@
 language: php
 php:
-  - "5.3.3"
-  - "5.3"
-  - "5.4"
   - "5.5"
   - "5.6"
   - "7.0"
   - "7.1"
   - "hhvm"
 sudo: false
-before_install:
-  - if [ "$TRAVIS_PHP_VERSION" = "5.3.3" ]; then composer config disable-tls 
true; composer config secure-http false; fi
 install:
   - composer install
 script:
diff --git a/composer.json b/composer.json
index c1e1246..5286f7b 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
]
},
"require": {
-   "php": ">=5.3.3"
+   "php": ">=5.5.9"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If5d10bd7ccef7d82b396ad13c24ea7aeabf77493
Gerrit-PatchSet: 1
Gerrit-Project: IPSet
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] IPSet[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..


build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

The following sniffs are failing and were disabled:
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Also added "composer fix" command.

Change-Id: I6ff246a42e5c35d9f5de2d9e309da25c33bc1a21
---
M composer.json
M phpcs.xml
M src/IPSet.php
M tests/IPSetTest.php
4 files changed, 62 insertions(+), 57 deletions(-)

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



diff --git a/composer.json b/composer.json
index 6c39e69..c1e1246 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"phpunit/phpunit": "^4.8",
-   "mediawiki/mediawiki-codesniffer": "0.5.1"
+   "mediawiki/mediawiki-codesniffer": "0.10.0"
},
"scripts": {
"test": [
@@ -28,6 +28,9 @@
"phpunit $PHPUNIT_ARGS",
"phpcs -p"
],
-   "cover": "phpunit --coverage-html coverage/"
+   "cover": "phpunit --coverage-html coverage/",
+   "fix": [
+   "phpcbf"
+   ]
}
 }
diff --git a/phpcs.xml b/phpcs.xml
index dc93336..317e4ab 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,8 @@
 
 
-   
+   
+   
+   
.
coverage
vendor
diff --git a/src/IPSet.php b/src/IPSet.php
index 912f602..92e2b0f 100644
--- a/src/IPSet.php
+++ b/src/IPSet.php
@@ -151,9 +151,9 @@
} elseif ( $node === false ) {
// create new subarray to go deeper
if ( !( $curBit & 7 ) && $curBit <= $mask - 8 ) 
{
-   $node = array( 'comp' => 
$rawOrd[$curBit >> 3], 'next' => false );
+   $node = [ 'comp' => $rawOrd[$curBit >> 
3], 'next' => false ];
} else {
-   $node = array( false, false );
+   $node = [ false, false ];
}
}
 
@@ -170,8 +170,8 @@
$unode = $node['next'];
for ( $i = 0; $i < 8; ++$i ) {
$unode = ( $comp & ( 1 << $i ) )
-   ? array( false, $unode )
-   : array( $unode, false 
);
+   ? [ false, $unode ]
+   : [ $unode, false ];
}
$node = $unode;
}
diff --git a/tests/IPSetTest.php b/tests/IPSetTest.php
index cc79ca3..4388e6e 100644
--- a/tests/IPSetTest.php
+++ b/tests/IPSetTest.php
@@ -38,9 +38,9 @@
 * an array of IP => expected (boolean) result against the config 
dataset.
 */
public static function provideIPSets() {
-   $testcases = array(
-   'old_list_subset' => array(
-   array(
+   $testcases = [
+   'old_list_subset' => [
+   [
'208.80.152.162',
'10.64.0.123',
'10.64.0.124',
@@ -78,8 +78,8 @@
'2620:0:862:102:26B6:FDFF:FEF5:AD9C',
'10.20.0.114',
'2620:0:862:102:26B6:FDFF:FEF5:7C38',
-   ),
-   array(
+   ],
+   [
'0.0.0.0' => false,
'255.255.255.255' => false,
'10.64.0.122' => false,
@@ -95,10 +95,10 @@
'2620:0:862:1:26b6:fdff:fef5:abb3' => 
false,
'2620:0:862:1:26b6:fdff:fef5:abb4' => 
true,
'2620:0:862:1:26b6:fdff:fef5:abb5' => 
false,
-   ),
-   ),
-   'new_cidr_set' => array(
-   array(
+   ],
+   ],
+

[MediaWiki-commits] [Gerrit] mediawiki...ApiFeatureUsage[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: Idf9417369d44414f11601b9b22dc42eccaa6246c
---
M composer.json
M phpcs.xml
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiFeatureUsage 
refs/changes/63/363963/1

diff --git a/composer.json b/composer.json
index 86cf2e1..4e6525f 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2",
+   "mediawiki/mediawiki-codesniffer": "0.10.0",
"jakub-onderka/php-console-highlighter": "0.3.2"
},
"scripts": {
diff --git a/phpcs.xml b/phpcs.xml
index d81a292..10703b3 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,8 +1,10 @@
 
 
-   
+   
+   
+   
.

-   
+   
vendor
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf9417369d44414f11601b9b22dc42eccaa6246c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApiFeatureUsage
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Autodiscover parser tests for extensions, deprecate $wgParse...

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

Change subject: Autodiscover parser tests for extensions, deprecate 
$wgParserTestFiles
..

Autodiscover parser tests for extensions, deprecate $wgParserTestFiles

This implements autodiscovery of extension parser tests that are located
in the tests/parser/ directory. Any *.txt file in that directory tree
will be treated as a parser test.

Core parser tests are now defined in ParserTestRunner::$coreTestFiles,
and $wgParserTestFiles is marked as deprecated.

Bug: T143976
Change-Id: Ia24fd8ef52e6732c698153b17bb679a5f511a2a7
---
M includes/DefaultSettings.php
M tests/parser/ParserTestRunner.php
M tests/parser/parserTests.php
M tests/phpunit/suites/ParserTestTopLevelSuite.php
4 files changed, 55 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/363961/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 1459ab6..aff158d 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6333,15 +6333,16 @@
  * Parser test suite files to be run by parserTests.php when no specific
  * filename is passed to it.
  *
- * Extensions may add their own tests to this array, or site-local tests
- * may be added via LocalSettings.php
+ * Extensions using extension.json will have any *.txt file in a
+ * tests/parser/ directory automatically run.
+ *
+ * Core tests can be added to ParserTestRunner::$coreTestFiles.
  *
  * Use full paths.
+ *
+ * @deprecated since 1.30
  */
-$wgParserTestFiles = [
-   "$IP/tests/parser/parserTests.txt",
-   "$IP/tests/parser/extraParserTests.txt"
-];
+$wgParserTestFiles = [];
 
 /**
  * Allow running of javascript test suites via [[Special:JavaScriptTest]] 
(such as QUnit).
diff --git a/tests/parser/ParserTestRunner.php 
b/tests/parser/ParserTestRunner.php
index a373142..ecaf782 100644
--- a/tests/parser/ParserTestRunner.php
+++ b/tests/parser/ParserTestRunner.php
@@ -34,6 +34,11 @@
  * @ingroup Testing
  */
 class ParserTestRunner {
+
+   private static $coreTestFiles = [
+   'parserTests.txt',
+   'extraParserTests.txt',
+   ];
/**
 * @var bool $useTemporaryTables Use temporary tables for the temporary 
database
 */
@@ -147,6 +152,44 @@
}
}
 
+   /**
+* Get list of filenames to extension and core parser tests
+*
+* @return array
+*/
+   public static function getParserTestFiles() {
+   global $wgParserTestFiles;
+
+   // Add core test files
+   $files = array_map( function( $item ) {
+   return __DIR__ . "/$item";
+   }, self::$coreTestFiles );
+
+   // Plus legacy global files
+   $files = array_merge( $files, $wgParserTestFiles );
+
+   // Auto-discover extension parser tests
+   $registry = ExtensionRegistry::getInstance();
+   foreach ( $registry->getAllThings() as $info ) {
+   $dir = dirname( $info['path'] ) . '/tests/parser';
+   if ( !file_exists( $dir ) ) {
+   continue;
+   }
+   $dirIterator = new RecursiveIteratorIterator(
+   new RecursiveDirectoryIterator( $dir )
+   );
+   foreach ( $dirIterator as $fileInfo ) {
+   /** @var SplFileInfo $fileInfo */
+   if ( substr( $fileInfo->getFilename(), -4 ) === 
'.txt' ) {
+   $files[] = $fileInfo->getPathname();
+   }
+   }
+   }
+
+   return array_unique( $files );
+
+   }
+
public function getRecorder() {
return $this->recorder;
}
diff --git a/tests/parser/parserTests.php b/tests/parser/parserTests.php
index 1d0867a..2735f93 100644
--- a/tests/parser/parserTests.php
+++ b/tests/parser/parserTests.php
@@ -80,7 +80,7 @@
}
 
public function execute() {
-   global $wgParserTestFiles, $wgDBtype;
+   global $wgDBtype;
 
// Cases of weird db corruption were encountered when running 
tests on earlyish
// versions of SQLite
@@ -167,7 +167,7 @@
}
 
// Default parser tests and any set from extensions or local 
config
-   $files = $this->getOption( 'file', $wgParserTestFiles );
+   $files = $this->getOption( 'file', 
ParserTestRunner::getParserTestFiles() );
 
$norm = $this->hasOption( 'norm' ) ? explode( ',', 
$this->getOption( 'norm' ) ) : [];
 
diff --git a/tests/phpunit/suites/ParserTestTopLevelSuite.php 

[MediaWiki-commits] [Gerrit] mediawiki...FundraisingTranslateWorkflow[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: I7839175926374893dc0e08d9b113bb400e539efc
---
M composer.json
M phpcs.xml
2 files changed, 5 insertions(+), 3 deletions(-)


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

diff --git a/composer.json b/composer.json
index b8f68fb..4f55859 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2"
+   "mediawiki/mediawiki-codesniffer": "0.10.0"
},
"scripts": {
"fix": "phpcbf",
diff --git a/phpcs.xml b/phpcs.xml
index ede6c5d..2059771 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,9 +1,11 @@
 
 
-   
+   
+   
+   
.

-   
+   
vendor
node_modules
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7839175926374893dc0e08d9b113bb400e539efc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FundraisingTranslateWorkflow
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


[MediaWiki-commits] [Gerrit] mediawiki...EventLogging[master]: Only subscribe EventLogging once

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

Change subject: Only subscribe EventLogging once
..

Only subscribe EventLogging once

Do not subscribe again on subsequent load events

Bug: T170018
Change-Id: I21b60a581b9dd3c4f4473c711941b6c28f7f7f0e
---
M modules/ext.eventLogging.subscriber.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/57/363957/1

diff --git a/modules/ext.eventLogging.subscriber.js 
b/modules/ext.eventLogging.subscriber.js
index e569ae7..a287ae4 100644
--- a/modules/ext.eventLogging.subscriber.js
+++ b/modules/ext.eventLogging.subscriber.js
@@ -87,7 +87,9 @@
 
};
 
-   $( window ).on( 'load', function () {
+   // The load event fires on certain back button presses so we only 
subscribe to this once.
+   // Otherwise duplicate events will be logged (T170018).
+   $( window ).one( 'load', function () {
mw.trackSubscribe( 'event.', handleTrackedEvent );
} );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21b60a581b9dd3c4f4473c711941b6c28f7f7f0e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Remove dead code and messages

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

Change subject: Remove dead code and messages
..


Remove dead code and messages

Change-Id: Ifbbf6844648940357df41d6998453edfe113c9a8
---
M i18n/en.json
M i18n/qqq.json
M includes/Hooks.php
3 files changed, 0 insertions(+), 11 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 01273fb..fa43439 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -11,7 +11,6 @@
"echo-pref-tooltip-login-fail": "Notify me when there have been 
multiple failed attempts to log in to my account.",
"echo-category-title-login-success": "Login from new computer",
"echo-pref-tooltip-login-success": "Notify me whenever somebody logs 
into my account from a computer I have not used before.",
-   "loginnotify-login-fail": "There have been several failed attempts to 
log in to your account",
"loginnotify-primary-link": "Help",
"notification-loginnotify-login-fail-email-subject": 
"{{PLURAL:$2|Failed attempt|Multiple failed attempts}} to log in to 
{{SITENAME}} as $1",
"notification-loginnotify-login-success-email-subject": "Login to 
{{SITENAME}} as $1 from a computer you have not recently used",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 981e129..3d7c89b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -11,7 +11,6 @@
"echo-pref-tooltip-login-fail": "Help tooltip for 
{{msg-mw|echo-category-title-login-fail}}",
"echo-category-title-login-success": "Label for 2 checkboxes in the 
Notifications section of [[Special:Preferences]]. The checkbox controls if the 
user receives notification on someone logging in to this account from a 
computer that has not previously been used to log in by this user.",
"echo-pref-tooltip-login-success": "Help tooltip for 
{{msg-mw|echo-category-title-login-success}}",
-   "loginnotify-login-fail": "FIXME I have no idea where this message is 
used.\n{{notranslate}}",
"loginnotify-primary-link": "Label for link to a help page about the 
feature\n{{Identical|Help}}",
"notification-loginnotify-login-fail-email-subject": "Email subject 
line for email notice that there have been failed login attempts for the user's 
account. $1 is the user in question.",
"notification-loginnotify-login-success-email-subject": "Email subject 
line for email notice that someone has logged in to the user's account from a 
computer that has not previously been used. $1 is the user in question.",
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 86d8794..82a9cce 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -50,14 +50,6 @@
'category' => 'login-fail',
'group' => 'negative',
'presentation-model' => PresentationModel::class,
-   // fixme, what does this actually do?
-   'title-message' => 'loginnotify-login-fail',
-   'title-params' => [],
-   // FIXME Should count be a parameter
-   'email-subject-params' => [ 'agent', 'count' ],
-   'email-body-batch-params' => [ 'agent', 'count' ],
-   // FIXME is it ok not to set batch email messages, since
-   // we have immediate flag?
'icon' => 'LoginNotify-user-avatar',
'immediate' => true,
];
@@ -80,7 +72,6 @@
];
$notifications['login-success'] = [
'category' => 'login-success',
-   // FIXME title-message. What is its purpose??
] + $loginBase;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifbbf6844648940357df41d6998453edfe113c9a8
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Niharika29 
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...CharInsert[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

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

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
..

build: Updating mediawiki/mediawiki-codesniffer to 0.10.0

Change-Id: Idb9b269ebf0cef901c35b7e79859ff5cd99fdce5
---
M CharInsert.body.php
M composer.json
M phpcs.xml
3 files changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/CharInsert.body.php b/CharInsert.body.php
index 67c0820..7fecc57 100644
--- a/CharInsert.body.php
+++ b/CharInsert.body.php
@@ -10,6 +10,7 @@
 * Things like edittools message are added to output directly,
 * instead of using something like OutputPage::addWikiText.
 * As a result, modules sometimes aren't transferred over.
+* @param OutputPage $out OutputPage to work on
 */
public static function onBeforePageDisplay( $out ) {
$addModules = false;
diff --git a/composer.json b/composer.json
index e70316e..8216dc7 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "0.7.2",
+   "mediawiki/mediawiki-codesniffer": "0.10.0",
"jakub-onderka/php-console-highlighter": "0.3.2"
},
"scripts": {
diff --git a/phpcs.xml b/phpcs.xml
index b21da71..2da2ec6 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,8 @@
 
 
-   
+   
+   
+   
.



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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb9b269ebf0cef901c35b7e79859ff5cd99fdce5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CharInsert
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

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


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

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

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


Change "article" to "page"

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

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

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



diff --git a/i18n/en.json b/i18n/en.json
index b5585bd..020bf82 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,7 +7,7 @@
"codemirror-desc": "Provides syntax highlighting in wikitext editor",
"codemirror-toggle-label": "Syntax highlighting",
"codemirror-beta-title": "Wikitext syntax highlighting",
-   "codemirror-beta-desc": "Syntax highlighting makes editing easier by 
using color and shade to visually separate article text from the code for 
links, references and templates.",
+   "codemirror-beta-desc": "Syntax highlighting makes editing easier by 
using color and shade to visually separate page text from the code for links, 
references and templates.",
"codemirror-popup-syntax": "Syntax",
"codemirror-popup-highlighting": "Highlighting",
"codemirror-popup-desc": "Syntax highlighting will help you easily 
distinguish different parts of your edit by color coding them.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I245b9c79e5de55c2c581f53fb4ae0890c4ff4119
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Raimond Spekking 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Remove more useless Config settings related to Special:GWToo...

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

Change subject: Remove more useless Config settings related to Special:GWToolset
..


Remove more useless Config settings related to Special:GWToolset

Hardcode that the 'gwtoolset' permission is required for the special
page. If someone wants to modify the permissions, they can grant that
right to different groups.

And just make the special page always listed. It's not really something
that needs to be configured, and no other extension does it.

Change-Id: I6817e71a5bfe0a7aea989c8ff691fa8a379df9a3
---
M includes/Config.php
M includes/Specials/SpecialGWToolset.php
2 files changed, 1 insertion(+), 16 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/Config.php b/includes/Config.php
index d278a58..4f8cbf7 100644
--- a/includes/Config.php
+++ b/includes/Config.php
@@ -188,20 +188,6 @@
public static $source_templates = 'Source_templates';
 
/**
-* @see SpecialPage __constructor
-* @var {string}
-* user right required, e.g. "block" or "delete"
-*/
-   public static $special_page_restriction = 'gwtoolset';
-
-   /**
-* @see SpecialPage __constructor
-* @var {bool}
-* whether the page is listed in Special:Specialpages
-*/
-   public static $special_page_listed = true;
-
-   /**
 * @var {int}
 * title maximum length in bytes
 * @see https://commons.wikimedia.org/wiki/Commons:File_naming
diff --git a/includes/Specials/SpecialGWToolset.php 
b/includes/Specials/SpecialGWToolset.php
index a23c66a..7a7bedf 100644
--- a/includes/Specials/SpecialGWToolset.php
+++ b/includes/Specials/SpecialGWToolset.php
@@ -53,8 +53,7 @@
public function __construct() {
parent::__construct(
Constants::EXTENSION_NAME,
-   Config::$special_page_restriction,
-   Config::$special_page_listed
+   'gwtoolset'
);
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6817e71a5bfe0a7aea989c8ff691fa8a379df9a3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Get rid of useless $mediafile_namespace Config setting

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

Change subject: Get rid of useless $mediafile_namespace Config setting
..


Get rid of useless $mediafile_namespace Config setting

It's always going to be NS_FILE.

Also fix a @see comment.

Change-Id: Icf8a0b707f3499eebfc167595b7d57c05dc7403e
---
M includes/Config.php
M includes/Handlers/UploadHandler.php
2 files changed, 2 insertions(+), 8 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/includes/Config.php b/includes/Config.php
index d26812b..d278a58 100644
--- a/includes/Config.php
+++ b/includes/Config.php
@@ -115,12 +115,6 @@
 
/**
 * @var {string}
-* wiki namespace to store metadata mappings and data sets
-*/
-   public static $mediafile_namespace = NS_FILE;
-
-   /**
-* @var {string}
 * 128M default
 */
public static $memory_limit = '256M';
@@ -229,7 +223,7 @@
/**
 * @var {array}
 * user permissions required in order to be able to use this extension
-* @see GWToolset\Helpers\WikiChecks\checkUserPermissions
+* @see \GWToolset\Helpers\WikiChecks::checkUserPermissions
 */
public static $user_permissions = [
'edit',
diff --git a/includes/Handlers/UploadHandler.php 
b/includes/Handlers/UploadHandler.php
index 16817ca..ca4096b 100644
--- a/includes/Handlers/UploadHandler.php
+++ b/includes/Handlers/UploadHandler.php
@@ -518,7 +518,7 @@
protected function getTitle( $title ) {
$result = Utils::getTitle(
Utils::stripIllegalTitleChars( $title ),
-   Config::$mediafile_namespace,
+   NS_FILE,
[ 'must-be-known' => false ]
);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf8a0b707f3499eebfc167595b7d57c05dc7403e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix full-text search.

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

Change subject: Fix full-text search.
..

Fix full-text search.

The newly-Retrofitted full text search client seemed to be unconditionally
using the "morelike:" prefix when performing searches.  Whereas, we should
only use morelike when searching for related articles.

Bug: T170017
Change-Id: Ib5aa0ef1674b915875b8a5648f894459274d53d0
---
M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadClient.java
M app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
M app/src/main/java/org/wikipedia/search/FullTextSearchClient.java
3 files changed, 9 insertions(+), 3 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadClient.java 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadClient.java
index 3347c26..4cdd80d 100644
--- 
a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadClient.java
+++ 
b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadClient.java
@@ -60,7 +60,7 @@
 
 private void getCardForHistoryEntry(@NonNull WikiSite wiki, @NonNull final 
HistoryEntry entry,
 final FeedClient.Callback cb) {
-request(wiki, entry.getTitle().getDisplayText(), null, null, 
SUGGESTION_REQUEST_ITEMS,
+requestMoreLike(wiki, entry.getTitle().getDisplayText(), null, null, 
SUGGESTION_REQUEST_ITEMS,
 new FullTextSearchClient.Callback() {
 @Override public void success(@NonNull Call call,
   @NonNull SearchResults results) {
diff --git 
a/app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java 
b/app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
index d3429b2..c663d4f 100644
--- 
a/app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
+++ 
b/app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java
@@ -326,7 +326,7 @@
 return;
 }
 final long timeMillis = System.currentTimeMillis();
-new FullTextSearchClient().request(entry.getTitle().getWikiSite(),
+new 
FullTextSearchClient().requestMoreLike(entry.getTitle().getWikiSite(),
 entry.getTitle().getPrefixedText(), null, null,
 Constants.MAX_SUGGESTION_RESULTS * 2, new 
FullTextSearchClient.Callback() {
 @Override
diff --git a/app/src/main/java/org/wikipedia/search/FullTextSearchClient.java 
b/app/src/main/java/org/wikipedia/search/FullTextSearchClient.java
index 392b36c..593f720 100644
--- a/app/src/main/java/org/wikipedia/search/FullTextSearchClient.java
+++ b/app/src/main/java/org/wikipedia/search/FullTextSearchClient.java
@@ -31,13 +31,19 @@
 return request(cachedService.service(wiki), wiki, searchTerm, cont, 
gsrOffset, limit, cb);
 }
 
+public Call requestMoreLike(@NonNull WikiSite wiki, 
@NonNull String searchTerm,
+ @Nullable String cont, 
@Nullable String gsrOffset,
+ int limit, @NonNull Callback 
cb) {
+return request(cachedService.service(wiki), wiki, 
moreLike(searchTerm), cont, gsrOffset, limit, cb);
+}
+
 @VisibleForTesting Call request(@NonNull Service service,
  @NonNull final WikiSite 
wiki,
  @NonNull String 
searchTerm,
  @Nullable String cont,
  @Nullable String 
gsrOffset,
  int limit, @NonNull final 
Callback cb) {
-call = service.request(moreLike(searchTerm), limit, cont, gsrOffset);
+call = service.request(searchTerm, limit, cont, gsrOffset);
 call.enqueue(new retrofit2.Callback() {
 @Override
 public void onResponse(@NonNull Call call,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Remove unused use statement

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

Change subject: Remove unused use statement
..


Remove unused use statement

Change-Id: I771ab99013649898fd8113d9b551da474fe86702
---
M GWToolset.php
1 file changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/GWToolset.php b/GWToolset.php
index 44d4a0d..f72384b 100644
--- a/GWToolset.php
+++ b/GWToolset.php
@@ -9,8 +9,6 @@
 
 namespace GWToolset;
 
-use GWToolset\Constants;
-
 if ( !defined( 'MEDIAWIKI' ) ) {
echo 'This file is part of a MediaWiki extension; it is not a valid 
entry point. To install this extension, follow the instructions in the INSTALL 
file.';
exit();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I771ab99013649898fd8113d9b551da474fe86702
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Use HTTPS in links to php.net

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

Change subject: Use HTTPS in links to php.net
..


Use HTTPS in links to php.net

Change-Id: I07fc218429c060142f58cd29cf7a1394e740240e
---
M i18n/en.json
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/i18n/en.json b/i18n/en.json
index b16faa3..00acb01 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -196,10 +196,10 @@
"gwtoolset-user-blocked": "Your user account is currently blocked. 
Please contact an administrator in order to correct the blocking issue.",
"gwtoolset-required-group": "You are not a member of the $1 group.",
"gwtoolset-verify-api-writeable": "The $1 extension requires that the 
wiki API can perform write actions for authorized users.\n\nPlease make sure 
that $wgEnableWriteAPI is set to true.",
-   "gwtoolset-verify-curl": "The $1 extension requires that PHP 
[http://www.php.net/manual/en/curl.setup.php cURL functions] be installed.",
-   "gwtoolset-verify-finfo": "The $1 extension requires that the PHP 
[http://www.php.net/manual/en/fileinfo.setup.php finfo] extension be 
installed.",
+   "gwtoolset-verify-curl": "The $1 extension requires that PHP 
[https://www.php.net/manual/en/curl.setup.php cURL functions] be installed.",
+   "gwtoolset-verify-finfo": "The $1 extension requires that the PHP 
[https://www.php.net/manual/en/fileinfo.setup.php finfo] extension be 
installed.",
"gwtoolset-verify-uploads-enabled": "The $1 extension requires that 
file uploads are enabled.\n\nPlease make sure that 
$wgEnableUploads is set to true in 
LocalSettings.php.",
-   "gwtoolset-verify-xmlreader": "The $1 extension requires that PHP 
[http://www.php.net/manual/en/xmlreader.setup.php XMLReader] be installed.",
+   "gwtoolset-verify-xmlreader": "The $1 extension requires that PHP 
[https://www.php.net/manual/en/xmlreader.setup.php XMLReader] be installed.",
"gwtoolset-wiki-checks-not-passed": "Wiki checks did not pass",
"gwtoolset-title-too-long": "The evaluated title is too long; a title 
can be up to a maximum of 240 bytes in length. This title evaluates to $1 
{{PLURAL:$1|byte|bytes}} in length.\n\n$2.",
"gwtoolset-title-label": "GWToolset title",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I07fc218429c060142f58cd29cf7a1394e740240e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...polloi[master]: Add capitalization function

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

Change subject: Add capitalization function
..


Add capitalization function

Also adds correct licensing info for code from Stack Overflow

Change-Id: I936b59b728e61fad07102c7e79a94d0754784607
---
M DESCRIPTION
M NAMESPACE
M NEWS.md
M R/manipulate.R
M R/maths.R
A man/capitalize_first_letter.Rd
M man/compress.Rd
M tests/testthat/test-manipulation.R
8 files changed, 60 insertions(+), 3 deletions(-)

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



diff --git a/DESCRIPTION b/DESCRIPTION
index 94d9e10..5b3828b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,12 +1,13 @@
 Package: polloi
 Type: Package
 Title: Common Functionality for Wikimedia Dashboards
-Version: 0.2.0
-Date: 2017-06-28
+Version: 0.2.1
+Date: 2017-07-07
 Authors@R: c(
 person("Mikhail", "Popov", email = "mikh...@wikimedia.org", role = 
c("aut", "cre")),
 person("Chelsy", "Xie", email = "c...@wikimedia.org", role = "aut"),
-person("Oliver", "Keyes", role = "aut", comment = "No longer employed at 
the Foundation")
+person("Oliver", "Keyes", role = "aut", comment = "No longer employed at 
the Foundation"),
+person("Andrie", "de Vries", role = "ctb", comment = "Capitalization code 
from StackOverflow")
 )
 Description: This package contains common functionality for all of the
 Wikimedia Foundation's Shiny Dashboards.
diff --git a/NAMESPACE b/NAMESPACE
index 1b06a9b..3542a1d 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,6 +1,7 @@
 # Generated by roxygen2: do not edit by hand
 
 export(automata_select)
+export(capitalize_first_letter)
 export(cbind_fill)
 export(check_past_week)
 export(check_yesterday)
diff --git a/NEWS.md b/NEWS.md
index 713fb16..4a41b2b 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,7 @@
+polloi 0.2.1
+
+- Adds `capitalize_first_letter`
+
 polloi 0.2.0
 
 - Adds unit tests and lint checking 
([T145445](https://phabricator.wikimedia.org/T145445)).
diff --git a/R/manipulate.R b/R/manipulate.R
index e9e9fb1..01294b0 100644
--- a/R/manipulate.R
+++ b/R/manipulate.R
@@ -117,3 +117,16 @@
   }
   return(no_set)
 }
+
+#' @title Capitalize First Letter Of Every Word
+#' @description Capitalizes the first letter of every word.
+#' @details This function is made available under CC-BY-SA 3.0
+#' @param x character vector
+#' @author [Andrie de Vries](https://stackoverflow.com/users/602276/andrie)
+#' @source 
\url{https://stackoverflow.com/questions/6364783/capitalize-the-first-letter-of-both-words-in-a-two-word-string}
+#' @export
+capitalize_first_letter <- function(x) {
+  return(vapply(strsplit(x, " "), function(s) {
+return(paste0(toupper(substring(s, 1, 1)), substring(s, 2), collapse = " 
"))
+  }, ""))
+}
diff --git a/R/maths.R b/R/maths.R
index aab5b7f..3308e91 100644
--- a/R/maths.R
+++ b/R/maths.R
@@ -16,8 +16,11 @@
 #' @title Convert Numeric Values to use SI suffixes
 #' @description takes a numeric vector (e.g. 1200, 130) and converts it to
 #'   use SI suffixes (e.g. 1.2K, 1.3M)
+#' @details This function is made available under CC-BY-SA 3.0
 #' @param x a vector of numeric or integer values
 #' @param round_by how many digits to round the resulting numbers by
+#' @author Original code: [42-](https://stackoverflow.com/users/1855677/42);
+#'   improvement: Mikhail
 #' @references 
\url{https://stackoverflow.com/questions/28159936/formatting-large-currency-or-dollar-values-to-millions-billions/}
 #' @export
 compress <- function(x, round_by = 2) {
diff --git a/man/capitalize_first_letter.Rd b/man/capitalize_first_letter.Rd
new file mode 100644
index 000..184da6e
--- /dev/null
+++ b/man/capitalize_first_letter.Rd
@@ -0,0 +1,23 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/manipulate.R
+\name{capitalize_first_letter}
+\alias{capitalize_first_letter}
+\title{Capitalize First Letter Of Every Word}
+\source{
+\url{https://stackoverflow.com/questions/6364783/capitalize-the-first-letter-of-both-words-in-a-two-word-string}
+}
+\usage{
+capitalize_first_letter(x)
+}
+\arguments{
+\item{x}{character vector}
+}
+\description{
+Capitalizes the first letter of every word.
+}
+\details{
+This function is made available under CC-BY-SA 3.0
+}
+\author{
+\href{https://stackoverflow.com/users/602276/andrie}{Andrie de Vries}
+}
diff --git a/man/compress.Rd b/man/compress.Rd
index fb16556..85826c6 100644
--- a/man/compress.Rd
+++ b/man/compress.Rd
@@ -15,6 +15,13 @@
 takes a numeric vector (e.g. 1200, 130) and converts it to
 use SI suffixes (e.g. 1.2K, 1.3M)
 }
+\details{
+This function is made available under CC-BY-SA 3.0
+}
 \references{
 
\url{https://stackoverflow.com/questions/28159936/formatting-large-currency-or-dollar-values-to-millions-billions/}
 }
+\author{
+Original code: \href{https://stackoverflow.com/users/1855677/42}{42-};
+improvement: Mikhail
+}
diff 

[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Remove i18n shim

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

Change subject: Remove i18n shim
..


Remove i18n shim

Change-Id: I97117143bdd65cb04795b2276694f941ef5bee87
---
D GWToolset.i18n.php
M GWToolset.php
2 files changed, 0 insertions(+), 36 deletions(-)

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



diff --git a/GWToolset.i18n.php b/GWToolset.i18n.php
deleted file mode 100644
index 3a20365..000
--- a/GWToolset.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = [];
-if ( !function_exists( 'wfJsonI18nShimee273fa76ab14105' ) ) {
-   function wfJsonI18nShimee273fa76ab14105( $cache, $code, &$cachedData ) {
-   $codeSequence = array_merge( [ $code ], 
$cachedData['fallbackSequence'] );
-   foreach ( $codeSequence as $csCode ) {
-   $fileName = __DIR__ . "/i18n/$csCode.json";
-   if ( is_readable( $fileName ) ) {
-   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-   foreach ( array_keys( $data ) as $key ) {
-   if ( $key === '' || $key[0] === '@' ) {
-   unset( $data[$key] );
-   }
-   }
-   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-   }
-
-   $cachedData['deps'][] = new FileDependency( $fileName );
-   }
-   return true;
-   }
-
-   $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimee273fa76ab14105';
-}
diff --git a/GWToolset.php b/GWToolset.php
index ab443c6..44d4a0d 100644
--- a/GWToolset.php
+++ b/GWToolset.php
@@ -84,7 +84,6 @@
 // add internationalization message file references
 $wgExtensionMessagesFiles['GWToolsetAlias'] = __DIR__ . '/GWToolset.alias.php';
 $wgMessagesDirs['GWToolset'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['GWToolset'] = __DIR__ . '/GWToolset.i18n.php';
 $wgExtensionMessagesFiles['GWToolsetNamespaces'] = __DIR__ . 
'/GWToolset.namespaces.php';
 
 // setup special page references

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I97117143bdd65cb04795b2276694f941ef5bee87
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
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...GWToolset[master]: Get rid of $wgGWToolsetDir

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

Change subject: Get rid of $wgGWToolsetDir
..


Get rid of $wgGWToolsetDir

Just use __DIR__ instead.

Change-Id: I8b367aecce71457c64926648affaeb688980f897
---
M GWToolset.php
M includes/Hooks/Hooks.php
2 files changed, 38 insertions(+), 41 deletions(-)

Approvals:
  Brian Wolff: Looks good to me, approved
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/GWToolset.php b/GWToolset.php
index 7a0ffe3..ab443c6 100644
--- a/GWToolset.php
+++ b/GWToolset.php
@@ -16,11 +16,8 @@
exit();
 }
 
-// set extension directory reference to this directory
-$wgGWToolsetDir = realpath( __DIR__ );
-
 // load extension constants
-require_once $wgGWToolsetDir . '/includes/Constants.php';
+require_once __DIR__ . '/includes/Constants.php';
 
 // register extension metadata with MediaWiki
 $wgExtensionCredits['media'][] = [
@@ -52,43 +49,43 @@
 
 // add autoloader classes
 $wgAutoloadClasses = $wgAutoloadClasses + [
-   'GWToolset\Config' => $wgGWToolsetDir . '/includes/Config.php',
-   'GWToolset\GWTException' => $wgGWToolsetDir . 
'/includes/GWTException.php',
-   'GWToolset\Utils' => $wgGWToolsetDir . '/includes/Utils.php',
-   'GWToolset\Adapters\DataAdapterInterface' => $wgGWToolsetDir . 
'/includes/Adapters/DataAdapterInterface.php',
-   'GWToolset\Adapters\Php\MappingPhpAdapter' => $wgGWToolsetDir . 
'/includes/Adapters/Php/MappingPhpAdapter.php',
-   'GWToolset\Adapters\Php\MediawikiTemplatePhpAdapter' => $wgGWToolsetDir 
. '/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php',
-   'GWToolset\Adapters\Php\MetadataPhpAdapter' => $wgGWToolsetDir . 
'/includes/Adapters/Php/MetadataPhpAdapter.php',
-   'GWToolset\Forms\MetadataDetectForm' => $wgGWToolsetDir . 
'/includes/Forms/MetadataDetectForm.php',
-   'GWToolset\Forms\MetadataMappingForm' => $wgGWToolsetDir . 
'/includes/Forms/MetadataMappingForm.php',
-   'GWToolset\Forms\PreviewForm' => $wgGWToolsetDir . 
'/includes/Forms/PreviewForm.php',
-   'GWToolset\Handlers\Forms\FormHandler' => $wgGWToolsetDir . 
'/includes/Handlers/Forms/FormHandler.php',
-   'GWToolset\Handlers\Forms\MetadataDetectHandler' => $wgGWToolsetDir . 
'/includes/Handlers/Forms/MetadataDetectHandler.php',
-   'GWToolset\Handlers\Forms\MetadataMappingHandler' => $wgGWToolsetDir . 
'/includes/Handlers/Forms/MetadataMappingHandler.php',
-   'GWToolset\Handlers\UploadHandler' => $wgGWToolsetDir . 
'/includes/Handlers/UploadHandler.php',
-   'GWToolset\Handlers\Xml\XmlDetectHandler' => $wgGWToolsetDir . 
'/includes/Handlers/Xml/XmlDetectHandler.php',
-   'GWToolset\Handlers\Xml\XmlHandler' => $wgGWToolsetDir . 
'/includes/Handlers/Xml/XmlHandler.php',
-   'GWToolset\Handlers\Xml\XmlMappingHandler' => $wgGWToolsetDir . 
'/includes/Handlers/Xml/XmlMappingHandler.php',
-   'GWToolset\Helpers\FileChecks' => $wgGWToolsetDir . 
'/includes/Helpers/FileChecks.php',
-   'GWToolset\Helpers\GWTFileBackend' => $wgGWToolsetDir . 
'/includes/Helpers/GWTFileBackend.php',
-   'GWToolset\Helpers\WikiChecks' => $wgGWToolsetDir . 
'/includes/Helpers/WikiChecks.php',
-   'GWToolset\Hooks' => $wgGWToolsetDir . '/includes/Hooks/Hooks.php',
-   'GWToolset\Jobs\GWTFileBackendCleanupJob' => $wgGWToolsetDir . 
'/includes/Jobs/GWTFileBackendCleanupJob.php',
-   'GWToolset\Jobs\UploadMediafileJob' => $wgGWToolsetDir . 
'/includes/Jobs/UploadMediafileJob.php',
-   'GWToolset\Jobs\UploadMetadataJob' => $wgGWToolsetDir . 
'/includes/Jobs/UploadMetadataJob.php',
-   'GWToolset\Models\Mapping' => $wgGWToolsetDir . 
'/includes/Models/Mapping.php',
-   'GWToolset\Models\MediawikiTemplate' => $wgGWToolsetDir . 
'/includes/Models/MediawikiTemplate.php',
-   'GWToolset\Models\Metadata' => $wgGWToolsetDir . 
'/includes/Models/Metadata.php',
-   'GWToolset\Models\ModelInterface' => $wgGWToolsetDir . 
'/includes/Models/ModelInterface.php',
-   'GWToolset\SpecialGWToolset' => $wgGWToolsetDir . 
'/includes/Specials/SpecialGWToolset.php',
-   'Php\File' => $wgGWToolsetDir . '/includes/Php/File.php'
+   'GWToolset\Config' => __DIR__ . '/includes/Config.php',
+   'GWToolset\GWTException' => __DIR__ . '/includes/GWTException.php',
+   'GWToolset\Utils' => __DIR__ . '/includes/Utils.php',
+   'GWToolset\Adapters\DataAdapterInterface' => __DIR__ . 
'/includes/Adapters/DataAdapterInterface.php',
+   'GWToolset\Adapters\Php\MappingPhpAdapter' => __DIR__ . 
'/includes/Adapters/Php/MappingPhpAdapter.php',
+   'GWToolset\Adapters\Php\MediawikiTemplatePhpAdapter' => __DIR__ . 
'/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php',
+   'GWToolset\Adapters\Php\MetadataPhpAdapter' => __DIR__ . 
'/includes/Adapters/Php/MetadataPhpAdapter.php',
+   'GWToolset\Forms\MetadataDetectForm' => __DIR__ . 

[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Remove dead code related to Constants::USE_FILEBACKEND

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

Change subject: Remove dead code related to Constants::USE_FILEBACKEND
..


Remove dead code related to Constants::USE_FILEBACKEND

This constant is true and has been since 2013, meaning both functions
have just been returning null. Leave FIXME comments since presumably
those functions had some purpose at some point.

Change-Id: I6a6977cef542844bd1b5ed3d278ef34f7a55a33f
---
M includes/Constants.php
M includes/Forms/MetadataDetectForm.php
2 files changed, 8 insertions(+), 50 deletions(-)

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



diff --git a/includes/Constants.php b/includes/Constants.php
index 098c8d4..b29ab97 100644
--- a/includes/Constants.php
+++ b/includes/Constants.php
@@ -14,6 +14,4 @@
const EXTENSION_NAME = 'GWToolset';
const EXTENSION_VERSION = '0.3.8';
const REQUIRED_MEDIAWIKI_VERSION = '1.23c';
-   const USE_FILEBACKEND = true;
-
 }
diff --git a/includes/Forms/MetadataDetectForm.php 
b/includes/Forms/MetadataDetectForm.php
index 911a5c7..c4b0130 100644
--- a/includes/Forms/MetadataDetectForm.php
+++ b/includes/Forms/MetadataDetectForm.php
@@ -367,57 +367,17 @@
Html::closeElement( 'form' );
}
 
+   /**
+* @FIXME what is the point of this function
+*/
public static function getMetadataFileUrlExtraInstructions() {
-   $result = null;
-
-   if ( Constants::USE_FILEBACKEND ) {
-   return $result;
-   }
-
-   $result = Html::rawElement( 'br' ) .
-   wfMessage( 'gwtoolset-metadata-file-source-info' 
)->escaped();
-
-   return $result;
+   return null;
}
 
+   /**
+* @FIXME what is the point of this function
+*/
public static function getMetadataFileUrlInput( $namespace ) {
-   $result = null;
-   $linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
-
-   if ( Constants::USE_FILEBACKEND ) {
-   return $result;
-   }
-
-   $result = Html::rawElement(
-   'li',
-   [],
-   Html::rawElement(
-   'label',
-   [],
-   wfMessage( 'gwtoolset-metadata-file-url' 
)->escaped() .
-   Html::rawElement(
-   'input',
-   [
-   'type' => 'text',
-   'name' => 
'gwtoolset-metadata-file-url',
-   'class' => 
'gwtoolset-wider-input',
-   'placeholder' => 
'Two-images.xml'
-   ]
-   ) .
-   Html::rawElement( 'br' ) .
-   $linkRenderer->makeLink(
-   Title::newFromText(
-   'Special:PrefixIndex/' .
-   $namespace .
-   Config::$metadata_sets_subpage
-   ),
-   $namespace .
-   Utils::sanitizeString( 
Config::$metadata_sets_subpage ),
-   [ 'target' => '_blank' ]
-   )
-   )
-   );
-
-   return $result;
+   return null;
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a6977cef542844bd1b5ed3d278ef34f7a55a33f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
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...GWToolset[master]: Remove unncessary $wgExtraNamespaces additions

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

Change subject: Remove unncessary $wgExtraNamespaces additions
..


Remove unncessary $wgExtraNamespaces additions

The namespaces are registered using the CanonicalNamespaces hook, so
they don't also need to be in $wgExtraNamespaces.

Change-Id: Ie3aaca93f36ddcf73fc9a30ee39faf0da45f4c4b
---
M GWToolset.php
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/GWToolset.php b/GWToolset.php
index 43ecc19..7a0ffe3 100644
--- a/GWToolset.php
+++ b/GWToolset.php
@@ -41,8 +41,6 @@
define( 'NS_GWTOOLSET_TALK', NS_GWTOOLSET + 1 );
 }
 
-$wgExtraNamespaces[NS_GWTOOLSET] = 'GWToolset';
-$wgExtraNamespaces[NS_GWTOOLSET_TALK] = 'GWToolset_talk';
 $wgNamespaceProtection[NS_GWTOOLSET] = [ 'gwtoolset' ];
 $wgNamespacesWithSubpages[NS_GWTOOLSET] = true;
 $wgNamespacesWithSubpages[NS_GWTOOLSET_TALK] = true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3aaca93f36ddcf73fc9a30ee39faf0da45f4c4b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
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]: Updating interwiki map

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

Change subject: Updating interwiki map
..


Updating interwiki map

Bug: T169979
Change-Id: I0fee35c6ecd25ad67603d39d3da899b614448666
---
M wmf-config/interwiki.php
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/wmf-config/interwiki.php b/wmf-config/interwiki.php
index 5ffb18a..6cf257e 100644
--- a/wmf-config/interwiki.php
+++ b/wmf-config/interwiki.php
@@ -1,5 +1,5 @@
  '0 https://www.acronymfinder.com/$1.html',
'__global:advisory' => '1 https://advisory.wikimedia.org/wiki/$1',
@@ -16,6 +16,7 @@
'__global:beacha' => '0 http://www.beachapedia.org/$1',
'__global:betawiki' => '0 https://translatewiki.net/wiki/$1',
'__global:bibcode' => '0 http://adsabs.harvard.edu/abs/$1',
+   '__global:bibliowiki' => '0 https://biblio.wiki/wiki/$1',
'__global:bluwiki' => '0 http://bluwiki.com/go/$1',
'__global:blw' => '0 http://britainloveswikipedia.org/wiki/$1',
'__global:botwiki' => '0 http://botwiki.sno.cc/wiki/$1',
@@ -323,7 +324,7 @@
'__global:wikihow' => '0 http://www.wikihow.com/$1',
'__global:wikiindex' => '0 http://wikiindex.org/$1',
'__global:wikilemon' => '0 http://wiki.illemonati.com/$1',
-   '__global:wikilivres' => '0 https://wikilivres.ca/wiki/$1',
+   '__global:wikilivres' => '0 https://biblio.wiki/wiki/$1',
'__global:wikilivresru' => '0 http://wikilivres.ru/$1',
'__global:wikimac-de' => '0 http://apfelwiki.de/wiki/Main/$1',
'__global:wikimedia' => '1 https://wikimediafoundation.org/wiki/$1',
@@ -11520,7 +11521,7 @@
'__global:meta' => '1 https://meta.wikimedia.org/wiki/$1',
'__global:sep11' => '1 https://sep11.wikipedia.org/wiki/$1',
'__global:d' => '1 https://www.wikidata.org/wiki/$1',
-   '__list:__global' => 'acronym advisory advogato aew appropedia 
aquariumwiki arborwiki arxiv atmwiki baden battlestarwiki bcnbio beacha 
betawiki bibcode bluwiki blw botwiki boxrec brickwiki bugzilla bulba c c2 
c2find cache ĉej cellwiki centralwikia chej choralwiki citizendium ckwiss 
comixpedia commons communityscheme communitywiki comune creativecommons 
creativecommonswiki cxej dcc dcdatabase dcma delicious devmo dictionary dict 
disinfopedia distributedproofreaders distributedproofreadersca dmoz dmozs doi 
donate doom_wiki download dbdump dpd drae dreamhost drumcorpswiki dwjwiki eĉei 
ecoreality ecxei elibre emacswiki encyc energiewiki englyphwiki enkol 
eokulturcentro esolang etherpad ethnologue ethnologuefamily evowiki exotica 
fanimutationwiki fedora finalfantasy finnix flickruser flickrphoto floralwiki 
foldoc forthfreak foundation foxwiki freebio freebsdman freeculturewiki 
freedomdefined freefeel freekiwiki freenode freesoft ganfyd gardenology 
gausswiki gentoo genwiki gerrit git globalvoices glossarwiki glossarywiki 
google googledefine googlegroups guildwarswiki guildwiki gutenberg 
gutenbergwiki hackerspaces h2wiki hammondwiki hdl heroeswiki horizonlabs hrwiki 
hrfwiki hupwiki iarchive imdbname imdbtitle imdbcompany imdbcharacter incubator 
infosecpedia infosphere irc ircrc rcirc iso639-3 issn iuridictum jaglyphwiki 
javanet javapedia jefo jerseydatabase jira jspwiki jstor kamelo karlsruhe 
kinowiki kmwiki komicawiki kontuwiki koslarwiki wikitech libreplanet 
linguistlist linuxwiki linuxwikide liswiki literateprograms livepedia localwiki 
lojban lostpedia lqwiki luxo mail mailarchive mariowiki marveldatabase meatball 
mw mediazilla memoryalpha metawiki metawikimedia metawikipedia metawikisearch 
mineralienatlas moinmoin monstropedia mosapedia mozcom mozillawiki 
mozillazinekb musicbrainz mediawikiwiki mwod mwot nkcells nara nosmoke nost 
nostalgia oeis oldwikisource olpc onelook openlibrary openstreetmap openwetware 
openwiki opera7wiki organicdesign orthodoxwiki osmwiki otrs otrswiki ourmedia 
outreach outreachwiki owasp panawiki patwiki personaltelco petscan phab 
phabricator phwiki phpwiki planetmath pmeg pmid pokewiki pokéwiki policy 
proofwiki pyrev pythoninfo pythonwiki pywiki psycle quality quarry rev revo rfc 
rheinneckar robowiki rodovid reuterswiki rowiki rt rtfm s23wiki scholar 
schoolswp scores scoutwiki scramble seapig seattlewiki slwiki semantic-mw 
senseislibrary sharemap silcode slashdot sourceforge spcom species squeak stats 
stewardry strategy strategywiki sulutil swtrain svn swinbrain tabwiki 
tclerswiki technorati tenwiki testwiki testwikidata test2wiki tfwiki 
thelemapedia theopedia thinkwiki ticket tmbw tmnet tmwiki toollabs tools tswiki 
translatewiki tviv tvtropes twiki tyvawiki uncyclopedia unihan unreal urbandict 
usej usemod usability utrs vikidia vlos vkol voipinfo votewiki werelate wg 
wikia wikiasite wikiapiary wikibooks wikichristian wikicities wikicity 
wikiconference wikidata 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Updating interwiki map

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

Change subject: Updating interwiki map
..

Updating interwiki map

Bug: T169979
Change-Id: I0fee35c6ecd25ad67603d39d3da899b614448666
---
M wmf-config/interwiki.php
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/interwiki.php b/wmf-config/interwiki.php
index 5ffb18a..6cf257e 100644
--- a/wmf-config/interwiki.php
+++ b/wmf-config/interwiki.php
@@ -1,5 +1,5 @@
  '0 https://www.acronymfinder.com/$1.html',
'__global:advisory' => '1 https://advisory.wikimedia.org/wiki/$1',
@@ -16,6 +16,7 @@
'__global:beacha' => '0 http://www.beachapedia.org/$1',
'__global:betawiki' => '0 https://translatewiki.net/wiki/$1',
'__global:bibcode' => '0 http://adsabs.harvard.edu/abs/$1',
+   '__global:bibliowiki' => '0 https://biblio.wiki/wiki/$1',
'__global:bluwiki' => '0 http://bluwiki.com/go/$1',
'__global:blw' => '0 http://britainloveswikipedia.org/wiki/$1',
'__global:botwiki' => '0 http://botwiki.sno.cc/wiki/$1',
@@ -323,7 +324,7 @@
'__global:wikihow' => '0 http://www.wikihow.com/$1',
'__global:wikiindex' => '0 http://wikiindex.org/$1',
'__global:wikilemon' => '0 http://wiki.illemonati.com/$1',
-   '__global:wikilivres' => '0 https://wikilivres.ca/wiki/$1',
+   '__global:wikilivres' => '0 https://biblio.wiki/wiki/$1',
'__global:wikilivresru' => '0 http://wikilivres.ru/$1',
'__global:wikimac-de' => '0 http://apfelwiki.de/wiki/Main/$1',
'__global:wikimedia' => '1 https://wikimediafoundation.org/wiki/$1',
@@ -11520,7 +11521,7 @@
'__global:meta' => '1 https://meta.wikimedia.org/wiki/$1',
'__global:sep11' => '1 https://sep11.wikipedia.org/wiki/$1',
'__global:d' => '1 https://www.wikidata.org/wiki/$1',
-   '__list:__global' => 'acronym advisory advogato aew appropedia 
aquariumwiki arborwiki arxiv atmwiki baden battlestarwiki bcnbio beacha 
betawiki bibcode bluwiki blw botwiki boxrec brickwiki bugzilla bulba c c2 
c2find cache ĉej cellwiki centralwikia chej choralwiki citizendium ckwiss 
comixpedia commons communityscheme communitywiki comune creativecommons 
creativecommonswiki cxej dcc dcdatabase dcma delicious devmo dictionary dict 
disinfopedia distributedproofreaders distributedproofreadersca dmoz dmozs doi 
donate doom_wiki download dbdump dpd drae dreamhost drumcorpswiki dwjwiki eĉei 
ecoreality ecxei elibre emacswiki encyc energiewiki englyphwiki enkol 
eokulturcentro esolang etherpad ethnologue ethnologuefamily evowiki exotica 
fanimutationwiki fedora finalfantasy finnix flickruser flickrphoto floralwiki 
foldoc forthfreak foundation foxwiki freebio freebsdman freeculturewiki 
freedomdefined freefeel freekiwiki freenode freesoft ganfyd gardenology 
gausswiki gentoo genwiki gerrit git globalvoices glossarwiki glossarywiki 
google googledefine googlegroups guildwarswiki guildwiki gutenberg 
gutenbergwiki hackerspaces h2wiki hammondwiki hdl heroeswiki horizonlabs hrwiki 
hrfwiki hupwiki iarchive imdbname imdbtitle imdbcompany imdbcharacter incubator 
infosecpedia infosphere irc ircrc rcirc iso639-3 issn iuridictum jaglyphwiki 
javanet javapedia jefo jerseydatabase jira jspwiki jstor kamelo karlsruhe 
kinowiki kmwiki komicawiki kontuwiki koslarwiki wikitech libreplanet 
linguistlist linuxwiki linuxwikide liswiki literateprograms livepedia localwiki 
lojban lostpedia lqwiki luxo mail mailarchive mariowiki marveldatabase meatball 
mw mediazilla memoryalpha metawiki metawikimedia metawikipedia metawikisearch 
mineralienatlas moinmoin monstropedia mosapedia mozcom mozillawiki 
mozillazinekb musicbrainz mediawikiwiki mwod mwot nkcells nara nosmoke nost 
nostalgia oeis oldwikisource olpc onelook openlibrary openstreetmap openwetware 
openwiki opera7wiki organicdesign orthodoxwiki osmwiki otrs otrswiki ourmedia 
outreach outreachwiki owasp panawiki patwiki personaltelco petscan phab 
phabricator phwiki phpwiki planetmath pmeg pmid pokewiki pokéwiki policy 
proofwiki pyrev pythoninfo pythonwiki pywiki psycle quality quarry rev revo rfc 
rheinneckar robowiki rodovid reuterswiki rowiki rt rtfm s23wiki scholar 
schoolswp scores scoutwiki scramble seapig seattlewiki slwiki semantic-mw 
senseislibrary sharemap silcode slashdot sourceforge spcom species squeak stats 
stewardry strategy strategywiki sulutil swtrain svn swinbrain tabwiki 
tclerswiki technorati tenwiki testwiki testwikidata test2wiki tfwiki 
thelemapedia theopedia thinkwiki ticket tmbw tmnet tmwiki toollabs tools tswiki 
translatewiki tviv tvtropes twiki tyvawiki uncyclopedia unihan unreal urbandict 
usej usemod usability utrs vikidia vlos vkol voipinfo votewiki werelate wg 
wikia wikiasite wikiapiary wikibooks wikichristian wikicities wikicity 
wikiconference 

[MediaWiki-commits] [Gerrit] mediawiki...Scribunto[master]: Move tests into tests/phpunit and remove UnitTestsList hook

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

Change subject: Move tests into tests/phpunit and remove UnitTestsList hook
..


Move tests into tests/phpunit and remove UnitTestsList hook

This takes advantage of extension.json's unit tests autodiscovery
mechanism.

Bug: T142120
Change-Id: Id526f3368fc73ba7e6ef1d793ea70ab05fbd9517
---
M common/Hooks.php
M extension.json
R tests/phpunit/engines/LuaCommon/CommonTest.php
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail1.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail2.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail3.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail4.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data-fail5.lua
R tests/phpunit/engines/LuaCommon/CommonTests-data.lua
R tests/phpunit/engines/LuaCommon/CommonTests-lib.lua
R tests/phpunit/engines/LuaCommon/CommonTests.lua
R tests/phpunit/engines/LuaCommon/HashLibraryTest.php
R tests/phpunit/engines/LuaCommon/HashLibraryTests.lua
R tests/phpunit/engines/LuaCommon/HtmlLibraryTest.php
R tests/phpunit/engines/LuaCommon/HtmlLibraryTests.lua
R tests/phpunit/engines/LuaCommon/LanguageLibraryTest.php
R tests/phpunit/engines/LuaCommon/LanguageLibraryTests.lua
R tests/phpunit/engines/LuaCommon/LibraryUtilTest.php
R tests/phpunit/engines/LuaCommon/LibraryUtilTests.lua
R tests/phpunit/engines/LuaCommon/LuaDataProvider.php
R tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php
R tests/phpunit/engines/LuaCommon/LuaEnvironmentComparisonTest.php
R tests/phpunit/engines/LuaCommon/LuaInterpreterTest.php
R tests/phpunit/engines/LuaCommon/MessageLibraryTest.php
R tests/phpunit/engines/LuaCommon/MessageLibraryTests.lua
R tests/phpunit/engines/LuaCommon/SiteLibraryTest.php
R tests/phpunit/engines/LuaCommon/SiteLibraryTests.lua
R tests/phpunit/engines/LuaCommon/TestFramework.lua
R tests/phpunit/engines/LuaCommon/TextLibraryTest.php
R tests/phpunit/engines/LuaCommon/TextLibraryTests.lua
R tests/phpunit/engines/LuaCommon/TitleLibraryTest.php
R tests/phpunit/engines/LuaCommon/TitleLibraryTests.lua
R tests/phpunit/engines/LuaCommon/UriLibraryTest.php
R tests/phpunit/engines/LuaCommon/UriLibraryTests.lua
R tests/phpunit/engines/LuaCommon/UstringLibraryNormalizationTests.lua
R tests/phpunit/engines/LuaCommon/UstringLibraryPureLuaTest.php
R tests/phpunit/engines/LuaCommon/UstringLibraryTest.php
R tests/phpunit/engines/LuaCommon/UstringLibraryTests.lua
R tests/phpunit/engines/LuaCommon/luaParserTests.txt
R tests/phpunit/engines/LuaSandbox/LuaSandboxInterpreterTest.php
R tests/phpunit/engines/LuaSandbox/SandboxTest.php
R tests/phpunit/engines/LuaSandbox/SandboxTests.lua
R tests/phpunit/engines/LuaStandalone/LuaStandaloneInterpreterTest.php
R tests/phpunit/engines/LuaStandalone/StandaloneTest.php
R tests/phpunit/engines/LuaStandalone/StandaloneTests.lua
45 files changed, 5 insertions(+), 36 deletions(-)

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



diff --git a/common/Hooks.php b/common/Hooks.php
index abfbfa4..63b90cb 100644
--- a/common/Hooks.php
+++ b/common/Hooks.php
@@ -388,36 +388,6 @@
}
 
/**
-* @param array $files
-* @return bool
-*/
-   public static function unitTestsList( array &$files ) {
-   $tests = [
-   
'engines/LuaStandalone/LuaStandaloneInterpreterTest.php',
-   'engines/LuaStandalone/StandaloneTest.php',
-   'engines/LuaSandbox/LuaSandboxInterpreterTest.php',
-   'engines/LuaSandbox/SandboxTest.php',
-   'engines/LuaCommon/LuaEnvironmentComparisonTest.php',
-   'engines/LuaCommon/CommonTest.php',
-   'engines/LuaCommon/SiteLibraryTest.php',
-   'engines/LuaCommon/UriLibraryTest.php',
-   'engines/LuaCommon/UstringLibraryTest.php',
-   'engines/LuaCommon/MessageLibraryTest.php',
-   'engines/LuaCommon/TitleLibraryTest.php',
-   'engines/LuaCommon/TextLibraryTest.php',
-   'engines/LuaCommon/HtmlLibraryTest.php',
-   'engines/LuaCommon/HashLibraryTest.php',
-   'engines/LuaCommon/LanguageLibraryTest.php',
-   'engines/LuaCommon/UstringLibraryPureLuaTest.php',
-   'engines/LuaCommon/LibraryUtilTest.php',
-   ];
-   foreach ( $tests as $test ) {
-   $files[] = __DIR__ . '/../tests/' . $test;
-   }
-   return true;
-   }
-
-   /**
 * @param Article &$article
 * @param bool &$outputDone
 * @param bool &$pcache
diff --git a/extension.json b/extension.json
index 

[MediaWiki-commits] [Gerrit] translatewiki[master]: Add more times for autosync.sh

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

Change subject: Add more times for autosync.sh
..


Add more times for autosync.sh

Because  why not.

Change-Id: I6cdff505fe824dea47de2d87e19c2590bcfd4b76
---
M puppet/modules/wiki/templates/wikimaintenance.erb
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/puppet/modules/wiki/templates/wikimaintenance.erb 
b/puppet/modules/wiki/templates/wikimaintenance.erb
index e609c80..6011e66 100644
--- a/puppet/modules/wiki/templates/wikimaintenance.erb
+++ b/puppet/modules/wiki/templates/wikimaintenance.erb
@@ -1,6 +1,6 @@
 # file managed by puppet
 @weekly www-data find /www/translatewiki.net/docroot/images/thumb/ -name 
"*.png" -type f -print0 | nice xargs -0 -P4 -I{} optipng -o7 {} 1> /dev/null
 @weekly <%= @user %> nice php 
/srv/mediawiki/targets/production/maintenance/generateSitemap.php --fspath 
/www/translatewiki.net/docroot/sitemap/ --skip-redirects --urlpath 
https://translatewiki.net/sitemap/
-48 6,10,13,16,20,22 * * * <%= @user %> <%= @config %>/bin/autosync.sh > 
/dev/null
+48 6,8,10,12,14,16,18,20,22 * * * <%= @user %> <%= @config %>/bin/autosync.sh 
> /dev/null
 48 7,13,21 * * * <%= @user %> <%= @config %>/bin/autosync-mediawiki.sh > 
/dev/null
 */10 * * * * root test -z "$(/bin/systemctl status mw-jobrunner | grep running 
-o)" && <%= @config %>/bin/udpcast JobQueue is not running

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6cdff505fe824dea47de2d87e19c2590bcfd4b76
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Remove duplicate hooks file that is never used

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

Change subject: Remove duplicate hooks file that is never used
..


Remove duplicate hooks file that is never used

This file isn't autoloaded nor is its single hook registered. It's also
a duplicate of the hook in the real Hooks file.

Change-Id: I1388ff6cf7fa11174d8517336c1fff017e0baebf
---
D GWToolset.hooks.php
1 file changed, 0 insertions(+), 20 deletions(-)

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



diff --git a/GWToolset.hooks.php b/GWToolset.hooks.php
deleted file mode 100644
index 79fb169..000
--- a/GWToolset.hooks.php
+++ /dev/null
@@ -1,20 +0,0 @@
-https://gerrit.wikimedia.org/r/363536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1388ff6cf7fa11174d8517336c1fff017e0baebf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GWToolset
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Add tests for forbidding use of backtick operator

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

Change subject: Add tests for forbidding use of backtick operator
..


Add tests for forbidding use of backtick operator

Follows-up affcecb0d7fb6.

Change-Id: I04b44f9abdb1921de4502a45bdca89a720f4c511
---
M MediaWiki/Tests/files/generic_fail.php
M MediaWiki/Tests/files/generic_fail.php.expect
2 files changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/MediaWiki/Tests/files/generic_fail.php 
b/MediaWiki/Tests/files/generic_fail.php
index 3c1cd35..276a614 100644
--- a/MediaWiki/Tests/files/generic_fail.php
+++ b/MediaWiki/Tests/files/generic_fail.php
@@ -3,3 +3,5 @@
 if ( $a or $b ) {
$c = $a and $b;
 }
+
+$foo = `echo "hi";`;
diff --git a/MediaWiki/Tests/files/generic_fail.php.expect 
b/MediaWiki/Tests/files/generic_fail.php.expect
index 2550fb0..2aaf83b 100644
--- a/MediaWiki/Tests/files/generic_fail.php.expect
+++ b/MediaWiki/Tests/files/generic_fail.php.expect
@@ -1,4 +1,8 @@
  3 | ERROR | Logical operator "or" is prohibited; use "||" instead
|   | (Squiz.Operators.ValidLogicalOperators.NotAllowed)
  4 | ERROR | Logical operator "and" is prohibited; use "&&" instead
-   |   | (Squiz.Operators.ValidLogicalOperators.NotAllowed)
\ No newline at end of file
+   |   | (Squiz.Operators.ValidLogicalOperators.NotAllowed)
+ 7 | ERROR | Use of the backtick operator is forbidden
+   |   | (Generic.PHP.BacktickOperator.Found)
+ 7 | ERROR | Use of the backtick operator is forbidden
+   |   | (Generic.PHP.BacktickOperator.Found)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I04b44f9abdb1921de4502a45bdca89a720f4c511
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Add CodeMirror to "Used by Wikimedia"

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

Change subject: Add CodeMirror to "Used by Wikimedia"
..


Add CodeMirror to "Used by Wikimedia"

Deployed on test.wikipedia.org.

Change-Id: I8c40b4ce3a190bfd420b39f711e5d60785e76055
---
M groups/MediaWiki/WikimediaAgg.yaml
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/groups/MediaWiki/WikimediaAgg.yaml 
b/groups/MediaWiki/WikimediaAgg.yaml
index be322cb..d2aa2fb 100644
--- a/groups/MediaWiki/WikimediaAgg.yaml
+++ b/groups/MediaWiki/WikimediaAgg.yaml
@@ -23,6 +23,7 @@
   - ext-checkuser # Only advanced users
   - ext-cldr
   - ext-codeeditor
+  - ext-codemirror
   - ext-cognate # 
https://phabricator.wikimedia.org/rOMWC20ffc2b65e603e7f533de1aae608704efc413d0d
   - ext-collaborationkit # 
https://phabricator.wikimedia.org/rOMWC54f5e751579cf7f715851bb89de538a28134668e
   - ext-commonsmetadata # Change id ecfa294d4b158aa5c44c166fa883d8ceef7d357d

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c40b4ce3a190bfd420b39f711e5d60785e76055
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Raimond Spekking 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Fix whitespace in WikimediaAgg

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

Change subject: Fix whitespace in WikimediaAgg
..


Fix whitespace in WikimediaAgg

Change-Id: I09023c3bd125ea1cbb8d7d3aa1af4d65dc81506c
---
M groups/MediaWiki/WikimediaAgg.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/groups/MediaWiki/WikimediaAgg.yaml 
b/groups/MediaWiki/WikimediaAgg.yaml
index be322cb..2e40854 100644
--- a/groups/MediaWiki/WikimediaAgg.yaml
+++ b/groups/MediaWiki/WikimediaAgg.yaml
@@ -42,7 +42,7 @@
   - ext-diff
   - ext-disableaccount # r86932 for some private wikis
   - ext-doublewiki # Wikisource
-  - ext-dynamicsidebar # Deployed but unused 
+  - ext-dynamicsidebar # Deployed but unused
   - ext-echo-api
   - ext-educationprogram # 2012-06-14 change id: 
Id3ea0259072e3aa7a508e5c61f03a0f23ec5fc2e
   - ext-elastica # 2013-09-20 for CirrusSearch, change id: 
7acdc7e8c346f00dcce1412f057ea38ad3d3e649

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I09023c3bd125ea1cbb8d7d3aa1af4d65dc81506c
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Raimond Spekking 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Fix path to alias files for mediawiki-extensions

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

Change subject: Fix path to alias files for mediawiki-extensions
..


Fix path to alias files for mediawiki-extensions

See I99630af5c6caa082e48c35afa6fcc3a9f39a32f5 and T160849

Change-Id: I1d31d57fa09b0b390d44973adc254249f24775cf
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index dca70ab..4757c24 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -270,7 +270,7 @@
 id = ext-bs-extendedsearch
 descmsg = bs-extendedsearch-desc
 file = BlueSpiceExtensions/ExtendedSearch/i18n/%CODE%.json
-aliasfile = 
BlueSpiceExtensions/ExtendedSearch/includes/specials/SpecialExtendedSearchAdmin.alias.php
+aliasfile = 
BlueSpiceExtensions/ExtendedSearch/languages/SpecialExtendedSearch.alias.php
 
 Blue Spice - Extension Info
 id = ext-bs-extensioninfo
@@ -669,7 +669,7 @@
 ignored = commentbox-prefill
 
 Comments
-aliasfile = Comments/Comments.alias.php
+aliasfile = Comments/includes/Comments.alias.php
 
 Common Messages
 
@@ -1461,7 +1461,7 @@
 Link Filter
 optional = linkfilter-url
 optional = group-linkadmin.css, group-linkadmin.js
-aliasfile = LinkFilter/Link.alias.php
+aliasfile = LinkFilter/includes/LinkFilter.alias.php
 
 Link Suggest
 
@@ -2011,7 +2011,7 @@
 Polyglot
 
 Poll NY
-aliasfile = PollNY/Poll.alias.php
+aliasfile = PollNY/includes/PollNY.alias.php
 descmsg = poll-desc
 
 Pool Counter
@@ -2074,7 +2074,7 @@
 descmsg = quiz_desc
 
 Quiz Game
-aliasfile = QuizGame/QuizGame.alias.php
+aliasfile = QuizGame/includes/QuizGame.alias.php
 optional = quizgame-leaderboard-desc-pct
 
 Quick Surveys
@@ -2311,7 +2311,7 @@
 magicfile = SiteMatrix/SiteMatrix.i18n.magic.php
 
 Site Metrics
-aliasfile = SiteMetrics/SiteMetrics.alias.php
+aliasfile = SiteMetrics/includes/SiteMetrics.alias.php
 
 Site Settings
 aliasfile = SiteSettings/SiteSettings.alias.php
@@ -2694,7 +2694,7 @@
 optional = visualeditor-help-link
 
 Vote NY
-aliasfile = VoteNY/VoteNY.alias.php
+aliasfile = VoteNY/includes/VoteNY.alias.php
 
 Watch Subpages
 aliasfile = WatchSubpages/WatchSubpages.alias.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d31d57fa09b0b390d44973adc254249f24775cf
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Raimond Spekking 
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...CentralAuth[wmf/1.30.0-wmf.7]: Fix handling of password hash upgrade on login

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

Change subject: Fix handling of password hash upgrade on login
..


Fix handling of password hash upgrade on login

Ie0fbf797 caused the user to be immediately logged out if their password
hash was upgraded on login, by moving the auth token reset to post-send
where it can't update the user's session cookie.

This is fixed by not bothering with the auth token reset in that code
path.

I5e22a184 caused the password hash upgrade to fail, accidentally, by
moving most processing to a non-master CentralAuthUser instance so
->setPassword() was being called on a master instance that hadn't yet
had its data loaded. Thus, the call to ->getId() which did trigger that
loading was overwriting ->mPassword.

This is fixed by making sure ->setPassword() loads the data before it
starts setting fields.

Bug: T169261
Change-Id: I7f01c02ed7c369e71f748ac9142edd1709ea6514
(cherry picked from commit 80eeb133cc707426c9fcca0cc1e6183d50f29211)
---
M includes/CentralAuthUser.php
1 file changed, 10 insertions(+), 1 deletion(-)

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



diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index a85c1dd..903138d 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -1903,7 +1903,12 @@
 
$centralUser = 
CentralAuthUser::newMasterInstanceFromId( $this->getId() );
if ( $centralUser ) {
-   $centralUser->setPassword( 
$password );
+   // Don't bother resetting the 
auth token for a hash
+   // upgrade. It's not really a 
password *change*, and
+   // since this is being done 
post-send it'll cause the
+   // user to be logged out when 
they just tried to log in
+   // since it can't update the 
just-sent session cookies.
+   $centralUser->setPassword( 
$password, false );
$centralUser->saveSettings();
}
} );
@@ -2537,6 +2542,10 @@
 */
function setPassword( $password, $resetAuthToken = true ) {
$this->checkWriteMode();
+
+   // Make sure state is loaded before updating ->mPassword
+   $this->loadState();
+
list( $salt, $hash ) = $this->saltedPassword( $password );
 
$this->mPassword = $hash;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f01c02ed7c369e71f748ac9142edd1709ea6514
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: wmf/1.30.0-wmf.7
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[wmf/1.30.0-wmf.7]: Unbreak tests

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

Change subject: Unbreak tests
..


Unbreak tests

This moves dummy CA tables creation to before any tests are run, so
that none of the parts of code CA hooks into attempts to use them before
they're in place. Also add an empty title check to fix another failure
that was popping for me.

Depends-On: If7050513719833d4167a24283885d7c10a25856b
Bug: T168802
Change-Id: I618840fafd22d9b6471eb470ef0414e354aa17f5
(cherry picked from commit f827873b7962f8ff47a9c2a21c647cc0cbb28095)
---
M extension.json
M includes/CentralAuthHooks.php
M tests/phpunit/CentralAuthTestCaseUsingDatabase.php
3 files changed, 58 insertions(+), 64 deletions(-)

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



diff --git a/extension.json b/extension.json
index f6c41cd..597a041 100644
--- a/extension.json
+++ b/extension.json
@@ -388,7 +388,9 @@
"AbuseFilter-builder": "CentralAuthHooks::abuseFilterBuilder",
"SecurePoll_GetUserParams": 
"CentralAuthHooks::onSecurePoll_GetUserParams",
"DeleteAccount": "CentralAuthHooks::onDeleteAccount",
-   "SessionCheckInfo": "CentralAuthHooks::onSessionCheckInfo"
+   "SessionCheckInfo": "CentralAuthHooks::onSessionCheckInfo",
+   "UnitTestsAfterDatabaseSetup": 
"CentralAuthHooks::onUnitTestsAfterDatabaseSetup",
+   "UnitTestsBeforeDatabaseTeardown": 
"CentralAuthHooks::onUnitTestsBeforeDatabaseTeardown"
},
"config": {
"@doc": "see CentralAuth.php",
diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index c9b85ad..0236011 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -1,5 +1,7 @@
 getTitle();
-   if ( $direct && ( $title->isSpecial( 'Userlogin' ) || 
$title->isSpecial( 'CreateAccount' ) ) ) {
+   if ( $direct && $title && ( $title->isSpecial( 'Userlogin' ) || 
$title->isSpecial( 'CreateAccount' ) ) ) {
// User will be redirected to 
Special:CentralLogin/start (central wiki),
// then redirected back to 
Special:CentralLogin/complete (this wiki).
// Sanity check that "returnto" is not one of the 
central login pages. If it
@@ -1425,4 +1427,54 @@
 
return true;
}
+
+   /**
+* UnitTestsAfterDatabaseSetup hook handler
+*
+* Setup the centralauth tables in the current DB, so we don't have
+* to worry about rights on another database. The first time it's called
+* we have to set the DB prefix ourselves, and reset it back to the 
original
+* so that CloneDatabase will work. On subsequent runs, the prefix is 
already
+* set up for us.
+*
+* @param IMaintainableDatabase $db
+* @param string $prefix
+*/
+
+   public static function onUnitTestsAfterDatabaseSetup( 
IMaintainableDatabase $db, $prefix ) {
+   global $wgCentralAuthDatabase;
+   $wgCentralAuthDatabase = false;
+
+   $originalPrefix = $db->tablePrefix();
+   $db->tablePrefix( $prefix );
+   if ( !$db->tableExists( 'globaluser' ) ) {
+   $db->sourceFile( __DIR__ . '/../central-auth.sql' );
+   }
+   $db->tablePrefix( $originalPrefix );
+   }
+
+   public static $centralauthTables = [
+   'global_group_permissions',
+   'global_group_restrictions',
+   'global_user_groups',
+   'globalnames',
+   'globaluser',
+   'localnames',
+   'localuser',
+   'wikiset',
+   'renameuser_status',
+   'renameuser_queue',
+   'users_to_rename',
+   ];
+
+   /**
+* UnitTestsBeforeDatabaseTeardown hook handler
+* Cleans up tables created by onUnitTestsAfterDatabaseSetup() above
+*/
+   public static function onUnitTestsBeforeDatabaseTeardown() {
+   $db = wfGetDB( DB_MASTER );
+   foreach ( self::$centralauthTables as $table ) {
+   $db->dropTable( $table );
+   }
+   }
 }
diff --git a/tests/phpunit/CentralAuthTestCaseUsingDatabase.php 
b/tests/phpunit/CentralAuthTestCaseUsingDatabase.php
index 82b4300..af356c2 100644
--- a/tests/phpunit/CentralAuthTestCaseUsingDatabase.php
+++ b/tests/phpunit/CentralAuthTestCaseUsingDatabase.php
@@ -1,73 +1,13 @@
 tablePrefix() !== MediaWikiTestCase::DB_PREFIX ) {
-   $originalPrefix = $db->tablePrefix();
-   $db->tablePrefix( MediaWikiTestCase::DB_PREFIX );
-   if ( !$db->tableExists( 'globaluser' ) ) {
-   $db->sourceFile( __DIR__ . 

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.7]: Add two new hooks to fix broken CentralAuth unit tests

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

Change subject: Add two new hooks to fix broken CentralAuth unit tests
..


Add two new hooks to fix broken CentralAuth unit tests

* UnitTestsAfterDatabaseSetup
* UnitTestsBeforeDatabaseTeardown
Bug T168802 necessitates that CentralAuth creates its tables
before any user tests are run, due to its extensive hooking
into everything. This change adds two hooks for that, called
after DB initialization is done and before teardown begins. The
corresponding CentralAuth change is
at I618840fafd22d9b6471eb470ef0414e354aa17f5

Bug: T168802
Change-Id: If7050513719833d4167a24283885d7c10a25856b
(cherry picked from commit 9374590feac2e1c78565b790681e9afb966393c6)
---
M docs/hooks.txt
M tests/phpunit/MediaWikiTestCase.php
2 files changed, 14 insertions(+), 0 deletions(-)

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



diff --git a/docs/hooks.txt b/docs/hooks.txt
index 3d310c3..7cabbbc 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -3454,6 +3454,14 @@
 $title: title object related to the revision
 $rev: revision (object) that will be viewed
 
+'UnitTestsAfterDatabaseSetup': Called right after MediaWiki's test 
infrastructure
+has finished creating/duplicating core tables for unit tests.
+$database: Database in question
+$prefix: Table prefix to be used in unit tests
+
+'UnitTestsBeforeDatabaseTeardown': Called right before MediaWiki tears down its
+database infrastructure used for unit tests.
+
 'UnitTestsList': Called when building a list of paths containing PHPUnit tests.
 Since 1.24: Paths pointing to a directory will be recursively scanned for
 test case files matching the suffix "Test.php".
diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index c1ada45..d804074 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -5,6 +5,8 @@
 use MediaWiki\Logger\MonologSpi;
 use MediaWiki\MediaWikiServices;
 use Psr\Log\LoggerInterface;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+use Wikimedia\Rdbms\Database;
 use Wikimedia\TestingAccessWrapper;
 
 /**
@@ -1101,6 +1103,8 @@
return;
}
 
+   Hooks::run( 'UnitTestsBeforeDatabaseTeardown' );
+
foreach ( $wgJobClasses as $type => $class ) {
// Delete any jobs under the clone DB (or old prefix in 
other stores)
JobQueueGroup::singleton()->get( $type )->delete();
@@ -1203,6 +1207,8 @@
if ( $db->getType() == 'oracle' ) {
$db->query( 'BEGIN FILL_WIKI_INFO; END;' );
}
+
+   Hooks::run( 'UnitTestsAfterDatabaseSetup', [ $db, $prefix ] );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If7050513719833d4167a24283885d7c10a25856b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.30.0-wmf.7
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   3   4   >