[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad, db-codfw.php: Pool db1096:3315

2017-12-03 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394926 )

Change subject: db-eqiad,db-codfw.php: Pool db1096:3315
..

db-eqiad,db-codfw.php: Pool db1096:3315

db1095 is a multiinstance slave that serves in s5 and s6.
Both replication threads are ready, so start pooling db1096:3315 a bit,
and add db1096:3316 to the config depooled unti it catches up

Bug: T178359
Change-Id: I4554bceba677c95b7395bb0534a10718134d7903
---
M wmf-config/db-codfw.php
M wmf-config/db-eqiad.php
2 files changed, 12 insertions(+), 4 deletions(-)


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

diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index b4e11ca..cf0ae4b 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -593,7 +593,8 @@
'db1092' => '10.64.48.151', # do not remove or comment out
'db1093' => '10.64.48.152', # do not remove or comment out
'db1094' => '10.64.48.153', # do not remove or comment out
-   'db1096:3315' => '10.64.0.163', # do not remove or comment out
+   'db1096:3315' => '10.64.0.163:3315', # do not remove or comment out
+   'db1096:3316' => '10.64.0.163:3316', # do not remove or comment out
'db1097:3314' => '10.64.48.11:3314', # do not remove or comment out
'db1097:3315' => '10.64.48.11:3315', # do not remove or comment out
'db1098' => '10.64.16.83', # do not remove or comment out
diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index cc94a40..a953f3d 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -145,7 +145,7 @@
'db1070' => 0,   # D1 2.8TB 160GB, master
'db1051' => 0,   # B3 2.8TB  96GB, vslow, dump in s5
'db1082' => 300, # A2 3.6TB 512GB, api # db1095 master
-   # 'db1096:3315' => 1,   # A6 3.6TB 512GB, watchlist, 
recentchanges, contributions, logpager
+   'db1096:3315' => 1,   # A6 3.6TB 512GB, watchlist, 
recentchanges, contributions, logpager
'db1097:3315' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5
'db1099:3318' => 1,   # B2 3.6TB 512GB, watchlist, 
recentchanges, contributions, logpager #s8
'db1100' => 50,  # C2 3.6TB 512GB, old master #api
@@ -158,6 +158,7 @@
'db1085' => 300, # B3 3.6TB 512GB, api #master for db1102 
(sanitarium 3) - T153743
'db1088' => 500, # C2 3.6TB 512GB
'db1093' => 1, # D2 3.6TB 512GB #temporary recentchanges 
#T178359
+   # 'db1096:3316' => 1,   # A6 3.6TB 512GB, watchlist, 
recentchanges, contributions, logpager
# 'db1098' => 1,   # B5 3.6TB 512GB, watchlist, recentchanges, 
contributions, logpager #T178359
],
's7' => [
@@ -398,12 +399,12 @@
'db1100' => 3,
],
'watchlist' => [
-   # 'db1096:3315' => 1,
+   'db1096:3315' => 1,
'db1097:3315' => 1,
'db1099:3318' => 1,
],
'recentchanges' => [
-   # 'db1096:3315' => 1,
+   'db1096:3315' => 1,
'db1097:3315' => 1,
'db1099:3318' => 1,
],
@@ -435,18 +436,23 @@
],
'watchlist' => [
'db1093' => 1,
+   # 'db1096:3316' => 1,
],
'recentchanges' => [
'db1093' => 1,
+   # 'db1096:3316' => 1,
],
'recentchangeslinked' => [
'db1093' => 1,
+   # 'db1096:3316' => 1,
],
'contributions' => [
'db1093' => 1,
+   # 'db1096:3316' => 1,
],
'logpager' => [
'db1093' => 1,
+   # 'db1096:3316' => 1,
],
],
's7' => [
@@ -573,6 +579,7 @@
'db1093' => '10.64.48.152', # do not remove or comment out
'db1094' => '10.64.48.153', # do not remove or comment out
'db1096:3315' => '10.64.0.163:3315', # do not remove or comment out
+   'db1096:3316' => '10.64.0.163:3316', # do not remove or comment out
'db1097:3314' => '10.64.48.11:3314', # do not remove or comment out
'db1097:3315' => '10.64.48.11:3315', # do not remove or comment out
'db1098' => '10.64.16.83', # do not remove or comment out

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

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

[MediaWiki-commits] [Gerrit] operations/software[master]: s6.hosts: Add db1096:3316

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

Change subject: s6.hosts: Add db1096:3316
..


s6.hosts: Add db1096:3316

db1096 is a multi-instance host that replicates s6

Bug: T178359
Change-Id: Id7efd7c962f3b88f98fa8f2b86618fd2ea43868e
---
M dbtools/s6.hosts
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/dbtools/s6.hosts b/dbtools/s6.hosts
index 7014baa..d9375e8 100644
--- a/dbtools/s6.hosts
+++ b/dbtools/s6.hosts
@@ -20,5 +20,6 @@
 db1085.eqiad.wmnet 3306
 db1088.eqiad.wmnet 3306
 db1093.eqiad.wmnet 3306
+db1096.eqiad.wmnet 3316
 db1098.eqiad.wmnet 3306
 db1061.eqiad.wmnet 3306

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id7efd7c962f3b88f98fa8f2b86618fd2ea43868e
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores2003: remove hiera file as tests are over

2017-12-03 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394924 )

Change subject: ores2003: remove hiera file as tests are over
..


ores2003: remove hiera file as tests are over

Change-Id: Iae7abafd1ea19ee336fdf3b38be6c5baefae189b
---
D hieradata/hosts/ores2003.yaml
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/hieradata/hosts/ores2003.yaml b/hieradata/hosts/ores2003.yaml
deleted file mode 100644
index b91c833..000
--- a/hieradata/hosts/ores2003.yaml
+++ /dev/null
@@ -1 +0,0 @@
-profile::base::notifications_enabled: "0"

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

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

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


[MediaWiki-commits] [Gerrit] operations/software[master]: s6.hosts: Add db1096:3316

2017-12-03 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394925 )

Change subject: s6.hosts: Add db1096:3316
..

s6.hosts: Add db1096:3316

db1096 is a multi-instance host that replicates s6

Bug: T178359
Change-Id: Id7efd7c962f3b88f98fa8f2b86618fd2ea43868e
---
M dbtools/s6.hosts
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/25/394925/1

diff --git a/dbtools/s6.hosts b/dbtools/s6.hosts
index 7014baa..d9375e8 100644
--- a/dbtools/s6.hosts
+++ b/dbtools/s6.hosts
@@ -20,5 +20,6 @@
 db1085.eqiad.wmnet 3306
 db1088.eqiad.wmnet 3306
 db1093.eqiad.wmnet 3306
+db1096.eqiad.wmnet 3316
 db1098.eqiad.wmnet 3306
 db1061.eqiad.wmnet 3306

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7efd7c962f3b88f98fa8f2b86618fd2ea43868e
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Marostegui 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores2003: remove hiera file as tests are over

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

Change subject: ores2003: remove hiera file as tests are over
..

ores2003: remove hiera file as tests are over

Change-Id: Iae7abafd1ea19ee336fdf3b38be6c5baefae189b
---
D hieradata/hosts/ores2003.yaml
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/hieradata/hosts/ores2003.yaml b/hieradata/hosts/ores2003.yaml
deleted file mode 100644
index b91c833..000
--- a/hieradata/hosts/ores2003.yaml
+++ /dev/null
@@ -1 +0,0 @@
-profile::base::notifications_enabled: "0"

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

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

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


[MediaWiki-commits] [Gerrit] labs/toollabs[master]: crontab: convert to mostly binary processing, and use surrog...

2017-12-03 Thread Zhuyifei1999 (Code Review)
Zhuyifei1999 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394923 )

Change subject: crontab: convert to mostly binary processing, and use 
surrogates for text
..

crontab: convert to mostly binary processing, and use surrogates for text

Argh... Python's unicode vs binary is always the annoying part.

The the code path processing the crontab data should now be binary
only, with the exception of the part that adds jsub to the entries,
which escapes and unescapes the data with surrogates before and after
the processing. Reading and writing to stdio in binary mode is done
on the buffer of sys.std{in,out,err}

Bug: T181948
Change-Id: I7601dae42724c4abc38c4c5cca76e3ad505b5d50
---
M debian/changelog
M misctools/oge-crontab
2 files changed, 24 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/23/394923/1

diff --git a/debian/changelog b/debian/changelog
index 209b6de..7f62aa7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+toollabs (1.2y) unstable; urgency=medium
+
+  * crontab: convert to mostly binary processing, and use surrogates for text
+
+ -- YiFei Zhu   Mon, 4 Dec 2017 07:34:32 +
+
 toollabs (1.26) unstable; urgency=medium
 
   * crontab: make tempfile use utf-8 encoding
diff --git a/misctools/oge-crontab b/misctools/oge-crontab
index 3ff4377..5495ce1 100644
--- a/misctools/oge-crontab
+++ b/misctools/oge-crontab
@@ -36,7 +36,7 @@
 '''
 
 
-DEFAULT_CRONTAB = '''\
+DEFAULT_CRONTAB = b'''\
 # Edit this file to introduce tasks to be run by cron.
 #
 # Each task to run has to be defined through a single line
@@ -88,16 +88,15 @@
 cmd,
 stdin=subprocess.PIPE,
 stdout=subprocess.PIPE,
-stderr=subprocess.PIPE,
-universal_newlines=True)  # kwarg encoding was added in py3.6
+stderr=subprocess.PIPE)
 
 stdoutdata, stderrdata = ssh.communicate(input=stdin)
 
 if ssh.returncode:
-if stderrdata.lower().startswith('no crontab for '):
+if stderrdata.lower().startswith(b'no crontab for '):
 raise NoCrontab
 else:
-print(stderrdata, end='', file=sys.stderr)
+sys.stderr.buffer.write(stderrdata)
 err('unable to execute remote crontab command')
 sys.exit(ssh.returncode)
 
@@ -105,7 +104,15 @@
 
 def _add_jsub(self, text):
 """Wrapper for the add_jsub function."""
-text = text.split('\n')
+# We don't really want to force utf-8 on our client, and prefer to
+# keep processing in binary data. However all the text processing here
+# must be executed on text, not binary, data, and surrogates is one of
+# the only ways to not lose information. Similar methods is also used
+# by python internally such as sys.args when non-ascii data is provided
+# with non-utf8 locale. In most cases, such as with utf8, any non-ascii
+# character will be escaped, and all the text-processing code will work
+# fine, but this is not guaranteed to be true for all codecs.
+text = text.decode('ascii', 'surrogateescape').split('\n')
 for lineno, line in enumerate(text):
 newline = add_jsub(line, 'cron-{}'.format(lineno))
 if newline is not None:
@@ -114,7 +121,7 @@
 text = '\n'.join(text)
 # Make sure there is one and only one line feed at the end
 text = text.rstrip('\n') + '\n'
-return text
+return text.encode('ascii', 'surrogateescape')
 
 def load(self):
 return self._remote('-l')
@@ -205,7 +212,7 @@
 
 def editor(text):
 """Open an editor with the given content and return results."""
-with tempfile.NamedTemporaryFile('w+t', encoding='utf-8') as f:
+with tempfile.NamedTemporaryFile('w+b') as f:
 f.write(text)
 f.flush()
 
@@ -225,7 +232,8 @@
 parser.add_argument('-u', dest='user', help=argparse.SUPPRESS)
 group = parser.add_mutually_exclusive_group()
 group.add_argument(
-'file', default=sys.stdin, nargs='?', type=argparse.FileType('r'),
+'file', default=sys.stdin.buffer, nargs='?',
+type=argparse.FileType('rb'),
 help='replace crontab with file (default)')
 subgroup = group.add_mutually_exclusive_group()
 subgroup.add_argument(
@@ -294,7 +302,7 @@
 elif args.operation == 'l':
 # List
 try:
-print(crontab.load(), end='')  # crontab already has lf
+sys.stdout.buffer.write(crontab.load())
 except NoCrontab:
 print(
 'no crontab for {}'.format(pw.pw_name), file=sys.stderr)

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores2003: temporarily disable notifications

2017-12-03 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394922 )

Change subject: ores2003: temporarily disable notifications
..


ores2003: temporarily disable notifications

Change-Id: I322091b2a46fff1fbc55df2396270fb658ef7d06
---
M hieradata/hosts/ores2003.yaml
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/hieradata/hosts/ores2003.yaml b/hieradata/hosts/ores2003.yaml
index 286eaa9..b91c833 100644
--- a/hieradata/hosts/ores2003.yaml
+++ b/hieradata/hosts/ores2003.yaml
@@ -1 +1 @@
-profile::base::notifications_enabled: "1"
+profile::base::notifications_enabled: "0"

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores2003: temporarily disable notifications

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

Change subject: ores2003: temporarily disable notifications
..

ores2003: temporarily disable notifications

Change-Id: I322091b2a46fff1fbc55df2396270fb658ef7d06
---
M hieradata/hosts/ores2003.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/hieradata/hosts/ores2003.yaml b/hieradata/hosts/ores2003.yaml
index 286eaa9..b91c833 100644
--- a/hieradata/hosts/ores2003.yaml
+++ b/hieradata/hosts/ores2003.yaml
@@ -1 +1 @@
-profile::base::notifications_enabled: "1"
+profile::base::notifications_enabled: "0"

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: CX2: Use cxserver v2 api

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

Change subject: CX2: Use cxserver v2 api
..


CX2: Use cxserver v2 api

Use the v2 path in the cxserver API URL when CX2 is the context.
Introduce mw.cx.getCXVersion utility method to know the CX
version at browser.

Follow up: I8ca37ce4884

Change-Id: I20334f08bda616732bbf192b9362ba180989a4f0
---
M ContentTranslation.hooks.php
M modules/base/ext.cx.sitemapper.js
M modules/util/mw.cx.util.js
3 files changed, 14 insertions(+), 2 deletions(-)

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



diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php
index f880cc3..00cba76 100644
--- a/ContentTranslation.hooks.php
+++ b/ContentTranslation.hooks.php
@@ -179,7 +179,8 @@
$wgContentTranslationDefaultSourceLanguage,
$wgContentTranslationTargetNamespace,
$wgContentTranslationUserGroupTargetNamespace,
-   $wgRecommendToolAPIURL;
+   $wgRecommendToolAPIURL,
+   $wgContentTranslationVersion;
 
$vars['wgContentTranslationTranslateInTarget'] = 
$wgContentTranslationTranslateInTarget;
$vars['wgContentTranslationDomainCodeMapping'] = 
$wgContentTranslationDomainCodeMapping;
@@ -194,6 +195,7 @@
$vars['wgContentTranslationUserGroupTargetNamespace']
= $wgContentTranslationUserGroupTargetNamespace;
$vars['wgRecommendToolAPIURL'] = $wgRecommendToolAPIURL;
+   $vars['wgContentTranslationVersion'] = 
$wgContentTranslationVersion;
}
 
/**
diff --git a/modules/base/ext.cx.sitemapper.js 
b/modules/base/ext.cx.sitemapper.js
index cdd1d89..ee1de6c 100644
--- a/modules/base/ext.cx.sitemapper.js
+++ b/modules/base/ext.cx.sitemapper.js
@@ -96,13 +96,18 @@
 * @return {string}
 */
mw.cx.SiteMapper.prototype.getCXServerUrl = function ( module, params ) 
{
+   var cxserverURL = this.config.cx;
if ( params !== undefined ) {
$.each( params, function ( key, value ) {
module = module.replace( key, 
encodeURIComponent( value ) );
} );
}
 
-   return this.config.cx + module;
+   if ( mw.cx.getCXVersion() === 2 ) {
+   cxserverURL = cxserverURL.replace( 'v1', 'v2' );
+   }
+
+   return cxserverURL + module;
};
 
mw.cx.SiteMapper.prototype.getRestbaseUrl = function ( language, 
module, params ) {
diff --git a/modules/util/mw.cx.util.js b/modules/util/mw.cx.util.js
index bd8a6ec..dd61c5e 100644
--- a/modules/util/mw.cx.util.js
+++ b/modules/util/mw.cx.util.js
@@ -108,3 +108,8 @@
 mw.cx.getSectionNumberFromSectionId = function ( sectionId ) {
return Number( sectionId.match( /^cx(Target|Source)Section([0-9]+)$/ )[ 
2 ] );
 };
+
+mw.cx.getCXVersion = function () {
+   var query = new mw.Uri().query;
+   return Number( query.version || mw.config.get( 
'wgContentTranslationVersion' ) );
+};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I20334f08bda616732bbf192b9362ba180989a4f0
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Santhosh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores2003: disable notifications temporarily for puppetdb tes...

2017-12-03 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394921 )

Change subject: ores2003: disable notifications temporarily for puppetdb testing
..


ores2003: disable notifications temporarily for puppetdb testing

Change-Id: Ic61b34267b419b81cb1a76a5b8c92708c031a9c4
---
A hieradata/hosts/ores2003.yaml
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/ores2003.yaml b/hieradata/hosts/ores2003.yaml
new file mode 100644
index 000..286eaa9
--- /dev/null
+++ b/hieradata/hosts/ores2003.yaml
@@ -0,0 +1 @@
+profile::base::notifications_enabled: "1"

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ores2003: disable notifications temporarily for puppetdb tes...

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

Change subject: ores2003: disable notifications temporarily for puppetdb testing
..

ores2003: disable notifications temporarily for puppetdb testing

Change-Id: Ic61b34267b419b81cb1a76a5b8c92708c031a9c4
---
A hieradata/hosts/ores2003.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/21/394921/1

diff --git a/hieradata/hosts/ores2003.yaml b/hieradata/hosts/ores2003.yaml
new file mode 100644
index 000..286eaa9
--- /dev/null
+++ b/hieradata/hosts/ores2003.yaml
@@ -0,0 +1 @@
+profile::base::notifications_enabled: "1"

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mariadb: Decommission db1044

2017-12-03 Thread Marostegui (Code Review)
Marostegui has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394919 )

Change subject: mariadb: Decommission db1044
..


mariadb: Decommission db1044

db1044 is going to be decommissioned

Bug: T181696
Change-Id: If69b2ec3fa2b8427248f98467ee37a05c7a5c893
---
D hieradata/hosts/db1044.yaml
M manifests/site.pp
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
M modules/role/files/prometheus/mysql-core_eqiad.yaml
4 files changed, 4 insertions(+), 14 deletions(-)

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



diff --git a/hieradata/hosts/db1044.yaml b/hieradata/hosts/db1044.yaml
deleted file mode 100644
index 82450ff..000
--- a/hieradata/hosts/db1044.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-mariadb::shard: 's3'
-mariadb::binlog_format: 'ROW'
-mariadb::socket: '/tmp/mysql.sock'
-profile::base::notifications_enabled: '0'
diff --git a/manifests/site.pp b/manifests/site.pp
index 8b19591..a8e7e07 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -352,10 +352,13 @@
 role(mariadb::core)
 }
 
-node /^db1(044|072|077|078)\.eqiad\.wmnet/ {
+node /^db1(072|077|078)\.eqiad\.wmnet/ {
 role(mariadb::core)
 }
 
+node 'db1044.eqiad.wmnet' {
+role(spare::system)
+}
 # s3 (default) core production dbs on codfw
 # codfw master
 node 'db2018.codfw.wmnet' {
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index ec63277..26ee3c4 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -959,14 +959,6 @@
 fixed-address db1043.eqiad.wmnet;
 }
 
-host db1044 {
-hardware ethernet 78:2b:cb:03:63:06;
-fixed-address db1044.eqiad.wmnet;
-option pxelinux.pathprefix "trusty-installer/";
-filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0";
-
-}
-
 host db1046 {
 hardware ethernet 78:2b:cb:03:60:c9;
 fixed-address db1046.eqiad.wmnet;
diff --git a/modules/role/files/prometheus/mysql-core_eqiad.yaml 
b/modules/role/files/prometheus/mysql-core_eqiad.yaml
index 11e62aa..f0720c8 100644
--- a/modules/role/files/prometheus/mysql-core_eqiad.yaml
+++ b/modules/role/files/prometheus/mysql-core_eqiad.yaml
@@ -39,7 +39,6 @@
 shard: s3
 role: slave
   targets:
-  - db1044:9104
   - db1072:9104
   - db1077:9104
   - db1078:9104

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

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

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


[MediaWiki-commits] [Gerrit] operations/software[master]: s3.hosts: Remove db1044

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

Change subject: s3.hosts: Remove db1044
..


s3.hosts: Remove db1044

db1044 will be decommissioned

Bug: T181696
Change-Id: Icbe2c7feacfd5088d5a00bb8813df6587a1c9a72
---
M dbtools/s3.hosts
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/dbtools/s3.hosts b/dbtools/s3.hosts
index 186f5fa..b166238 100644
--- a/dbtools/s3.hosts
+++ b/dbtools/s3.hosts
@@ -14,7 +14,6 @@
 dbstore1001.eqiad.wmnet3306
 dbstore1002.eqiad.wmnet3306
 db1095.eqiad.wmnet 3306
-db1044.eqiad.wmnet 3306
 db1072.eqiad.wmnet 3306
 db1077.eqiad.wmnet 3306
 db1078.eqiad.wmnet 3306

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbe2c7feacfd5088d5a00bb8813df6587a1c9a72
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/software[master]: s3.hosts: Remove db1044

2017-12-03 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394920 )

Change subject: s3.hosts: Remove db1044
..

s3.hosts: Remove db1044

db1044 will be decommissioned

Bug: T181696
Change-Id: Icbe2c7feacfd5088d5a00bb8813df6587a1c9a72
---
M dbtools/s3.hosts
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/20/394920/1

diff --git a/dbtools/s3.hosts b/dbtools/s3.hosts
index 186f5fa..b166238 100644
--- a/dbtools/s3.hosts
+++ b/dbtools/s3.hosts
@@ -14,7 +14,6 @@
 dbstore1001.eqiad.wmnet3306
 dbstore1002.eqiad.wmnet3306
 db1095.eqiad.wmnet 3306
-db1044.eqiad.wmnet 3306
 db1072.eqiad.wmnet 3306
 db1077.eqiad.wmnet 3306
 db1078.eqiad.wmnet 3306

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbe2c7feacfd5088d5a00bb8813df6587a1c9a72
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Marostegui 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mariadb: Decommission db1044

2017-12-03 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394919 )

Change subject: mariadb: Decommission db1044
..

mariadb: Decommission db1044

db1044 is going to be decommissioned

Bug: T181696
Change-Id: If69b2ec3fa2b8427248f98467ee37a05c7a5c893
---
D hieradata/hosts/db1044.yaml
M manifests/site.pp
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
M modules/role/files/prometheus/mysql-core_eqiad.yaml
4 files changed, 4 insertions(+), 14 deletions(-)


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

diff --git a/hieradata/hosts/db1044.yaml b/hieradata/hosts/db1044.yaml
deleted file mode 100644
index 82450ff..000
--- a/hieradata/hosts/db1044.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-mariadb::shard: 's3'
-mariadb::binlog_format: 'ROW'
-mariadb::socket: '/tmp/mysql.sock'
-profile::base::notifications_enabled: '0'
diff --git a/manifests/site.pp b/manifests/site.pp
index 8b19591..a8e7e07 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -352,10 +352,13 @@
 role(mariadb::core)
 }
 
-node /^db1(044|072|077|078)\.eqiad\.wmnet/ {
+node /^db1(072|077|078)\.eqiad\.wmnet/ {
 role(mariadb::core)
 }
 
+node 'db1044.eqiad.wmnet' {
+role(spare::system)
+}
 # s3 (default) core production dbs on codfw
 # codfw master
 node 'db2018.codfw.wmnet' {
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index ec63277..26ee3c4 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -959,14 +959,6 @@
 fixed-address db1043.eqiad.wmnet;
 }
 
-host db1044 {
-hardware ethernet 78:2b:cb:03:63:06;
-fixed-address db1044.eqiad.wmnet;
-option pxelinux.pathprefix "trusty-installer/";
-filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0";
-
-}
-
 host db1046 {
 hardware ethernet 78:2b:cb:03:60:c9;
 fixed-address db1046.eqiad.wmnet;
diff --git a/modules/role/files/prometheus/mysql-core_eqiad.yaml 
b/modules/role/files/prometheus/mysql-core_eqiad.yaml
index 11e62aa..f0720c8 100644
--- a/modules/role/files/prometheus/mysql-core_eqiad.yaml
+++ b/modules/role/files/prometheus/mysql-core_eqiad.yaml
@@ -39,7 +39,6 @@
 shard: s3
 role: slave
   targets:
-  - db1044:9104
   - db1072:9104
   - db1077:9104
   - db1078:9104

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Remove deprecated dieUsage methods

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

Change subject: Remove deprecated dieUsage methods
..


Remove deprecated dieUsage methods

dieWithError is used unconditionally now. dieUsage is deprecated
in 1.29

Change-Id: Ib57384ee76c9f8a4ef88a9e395027efbb179fb65
---
M api/ApiContentTranslationPublish.php
M api/ApiContentTranslationSuggestionList.php
M api/ApiQueryContentTranslation.php
M api/ApiQueryContentTranslationSuggestions.php
M api/ApiQueryPublishedTranslations.php
M api/ApiQueryTranslatorStats.php
6 files changed, 18 insertions(+), 77 deletions(-)

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



diff --git a/api/ApiContentTranslationPublish.php 
b/api/ApiContentTranslationPublish.php
index 2839954..cbe3cfd 100644
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -110,27 +110,15 @@
}
 
if ( !Language::isKnownLanguageTag( $params['from'] ) ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 
'apierror-cx-invalidsourcelanguage', 'invalidsourcelanguage' );
-   } else {
-   $this->dieUsage( 'Invalid source language', 
'invalidsourcelanguage' );
-   }
+   $this->dieWithError( 
'apierror-cx-invalidsourcelanguage', 'invalidsourcelanguage' );
}
 
if ( !Language::isKnownLanguageTag( $params['to'] ) ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 
'apierror-cx-invalidtargetlanguage', 'invalidtargetlanguage' );
-   } else {
-   $this->dieUsage( 'Invalid target language', 
'invalidtargetlanguage' );
-   }
+   $this->dieWithError( 
'apierror-cx-invalidtargetlanguage', 'invalidtargetlanguage' );
}
 
if ( trim( $params['html'] ) === '' ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( [ 'apierror-paramempty', 
'html' ], 'invalidhtml' );
-   } else {
-   $this->dieUsage( 'html cannot be empty', 
'invalidhtml' );
-   }
+   $this->dieWithError( [ 'apierror-paramempty', 'html' ], 
'invalidhtml' );
}
 
$this->publish();
@@ -144,11 +132,7 @@
 
$targetTitle = Title::newFromText( $params['title'] );
if ( !$targetTitle ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( [ 'apierror-invalidtitle', 
wfEscapeWikiText( $params['title'] ) ] );
-   } else {
-   $this->dieUsageMsg( [ 'invalidtitle', 
$params['title'] ] );
-   }
+   $this->dieWithError( [ 'apierror-invalidtitle', 
wfEscapeWikiText( $params['title'] ) ] );
}
 
$translator = new Translator( $user );
@@ -176,13 +160,9 @@
ApiVisualEditorEdit::tryDeflate( 
$params['html'] )
);
} catch ( MWException $e ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError(
-   [ 'apierror-cx-docserverexception', 
wfEscapeWikiText( $e->getMessage() ) ], 'docserver'
-   );
-   } else {
-   $this->dieUsage( $e->getMessage(), 'docserver' 
);
-   }
+   $this->dieWithError(
+   [ 'apierror-cx-docserverexception', 
wfEscapeWikiText( $e->getMessage() ) ], 'docserver'
+   );
}
 
$saveresult = $this->saveWikitext( $targetTitle, $wikitext, 
$params );
diff --git a/api/ApiContentTranslationSuggestionList.php 
b/api/ApiContentTranslationSuggestionList.php
index f5732e1..b4aabe1 100644
--- a/api/ApiContentTranslationSuggestionList.php
+++ b/api/ApiContentTranslationSuggestionList.php
@@ -17,11 +17,7 @@
$user = $this->getUser();
 
if ( !$this->getUser()->isLoggedIn() ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 
'apierror-cx-mustbeloggedin-suggestions', 'notloggedin' );
-   } else {
-   $this->dieUsage( 'You must be logged-in to 
manage your suggestions', 'notloggedin' );
-   }
+   

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: mariadb: Decommission db1044

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

Change subject: mariadb: Decommission db1044
..


mariadb: Decommission db1044

Bug: T148078
Change-Id: I8522744ce2441fee81034f9c9f4c8e62a02fc55b
---
M wmf-config/db-codfw.php
M wmf-config/db-eqiad.php
2 files changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index 962bcd6..b4e11ca 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -551,7 +551,6 @@
'db1034' => '10.64.16.23', # do not remove or comment out
'db1039' => '10.64.16.28', # do not remove or comment out
'db1043' => '10.64.16.32', # do not remove or comment out
-   'db1044' => '10.64.16.33', # do not remove or comment out
'db1047' => '10.64.16.36', # do not remove or comment out
'db1051' => '10.64.16.76', # do not remove or comment out
'db1052' => '10.64.16.77', # do not remove or comment out
diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index eae64e3..cc94a40 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -530,7 +530,6 @@
'db1034' => '10.64.16.23', # do not remove or comment out
'db1039' => '10.64.16.28', # do not remove or comment out
'db1043' => '10.64.16.32', # do not remove or comment out
-   'db1044' => '10.64.16.33', # do not remove or comment out
'db1047' => '10.64.16.36', # do not remove or comment out
'db1051' => '10.64.16.76', # do not remove or comment out
'db1052' => '10.64.16.77', # do not remove or comment out

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8522744ce2441fee81034f9c9f4c8e62a02fc55b
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: Urbanecm 
Gerrit-Reviewer: Zoranzoki21 
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...CheckUser[master]: Start on basic unit tests for CheckUser extension

2017-12-03 Thread MusikAnimal (Code Review)
MusikAnimal has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394918 )

Change subject: Start on basic unit tests for CheckUser extension
..

Start on basic unit tests for CheckUser extension

This patch only adds test coverage for CheckUser::getIpConds, in
response to the regression T175898. More test coverage will hopefully
follow.

Bug: T175920
Change-Id: Id0b0837ab3bb0604c99a2bc04d0fccf157620642
---
A tests/SpecialCheckUserTest.php
1 file changed, 84 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser 
refs/changes/18/394918/1

diff --git a/tests/SpecialCheckUserTest.php b/tests/SpecialCheckUserTest.php
new file mode 100644
index 000..fcdce70
--- /dev/null
+++ b/tests/SpecialCheckUserTest.php
@@ -0,0 +1,84 @@
+tablesUsed = array_merge(
+   $this->tablesUsed,
+   [
+   'page',
+   'revision',
+   'ip_changes',
+   'text',
+   'archive',
+   'recentchanges',
+   'logging',
+   'page_props',
+   'cu_changes',
+   ]
+   );
+   }
+
+   protected function setUp() {
+   parent::setUp();
+
+   $this->setMwGlobals( [
+   'wgCheckUserCIDRLimit' => [
+   'IPv4' => 16,
+   'IPv6' => 32,
+   ]
+   ] );
+   }
+
+   /**
+* @covers SpecialCheckUser::getIpConds
+* @dataProvider provideGetIpConds
+*/
+   public function testGetIpConds( $target, $expected ) {
+   $dbr = wfGetDB( DB_REPLICA );
+
+   $this->assertEquals(
+   $expected,
+   CheckUser::getIpConds( $dbr, $target )
+   );
+   }
+
+   /**
+* Test cases for SpecialCheckUser::getIpConds
+* @return array
+*/
+   public function provideGetIpConds()
+   {
+   return [
+   [
+   '212.35.31.121',
+   [ 'cuc_ip_hex' => 'D4231F79' ],
+   ],
+   [
+   '212.35.31.121/32',
+   [ 0 => 'cuc_ip_hex BETWEEN \'D4231F79\' AND 
\'D4231F79\'' ],
+   ],
+   [
+   '::e:f:2001',
+   [ 'cuc_ip_hex' => 
'v6-000E000F2001' ],
+   ],
+   [
+   '::e:f:2001/96',
+   [ 0 => 'cuc_ip_hex BETWEEN 
\'v6-000E\'' .
+   ' AND 
\'v6-000E\'' ],
+   ],
+   [ '0.17.184.5/15', false ],
+   [ '2000::/31', false ],
+   ];
+   }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0b0837ab3bb0604c99a2bc04d0fccf157620642
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: MusikAnimal 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Depool db1098

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

Change subject: db-eqiad.php: Depool db1098
..


db-eqiad.php: Depool db1098

db1098 will be used to populate db1096.s6.
Pool db1093 temporarily to replace it

Bug: T178359
Change-Id: Idbb065de0504cfe16031d3a8b96216446404c032
---
M wmf-config/db-eqiad.php
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index ddf2370..eae64e3 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -157,8 +157,8 @@
'db1030' => 0,   # B1 1.4TB  64GB, vslow, dump
'db1085' => 300, # B3 3.6TB 512GB, api #master for db1102 
(sanitarium 3) - T153743
'db1088' => 500, # C2 3.6TB 512GB
-   'db1093' => 500, # D2 3.6TB 512GB
-   'db1098' => 1,   # B5 3.6TB 512GB, watchlist, recentchanges, 
contributions, logpager
+   'db1093' => 1, # D2 3.6TB 512GB #temporary recentchanges 
#T178359
+   # 'db1098' => 1,   # B5 3.6TB 512GB, watchlist, recentchanges, 
contributions, logpager #T178359
],
's7' => [
'db1062' => 0,   # D4 2.8TB 128GB, master
@@ -434,19 +434,19 @@
'db1085' => 1,
],
'watchlist' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'recentchanges' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'recentchangeslinked' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'contributions' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'logpager' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
],
's7' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idbb065de0504cfe16031d3a8b96216446404c032
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: Urbanecm 
Gerrit-Reviewer: Zoranzoki21 
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...ContentTranslation[master]: Remove deprecated dieUsage methods

2017-12-03 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394917 )

Change subject: Remove deprecated dieUsage methods
..

Remove deprecated dieUsage methods

dieWithError is used unconditionally now. dieUsage is deprecated
in 1.29

Change-Id: Ib57384ee76c9f8a4ef88a9e395027efbb179fb65
---
M api/ApiContentTranslationPublish.php
M api/ApiContentTranslationSuggestionList.php
M api/ApiQueryContentTranslation.php
M api/ApiQueryContentTranslationSuggestions.php
M api/ApiQueryPublishedTranslations.php
M api/ApiQueryTranslatorStats.php
6 files changed, 18 insertions(+), 77 deletions(-)


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

diff --git a/api/ApiContentTranslationPublish.php 
b/api/ApiContentTranslationPublish.php
index 2839954..cbe3cfd 100644
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -110,27 +110,15 @@
}
 
if ( !Language::isKnownLanguageTag( $params['from'] ) ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 
'apierror-cx-invalidsourcelanguage', 'invalidsourcelanguage' );
-   } else {
-   $this->dieUsage( 'Invalid source language', 
'invalidsourcelanguage' );
-   }
+   $this->dieWithError( 
'apierror-cx-invalidsourcelanguage', 'invalidsourcelanguage' );
}
 
if ( !Language::isKnownLanguageTag( $params['to'] ) ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 
'apierror-cx-invalidtargetlanguage', 'invalidtargetlanguage' );
-   } else {
-   $this->dieUsage( 'Invalid target language', 
'invalidtargetlanguage' );
-   }
+   $this->dieWithError( 
'apierror-cx-invalidtargetlanguage', 'invalidtargetlanguage' );
}
 
if ( trim( $params['html'] ) === '' ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( [ 'apierror-paramempty', 
'html' ], 'invalidhtml' );
-   } else {
-   $this->dieUsage( 'html cannot be empty', 
'invalidhtml' );
-   }
+   $this->dieWithError( [ 'apierror-paramempty', 'html' ], 
'invalidhtml' );
}
 
$this->publish();
@@ -144,11 +132,7 @@
 
$targetTitle = Title::newFromText( $params['title'] );
if ( !$targetTitle ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( [ 'apierror-invalidtitle', 
wfEscapeWikiText( $params['title'] ) ] );
-   } else {
-   $this->dieUsageMsg( [ 'invalidtitle', 
$params['title'] ] );
-   }
+   $this->dieWithError( [ 'apierror-invalidtitle', 
wfEscapeWikiText( $params['title'] ) ] );
}
 
$translator = new Translator( $user );
@@ -176,13 +160,9 @@
ApiVisualEditorEdit::tryDeflate( 
$params['html'] )
);
} catch ( MWException $e ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError(
-   [ 'apierror-cx-docserverexception', 
wfEscapeWikiText( $e->getMessage() ) ], 'docserver'
-   );
-   } else {
-   $this->dieUsage( $e->getMessage(), 'docserver' 
);
-   }
+   $this->dieWithError(
+   [ 'apierror-cx-docserverexception', 
wfEscapeWikiText( $e->getMessage() ) ], 'docserver'
+   );
}
 
$saveresult = $this->saveWikitext( $targetTitle, $wikitext, 
$params );
diff --git a/api/ApiContentTranslationSuggestionList.php 
b/api/ApiContentTranslationSuggestionList.php
index f5732e1..b4aabe1 100644
--- a/api/ApiContentTranslationSuggestionList.php
+++ b/api/ApiContentTranslationSuggestionList.php
@@ -17,11 +17,7 @@
$user = $this->getUser();
 
if ( !$this->getUser()->isLoggedIn() ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 
'apierror-cx-mustbeloggedin-suggestions', 'notloggedin' );
-   } else {
-   $this->dieUsage( 'You must be logged-in to 
manage your suggestions', 'notloggedin' );
-   }
+

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Depool db1098

2017-12-03 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394916 )

Change subject: db-eqiad.php: Depool db1098
..

db-eqiad.php: Depool db1098

db1098 will be used to populate db1096.s6.
Pool db1093 temporarily to replace it

Bug: T178359
Change-Id: Idbb065de0504cfe16031d3a8b96216446404c032
---
M wmf-config/db-eqiad.php
1 file changed, 7 insertions(+), 7 deletions(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index ddf2370..eae64e3 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -157,8 +157,8 @@
'db1030' => 0,   # B1 1.4TB  64GB, vslow, dump
'db1085' => 300, # B3 3.6TB 512GB, api #master for db1102 
(sanitarium 3) - T153743
'db1088' => 500, # C2 3.6TB 512GB
-   'db1093' => 500, # D2 3.6TB 512GB
-   'db1098' => 1,   # B5 3.6TB 512GB, watchlist, recentchanges, 
contributions, logpager
+   'db1093' => 1, # D2 3.6TB 512GB #temporary recentchanges 
#T178359
+   # 'db1098' => 1,   # B5 3.6TB 512GB, watchlist, recentchanges, 
contributions, logpager #T178359
],
's7' => [
'db1062' => 0,   # D4 2.8TB 128GB, master
@@ -434,19 +434,19 @@
'db1085' => 1,
],
'watchlist' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'recentchanges' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'recentchangeslinked' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'contributions' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
'logpager' => [
-   'db1098' => 1,
+   'db1093' => 1,
],
],
's7' => [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...UniversalLanguageSelector[master]: ApiULSLocalization: Correct the language code validation

2017-12-03 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394915 )

Change subject: ApiULSLocalization: Correct the language code validation
..

ApiULSLocalization: Correct the language code validation

Use Language::isKnownLanguageTag instead of Language::isValidCode
isValidCode will accept strings that are not language code like
abcd.

Also removed the check for dieWithError method

Change-Id: I511dfab03208b3fd70079cb97ad70549935cc6cb
---
M api/ApiULSLocalization.php
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/15/394915/1

diff --git a/api/ApiULSLocalization.php b/api/ApiULSLocalization.php
index c86b5db..6176c3b 100644
--- a/api/ApiULSLocalization.php
+++ b/api/ApiULSLocalization.php
@@ -29,12 +29,8 @@
 
$params = $this->extractRequestParams();
$language = $params['language'];
-   if ( !Language::isValidCode( $language ) ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( [ 'apierror-invalidlang', 
'language' ], 'invalidlanguage' );
-   } else {
-   $this->dieUsage( 'Invalid language', 
'invalidlanguage' );
-   }
+   if ( !Language::isKnownLanguageTag( $language ) ) {
+   $this->dieWithError( [ 'apierror-invalidlang', 
'language' ], 'invalidlanguage' );
}
$contents = ULSJsonMessageLoader::getMessages( $language );
// Output the file's contents raw

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Fix undefined $db

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

Change subject: Fix undefined $db
..


Fix undefined $db

Noticed while testing Flow locally...

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

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



diff --git a/includes/ThrottleOverrideHooks.php 
b/includes/ThrottleOverrideHooks.php
index 25f67f2..43bb38b 100644
--- a/includes/ThrottleOverrideHooks.php
+++ b/includes/ThrottleOverrideHooks.php
@@ -71,7 +71,7 @@
$dbr = ThrottleOverrideUtils::getCentralDB( 
DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
 
-   $quotedIp = $db->addQuotes( $hexIp );
+   $quotedIp = $dbr->addQuotes( $hexIp );
$expiry = $dbr->selectField(
'throttle_override',
'thr_expiry',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0ca42bbad79c9968cb8a2629eca5207ef18d18b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ThrottleOverride
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: EddieGP 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mediawiki: Remove Score firejail wrappers

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

Change subject: mediawiki: Remove Score firejail wrappers
..

mediawiki: Remove Score firejail wrappers

firejailing is now implemented in MediaWiki/Score itself.

Depends-On: I481d7918d53569d47e30f169a2ad72ed29fb3b87
Change-Id: I6701c5976311ebf37c934ae222159ff4600e10c3
---
D modules/mediawiki/files/mediawiki-firejail-abc2ly
D modules/mediawiki/files/mediawiki-firejail-lilypond
D modules/mediawiki/files/mediawiki-firejail-timidity
M modules/mediawiki/manifests/init.pp
4 files changed, 0 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/14/394914/1

diff --git a/modules/mediawiki/files/mediawiki-firejail-abc2ly 
b/modules/mediawiki/files/mediawiki-firejail-abc2ly
deleted file mode 100644
index 3b12f2a..000
--- a/modules/mediawiki/files/mediawiki-firejail-abc2ly
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /usr/bin/python
-# -*- coding: utf-8 -*-
-
-import sys, subprocess
-subprocess.call(['/usr/bin/firejail', 
'--profile=/etc/firejail/mediawiki-converters.profile', '/usr/bin/abc2ly'] + 
sys.argv[1:])
diff --git a/modules/mediawiki/files/mediawiki-firejail-lilypond 
b/modules/mediawiki/files/mediawiki-firejail-lilypond
deleted file mode 100755
index 69e3ff2..000
--- a/modules/mediawiki/files/mediawiki-firejail-lilypond
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /usr/bin/python
-# -*- coding: utf-8 -*-
-
-import sys, subprocess
-subprocess.call(['/usr/bin/firejail', '--quiet', 
'--profile=/etc/firejail/mediawiki-converters.profile', '/usr/bin/lilypond'] + 
sys.argv[1:])
diff --git a/modules/mediawiki/files/mediawiki-firejail-timidity 
b/modules/mediawiki/files/mediawiki-firejail-timidity
deleted file mode 100644
index ebb6fa6..000
--- a/modules/mediawiki/files/mediawiki-firejail-timidity
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /usr/bin/python
-# -*- coding: utf-8 -*-
-
-import sys, subprocess
-subprocess.call(['/usr/bin/firejail', 
'--profile=/etc/firejail/mediawiki-converters.profile', '/usr/bin/timidity'] + 
sys.argv[1:])
diff --git a/modules/mediawiki/manifests/init.pp 
b/modules/mediawiki/manifests/init.pp
index f56bebc..e8d29aa 100644
--- a/modules/mediawiki/manifests/init.pp
+++ b/modules/mediawiki/manifests/init.pp
@@ -62,27 +62,6 @@
 mode   => '0555',
 }
 
-file { '/usr/local/bin/mediawiki-firejail-lilypond':
-source => 'puppet:///modules/mediawiki/mediawiki-firejail-lilypond',
-owner  => 'root',
-group  => 'root',
-mode   => '0555',
-}
-
-file { '/usr/local/bin/mediawiki-firejail-abc2ly':
-source => 'puppet:///modules/mediawiki/mediawiki-firejail-abc2ly',
-owner  => 'root',
-group  => 'root',
-mode   => '0555',
-}
-
-file { '/usr/local/bin/mediawiki-firejail-timidity':
-source => 'puppet:///modules/mediawiki/mediawiki-firejail-timidity',
-owner  => 'root',
-group  => 'root',
-mode   => '0555',
-}
-
 # /var/log/mediawiki contains log files for the MediaWiki jobrunner
 # and for various periodic jobs that are managed by cron.
 file { '/var/log/mediawiki':

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove manual firejailing of Score binaries

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

Change subject: Remove manual firejailing of Score binaries
..

Remove manual firejailing of Score binaries

As of d333ae89df, this is now done by MediaWiki/Score itself.

Bug: T181535
Change-Id: I481d7918d53569d47e30f169a2ad72ed29fb3b87
---
M wmf-config/CommonSettings.php
1 file changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 6d3cb6e..389f384 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1096,9 +1096,6 @@
 if ( $wmgUseScore ) {
wfLoadExtension( 'Score' );
$wgScoreSafeMode = false;
-   $wgScoreLilypond = '/usr/local/bin/mediawiki-firejail-lilypond';
-   $wgScoreAbc2Ly = '/usr/local/bin/mediawiki-firejail-abc2ly';
-   $wgScoreTimidity = '/usr/local/bin/mediawiki-firejail-timidity';
$wgScoreFileBackend = $wmgScoreFileBackend;
$wgScorePath = $wmgScorePath;
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Fix undefined $db

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394912 )

Change subject: Fix undefined $db
..

Fix undefined $db

Noticed while testing Flow locally...

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


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

diff --git a/includes/ThrottleOverrideHooks.php 
b/includes/ThrottleOverrideHooks.php
index 25f67f2..43bb38b 100644
--- a/includes/ThrottleOverrideHooks.php
+++ b/includes/ThrottleOverrideHooks.php
@@ -71,7 +71,7 @@
$dbr = ThrottleOverrideUtils::getCentralDB( 
DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
 
-   $quotedIp = $db->addQuotes( $hexIp );
+   $quotedIp = $dbr->addQuotes( $hexIp );
$expiry = $dbr->selectField(
'throttle_override',
'thr_expiry',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Update zordius/lightncandy v0.23 to v1.1.0

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394911 )

Change subject: Update zordius/lightncandy v0.23 to v1.1.0
..

Update zordius/lightncandy v0.23 to v1.1.0

Change-Id: I607aee7469c3d39da02d324083a6e8f8468c1c27
Depends-On: Ida9e12e759cdc4508238c3215354485a6561
Depends-On: I734ee96b6b020f22a9743e1905b147a7d5e05123
---
M includes/TemplateHelper.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/TemplateHelper.php b/includes/TemplateHelper.php
index 069c7bd..22a8058 100644
--- a/includes/TemplateHelper.php
+++ b/includes/TemplateHelper.php
@@ -8,7 +8,7 @@
 use Closure;
 use HTML;
 use OOUI\IconWidget;
-use LightnCandy;
+use LightnCandy\LightnCandy;
 use MWTimestamp;
 use RequestContext;
 use Title;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...minus-x[master]: Release 0.2.1

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

Change subject: Release 0.2.1
..


Release 0.2.1

Change-Id: I25d9fbcb58518ad2127213e9e2b9b061c9a81920
---
M HISTORY.md
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/HISTORY.md b/HISTORY.md
index 3e7c453..94d2c07 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,5 +1,9 @@
 # MinusX release history #
 
+## 0.2.1 / 2017-12-03 ##
+* Percent-encode URLs in `README.md` to work around bad parsers. (MZMcBride)
+* Use env instead of /usr/bin/php directly (Sam Wilson)
+
 ## 0.2.0 / 2017-10-30 ##
 * Don't use SplFileObject::fread() for PHP < 5.5.11 support (Kunal Mehta)
 * Drop .php extension from minus-x command (Kunal Mehta)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I25d9fbcb58518ad2127213e9e2b9b061c9a81920
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/minus-x
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
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...minus-x[master]: Release 0.2.1

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

Change subject: Release 0.2.1
..

Release 0.2.1

Change-Id: I25d9fbcb58518ad2127213e9e2b9b061c9a81920
---
M HISTORY.md
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/minus-x 
refs/changes/10/394910/1

diff --git a/HISTORY.md b/HISTORY.md
index 3e7c453..94d2c07 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,5 +1,9 @@
 # MinusX release history #
 
+## 0.2.1 / 2017-12-03 ##
+* Percent-encode URLs in `README.md` to work around bad parsers. (MZMcBride)
+* Use env instead of /usr/bin/php directly (Sam Wilson)
+
 ## 0.2.0 / 2017-10-30 ##
 * Don't use SplFileObject::fread() for PHP < 5.5.11 support (Kunal Mehta)
 * Drop .php extension from minus-x command (Kunal Mehta)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25d9fbcb58518ad2127213e9e2b9b061c9a81920
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/minus-x
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki...minus-x[master]: Use env instead of /usr/bin/php directly

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

Change subject: Use env instead of /usr/bin/php directly
..


Use env instead of /usr/bin/php directly

Bug: T181957
Change-Id: Ieb51d38fe1ec182bdbe54a33a7a51abfa96a3246
---
M bin/minus-x
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/bin/minus-x b/bin/minus-x
index b5a6fe3..494355e 100755
--- a/bin/minus-x
+++ b/bin/minus-x
@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 https://gerrit.wikimedia.org/r/394908
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb51d38fe1ec182bdbe54a33a7a51abfa96a3246
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/minus-x
Gerrit-Branch: master
Gerrit-Owner: Samwilson 
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...Score[master]: Check for PNG metadata before generating HTML

2017-12-03 Thread Ebe123 (Code Review)
Ebe123 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394909 )

Change subject: Check for PNG metadata before generating HTML
..

Check for PNG metadata before generating HTML

When embedding the PNG file(s), the dimensions of the file are
placed into the `

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


[MediaWiki-commits] [Gerrit] mediawiki...minus-x[master]: Use env instead of /usr/bin/php directly

2017-12-03 Thread Samwilson (Code Review)
Samwilson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394908 )

Change subject: Use env instead of /usr/bin/php directly
..

Use env instead of /usr/bin/php directly

Bug: T181957
Change-Id: Ieb51d38fe1ec182bdbe54a33a7a51abfa96a3246
---
M bin/minus-x
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/minus-x 
refs/changes/08/394908/1

diff --git a/bin/minus-x b/bin/minus-x
index b5a6fe3..494355e 100755
--- a/bin/minus-x
+++ b/bin/minus-x
@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 https://gerrit.wikimedia.org/r/394908
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb51d38fe1ec182bdbe54a33a7a51abfa96a3246
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/minus-x
Gerrit-Branch: master
Gerrit-Owner: Samwilson 

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


[MediaWiki-commits] [Gerrit] integration/jenkins[master]: Remove `composer dump-autoload --optimize`

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394907 )

Change subject: Remove `composer dump-autoload --optimize`
..

Remove `composer dump-autoload --optimize`

Change-Id: I45329e95f69d66c05230ca39cc28d32cf218b2b3
---
M bin/mw-fetch-composer-dev.sh
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/07/394907/2

diff --git a/bin/mw-fetch-composer-dev.sh b/bin/mw-fetch-composer-dev.sh
index 01ed093..09f1d36 100755
--- a/bin/mw-fetch-composer-dev.sh
+++ b/bin/mw-fetch-composer-dev.sh
@@ -16,11 +16,6 @@
composer config extra.merge-plugin.include 
"$MW_INSTALL_PATH/composer.json"
 fi
 
-# FIXME: integration/composer is outdated and breaks autoloader
-# Once we're on composer 1.0.0-alpha11 or higher this might not
-# be needed anymore
-composer dump-autoload --optimize
-
 mkdir -p "$LOG_DIR"
 [ -f "$MW_INSTALL_PATH/composer.json" ] && cp -vf 
"$MW_INSTALL_PATH/composer.json" "$LOG_DIR/composer.core.json.txt" || :
 [ -f "$MW_INSTALL_PATH/vendor/composer.json" ] && cp -vf 
"$MW_INSTALL_PATH/vendor/composer.json" "$LOG_DIR/composer.vendor.json.txt" || :

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45329e95f69d66c05230ca39cc28d32cf218b2b3
Gerrit-PatchSet: 2
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] labs...ZppixBot[master]: Add documentation

2017-12-03 Thread MacFan4000 (Code Review)
MacFan4000 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394906 )

Change subject: Add documentation
..

Add documentation

Bug: T149500
Change-Id: I4f089b5e796a2d80369e431c9a4bdfc3d3575f46
---
A public_html/documentation.html
D public_html/documentation.php
M public_html/index.php
3 files changed, 544 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/ZppixBot 
refs/changes/06/394906/1

diff --git a/public_html/documentation.html b/public_html/documentation.html
new file mode 100644
index 000..ff03e52
--- /dev/null
+++ b/public_html/documentation.html
@@ -0,0 +1,543 @@
+List of Commands -ZppixBot
+Commands
+
+
+
+Commands
+Purpose
+Example
+Module
+
+
+
+
+.accesslevel
+Shows what level of access you have.
+
+adminlist
+
+
+.ban
+This give admins the ability to ban a user.The bot 
must be a Channel Operator for this command to work.
+
+adminchannel
+
+
+.bing
+Queries Bing for the specified input.
+.bing swhack
+search
+
+
+.blocks
+Manage ZppixBots blocking features.https://github.com/sopel-irc/sopel/wiki/Making-Sopel-ignore-people;>https://github.com/sopel-irc/sopel/wiki/Making-Sopel-ignore-people
+
+coretasks
+
+
+.bytes
+Show the input as pretty printed bytes.
+.bytes ㋡
+codepoints
+
+
+.c.calc
+Google calculator.
+.c 5 + 3
+calc
+
+
+.chairs
+Set the meeting chairs.https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
+.chairs Tyrope Jason elad
+meetbot
+
+
+.commands
+Return a list of ZppixBots commands
+
+help
+
+
+.roll.dice.d
+.dice  - Rolls dice using the XdY format, also does 
basic math anddrop lowest (XdYvZ).
+
+dice
+
+
+.duck.ddg
+Queries Duck Duck Go for the specified input.
+
+search
+
+
+.endmeeting
+End a meeting.https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module;>https://github.com/sopel-irc/sopel/wiki/Using-the-meetbot-module
+.endmeeting
+meetbot
+
+
+.ety
+Look up the etymology of a word
+.ety word
+etymology
+
+
+.twitinfo
+Show information about the given Twitter account
+.twitinfo aplsuk
+twit
+
+
+.tweet
+Tweet with ZppixBots account. Admin-only.
+.tweet Hello World!
+twit
+
+
+.findissue.findbug
+Search for a GitHub issue by keyword or ID. usage: .findissue search 
keywords/ID (optional) You can specify the first keyword as CLOSED 
to search closed issues.
+
+github
+
+
+.fucking_weather.fw
+No documentation found.
+
+fuckingweather
+
+
+.g.google
+Queries Google for the specified input.
+.g swhack
+search
+
+
+.gc
+Returns the number of Google results for the specified input.
+.gc extrapolate
+search
+
+
+.gcs.comp
+Compare the number of Google search results
+.gcs foo bar
+search
+
+
+.countdown
+.countdown- displays a countdown to a 
given date.
+
+countdown
+
+
+.tld
+Show information about the given Top Level Domain.
+
+tld
+
+
+.twit
+Show the last tweet by the given user
+.twit aplusk
+twit
+
+
+.task>
+Gives a link to the specified task on Miraheze Phabricator
+.task 1
+mh_phab
+
+
+.iplookup.ip
+IP Lookup tool
+.iplookup 8.8.8.8
+ip
+
+
+.isop
+Show if you are an operator in the current channel
+
+adminchannel
+
+
+.makeissue.makebug
+Create a GitHub issue, also known as a bug report. Syntax: .makeissue 
Title of the bug report
+
+github
+
+
+.isup
+isup.me website status checker
+
+isup
+
+
+.kick
+Kick a user from the channel.
+
+adminchannel
+
+
+.in
+Gives you a reminder in the given amount of time.
+.in 3h45m Release a new version of ZppixBot
+reminders
+
+
+.at
+Gives you a reminder at the given time. Time format: hh:mm:ss. To see what 
timezone is used, type .getchanneltz (if setting a reminder in a IRC channel) 
or .gettz (elsewhere)
+.at 13:47 Update the servers!
+reminders
+
+
+.cancelreminder
+Pings the bot operators to cancel a reminder that you no longer need.
+.cancelreminder (insert reminder message here)
+reminders
+
+
+.miraheze
+This command will tell you about Miraheze and where to learn more
+
+miraheze
+
+
+.gethelp
+Pings Miraheze admins, prompting to help a user that needs help.
+.gethelp I cannot access https://www.meta.miraheze.org
+miraheze
+
+
+.python
+Tells you what version of Python ZppixBot is running.
+
+pyver
+
+
+.kickban.kb
+   This gives admins the ability to kickban a user.   The bot 
must be a Channel Operator for this command to work   .kickban [#chan] 
user1 user!@ get out of here
+
+adminchannel
+
+
+.listops
+List channel operators in the given channel, or current channel 
if none isgiven.
+
+coretasks
+
+
+.rss
+.rss operation channel site_name url -- operation can be either 
add, del, or list no further operators needed if 
list used
+
+rss
+
+
+.mangle
+Repeatedly translate the input until it makes no sense.
+
+translate
+
+
+.action
+Log an action in the meeting log

[MediaWiki-commits] [Gerrit] mediawiki...namespaceizer[master]: Add a tool to modify and standardize file headers

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

Change subject: Add a tool to modify and standardize file headers
..

Add a tool to modify and standardize file headers

See the core commit Ie0cea0ef5 for the details of the resulting changes.

Change-Id: I4689786bb87ac8fe86564e148d0997cb578dbb47
---
A bin/fixFileHeader.php
M composer.json
A src/FileHeaderFixer.php
3 files changed, 386 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/namespaceizer 
refs/changes/05/394905/1

diff --git a/bin/fixFileHeader.php b/bin/fixFileHeader.php
new file mode 100644
index 000..0334ac9
--- /dev/null
+++ b/bin/fixFileHeader.php
@@ -0,0 +1,29 @@
+ ...\n";
+   exit( 1 );
+   }
+   $files = array_slice( $argv, 1 );
+
+   foreach ( $files as $fileName ) {
+   $input = file_get_contents( $fileName );
+   $result = FileHeaderFixer::fix( $input, function ( $line, $msg 
) use ( $fileName ) {
+   echo "$fileName:$line: $msg\n";
+   } );
+   if ( $result !== false && $input !== $result ) {
+   file_put_contents( $fileName, $result );
+   }
+   }
+}
+
+fixFileHeader( $argv );
diff --git a/composer.json b/composer.json
index 1a2d50d..6fb2e15 100644
--- a/composer.json
+++ b/composer.json
@@ -5,5 +5,10 @@
"psr-4": {
"MediaWiki\\Tool\\Namespaceizer\\": "src/"
}
+   },
+   "minimum-stability": "alpha",
+   "prefer-stable": true,
+   "require": {
+   "nikic/php-parser": "~4.0"
}
 }
diff --git a/src/FileHeaderFixer.php b/src/FileHeaderFixer.php
new file mode 100644
index 000..a7affaa
--- /dev/null
+++ b/src/FileHeaderFixer.php
@@ -0,0 +1,352 @@
+execute();
+   } catch ( Error $error ) {
+   return false;
+   }
+   }
+
+   private function __construct( $text, $errorCallback ) {
+   $this->text = $text;
+   $this->errorCallback = $errorCallback;
+   }
+
+   private function execute() {
+   $lexer = new Lexer\Emulative( [
+   'usedAttributes' => [
+   'comments',
+   'startLine', 'endLine',
+   'startTokenPos', 'endTokenPos',
+   ],
+   ] );
+   $parser = new Parser\Php7( $lexer );
+   $oldAst = $parser->parse( $this->text );
+
+   $traverser = new NodeTraverser;
+   $traverser->addVisitor( new NodeVisitor\CloningVisitor );
+   $newAst = $traverser->traverse( $oldAst );
+
+   if ( count( $newAst ) < 1 ) {
+   $this->fatal( 0, "empty file" );
+   }
+
+   $nonClass = $this->findNonClassCode( $newAst );
+   if ( $nonClass ) {
+   $this->fatal( $nonClass->getLine(), "non-class code 
found" );
+   }
+
+   $firstNode = $newAst[0];
+   $comments = $firstNode->getAttribute( 'comments' );
+   if ( !count( $comments ) ) {
+   $this->error( $firstNode->getLine(), "First node has no 
comments" );
+   return $this->text;
+   }
+
+   $commentText = $comments[0]->getText();
+   $parts = $this->splitComment( $firstNode->getLine(), 
$commentText );
+
+   if ( isset( $parts['start'] ) ) {
+   $parts['start'] = $this->removeCreationDate( 
$parts['start'] );
+   }
+
+   $ingroup = false;
+   if ( isset( $parts['end'] ) ) {
+   $ingroup = $this->getAnnotation( $parts['end'], 
'ingroup' );
+   $parts['end'] = $this->removeAnnotation( $parts['end'], 
'ingroup' );
+   }
+   if ( isset( $parts['license'] ) ) {
+   $newLicenseComment = "/*\n" . $parts['license'] . " 
*/\n";
+   } else {
+   $newLicenseComment = null;
+   }
+
+   if ( isset( $parts['license'] ) && ( isset( $parts['start'] ) 
|| isset( $parts['end'] ) ) ) {
+   $newFileComment = "/**\n";
+   if ( isset( $parts['start'] ) ) {
+   $newFileComment .= $parts['start'];
+   }
+   if ( isset( $parts['end'] ) ) {
+   $newFileComment .= $parts['end'];
+   }
+   $newFileComment .= " */";
+
+   $newComments = [];
+   if ( !$this->isPracticallyEmpty( $newFileComment ) ) {
+   $newComments[] = new 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move license headers out of @file, and other cleanups

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

Change subject: Move license headers out of @file, and other cleanups
..

Move license headers out of @file, and other cleanups

This is the result of running fixFileHeader.php from the
mediawiki/tools/namespaceizer repo on all .php files in the includes
directory. The effect is as follows:

* Don't include the full license header in the @file doc comment, since
  the resulting presentation in Doxygen is unhelpful. Instead, move the
  license header to a non-doc comment. For consistency, also include
  copyright notices which previously appeared above the license header.
* The GPL recommends placing a short description of the file above the
  license header, and many files did do that. These short descriptions
  are also ideal as content for @file doc comments for Doxygen's
  purposes. So, place the pre-existing file descriptions at the top of
  the file, together with @file and other annotations which previously
  below the license.
* Remove @ingroup from @file sections relating to class files. It is
  redundant and unhelpful to list class files alongside the classes they
  contain in Doxygen's module menu. Copied the @ingroup annotation from
  the file comment to any classes in the same file which did not already
  have it, which I think reflects the authors' intents.
* Remove creation dates from file headers. I don't think this
  information is important enough to include in such a prominent place,
  and creation date notices are apparently not protected by the GPL.
* Standardize on having one blank line following the license header.
  It's inconvenient to detect the whitespace environment with
  php-parser, and this was the most common pre-existing style.

Files which had file-level code were skipped, since those are irrelevant
for the PSR-4 migration which motivated this work.

Change-Id: Ie0cea0ef5027c7e583318aed04454bd33e26fcee
---
M includes/AjaxDispatcher.php
M includes/AjaxResponse.php
M includes/AuthPlugin.php
M includes/Autopromote.php
M includes/Block.php
M includes/CategoriesRdf.php
M includes/Category.php
M includes/CategoryFinder.php
M includes/CategoryViewer.php
M includes/CommentStore.php
M includes/CommentStoreComment.php
M includes/DeprecatedGlobal.php
M includes/DerivativeRequest.php
M includes/EditPage.php
M includes/EventRelayerGroup.php
M includes/FauxRequest.php
M includes/Feed.php
M includes/FeedUtils.php
M includes/FileDeleteForm.php
M includes/ForkController.php
M includes/FormOptions.php
M includes/GitInfo.php
M includes/Hooks.php
M includes/Html.php
M includes/HtmlFormatter.php
M includes/LinkFilter.php
M includes/Linker.php
M includes/ListToggle.php
M includes/MWGrants.php
M includes/MWNamespace.php
M includes/MWTimestamp.php
M includes/MagicWord.php
M includes/MagicWordArray.php
M includes/MediaWiki.php
M includes/MergeHistory.php
M includes/Message.php
M includes/MimeMagic.php
M includes/MovePage.php
M includes/OrderedStreamingForkController.php
M includes/OutputPage.php
M includes/PageProps.php
M includes/PathRouter.php
M includes/Pingback.php
M includes/Preferences.php
M includes/PrefixSearch.php
M includes/ProtectionForm.php
M includes/ProxyLookup.php
M includes/RawMessage.php
M includes/Revision.php
M includes/RevisionList.php
M includes/SiteConfiguration.php
M includes/SiteStats.php
M includes/Status.php
M includes/StreamFile.php
M includes/StubObject.php
M includes/TemplatesOnThisPageFormatter.php
M includes/Title.php
M includes/TitleArray.php
M includes/TitleArrayFromResult.php
M includes/TrackingCategories.php
M includes/WebRequest.php
M includes/WebRequestUpload.php
M includes/WebResponse.php
M includes/WikiMap.php
M includes/WikiReference.php
M includes/Xml.php
M includes/XmlJsCode.php
M includes/XmlSelect.php
M includes/actions/Action.php
M includes/actions/CachedAction.php
M includes/actions/CreditsAction.php
M includes/actions/DeleteAction.php
M includes/actions/EditAction.php
M includes/actions/FormAction.php
M includes/actions/FormlessAction.php
M includes/actions/HistoryAction.php
M includes/actions/InfoAction.php
M includes/actions/MarkpatrolledAction.php
M includes/actions/ProtectAction.php
M includes/actions/PurgeAction.php
M includes/actions/RawAction.php
M includes/actions/RenderAction.php
M includes/actions/RevertAction.php
M includes/actions/RollbackAction.php
M includes/actions/SpecialPageAction.php
M includes/actions/SubmitAction.php
M includes/actions/UnprotectAction.php
M includes/actions/UnwatchAction.php
M includes/actions/ViewAction.php
M includes/actions/WatchAction.php
M includes/api/ApiAMCreateAccount.php
M includes/api/ApiAuthManagerHelper.php
M includes/api/ApiBlock.php
M includes/api/ApiCSPReport.php
M includes/api/ApiChangeAuthenticationData.php
M includes/api/ApiCheckToken.php
M includes/api/ApiClearHasMsg.php
M includes/api/ApiClientLogin.php
M 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: A few doc comment fixups

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

Change subject: A few doc comment fixups
..

A few doc comment fixups

* Remove some creation dates, they are not protected by GPL
* Remove duplicate @defgroup API
* Remove @ingroup from some @file doc comments on class files. It is not
  useful to list class files alongside classes in the doxygen module menu.
  Add @ingroup to some more class files that had @ingroup on their file,
  that was probably the author's intent.
* In PackedOverlayImageGallery, use the file comment as a class comment
* Don't put @defgroup and @file in the same comment. @defgroup makes the
  whole doc comment describe the group.
* Instead of putting AnsiTermColorer in two groups, use hierarchical
  groups.

Change-Id: If54f6e0b2bc1ea6de42045885cf836ee67b8e961
---
M includes/api/ApiImport.php
M includes/api/ApiOpenSearch.php
M includes/api/ApiRsd.php
M includes/api/ApiUsageException.php
M includes/deferred/CdnCacheUpdate.php
M includes/gallery/PackedOverlayImageGallery.php
M includes/installer/PhpBugTests.php
M includes/jobqueue/JobSpecification.php
M includes/jobqueue/aggregator/JobQueueAggregator.php
M includes/libs/rdbms/database/IDatabase.php
M includes/libs/rdbms/database/IMaintainableDatabase.php
M includes/libs/rdbms/exception/DBExpectedError.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
M includes/specials/SpecialUploadStash.php
M includes/upload/UploadStash.php
M languages/classes/LanguageEn.php
M languages/classes/LanguageGan.php
M maintenance/term/MWTerm.php
18 files changed, 67 insertions(+), 31 deletions(-)


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

diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index a0f0a8d..822711a 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -1,9 +1,5 @@
 .@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php
index 419fd14..416fc7f 100644
--- a/includes/api/ApiOpenSearch.php
+++ b/includes/api/ApiOpenSearch.php
@@ -1,7 +1,5 @@
 @gmail.com"
  * Copyright © 2008 Brion Vibber 
  * Copyright © 2014 Wikimedia Foundation and contributors
@@ -382,6 +380,9 @@
}
 }
 
+/**
+ * @ingroup API
+ */
 class ApiOpenSearchFormatJson extends ApiFormatJson {
private $warningsAsError = false;
 
diff --git a/includes/api/ApiRsd.php b/includes/api/ApiRsd.php
index fdc62a8..f20d1c6 100644
--- a/includes/api/ApiRsd.php
+++ b/includes/api/ApiRsd.php
@@ -3,8 +3,6 @@
 /**
  * API for MediaWiki 1.17+
  *
- * Created on October 26, 2010
- *
  * Copyright © 2010 Bryan Tong Minh and Brion Vibber
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/includes/api/ApiUsageException.php 
b/includes/api/ApiUsageException.php
index 4196add..c200dcb 100644
--- a/includes/api/ApiUsageException.php
+++ b/includes/api/ApiUsageException.php
@@ -16,7 +16,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @defgroup API API
  */
 
 /**
diff --git a/includes/deferred/CdnCacheUpdate.php 
b/includes/deferred/CdnCacheUpdate.php
index 7fafc0e..301c4f3 100644
--- a/includes/deferred/CdnCacheUpdate.php
+++ b/includes/deferred/CdnCacheUpdate.php
@@ -18,7 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @ingroup Cache
  */
 
 use Wikimedia\Assert\Assert;
diff --git a/includes/gallery/PackedOverlayImageGallery.php 
b/includes/gallery/PackedOverlayImageGallery.php
index db8ce68..0a5a457 100644
--- a/includes/gallery/PackedOverlayImageGallery.php
+++ b/includes/gallery/PackedOverlayImageGallery.php
@@ -1,8 +1,5 @@
 http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @defgroup PHPBugTests PHP known bugs tests
  */
 
 /**
+ * @defgroup PHPBugTests PHP known bugs tests
+ */
+/**
  * Test for PHP+libxml2 bug which breaks XML input subtly with certain 
versions.
  * Known fixed with PHP 5.2.9 + libxml2-2.7.3
  * @see https://bugs.php.net/bug.php?id=45996
diff --git a/includes/jobqueue/JobSpecification.php 
b/includes/jobqueue/JobSpecification.php
index d844795..b62b83c 100644
--- a/includes/jobqueue/JobSpecification.php
+++ b/includes/jobqueue/JobSpecification.php
@@ -18,7 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @ingroup JobQueue
  */
 
 /**
diff --git a/includes/jobqueue/aggregator/JobQueueAggregator.php 
b/includes/jobqueue/aggregator/JobQueueAggregator.php
index f26beee..433de93 100644
--- a/includes/jobqueue/aggregator/JobQueueAggregator.php
+++ b/includes/jobqueue/aggregator/JobQueueAggregator.php
@@ -158,6 +158,9 @@
}
 }
 
+/**
+ * @ingroup JobQueue
+ */
 class JobQueueAggregatorNull extends JobQueueAggregator {
protected function doNotifyQueueEmpty( $wiki, $type ) {
return true;
diff --git 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: varnish: Don't redirect www.$project.org on mobile

2017-12-03 Thread EddieGP (Code Review)
EddieGP has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394902 )

Change subject: varnish: Don't redirect www.$project.org on mobile
..

varnish: Don't redirect www.$project.org on mobile

Currently varnish redirects www.$project.org to www.m.$project.org when
a mobile browser is detected. www.m.$project.org does exist in neither
DNS nor apache though, so we shouldn't redirect there.

This patch just kills the redirect from www.$project.org - that is,
varnish won't generate a local redirect for those domains anymore. It
will instead hand over the requests to apache, which already has
properly configured VirtualHosts for these and is going to
either serve the wwwportal or redirect elsewhere, based on the path
given in the request.

Bug: T154026
Change-Id: I6d849fc8f59957883c050634d0a396d3843b6d57
---
M modules/varnish/templates/text-frontend.inc.vcl.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/02/394902/1

diff --git a/modules/varnish/templates/text-frontend.inc.vcl.erb 
b/modules/varnish/templates/text-frontend.inc.vcl.erb
index 00b129f..7691574 100644
--- a/modules/varnish/templates/text-frontend.inc.vcl.erb
+++ b/modules/varnish/templates/text-frontend.inc.vcl.erb
@@ -34,7 +34,7 @@
set req.http.MobileHost = req.http.Host;
set req.http.MobileHost = regsub(req.http.MobileHost, 
"^(www\.)?(mediawiki|wikisource|wikidata)\.", "m.\2.");
set req.http.MobileHost = regsub(req.http.MobileHost, 
"^(commons|incubator|legalteam|meta|office|outreach|pl|species|strategy|wikimania20[0-9][0-9])\.wikimedia\.",
 "\1.m.wikimedia.");
-   set req.http.MobileHost = regsub(req.http.MobileHost, 
"^((?!commons|meta|nostalgia|quote|quality|sep11|sources|species|textbook|m\b)[-\w]+)\.(wikipedia|wiktionary|wikinews|wikisource|wikiquote|wikibooks|wikiversity|wikivoyage)\.",
 "\1.m.\2.");
+   set req.http.MobileHost = regsub(req.http.MobileHost, 
"^((?!www|commons|meta|nostalgia|quote|quality|sep11|sources|species|textbook|m\b)[-\w]+)\.(wikipedia|wiktionary|wikinews|wikisource|wikiquote|wikibooks|wikiversity|wikivoyage)\.",
 "\1.m.\2.");
 
if (req.http.Host != req.http.MobileHost) {
set req.http.Location = "https://; + 
req.http.MobileHost + req.url;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Replace deprecated usage of ApiBase::dieUsage()

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

Change subject: Replace deprecated usage of ApiBase::dieUsage()
..


Replace deprecated usage of ApiBase::dieUsage()

Linter calls the deprecated ApiBase::dieUsage() function in
ApiRecordLint.php, replacing it with dieWithError().

Bug: T181758
Change-Id: I0cbf784f591b86b206b032fccbc0e32564a3e9e8
---
M i18n/en.json
M i18n/qqq.json
M includes/ApiRecordLint.php
3 files changed, 11 insertions(+), 8 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 54254db..2c0909f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -73,5 +73,8 @@
"apihelp-record-lint-param-revision": "Revision ID that the error was 
found in",
"apihelp-query+linterstats-description": "Get number of lint errors in 
each category",
"apihelp-query+linterstats-summary": "Get number of lint errors in each 
category",
-   "apihelp-query+linterstats-example-1": "Get number of lint errors in 
each category"
+   "apihelp-query+linterstats-example-1": "Get number of lint errors in 
each category",
+   "apierror-linter-invalid-ip": "Your IP address has not been whitelisted 
to report lint errors",
+   "apierror-linter-invalid-data": "Invalid data",
+   "apierror-linter-invalid-title": "Invalid, non-existent, or outdated 
title"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d6898e7..58212e4 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -77,5 +77,8 @@
"apihelp-record-lint-param-revision": 
"{{doc-apihelp-param|record-lint|revision}}",
"apihelp-query+linterstats-description": 
"{{doc-apihelp-description|query+linterstats}}",
"apihelp-query+linterstats-summary": 
"{{doc-apihelp-summary|query+linterstats}}",
-   "apihelp-query+linterstats-example-1": 
"{{doc-apihelp-example|query+linterstats}}"
+   "apihelp-query+linterstats-example-1": 
"{{doc-apihelp-example|query+linterstats}}",
+   "apierror-linter-invalid-ip": "Error message when IP address has not 
been whitelisted to report lint errors",
+   "apierror-linter-invalid-data": "Error message when there is invalid 
data",
+   "apierror-linter-invalid-title": "Error message when there is invalid, 
non-existent, or outdated title"
 }
diff --git a/includes/ApiRecordLint.php b/includes/ApiRecordLint.php
index c009f4f..26f2853 100644
--- a/includes/ApiRecordLint.php
+++ b/includes/ApiRecordLint.php
@@ -40,15 +40,12 @@
array_keys( array_filter( $wgLinterSubmitterWhitelist ) 
)
);
if ( !$ipSet->match( $this->getRequest()->getIP() ) ) {
-   $this->dieUsage(
-   'Your IP address has not been whitelisted to 
report lint errors',
-   'invalid-ip'
-   );
+   $this->dieWithError( 'apierror-linter-invalid-ip', 
'invalid-ip' );
}
$params = $this->extractRequestParams();
$data = FormatJson::decode( $params['data'], true );
if ( !is_array( $data ) ) {
-   $this->dieUsage( 'Invalid data', 'invalid-data' );
+   $this->dieWithError( 'apierror-linter-invalid-data', 
'invalid-data' );
}
 
$errors = [];
@@ -56,7 +53,7 @@
if ( !$title || !$title->getArticleID()
|| $title->getLatestRevID() != $params['revision']
) {
-   $this->dieUsage( 'Invalid, non-existent, or outdated 
title', 'invalid-title' );
+   $this->dieWithError( 'apierror-linter-invalid-title', 
'invalid-title' );
}
$categoryMgr = new CategoryManager();
foreach ( $data as $info ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cbf784f591b86b206b032fccbc0e32564a3e9e8
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Linter
Gerrit-Branch: master
Gerrit-Owner: Haikalizz 
Gerrit-Reviewer: Haikalizz 
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...OAuth[master]: Move links from i18n to software

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

Change subject: Move links from i18n to software
..


Move links from i18n to software

Bug: T59181
Change-Id: I46de236687020d1af64571738cce236c1fdaafa6
---
M api/MWOAuthSessionProvider.php
M backend/MWOAuthDataStore.php
M backend/MWOAuthServer.php
M frontend/specialpages/SpecialMWOAuth.php
M i18n/en.json
M i18n/qqq.json
6 files changed, 97 insertions(+), 27 deletions(-)

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



diff --git a/api/MWOAuthSessionProvider.php b/api/MWOAuthSessionProvider.php
index f5cb4bf..f821e65 100644
--- a/api/MWOAuthSessionProvider.php
+++ b/api/MWOAuthSessionProvider.php
@@ -98,7 +98,13 @@
// There exists a local user
$localUser = MWOAuthUtils::getLocalUserFromCentralId( 
$access->get( 'userId' ) );
if ( !$localUser || !$localUser->isLoggedIn() ) {
-   return $this->makeException( 
'mwoauth-invalid-authorization-invalid-user' );
+   return $this->makeException( 
'mwoauth-invalid-authorization-invalid-user',
+   \Message::rawParam( \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E008',
+   'E008',
+   true
+   ) )
+   );
}
if ( $localUser->isLocked() ||
( $this->config->get( 'BlockDisablesLogin' ) && 
$localUser->isBlocked() )
diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php
index 02fbe00..7e01bdf 100644
--- a/backend/MWOAuthDataStore.php
+++ b/backend/MWOAuthDataStore.php
@@ -66,7 +66,13 @@
throw new MWOAuthException( 
'mwoauthdatastore-request-token-already-used' );
}
if ( $token === null || !( $returnToken instanceof 
MWOAuthToken ) ) {
-   throw new MWOAuthException( 
'mwoauthdatastore-request-token-not-found' );
+   throw new MWOAuthException( 
'mwoauthdatastore-request-token-not-found', [
+   \Message::rawParam( 
\Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E004',
+   'E004',
+   true
+   ) )
+   ] );
}
} elseif ( $token_type === 'access' ) {
$cmra = MWOAuthConsumerAcceptance::newFromToken( 
$this->centralSlave, $token );
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 4905e29..1d60c33 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -277,11 +277,23 @@
 
// Check that user and consumer are in good standing
if ( $mwUser->isLocked() || $wgBlockDisablesLogin && 
$mwUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauthserver-insufficient-rights' );
+   throw new MWOAuthException( 
'mwoauthserver-insufficient-rights', [
+   \Message::rawParam( \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E007',
+   'E007',
+   true
+   ) )
+   ] );
}
$consumer = $this->data_store->lookup_consumer( $consumerKey );
if ( !$consumer || $consumer->get( 'deleted' ) ) {
-   throw new MWOAuthException( 
'mwoauthserver-bad-consumer-key' );
+   throw new MWOAuthException( 
'mwoauthserver-bad-consumer-key', [
+   \Message::rawParam( \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E006',
+   'E006',
+   true
+   ) )
+   ] );
} elseif ( !$consumer->isUsableBy( $mwUser ) ) {
$owner = MWOAuthUtils::getCentralUserNameFromId(
$consumer->get( 'userId' ),
@@ -289,7 +301,13 @@
);
throw new MWOAuthException(
'mwoauthserver-bad-consumer',
-   [ $consumer->get( 'name' ), 
MWOAuthUtils::getCentralUserTalk( $owner ) ]
+   [ 

[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: RepoGroup::findFile() can and will return false

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

Change subject: RepoGroup::findFile() can and will return false
..


RepoGroup::findFile() can and will return false

Bug: T181944
Change-Id: I978ed2f9f3005210f6713a7f3ecde1fe0501a5ff
---
M includes/page/DatabaseIndexForPageLookup.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/page/DatabaseIndexForPageLookup.php 
b/includes/page/DatabaseIndexForPageLookup.php
index e71a3c2..3e0125b 100644
--- a/includes/page/DatabaseIndexForPageLookup.php
+++ b/includes/page/DatabaseIndexForPageLookup.php
@@ -75,7 +75,7 @@
if ( $imageTitle !== null ) {
$image = $this->repoGroup->findFile( 
$imageTitle );
// if it is multipage, we use the page order of 
the file
-   if ( $image->exists() && $image->isMultipage() 
) {
+   if ( $image && $image->exists() && 
$image->isMultipage() ) {
return Title::makeTitle(
$this->indexNamespaceId, 
$image->getTitle()->getText()
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I978ed2f9f3005210f6713a7f3ecde1fe0501a5ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Tpt 
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...AbuseFilter[master]: Format filter IDs as numbers

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

Change subject: Format filter IDs as numbers
..


Format filter IDs as numbers

Follows up I2bd833c35.

Change-Id: I3f2241fe791e9918750ef06805f9c4e5d52ee3b4
---
M includes/Views/AbuseFilterViewHistory.php
M includes/Views/AbuseFilterViewRevert.php
2 files changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/includes/Views/AbuseFilterViewHistory.php 
b/includes/Views/AbuseFilterViewHistory.php
index 8b9abbb..16b8756 100644
--- a/includes/Views/AbuseFilterViewHistory.php
+++ b/includes/Views/AbuseFilterViewHistory.php
@@ -11,7 +11,7 @@
$filter = $this->mFilter;
 
if ( $filter ) {
-   $out->setPageTitle( $this->msg( 'abusefilter-history', 
$filter ) );
+   $out->setPageTitle( $this->msg( 'abusefilter-history' 
)->numParams( $filter ) );
} else {
$out->setPageTitle( $this->msg( 
'abusefilter-filter-log' ) );
}
diff --git a/includes/Views/AbuseFilterViewRevert.php 
b/includes/Views/AbuseFilterViewRevert.php
index eccddea..f8c07bd 100644
--- a/includes/Views/AbuseFilterViewRevert.php
+++ b/includes/Views/AbuseFilterViewRevert.php
@@ -20,8 +20,8 @@
return;
}
 
-   $out->addWikiMsg( 'abusefilter-revert-intro', $filter );
-   $out->setPageTitle( $this->msg( 'abusefilter-revert-title', 
$filter ) );
+   $out->addWikiMsg( 'abusefilter-revert-intro', 
Message::numParam( $filter ) );
+   $out->setPageTitle( $this->msg( 'abusefilter-revert-title' 
)->numParams( $filter ) );
 
// First, the search form.
$searchFields = [];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f2241fe791e9918750ef06805f9c4e5d52ee3b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: Huji 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Legoktm 
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/core[wmf/1.31.0-wmf.10]: Revert "Special:Preferences: Use OOjs UI" and follow-ups

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

Change subject: Revert "Special:Preferences: Use OOjs UI" and follow-ups
..

Revert "Special:Preferences: Use OOjs UI" and follow-ups

The number of issues with the new interface is unacceptable and we
will not be able to fix them reasonably quickly. See subtasks of
T180538 for the list of issues, raised both by the Wikimedia community
and by WMF employees.

I should have pushed back harder against the merging of this half-baked
change with the promise that we'll fix it later. I convinced myself
that the regressions were not so noticeable and that the issues that
were pointed out will in fact be fixed by someone. Predictably,
however, regressions were bad and the only person fixing the issues
was me.

I am not going to work nights to make this page decent again within a
reasonable timeframe; I'm not sure if I'd even be able to since many
issues are problems with the design rather than the implementation. No
one else seems to be working on improving it, therefore I am reverting
the change.

On the bright side, this work has resulted in a number of improvements
to HTMLForm and Preferences code, which are not being reverted here:
.

If anyone reattempts this, I recommend gating the new interface behind
a configuration variable and URL parameter, like we did with
$wgOOUIEditPage in the past, and testing thoroughly in production
before enabling it for everyone.

* Revert "Special:Preferences: Use OOjs UI"
  This reverts commit 486e566cfef612de6773df435a74d5fc37e27174.
* Revert "Preferences: Show preview of edit fonts in edit font selector"
  This reverts commit 6634ff729dc7f6d0f541639dbdf3c4d9f786ddf6.
* Revert "Follow-Up Iae63b6994: Add missing editfont dependency"
  This reverts commit ce42fdf151c39f91cf4077673219fa6228a54d7f.
* Revert "Preferences: Improve visual appearance by “unboxing” sections"
  This reverts commit c9415bb0059f4dae4abc5e39a8af844328333120.
* Revert "Remove box-shadow from preference panels for ooui-apex"
  This reverts commit a934b82ca27971e8f0553a7ab7c8ee30fccf3283.
* Revert "Preferences: Don't show the watchlist token; just link to ResetTokens"
  This reverts commit e8c9102fc7b66460c33f643b0dea7190cb89ac83.
* Revert "mw.special.preferences: Make the "Basic information" section more 
compact"
  This reverts commit d48b7260f30c1ec57046a1f8e4c82057aed45e5f.
* Revert "mw.special.preferences: Widen the dropdown of the "Time zone" field"
  This reverts commit afd5f1417efdd463d86186257c4ec77dd4a442ce.

Bug: T117781
Bug: T180538
Change-Id: I44b5daea1828f71881b5bd35218f5ecb7ab7f36e
(cherry picked from commit 808e45d13d400256d36cfcd95e79a567197d9a8b)
---
M includes/Preferences.php
M includes/specials/SpecialPasswordReset.php
M includes/specials/SpecialPreferences.php
M includes/specials/SpecialResetTokens.php
M includes/specials/forms/PreferencesForm.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
M resources/src/mediawiki.legacy/oldshared.css
M resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js
D resources/src/mediawiki.special/mediawiki.special.preferences.editfont.js
M resources/src/mediawiki.special/mediawiki.special.preferences.styles.css
M resources/src/mediawiki.special/mediawiki.special.preferences.tabs.js
M resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js
M tests/selenium/pageobjects/preferences.page.js
15 files changed, 216 insertions(+), 295 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/394874/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index 924e3ad..2dd3e2d 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -75,11 +75,6 @@
 * @return array|null
 */
static function getPreferences( $user, IContextSource $context ) {
-   OutputPage::setupOOUI(
-   strtolower( $context->getSkin()->getSkinName() ),
-   $context->getLanguage()->getDir()
-   );
-
$defaultPreferences = [];
 
self::profilePreferences( $user, $context, $defaultPreferences 
);
@@ -317,17 +312,14 @@
if ( $canEditPrivateInfo && 
$authManager->allowsAuthenticationDataChange(
new PasswordAuthenticationRequest(), false )->isGood()
) {
-   $link = new OOUI\ButtonWidget( [
-   'href' => SpecialPage::getTitleFor( 
'ChangePassword' )->getLinkURL( [
-   'returnto' => SpecialPage::getTitleFor( 
'Preferences' )->getPrefixedText()
-   ] ),
-   'label' => $context->msg( 'prefs-resetpass' 
)->text(),
-   ] );
+   $link 

[MediaWiki-commits] [Gerrit] integration/config[master]: Add GCI 2017 student: Albert221 <w.albert...@gmail.com> to w...

2017-12-03 Thread Zppix (Code Review)
Zppix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394872 )

Change subject: Add GCI 2017 student: Albert221  to 
whitelist
..

Add GCI 2017 student: Albert221  to whitelist

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


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/72/394872/2

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index f71ad36..d351000 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -253,6 +253,7 @@
 | vikasyaligar\.it@gmail\.com
 | vinithacse@gmail\.com
 | victorbarbu08@gmail\.com
+| w\.albert221@gmail\.com # Albert221
 | w@mzmcbride\.com
 | washuu@gmail\.com
 | wctaiwan@gmail\.com

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1e4144953c0e475c8036e303d09d555033b4d9b
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Zppix 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Let the browser handle click events with a modifier key on e...

2017-12-03 Thread Maxlath (Code Review)
Maxlath has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394871 )

Change subject: Let the browser handle click events with a modifier key on 
examples links so that the links can be open in a new tab or window
..

Let the browser handle click events with a modifier key on examples links
so that the links can be open in a new tab or window

Bug: T181885
Change-Id: If28748bd75424b030d84250d329375c65f1056be
---
M wikibase/queryService/ui/QueryExampleDialog.js
1 file changed, 13 insertions(+), 6 deletions(-)


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

diff --git a/wikibase/queryService/ui/QueryExampleDialog.js 
b/wikibase/queryService/ui/QueryExampleDialog.js
index 2d1754e..6181360 100644
--- a/wikibase/queryService/ui/QueryExampleDialog.js
+++ b/wikibase/queryService/ui/QueryExampleDialog.js
@@ -253,12 +253,19 @@
 */
SELF.prototype._addExample = function( title, query, href, tags, 
category ) {
var self = this,
-   $link = $( '' 
).text( title ).attr( 'href', '#' )
-   .click( function() {
-   self._callback( query, title );
-   self._track( 'select' );
-   self._track( 'select.category.' 
+ category.replace( /[^a-zA-Z0-9]/g, '_' ) );
-   } ),
+ href = '#' + encodeURIComponent( query );
+
+   var $link = $( '' ).text( title ).attr( 
'href', href )
+   .click( function(e) {
+   // if one of those keys is presssed, 
the link is opened in a new tab or window
+   // instead of being displayed in the 
current tab, so there is nothing more to do here
+   if (e.ctrlKey || e.metaKey || 
e.shiftKey) return
+
+   $( '#QueryExamples' ).modal('hide');
+   self._callback( query, title );
+   self._track( 'select' );
+   self._track( 'select.category.' + 
category.replace( /[^a-zA-Z0-9]/g, '_' ) );
+   } ),
$edit = $( '' )
.attr( { title: 'Edit', href: href, target: 
'_blank' } )
.append( '' ).addClass( 'glyphicon 
glyphicon-pencil' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If28748bd75424b030d84250d329375c65f1056be
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Maxlath 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Show protection log on every use of moveddeleted-notice

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

Change subject: Show protection log on every use of moveddeleted-notice
..


Show protection log on every use of moveddeleted-notice

As a follow-up to T171338, the other uses of the message were ignored.
This change adds the protection log to these uses; that is, history and
image pages.

Bug: T174889
Change-Id: Ib9f22d6e06c372c4a32e77a08c846d768853bc21
---
M includes/actions/HistoryAction.php
M includes/page/ImagePage.php
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  GeoffreyT2000: Looks good to me, but someone else must approve
  Brian Wolff: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/actions/HistoryAction.php 
b/includes/actions/HistoryAction.php
index a9e3d6a..0e964bf 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -154,7 +154,7 @@
# show deletion/move log if there is an entry
LogEventsList::showLogExtract(
$out,
-   [ 'delete', 'move' ],
+   [ 'delete', 'move', 'protect' ],
$this->getTitle(),
'',
[ 'lim' => 10,
diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php
index 76ff41b..67f9e09 100644
--- a/includes/page/ImagePage.php
+++ b/includes/page/ImagePage.php
@@ -589,7 +589,7 @@
# Show deletion log to be consistent with 
normal articles
LogEventsList::showLogExtract(
$out,
-   [ 'delete', 'move' ],
+   [ 'delete', 'move', 'protect' ],
$this->getTitle()->getPrefixedText(),
'',
[ 'lim' => 10,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9f22d6e06c372c4a32e77a08c846d768853bc21
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ebe123 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Brian Wolff 
Gerrit-Reviewer: GeoffreyT2000 
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...SecurityCheckPlugin[master]: Add ARRAY_OK flag for functions that are safe with arrays

2017-12-03 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394868 )

Change subject: Add ARRAY_OK flag for functions that are safe with arrays
..


Add ARRAY_OK flag for functions that are safe with arrays

Mostly a special case for wfShellExec()

Change-Id: I23a1cca96505d91039bddb5ea7ed458da891747b
---
M src/MediaWikiSecurityCheckPlugin.php
M src/SecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
A tests/integration/arrayok/expectedResults.txt
A tests/integration/arrayok/test.php
5 files changed, 117 insertions(+), 5 deletions(-)



diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index adf1d07..d17ebfa 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -154,11 +154,11 @@
],
// FIXME Doesn't handle array args right.
'\wfShellExec' => [
-   SecurityCheckPlugin::SHELL_EXEC_TAINT,
+   self::SHELL_EXEC_TAINT | self::ARRAY_OK,
'overall' => self::YES_TAINT
],
'\wfShellExecWithStderr' => [
-   SecurityCheckPlugin::SHELL_EXEC_TAINT,
+   self::SHELL_EXEC_TAINT | self::ARRAY_OK,
'overall' => self::YES_TAINT
],
'\wfEscapeShellArg' => [
@@ -173,6 +173,34 @@
self::YES_TAINT & ~self::SHELL_TAINT,
'overall' => self::NO_TAINT,
],
+   'MediaWiki\Shell\Shell::escape' => [
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   'MediaWiki\Shell\Command::unsafeParams' => [
+   self::SHELL_EXEC_TAINT,
+   'overall' => self::NO_TAINT
+   ],
+   'MediaWiki\Shell\Result::getStdout' => [
+   // This is a bit unclear. Most of the time
+   // you should probably be escaping the results
+   // of a shell command, but not all the time.
+   'overall' => self::YES_TAINT
+   ],
+   'MediaWiki\Shell\Result::getStderr' => [
+   // This is a bit unclear. Most of the time
+   // you should probably be escaping the results
+   // of a shell command, but not all the time.
+   'overall' => self::YES_TAINT
+   ],
'\Html::rawElement' => [
SecurityCheckPlugin::HTML_TAINT,
SecurityCheckPlugin::NO_TAINT,
diff --git a/src/SecurityCheckPlugin.php b/src/SecurityCheckPlugin.php
index 75bc713..84e1a33 100644
--- a/src/SecurityCheckPlugin.php
+++ b/src/SecurityCheckPlugin.php
@@ -48,10 +48,28 @@
// category (For the moment, this is stuff like `require $foo`)
const MISC_TAINT = 32768;
const MISC_EXEC_TAINT = 65536;
+   // Special purpose for supporting MediaWiki's IDatabase::select
+   // and friends. Like SQL_TAINT, but only applies to the numeric
+   // keys of an array. Note: These are not included in 
YES_TAINT/EXEC_TAINT.
+   // e.g. given $f = [ $_GET['foo'] ]; $f would have the flag, but
+   // $g = $_GET['foo']; or $h = [ 's' => $_GET['foo'] ] would not.
+   // The associative keys also have this flag if they are tainted.
+   // It is also assumed anything with this flag will also have
+   // the SQL_TAINT flag set.
+   const SQL_NUMKEY_TAINT = 131072;
+   const SQL_NUMKEY_EXEC_TAINT = 262144;
 
+   // Special purpose flags(Starting at 2^28)
+   // Cancel's out all EXEC flags on a function arg if arg is array.
+   const ARRAY_OK = 268435456;
+
+   // Combination flags
const YES_TAINT = 43688;
const EXEC_TAINT = 87376;
const YES_EXEC_TAINT = 131064;
+   // ALL_TAINT == YES_TAINT 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Make unit tests for extension.json always work

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

Change subject: Make unit tests for extension.json always work
..

Make unit tests for extension.json always work

previously it did not work from composer due to different
base directories.

Change-Id: Ia7755e7f9e30e284caf120a53adcc474c3a77c71
---
M tests/runtests.sh
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/67/394867/1

diff --git a/tests/runtests.sh b/tests/runtests.sh
index eea31ea..806ceb0 100755
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -24,7 +24,7 @@
 for i in $testList
 do
echo "Running test $i"
-   SECURITY_CHECK_EXT_PATH=`dirname "$0"`"/integration/$i/"
+   SECURITY_CHECK_EXT_PATH=`pwd`"/integration/$i/"
export SECURITY_CHECK_EXT_PATH
totalTests=$((totalTests+1))
$php ../vendor/etsy/phan/phan \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7755e7f9e30e284caf120a53adcc474c3a77c71
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/phan/SecurityCheckPlugin
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Make error messages from hooks be in extension instead of core

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

Change subject: Make error messages from hooks be in extension instead of core
..

Make error messages from hooks be in extension instead of core

Change-Id: Ice88ef3854eeb2e7266439e4c1552e003bad6c6f
---
M src/MWVisitor.php
M src/TaintednessBaseVisitor.php
M tests/integration/json/expectedResults.txt
3 files changed, 32 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/66/394866/1

diff --git a/src/MWVisitor.php b/src/MWVisitor.php
index ee82597..925d62f 100644
--- a/src/MWVisitor.php
+++ b/src/MWVisitor.php
@@ -130,11 +130,21 @@
}
$taint = $this->getTaintOfFunction( $func );
// $this->debug( __METHOD__, "Dispatching $hookName to 
$subscriber" );
-   // FIXME There is a slight flaw here, in that this will 
often mark
-   // the offending line as being the Hooks::run call, 
which means
-   // people only looking at the issues in an extension 
would
-   // not see it.
+   // This is hacky, but try to ensure that the associated 
line
+   // number for any issues is in the extension, and not 
the
+   // line where the Hooks::register() is in MW core.
+   // FIXME: In the case of reference parameters, this is
+   // still reporting things being in MW core instead of 
extension.
+   $oldContext = $this->overrideContext;
+   $fContext = $func->getContext();
+   $newContext = clone $this->context;
+   $newContext = $newContext->withFile( 
$fContext->getFile() )
+   ->withLineNumberStart( 
$fContext->getLineNumberStart() );
+   $this->overrideContext = $newContext;
+
$this->handleMethodCall( $func, $subscriber, $taint, 
$args );
+
+   $this->overrideContext = $oldContext;
}
}
 
diff --git a/src/TaintednessBaseVisitor.php b/src/TaintednessBaseVisitor.php
index 6fceec7..ffdaf46 100644
--- a/src/TaintednessBaseVisitor.php
+++ b/src/TaintednessBaseVisitor.php
@@ -35,6 +35,9 @@
/** @var null|string|bool|resource filehandle to output debug messages 
*/
private $debugOutput = null;
 
+   /** @var Context Override the file/line number to emit issues */
+   protected $overrideContext = null;
+
/**
 * @param CodeBase $code_base
 * @param Context $context
@@ -1315,6 +1318,11 @@
/**
 * Emit an issue using the appropriate issue type
 *
+* If $this->overrideContext is set, it will use that for the
+* file/line number to report. This is meant as a hack, so that
+* in MW we can force hook related issues to be in the extension
+* instead of where the hook is called from in MW core.
+*
 * @param int $lhsTaint Taint of left hand side (or equivalent)
 * @param int $rhsTaint Taint of right hand side (or equivalent)
 * @param string $msg Issue description
@@ -1335,6 +1343,7 @@
$adjustLHS,
$rhsTaint,
$msg,
+   // FIXME should this be $this->overrideContext ?
$this->context,
$this->code_base
)
@@ -1390,9 +1399,16 @@
}
}
 
+   $context = $this->context;
+   if ( $this->overrideContext ) {
+   // If we are overriding the file/line number,
+   // report the original line number as well.
+   $msg .= " (Originally at: $this->context)";
+   $context = $this->overrideContext;
+   }
$this->plugin->emitIssue(
$this->code_base,
-   $this->context,
+   $context,
$issueType,
$msg,
$severity
diff --git a/tests/integration/json/expectedResults.txt 
b/tests/integration/json/expectedResults.txt
index b2edd5b..f48a8d4 100644
--- a/tests/integration/json/expectedResults.txt
+++ b/tests/integration/json/expectedResults.txt
@@ -1,2 +1,2 @@
-integration/json/test.php:29 SecurityCheck-XSS Calling method \wfRegister() in 
\doStuff that outputs using tainted argument $[arg #2]. (Caused by: 
integration/json/test.php +10; integration/json/test.php +11)
+integration/json/test.php:9 SecurityCheck-XSS Calling method \wfRegister() in 
\doStuff 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Avoid duplication in output

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

Change subject: Avoid duplication in output
..

Avoid duplication in output

This also fixes the json test

Change-Id: Iaaed1b0984552d1c7d6b5551cdbb7af3d37ca961
---
M src/TaintednessBaseVisitor.php
M tests/integration/callbackhook/expectedResults.txt
M tests/integration/callwithevil/expectedResults.txt
M tests/integration/callwithevil3/expectedResults.txt
M tests/integration/indirectecho/expectedResults.txt
M tests/integration/json/expectedResults.txt
M tests/integration/multi/expectedResults.txt
M tests/integration/registerhook/Hooks.php
M tests/integration/registerhook/expectedResults.txt
M tests/integration/registerhook/test.php
M tests/integration/stripitem/expectedResults.txt
M tests/integration/taghook/expectedResults.txt
12 files changed, 36 insertions(+), 26 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/65/394865/1

diff --git a/src/TaintednessBaseVisitor.php b/src/TaintednessBaseVisitor.php
index 9d4def9..6fceec7 100644
--- a/src/TaintednessBaseVisitor.php
+++ b/src/TaintednessBaseVisitor.php
@@ -101,7 +101,11 @@
if ( !property_exists( $func, 'taintedOriginalError' ) 
) {
$func->taintedOriginalError = '';
}
-   $func->taintedOriginalError .= $this->dbgInfo() . ';';
+   $newError = $this->dbgInfo() . ';';
+   if ( strpos( $func->taintedOriginalError, $newError ) 
=== false ) {
+   // Only add to error if we haven't added this 
line before
+   $func->taintedOriginalError .= $newError;
+   }
 
if ( strlen( $func->taintedOriginalError ) > 254 ) {
$this->debug( __METHOD__, "Too long original 
error! for $func" );
@@ -126,7 +130,10 @@
if ( !property_exists( $left, 'taintedOriginalError' ) ) {
$left->taintedOriginalError = '';
}
-   $left->taintedOriginalError .= $right->taintedOriginalError ?? 
'';
+   $rightError = $right->taintedOriginalError ?? '';
+   if ( strpos( $left->taintedOriginalError, $rightError ?: "\1\2" 
) === false ) {
+   $left->taintedOriginalError .= $rightError;
+   }
 
if ( strlen( $left->taintedOriginalError ) > 254 ) {
$this->debug( __METHOD__, "Too long original error! for 
$left" );
@@ -190,8 +197,12 @@
$variableObjLinks = 
$variableObj->taintedMethodLinks ?? new Set;
$variableObj->taintedMethodLinks = 
$methodLinks->union( $variableObjLinks );
$parentVarObj->taintedMethodLinks =& 
$variableObj->taintedMethodLinks;
-   $combinedOrig = ( 
$variableObj->taintedOriginalError ?? '' )
-   . ( 
$parentVarObj->taintedOriginalError ?? '' );
+   $varError = 
$variableObj->taintedOriginalError ?? '';
+   $combinedOrig = 
$parentVarObj->taintedOriginalError ?? '';
+   if ( strpos( $combinedOrig, $varError 
?: "\1\2" ) === false ) {
+   $combinedOrig .= $varError;
+   }
+
if ( strlen( $combinedOrig ) > 254 ) {
$this->debug( __METHOD__, "Too 
long original error! $variableObj" );
$combinedOrig = substr( 
$combinedOrig, 0, 250 ) . '...';
@@ -226,7 +237,10 @@
if ( !property_exists( $variableObj, 
'taintedOriginalError' ) ) {
$variableObj->taintedOriginalError = '';
}
-   $variableObj->taintedOriginalError .= $this->dbgInfo() 
. ';';
+   $newError = $this->dbgInfo() . ';';
+   if ( strpos( $variableObj->taintedOriginalError, 
$newError ) === false ) {
+   $variableObj->taintedOriginalError .= $newError;
+   }
 
if ( strlen( $variableObj->taintedOriginalError ) > 254 
) {
$this->debug( __METHOD__, "Too long original 
error! $variableObj" );
diff --git a/tests/integration/callbackhook/expectedResults.txt 
b/tests/integration/callbackhook/expectedResults.txt
index 7e5d8e0..063e750 100644
--- a/tests/integration/callbackhook/expectedResults.txt
+++ 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Fix bug where non-local variables are treated like local

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

Change subject: Fix bug where non-local variables are treated like local
..

Fix bug where non-local variables are treated like local

Previously for globals and $this->classProps if someone
assigned to them, the taint was totally overriden. This is
often wrong, as they can be modified in other functions/methods.

Change-Id: Icc34010ed39c58e9d6bf2007f63257e4072a5592
---
M .phpcs.xml
M src/TaintednessVisitor.php
2 files changed, 12 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/69/394869/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 309c64f..c9196a4 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,6 +6,7 @@



+   

.

@@ -43,4 +44,7 @@

./tests

+   
+   ./tests
+   

diff --git a/src/TaintednessVisitor.php b/src/TaintednessVisitor.php
index e7a5221..d4b588d 100644
--- a/src/TaintednessVisitor.php
+++ b/src/TaintednessVisitor.php
@@ -294,11 +294,15 @@
// echo __METHOD__ . $this->dbgInfo() . ' ';
// Debug::printNode($node);
 
-   // FIXME This is wrong for non-local vars (including class 
props)
-   // Depending on order of methods in the class file.
+   // Note: If there is a local variable that is a reference
+   // to another non-local variable, this will probably incorrectly
+   // override the taint (Pass by reference variables are handled
+   // specially and should be ok).
 
// Make sure $foo[2] = 0; doesn't kill taint of $foo generally.
-   $override = $node->children['var']->kind !== \ast\AST_DIM;
+   // Ditto for $this->bar, or props in general just in case.
+   $override = $node->children['var']->kind !== \ast\AST_DIM
+   && $node->children['var']->kind !== \ast\AST_PROP;
try {
$variableObjs = $this->getPhanObjsForNode( 
$node->children['var'] );
} catch ( Exception $e ) {
@@ -671,7 +675,7 @@
}
 
$localVar->taintedness =& $globalVar->taintedness;
-   $localVar->taintednessHasExtendedScope = true;
+   $localVar->taintednessHasOuterScope = true;
}
return SecurityCheckPlugin::INAPLICABLE_TAINT;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc34010ed39c58e9d6bf2007f63257e4072a5592
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/phan/SecurityCheckPlugin
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Fix bug where non-local variables are treated like local

2017-12-03 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394869 )

Change subject: Fix bug where non-local variables are treated like local
..


Fix bug where non-local variables are treated like local

Previously for globals and $this->classProps if someone
assigned to them, the taint was totally overriden. This is
often wrong, as they can be modified in other functions/methods.

Change-Id: Icc34010ed39c58e9d6bf2007f63257e4072a5592
---
M .phpcs.xml
M src/TaintednessVisitor.php
2 files changed, 12 insertions(+), 4 deletions(-)



diff --git a/.phpcs.xml b/.phpcs.xml
index 309c64f..c9196a4 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,6 +6,7 @@



+   

.

@@ -43,4 +44,7 @@

./tests

+   
+   ./tests
+   

diff --git a/src/TaintednessVisitor.php b/src/TaintednessVisitor.php
index e7a5221..d4b588d 100644
--- a/src/TaintednessVisitor.php
+++ b/src/TaintednessVisitor.php
@@ -294,11 +294,15 @@
// echo __METHOD__ . $this->dbgInfo() . ' ';
// Debug::printNode($node);
 
-   // FIXME This is wrong for non-local vars (including class 
props)
-   // Depending on order of methods in the class file.
+   // Note: If there is a local variable that is a reference
+   // to another non-local variable, this will probably incorrectly
+   // override the taint (Pass by reference variables are handled
+   // specially and should be ok).
 
// Make sure $foo[2] = 0; doesn't kill taint of $foo generally.
-   $override = $node->children['var']->kind !== \ast\AST_DIM;
+   // Ditto for $this->bar, or props in general just in case.
+   $override = $node->children['var']->kind !== \ast\AST_DIM
+   && $node->children['var']->kind !== \ast\AST_PROP;
try {
$variableObjs = $this->getPhanObjsForNode( 
$node->children['var'] );
} catch ( Exception $e ) {
@@ -671,7 +675,7 @@
}
 
$localVar->taintedness =& $globalVar->taintedness;
-   $localVar->taintednessHasExtendedScope = true;
+   $localVar->taintednessHasOuterScope = true;
}
return SecurityCheckPlugin::INAPLICABLE_TAINT;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc34010ed39c58e9d6bf2007f63257e4072a5592
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/phan/SecurityCheckPlugin
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Add support for IDatabase::select style arguments

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

Change subject: Add support for IDatabase::select style arguments
..

Add support for IDatabase::select style arguments

Change-Id: Id52f45e3dfc21a4c522902a8d4d92e61b40b7202
---
M src/MediaWikiSecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
M src/TaintednessVisitor.php
A tests/integration/arraynumkey/db.php
A tests/integration/arraynumkey/expectedResults.txt
A tests/integration/arraynumkey/test.php
A tests/integration/multiassign/expectedResults.txt
A tests/integration/multiassign/test.php
A tests/integration/multiassign/test2.php
9 files changed, 289 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/70/394870/1

diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index d17ebfa..2c25a07 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -76,6 +76,42 @@
// What should DB results be considered?
'overall' => self::YES_TAINT
],
+   '\Wikimedia\Rdbms\IDatabase::select' => [
+   self::SQL_EXEC_TAINT,
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // the function name doesn't seem to be escaped
+   self::SQL_EXEC_TAINT,
+   // I'm not even sure for options
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\Database::select' => [
+   self::SQL_EXEC_TAINT,
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // the function name doesn't seem to be escaped
+   self::SQL_EXEC_TAINT,
+   // I'm not even sure for options
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\DBConnRef::select' => [
+   self::SQL_EXEC_TAINT,
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // the function name doesn't seem to be escaped
+   self::SQL_EXEC_TAINT,
+   // I'm not even sure for options
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
'\Wikimedia\Rdbms\Database::addIdentifierQuotes' => [
self::YES_TAINT & ~self::SQL_TAINT,
'overall' => self::NO_TAINT,
diff --git a/src/TaintednessBaseVisitor.php b/src/TaintednessBaseVisitor.php
index 89a47b1..4a01337 100644
--- a/src/TaintednessBaseVisitor.php
+++ b/src/TaintednessBaseVisitor.php
@@ -12,6 +12,7 @@
 use Phan\Language\UnionType;
 use Phan\Language\Type\CallableType;
 use Phan\Language\Type\MixedType;
+use Phan\Language\Type\IntType;
 use Phan\Language\Type\StringType;
 use Phan\Language\FQSEN\FullyQualifiedFunctionLikeName;
 use Phan\Language\FQSEN\FullyQualifiedFunctionName;
@@ -1359,7 +1360,12 @@
) {
$issueType = 'SecurityCheck-XSS';
} elseif (
-   $combinedTaint === SecurityCheckPlugin::SQL_TAINT
+   $combinedTaint === SecurityCheckPlugin::SQL_TAINT ||
+   $combinedTaint === 
SecurityCheckPlugin::SQL_NUMKEY_TAINT ||
+   $combinedTaint === (
+   SecurityCheckPlugin::SQL_TAINT |
+   SecurityCheckPlugin::SQL_NUMKEY_TAINT
+   )
) {
$issueType = 'SecurityCheck-SQLInjection';
$severity = Issue::SEVERITY_CRITICAL;
@@ -1459,6 +1465,16 @@
$curArgTaintedness = 
SecurityCheckPlugin::NO_TAINT;
$effectiveArgTaintedness = 
SecurityCheckPlugin::NO_TAINT;
 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Add ARRAY_OK flag for functions that are safe with arrays

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

Change subject: Add ARRAY_OK flag for functions that are safe with arrays
..

Add ARRAY_OK flag for functions that are safe with arrays

Mostly a special case for wfShellExec()

Change-Id: I23a1cca96505d91039bddb5ea7ed458da891747b
---
M src/MediaWikiSecurityCheckPlugin.php
M src/SecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
A tests/integration/arrayok/expectedResults.txt
A tests/integration/arrayok/test.php
5 files changed, 117 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/68/394868/1

diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index adf1d07..d17ebfa 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -154,11 +154,11 @@
],
// FIXME Doesn't handle array args right.
'\wfShellExec' => [
-   SecurityCheckPlugin::SHELL_EXEC_TAINT,
+   self::SHELL_EXEC_TAINT | self::ARRAY_OK,
'overall' => self::YES_TAINT
],
'\wfShellExecWithStderr' => [
-   SecurityCheckPlugin::SHELL_EXEC_TAINT,
+   self::SHELL_EXEC_TAINT | self::ARRAY_OK,
'overall' => self::YES_TAINT
],
'\wfEscapeShellArg' => [
@@ -173,6 +173,34 @@
self::YES_TAINT & ~self::SHELL_TAINT,
'overall' => self::NO_TAINT,
],
+   'MediaWiki\Shell\Shell::escape' => [
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   self::YES_TAINT & ~self::SHELL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   'MediaWiki\Shell\Command::unsafeParams' => [
+   self::SHELL_EXEC_TAINT,
+   'overall' => self::NO_TAINT
+   ],
+   'MediaWiki\Shell\Result::getStdout' => [
+   // This is a bit unclear. Most of the time
+   // you should probably be escaping the results
+   // of a shell command, but not all the time.
+   'overall' => self::YES_TAINT
+   ],
+   'MediaWiki\Shell\Result::getStderr' => [
+   // This is a bit unclear. Most of the time
+   // you should probably be escaping the results
+   // of a shell command, but not all the time.
+   'overall' => self::YES_TAINT
+   ],
'\Html::rawElement' => [
SecurityCheckPlugin::HTML_TAINT,
SecurityCheckPlugin::NO_TAINT,
diff --git a/src/SecurityCheckPlugin.php b/src/SecurityCheckPlugin.php
index 75bc713..84e1a33 100644
--- a/src/SecurityCheckPlugin.php
+++ b/src/SecurityCheckPlugin.php
@@ -48,10 +48,28 @@
// category (For the moment, this is stuff like `require $foo`)
const MISC_TAINT = 32768;
const MISC_EXEC_TAINT = 65536;
+   // Special purpose for supporting MediaWiki's IDatabase::select
+   // and friends. Like SQL_TAINT, but only applies to the numeric
+   // keys of an array. Note: These are not included in 
YES_TAINT/EXEC_TAINT.
+   // e.g. given $f = [ $_GET['foo'] ]; $f would have the flag, but
+   // $g = $_GET['foo']; or $h = [ 's' => $_GET['foo'] ] would not.
+   // The associative keys also have this flag if they are tainted.
+   // It is also assumed anything with this flag will also have
+   // the SQL_TAINT flag set.
+   const SQL_NUMKEY_TAINT = 131072;
+   const SQL_NUMKEY_EXEC_TAINT = 262144;
 
+   // Special purpose flags(Starting at 2^28)
+   // Cancel's out all EXEC flags on a function arg if arg is array.
+   const ARRAY_OK = 268435456;
+
+   // Combination flags
const YES_TAINT = 43688;
   

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Make unit tests for extension.json always work

2017-12-03 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394867 )

Change subject: Make unit tests for extension.json always work
..


Make unit tests for extension.json always work

previously it did not work from composer due to different
base directories.

Change-Id: Ia7755e7f9e30e284caf120a53adcc474c3a77c71
---
M tests/runtests.sh
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/tests/runtests.sh b/tests/runtests.sh
index eea31ea..806ceb0 100755
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -24,7 +24,7 @@
 for i in $testList
 do
echo "Running test $i"
-   SECURITY_CHECK_EXT_PATH=`dirname "$0"`"/integration/$i/"
+   SECURITY_CHECK_EXT_PATH=`pwd`"/integration/$i/"
export SECURITY_CHECK_EXT_PATH
totalTests=$((totalTests+1))
$php ../vendor/etsy/phan/phan \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7755e7f9e30e284caf120a53adcc474c3a77c71
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/phan/SecurityCheckPlugin
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Add support for IDatabase::select style arguments

2017-12-03 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394870 )

Change subject: Add support for IDatabase::select style arguments
..


Add support for IDatabase::select style arguments

Change-Id: Id52f45e3dfc21a4c522902a8d4d92e61b40b7202
---
M src/MediaWikiSecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
M src/TaintednessVisitor.php
A tests/integration/arraynumkey/db.php
A tests/integration/arraynumkey/expectedResults.txt
A tests/integration/arraynumkey/test.php
A tests/integration/multiassign/expectedResults.txt
A tests/integration/multiassign/test.php
A tests/integration/multiassign/test2.php
9 files changed, 289 insertions(+), 1 deletion(-)



diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index d17ebfa..2c25a07 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -76,6 +76,42 @@
// What should DB results be considered?
'overall' => self::YES_TAINT
],
+   '\Wikimedia\Rdbms\IDatabase::select' => [
+   self::SQL_EXEC_TAINT,
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // the function name doesn't seem to be escaped
+   self::SQL_EXEC_TAINT,
+   // I'm not even sure for options
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\Database::select' => [
+   self::SQL_EXEC_TAINT,
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // the function name doesn't seem to be escaped
+   self::SQL_EXEC_TAINT,
+   // I'm not even sure for options
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\DBConnRef::select' => [
+   self::SQL_EXEC_TAINT,
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // the function name doesn't seem to be escaped
+   self::SQL_EXEC_TAINT,
+   // I'm not even sure for options
+   self::SQL_EXEC_TAINT,
+   self::SQL_NUMKEY_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
'\Wikimedia\Rdbms\Database::addIdentifierQuotes' => [
self::YES_TAINT & ~self::SQL_TAINT,
'overall' => self::NO_TAINT,
diff --git a/src/TaintednessBaseVisitor.php b/src/TaintednessBaseVisitor.php
index 89a47b1..4a01337 100644
--- a/src/TaintednessBaseVisitor.php
+++ b/src/TaintednessBaseVisitor.php
@@ -12,6 +12,7 @@
 use Phan\Language\UnionType;
 use Phan\Language\Type\CallableType;
 use Phan\Language\Type\MixedType;
+use Phan\Language\Type\IntType;
 use Phan\Language\Type\StringType;
 use Phan\Language\FQSEN\FullyQualifiedFunctionLikeName;
 use Phan\Language\FQSEN\FullyQualifiedFunctionName;
@@ -1359,7 +1360,12 @@
) {
$issueType = 'SecurityCheck-XSS';
} elseif (
-   $combinedTaint === SecurityCheckPlugin::SQL_TAINT
+   $combinedTaint === SecurityCheckPlugin::SQL_TAINT ||
+   $combinedTaint === 
SecurityCheckPlugin::SQL_NUMKEY_TAINT ||
+   $combinedTaint === (
+   SecurityCheckPlugin::SQL_TAINT |
+   SecurityCheckPlugin::SQL_NUMKEY_TAINT
+   )
) {
$issueType = 'SecurityCheck-SQLInjection';
$severity = Issue::SEVERITY_CRITICAL;
@@ -1459,6 +1465,16 @@
$curArgTaintedness = 
SecurityCheckPlugin::NO_TAINT;
$effectiveArgTaintedness = 
SecurityCheckPlugin::NO_TAINT;
} elseif ( isset( $taint[$i] ) ) {
+   if (
+

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Make error messages from hooks be in extension instead of core

2017-12-03 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394866 )

Change subject: Make error messages from hooks be in extension instead of core
..


Make error messages from hooks be in extension instead of core

Change-Id: Ice88ef3854eeb2e7266439e4c1552e003bad6c6f
---
M src/MWVisitor.php
M src/TaintednessBaseVisitor.php
M tests/integration/json/expectedResults.txt
3 files changed, 32 insertions(+), 6 deletions(-)



diff --git a/src/MWVisitor.php b/src/MWVisitor.php
index ee82597..925d62f 100644
--- a/src/MWVisitor.php
+++ b/src/MWVisitor.php
@@ -130,11 +130,21 @@
}
$taint = $this->getTaintOfFunction( $func );
// $this->debug( __METHOD__, "Dispatching $hookName to 
$subscriber" );
-   // FIXME There is a slight flaw here, in that this will 
often mark
-   // the offending line as being the Hooks::run call, 
which means
-   // people only looking at the issues in an extension 
would
-   // not see it.
+   // This is hacky, but try to ensure that the associated 
line
+   // number for any issues is in the extension, and not 
the
+   // line where the Hooks::register() is in MW core.
+   // FIXME: In the case of reference parameters, this is
+   // still reporting things being in MW core instead of 
extension.
+   $oldContext = $this->overrideContext;
+   $fContext = $func->getContext();
+   $newContext = clone $this->context;
+   $newContext = $newContext->withFile( 
$fContext->getFile() )
+   ->withLineNumberStart( 
$fContext->getLineNumberStart() );
+   $this->overrideContext = $newContext;
+
$this->handleMethodCall( $func, $subscriber, $taint, 
$args );
+
+   $this->overrideContext = $oldContext;
}
}
 
diff --git a/src/TaintednessBaseVisitor.php b/src/TaintednessBaseVisitor.php
index 6fceec7..ffdaf46 100644
--- a/src/TaintednessBaseVisitor.php
+++ b/src/TaintednessBaseVisitor.php
@@ -35,6 +35,9 @@
/** @var null|string|bool|resource filehandle to output debug messages 
*/
private $debugOutput = null;
 
+   /** @var Context Override the file/line number to emit issues */
+   protected $overrideContext = null;
+
/**
 * @param CodeBase $code_base
 * @param Context $context
@@ -1315,6 +1318,11 @@
/**
 * Emit an issue using the appropriate issue type
 *
+* If $this->overrideContext is set, it will use that for the
+* file/line number to report. This is meant as a hack, so that
+* in MW we can force hook related issues to be in the extension
+* instead of where the hook is called from in MW core.
+*
 * @param int $lhsTaint Taint of left hand side (or equivalent)
 * @param int $rhsTaint Taint of right hand side (or equivalent)
 * @param string $msg Issue description
@@ -1335,6 +1343,7 @@
$adjustLHS,
$rhsTaint,
$msg,
+   // FIXME should this be $this->overrideContext ?
$this->context,
$this->code_base
)
@@ -1390,9 +1399,16 @@
}
}
 
+   $context = $this->context;
+   if ( $this->overrideContext ) {
+   // If we are overriding the file/line number,
+   // report the original line number as well.
+   $msg .= " (Originally at: $this->context)";
+   $context = $this->overrideContext;
+   }
$this->plugin->emitIssue(
$this->code_base,
-   $this->context,
+   $context,
$issueType,
$msg,
$severity
diff --git a/tests/integration/json/expectedResults.txt 
b/tests/integration/json/expectedResults.txt
index b2edd5b..f48a8d4 100644
--- a/tests/integration/json/expectedResults.txt
+++ b/tests/integration/json/expectedResults.txt
@@ -1,2 +1,2 @@
-integration/json/test.php:29 SecurityCheck-XSS Calling method \wfRegister() in 
\doStuff that outputs using tainted argument $[arg #2]. (Caused by: 
integration/json/test.php +10; integration/json/test.php +11)
+integration/json/test.php:9 SecurityCheck-XSS Calling method \wfRegister() in 
\doStuff that outputs using tainted argument $[arg #2]. (Caused by: 
integration/json/test.php +10; 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Avoid duplication in output

2017-12-03 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394865 )

Change subject: Avoid duplication in output
..


Avoid duplication in output

This also fixes the json test

Change-Id: Iaaed1b0984552d1c7d6b5551cdbb7af3d37ca961
---
M src/TaintednessBaseVisitor.php
M tests/integration/callbackhook/expectedResults.txt
M tests/integration/callwithevil/expectedResults.txt
M tests/integration/callwithevil3/expectedResults.txt
M tests/integration/indirectecho/expectedResults.txt
M tests/integration/json/expectedResults.txt
M tests/integration/multi/expectedResults.txt
M tests/integration/registerhook/Hooks.php
M tests/integration/registerhook/expectedResults.txt
M tests/integration/registerhook/test.php
M tests/integration/stripitem/expectedResults.txt
M tests/integration/taghook/expectedResults.txt
12 files changed, 36 insertions(+), 26 deletions(-)



diff --git a/src/TaintednessBaseVisitor.php b/src/TaintednessBaseVisitor.php
index 9d4def9..6fceec7 100644
--- a/src/TaintednessBaseVisitor.php
+++ b/src/TaintednessBaseVisitor.php
@@ -101,7 +101,11 @@
if ( !property_exists( $func, 'taintedOriginalError' ) 
) {
$func->taintedOriginalError = '';
}
-   $func->taintedOriginalError .= $this->dbgInfo() . ';';
+   $newError = $this->dbgInfo() . ';';
+   if ( strpos( $func->taintedOriginalError, $newError ) 
=== false ) {
+   // Only add to error if we haven't added this 
line before
+   $func->taintedOriginalError .= $newError;
+   }
 
if ( strlen( $func->taintedOriginalError ) > 254 ) {
$this->debug( __METHOD__, "Too long original 
error! for $func" );
@@ -126,7 +130,10 @@
if ( !property_exists( $left, 'taintedOriginalError' ) ) {
$left->taintedOriginalError = '';
}
-   $left->taintedOriginalError .= $right->taintedOriginalError ?? 
'';
+   $rightError = $right->taintedOriginalError ?? '';
+   if ( strpos( $left->taintedOriginalError, $rightError ?: "\1\2" 
) === false ) {
+   $left->taintedOriginalError .= $rightError;
+   }
 
if ( strlen( $left->taintedOriginalError ) > 254 ) {
$this->debug( __METHOD__, "Too long original error! for 
$left" );
@@ -190,8 +197,12 @@
$variableObjLinks = 
$variableObj->taintedMethodLinks ?? new Set;
$variableObj->taintedMethodLinks = 
$methodLinks->union( $variableObjLinks );
$parentVarObj->taintedMethodLinks =& 
$variableObj->taintedMethodLinks;
-   $combinedOrig = ( 
$variableObj->taintedOriginalError ?? '' )
-   . ( 
$parentVarObj->taintedOriginalError ?? '' );
+   $varError = 
$variableObj->taintedOriginalError ?? '';
+   $combinedOrig = 
$parentVarObj->taintedOriginalError ?? '';
+   if ( strpos( $combinedOrig, $varError 
?: "\1\2" ) === false ) {
+   $combinedOrig .= $varError;
+   }
+
if ( strlen( $combinedOrig ) > 254 ) {
$this->debug( __METHOD__, "Too 
long original error! $variableObj" );
$combinedOrig = substr( 
$combinedOrig, 0, 250 ) . '...';
@@ -226,7 +237,10 @@
if ( !property_exists( $variableObj, 
'taintedOriginalError' ) ) {
$variableObj->taintedOriginalError = '';
}
-   $variableObj->taintedOriginalError .= $this->dbgInfo() 
. ';';
+   $newError = $this->dbgInfo() . ';';
+   if ( strpos( $variableObj->taintedOriginalError, 
$newError ) === false ) {
+   $variableObj->taintedOriginalError .= $newError;
+   }
 
if ( strlen( $variableObj->taintedOriginalError ) > 254 
) {
$this->debug( __METHOD__, "Too long original 
error! $variableObj" );
diff --git a/tests/integration/callbackhook/expectedResults.txt 
b/tests/integration/callbackhook/expectedResults.txt
index 7e5d8e0..063e750 100644
--- a/tests/integration/callbackhook/expectedResults.txt
+++ b/tests/integration/callbackhook/expectedResults.txt
@@ -1,7 +1,5 @@
 integration/callbackhook/func.php:5 SecurityCheck-XSS Outputting user 

[MediaWiki-commits] [Gerrit] translatewiki[master]: Add rudimentary state synchronization

2017-12-03 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394864 )

Change subject: Add rudimentary state synchronization
..

Add rudimentary state synchronization

The purpose is to prevent accidental overriding of commits
that happen between our last synchronization to translatewiki.net
and us exporting those changes.

For example:
1. Update read-only repo
2. Synchronize into the wiki
3. Update read-write repo
4. Export and commit translations

In step 3 the read-write repo could get ahead of the read-only
repo. Now, if possible, we read the git commit from step 1 to
reduce the likelyhood. This is not completely safe yet, because
there is no guarantee that step 2 has happened. For humans this
should be fairly obvious, because our scripts always alert after
step 1 (which is automatized) that there are pending changes
to check. For fully automatic exports this is not safe enough.

Step 4 is amended to attempt automatic rebase before pushing to
avoid failing on non-conflicting changes.

Removed update-reset-repo which is now enhanced and inlined in
clupdate-git-repo.

State synchronization is not really possible when we are committing
to a different branch or repository. Different branch is detected
automatically and state is not synchronized then. For different
repos there is new option no-state-sync that can be set to disable
synching.

This commit uses the null coalescing operator (??) available in
PHP7 and HHVM.

Change-Id: I979cbc20f31cf827a58bfd0fdd9ca2a7803ae345
---
M bin/clupdate-git-repo
D bin/update-reset-repo
M repoconfig.yaml
M repong/repong.php
4 files changed, 47 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/64/394864/1

diff --git a/bin/clupdate-git-repo b/bin/clupdate-git-repo
index bff3343..018362b 100755
--- a/bin/clupdate-git-repo
+++ b/bin/clupdate-git-repo
@@ -10,11 +10,17 @@
 URL=$1
 DIR=$2
 BRANCH=${3:-master}
+COMMIT=${4:-origin/$BRANCH}
 
 if [ -d "$DIR/.git" ]
-then
-   "$DIRSCRIPT/update-reset-repo" "$DIR" "" "$BRANCH"
-else
+then (
+   cd $DIR
+   git rebase --abort &>/dev/null || :
+   git checkout -qf "$BRANCH"
+   git fetch -q
+   git reset -q --hard "$COMMIT"
+   git clean -q -f -d &>/dev/null
+) else
git clone "$URL" "$DIR" -b "$BRANCH"
 
if [ "$ME" = 'clupdate-gerrit-repo' ]
diff --git a/bin/update-reset-repo b/bin/update-reset-repo
deleted file mode 100755
index 900fb56..000
--- a/bin/update-reset-repo
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-set -e
-
-# Allow for passing a base path and repo folder name in two parameters
-# or a single full path as parameter.
-if [ $# -eq 2 ]
-then
-   # Concatenate base path and folder name
-   DIR=$1/$2
-else
-   DIR=$1
-fi
-
-BRANCH=${3:-master}
-
-# Updates the repository in the current directory and resets it.
-# Sets OUTPUT to the output of the git operations
-# Sets CODE to the return value of the pipeline.
-update_reset() {
-   OUTPUT=$(git fetch -q && git reset -q --hard origin/$BRANCH && git 
clean -q -f -d 2>&1 >&-)
-   CODE=$?
-}
-
-cd $DIR
-update_reset
-
-if [ $CODE -ne 0 ]; then
-   cd $DIR
-   echo "Retry $DIR"
-   update_reset
-   if [ $CODE -ne 0 ]; then
-   printf "\033[31m%s failed to update\033[0m\n" "$DIR";
-   echo $OUTPUT;
-   fi
-fi
diff --git a/repoconfig.yaml b/repoconfig.yaml
index 9493bb9..a7c718b 100644
--- a/repoconfig.yaml
+++ b/repoconfig.yaml
@@ -2,6 +2,7 @@
 '@meta':
   export: php 
/srv/mediawiki/targets/production/extensions/Translate/scripts/export.php
   expand: php 
/srv/mediawiki/targets/production/extensions/Translate/scripts/expand-groupspec.php
 --exportable
+  state-directory|export: /resources/projects
 
 blockly:
   group: out-blockly*
diff --git a/repong/repong.php b/repong/repong.php
index 9b4ab4c..c034271 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -235,15 +235,41 @@
protected function execute( InputInterface $input, OutputInterface 
$output ) {
$project = $input->getArgument( 'project' );
$variant = $input->getOption( 'variant' ) ?: 
$this->defaultVariant;
+   $defaultConfig = $this->getConfig( $project, 
$this->defaultVariant );
$config = $this->getConfig( $project, $variant );
+   $meta = $this->getConfig( '@meta', $variant );
$base = $this->getBase();
$bindir = $this->bindir;
+   // Without state synchronization, the repository we make commits
+   // could be ahead of the state that has been processed in the 
wiki.
+   // With state synchronization we ensure we do not overwrite any
+   // changes that have been made in the between.
+   $stateDir = isset( $meta[ 'state-directory' ] ) ? $meta[ 
'state-directory' ] : false;
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move two-column to the element

2017-12-03 Thread Fomafix (Code Review)
Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394863 )

Change subject: Move two-column to the  element
..

Move two-column to the  element

The two-column layout has on skin Timeless currently a different top
margin on the first and on the second column. This change fix this.

Bug: T181947
Change-Id: If995845c6cab58fe24b1d9b7859c0614db75ceb7
---
M resources/src/mediawiki.special/mediawiki.special.css
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/394863/1

diff --git a/resources/src/mediawiki.special/mediawiki.special.css 
b/resources/src/mediawiki.special/mediawiki.special.css
index 5d0ec49..97537d3 100644
--- a/resources/src/mediawiki.special/mediawiki.special.css
+++ b/resources/src/mediawiki.special/mediawiki.special.css
@@ -100,7 +100,7 @@
font-weight: bold;
 }
 
-.mw-specialpages-list {
+.mw-specialpages-list > ul {
-webkit-columns: 16em 2;
-moz-columns: 16em 2;
columns: 16em 2;

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

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

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: [CreateWiki] Register extension

2017-12-03 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394862 )

Change subject: [CreateWiki] Register extension
..

[CreateWiki] Register extension

Bug: T181939
Change-Id: Ibcbc0baade8b39faa7da323f742620684342ec35
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/62/394862/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 37e095e..754f6dd 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -667,6 +667,9 @@
 
 Create User Page
 
+CreateWiki
+descmsg = createwiki-desc
+
 Credits Source
 
 CryoKey

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcbc0baade8b39faa7da323f742620684342ec35
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 

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


[MediaWiki-commits] [Gerrit] integration/composer[master]: Minor README.md updates

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

Change subject: Minor README.md updates
..


Minor README.md updates

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

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



diff --git a/README.md b/README.md
index 174d261..93f3e96 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 deploy Composer on the Wikimedia cluster since:
 
 1) we can NOT download from third parties
-2) there isno Debian package for Composer
+2) there is no Debian package for Composer (until Debian Stretch, which has 
1.2.2)
 
 ## How to update
 
@@ -30,5 +30,5 @@
 
 Then ask for review.
 
-The composer executable will be available on the Wikimedia Jenkins slave as
-/srv/deployment/integration/composer/vendor/bin/composer
+The composer executable will be available on the Wikimedia Jenkins slaves at
+`/srv/deployment/integration/composer/vendor/bin/composer`

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ee71785117ff6443f7b6759ac91e97e16ac0f1e
Gerrit-PatchSet: 2
Gerrit-Project: integration/composer
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: RepoGroup::findFile() can and will return false

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394861 )

Change subject: RepoGroup::findFile() can and will return false
..

RepoGroup::findFile() can and will return false

Bug: T181944
Change-Id: I978ed2f9f3005210f6713a7f3ecde1fe0501a5ff
---
M includes/page/DatabaseIndexForPageLookup.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage 
refs/changes/61/394861/1

diff --git a/includes/page/DatabaseIndexForPageLookup.php 
b/includes/page/DatabaseIndexForPageLookup.php
index e71a3c2..3e0125b 100644
--- a/includes/page/DatabaseIndexForPageLookup.php
+++ b/includes/page/DatabaseIndexForPageLookup.php
@@ -75,7 +75,7 @@
if ( $imageTitle !== null ) {
$image = $this->repoGroup->findFile( 
$imageTitle );
// if it is multipage, we use the page order of 
the file
-   if ( $image->exists() && $image->isMultipage() 
) {
+   if ( $image && $image->exists() && 
$image->isMultipage() ) {
return Title::makeTitle(
$this->indexNamespaceId, 
$image->getTitle()->getText()
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Move links from i18n to software

2017-12-03 Thread Albert221 (Code Review)
Albert221 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394860 )

Change subject: Move links from i18n to software
..

Move links from i18n to software

Bug: T59181
Change-Id: I46de236687020d1af64571738cce236c1fdaafa6
---
M api/MWOAuthSessionProvider.php
M backend/MWOAuthDataStore.php
M backend/MWOAuthServer.php
M frontend/specialpages/SpecialMWOAuth.php
M i18n/en.json
5 files changed, 81 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/60/394860/1

diff --git a/api/MWOAuthSessionProvider.php b/api/MWOAuthSessionProvider.php
index f5cb4bf..2c709a3 100644
--- a/api/MWOAuthSessionProvider.php
+++ b/api/MWOAuthSessionProvider.php
@@ -98,7 +98,11 @@
// There exists a local user
$localUser = MWOAuthUtils::getLocalUserFromCentralId( 
$access->get( 'userId' ) );
if ( !$localUser || !$localUser->isLoggedIn() ) {
-   return $this->makeException( 
'mwoauth-invalid-authorization-invalid-user' );
+   return $this->makeException( 
'mwoauth-invalid-authorization-invalid-user', \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E008',
+'E008',
+true
+) );
}
if ( $localUser->isLocked() ||
( $this->config->get( 'BlockDisablesLogin' ) && 
$localUser->isBlocked() )
diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php
index 02fbe00..6fcdc4e 100644
--- a/backend/MWOAuthDataStore.php
+++ b/backend/MWOAuthDataStore.php
@@ -66,7 +66,13 @@
throw new MWOAuthException( 
'mwoauthdatastore-request-token-already-used' );
}
if ( $token === null || !( $returnToken instanceof 
MWOAuthToken ) ) {
-   throw new MWOAuthException( 
'mwoauthdatastore-request-token-not-found' );
+   throw new MWOAuthException( 
'mwoauthdatastore-request-token-not-found', [
+   \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E004',
+'E004',
+true
+)
+] );
}
} elseif ( $token_type === 'access' ) {
$cmra = MWOAuthConsumerAcceptance::newFromToken( 
$this->centralSlave, $token );
diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 4905e29..e0645f9 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -277,11 +277,21 @@
 
// Check that user and consumer are in good standing
if ( $mwUser->isLocked() || $wgBlockDisablesLogin && 
$mwUser->isBlocked() ) {
-   throw new MWOAuthException( 
'mwoauthserver-insufficient-rights' );
+   throw new MWOAuthException( 
'mwoauthserver-insufficient-rights', \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E007',
+'E007',
+true
+) );
}
$consumer = $this->data_store->lookup_consumer( $consumerKey );
if ( !$consumer || $consumer->get( 'deleted' ) ) {
-   throw new MWOAuthException( 
'mwoauthserver-bad-consumer-key' );
+   throw new MWOAuthException( 
'mwoauthserver-bad-consumer-key', [
+   \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E006',
+'E006',
+true
+)
+] );
} elseif ( !$consumer->isUsableBy( $mwUser ) ) {
$owner = MWOAuthUtils::getCentralUserNameFromId(
$consumer->get( 'userId' ),
@@ -289,7 +299,11 @@
);
throw new MWOAuthException(
'mwoauthserver-bad-consumer',
-   [ $consumer->get( 'name' ), 
MWOAuthUtils::getCentralUserTalk( $owner ) ]
+   [ $consumer->get( 'name' ), 
MWOAuthUtils::getCentralUserTalk( $owner ), \Linker::makeExternalLink(
+   
'https://www.mediawiki.org/wiki/Help:OAuth/Errors#E005',
+'E005',
+true
+) ]
);
} elseif ( $consumer->get( 'ownerOnly' ) ) {
throw new MWOAuthException( 
'mwoauthserver-consumer-owner-only', [
@@ -317,7 +331,11 @@
$centralUserId = MWOAuthUtils::getCentralIdFromLocalUser( 

[MediaWiki-commits] [Gerrit] integration/composer[master]: Update composer to 1.4.3

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

Change subject: Update composer to 1.4.3
..


Update composer to 1.4.3

This is the latest 1.4 release, 1.5 seems a little buggy so will do 1.4
then 1.5 once it is more stable.

Bug: T125343
Change-Id: I60e93857acc65e2416de4af305f0224a1eaf6fe8
---
M composer.json
M composer.lock
M vendor/composer/ClassLoader.php
M vendor/composer/LICENSE
M vendor/composer/autoload_classmap.php
M vendor/composer/autoload_static.php
M vendor/composer/ca-bundle/README.md
M vendor/composer/ca-bundle/composer.json
M vendor/composer/ca-bundle/res/cacert.pem
M vendor/composer/ca-bundle/src/CaBundle.php
M vendor/composer/composer/.gitattributes
M vendor/composer/composer/.github/CONTRIBUTING.md
M vendor/composer/composer/.github/ISSUE_TEMPLATE.md
M vendor/composer/composer/.php_cs
M vendor/composer/composer/.travis.yml
M vendor/composer/composer/CHANGELOG.md
M vendor/composer/composer/LICENSE
M vendor/composer/composer/README.md
M vendor/composer/composer/appveyor.yml
M vendor/composer/composer/bin/composer
M vendor/composer/composer/composer.json
M vendor/composer/composer/composer.lock
M vendor/composer/composer/doc/00-intro.md
M vendor/composer/composer/doc/01-basic-usage.md
M vendor/composer/composer/doc/02-libraries.md
M vendor/composer/composer/doc/03-cli.md
M vendor/composer/composer/doc/04-schema.md
M vendor/composer/composer/doc/05-repositories.md
M vendor/composer/composer/doc/06-config.md
M vendor/composer/composer/doc/07-community.md
A vendor/composer/composer/doc/articles/autoloader-optimization.md
M vendor/composer/composer/doc/articles/custom-installers.md
M vendor/composer/composer/doc/articles/handling-private-packages-with-satis.md
M vendor/composer/composer/doc/articles/plugins.md
M vendor/composer/composer/doc/articles/scripts.md
M vendor/composer/composer/doc/articles/troubleshooting.md
M vendor/composer/composer/doc/articles/versions.md
A vendor/composer/composer/doc/faqs/how-to-install-composer-programmatically.md
A vendor/composer/composer/doc/faqs/how-to-install-untrusted-packages-safely.md
M 
vendor/composer/composer/doc/faqs/why-are-unbound-version-constraints-a-bad-idea.md
M 
vendor/composer/composer/doc/faqs/why-can't-composer-load-repositories-recursively.md
M vendor/composer/composer/doc/fixtures/fixtures.md
D 
vendor/composer/composer/doc/fixtures/repo-composer-with-includes/include/all$5fa86b937f0502d92f776072cd49c002dca742b9.json
D 
vendor/composer/composer/doc/fixtures/repo-composer-with-includes/packages.json
A vendor/composer/composer/res/composer-repository-schema.json
M vendor/composer/composer/res/composer-schema.json
M vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php
M vendor/composer/composer/src/Composer/Autoload/ClassLoader.php
M vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php
M vendor/composer/composer/src/Composer/Cache.php
M vendor/composer/composer/src/Composer/Command/AboutCommand.php
M vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
M vendor/composer/composer/src/Composer/Command/BaseCommand.php
M vendor/composer/composer/src/Composer/Command/ConfigCommand.php
M vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php
M vendor/composer/composer/src/Composer/Command/DependsCommand.php
M vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php
M vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php
M vendor/composer/composer/src/Composer/Command/ExecCommand.php
M vendor/composer/composer/src/Composer/Command/GlobalCommand.php
M vendor/composer/composer/src/Composer/Command/HomeCommand.php
M vendor/composer/composer/src/Composer/Command/InitCommand.php
M vendor/composer/composer/src/Composer/Command/InstallCommand.php
M vendor/composer/composer/src/Composer/Command/LicensesCommand.php
M vendor/composer/composer/src/Composer/Command/OutdatedCommand.php
M vendor/composer/composer/src/Composer/Command/ProhibitsCommand.php
M vendor/composer/composer/src/Composer/Command/RemoveCommand.php
M vendor/composer/composer/src/Composer/Command/RequireCommand.php
M vendor/composer/composer/src/Composer/Command/RunScriptCommand.php
M vendor/composer/composer/src/Composer/Command/SearchCommand.php
M vendor/composer/composer/src/Composer/Command/SelfUpdateCommand.php
M vendor/composer/composer/src/Composer/Command/ShowCommand.php
M vendor/composer/composer/src/Composer/Command/StatusCommand.php
M vendor/composer/composer/src/Composer/Command/SuggestsCommand.php
M vendor/composer/composer/src/Composer/Command/UpdateCommand.php
M vendor/composer/composer/src/Composer/Command/ValidateCommand.php
M vendor/composer/composer/src/Composer/Composer.php
M vendor/composer/composer/src/Composer/Config.php
M vendor/composer/composer/src/Composer/Config/JsonConfigSource.php
M vendor/composer/composer/src/Composer/Console/Application.php
A 

[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: [WIP]Un-i18n of exception messages

2017-12-03 Thread Albert221 (Code Review)
Albert221 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394859 )

Change subject: [WIP]Un-i18n of exception messages
..

[WIP]Un-i18n of exception messages

Bug: T59181
Change-Id: I763fdf290f3ee5a7f9281ff14ad6c2db7163f770
---
M api/MWOAuthSessionProvider.php
M backend/MWOAuthDataStore.php
M backend/MWOAuthServer.php
M frontend/specialpages/SpecialMWOAuth.php
M i18n/en.json
5 files changed, 110 insertions(+), 56 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/59/394859/1

diff --git a/api/MWOAuthSessionProvider.php b/api/MWOAuthSessionProvider.php
index f5cb4bf..2a785c2 100644
--- a/api/MWOAuthSessionProvider.php
+++ b/api/MWOAuthSessionProvider.php
@@ -41,32 +41,46 @@
 * @returns SessionInfo
 */
private function makeException( $key /*, ... */ ) {
-   global $wgHooks;
-
// First, schedule the throwing of the exception for later when 
the API
// is ready to catch it
$params = func_get_args();
array_shift( $params );
$msg = wfMessage( $key, $params );
-   if ( class_exists( \ApiUsageException::class ) ) {
-   $exception = \ApiUsageException::newWithMessage( null, 
$msg );
-   } else {
-   $msg = $msg->inLanguage( 'en' )->useDatabase( false 
)->plain();
-   $exception = new \UsageException( $msg, $key );
-   }
-   $wgHooks['ApiBeforeMain'][] = function () use ( $exception ) {
-   throw $exception;
-   };
 
-   // Then return an appropriate SessionInfo
-   $id = $this->hashToSessionId( 'bogus' );
-   return new SessionInfo( SessionInfo::MAX_PRIORITY, [
-   'provider' => $this,
-   'id' => $id,
-   'userInfo' => UserInfo::newAnonymous(),
-   'persisted' => false,
-   ] );
+   if ( !class_exists( \ApiUsageException::class ) ) {
+$msg = $msg->inLanguage( 'en' )->useDatabase( false )->plain();
+
+return $this->makeRawException($msg, $key);
+}
+
+   return $this->makeRawException($msg);
}
+
+   private function makeRawException( $msg, $key = '' ) {
+   global $wgHooks;
+
+   if ( class_exists( \ApiUsageException::class ) ) {
+$exception = \ApiUsageException::newWithMessage( null, $msg );
+} else {
+   if ( !is_null($key) && $key !== '' ) {
+   $exception = new \UsageException ( $msg, $key );
+} else {
+$exception = new \UsageException('', $msg);
+}
+}
+$wgHooks['ApiBeforeMain'][] = function () use ( $exception ) {
+throw $exception;
+};
+
+// Then return an appropriate SessionInfo
+$id = $this->hashToSessionId( 'bogus' );
+return new SessionInfo( SessionInfo::MAX_PRIORITY, [
+'provider' => $this,
+'id' => $id,
+'userInfo' => UserInfo::newAnonymous(),
+'persisted' => false,
+] );
+}
 
public function provideSessionInfo( WebRequest $request ) {
// For some reason MWOAuth is restricted to be API-only.
@@ -98,7 +112,7 @@
// There exists a local user
$localUser = MWOAuthUtils::getLocalUserFromCentralId( 
$access->get( 'userId' ) );
if ( !$localUser || !$localUser->isLoggedIn() ) {
-   return $this->makeException( 
'mwoauth-invalid-authorization-invalid-user' );
+   return $this->makeRawException( 'The authorization 
headers in your request are for a user that does not exist here' );
}
if ( $localUser->isLocked() ||
( $this->config->get( 'BlockDisablesLogin' ) && 
$localUser->isBlocked() )
diff --git a/backend/MWOAuthDataStore.php b/backend/MWOAuthDataStore.php
index 02fbe00..5185b84 100644
--- a/backend/MWOAuthDataStore.php
+++ b/backend/MWOAuthDataStore.php
@@ -49,7 +49,7 @@
 * @param OAuthConsumer|MWOAuthConsumer $consumer
 * @param string $token_type
 * @param string $token String the token
-* @throws MWOAuthException
+* @throws OAuthException
 * @return MWOAuthToken
 */
public function lookup_token( $consumer, $token_type, $token ) {
@@ -66,7 +66,12 @@
throw new MWOAuthException( 
'mwoauthdatastore-request-token-already-used' );
}
if ( $token === null || !( $returnToken instanceof 
MWOAuthToken ) ) {
-   throw new MWOAuthException( 
'mwoauthdatastore-request-token-not-found' 

[MediaWiki-commits] [Gerrit] integration/composer[master]: Minor README.md updates

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394858 )

Change subject: Minor README.md updates
..

Minor README.md updates

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


  git pull ssh://gerrit.wikimedia.org:29418/integration/composer 
refs/changes/58/394858/1

diff --git a/README.md b/README.md
index 174d261..93f3e96 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 deploy Composer on the Wikimedia cluster since:
 
 1) we can NOT download from third parties
-2) there isno Debian package for Composer
+2) there is no Debian package for Composer (until Debian Stretch, which has 
1.2.2)
 
 ## How to update
 
@@ -30,5 +30,5 @@
 
 Then ask for review.
 
-The composer executable will be available on the Wikimedia Jenkins slave as
-/srv/deployment/integration/composer/vendor/bin/composer
+The composer executable will be available on the Wikimedia Jenkins slaves at
+`/srv/deployment/integration/composer/vendor/bin/composer`

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ee71785117ff6443f7b6759ac91e97e16ac0f1e
Gerrit-PatchSet: 1
Gerrit-Project: integration/composer
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] operations/dumps[master]: ability to do xmlpageslogging several pieces at a time in pa...

2017-12-03 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394857 )

Change subject: ability to do xmlpageslogging several pieces at a time in 
parallel
..

ability to do xmlpageslogging several pieces at a time in parallel

[WIP] First partial draft, don't look at it or your eyeballs will
fall out, etc.

Bug: T181935
Change-Id: Icef0aa23c363d7fa4d3b09074571f02a9ed2d3c6
---
M xmldumps-backup/dumps/WikiDump.py
M xmldumps-backup/dumps/recombinejobs.py
M xmldumps-backup/dumps/runner.py
M xmldumps-backup/dumps/runnerutils.py
M xmldumps-backup/dumps/utils.py
M xmldumps-backup/dumps/xmljobs.py
6 files changed, 104 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/57/394857/1

diff --git a/xmldumps-backup/dumps/WikiDump.py 
b/xmldumps-backup/dumps/WikiDump.py
index 80115ec..4d845bc 100644
--- a/xmldumps-backup/dumps/WikiDump.py
+++ b/xmldumps-backup/dumps/WikiDump.py
@@ -274,6 +274,8 @@
 "chunks", "revsPerChunkHistory", 0)
 self.numparts_for_abstract = self.get_opt_for_proj_or_default(
 "chunks", "chunksForAbstract", 0)
+self.numparts_for_pagelogs = self.get_opt_for_proj_or_default(
+"chunks", "chunksForPagelogs", 0)
 self.pages_per_filepart_abstract = self.get_opt_for_proj_or_default(
 "chunks", "pagesPerChunkAbstract", 0)
 self.recombine_history = self.get_opt_for_proj_or_default(
diff --git a/xmldumps-backup/dumps/recombinejobs.py 
b/xmldumps-backup/dumps/recombinejobs.py
index 12c49e5..2401d44 100644
--- a/xmldumps-backup/dumps/recombinejobs.py
+++ b/xmldumps-backup/dumps/recombinejobs.py
@@ -328,3 +328,56 @@
 error = result
 if error:
 raise BackupError("error recombining abstract dump files")
+
+
+class RecombineXmlLoggingDump(RecombineDump):
+def __init__(self, name, desc, item_for_recombine):
+# no partnum_todo, no parts generally (False, False), even though 
input may have it
+self.item_for_recombine = item_for_recombine
+self._prerequisite_items = [self.item_for_recombine]
+super(RecombineXmlLoggingDump, self).__init__(name, desc)
+
+def get_filetype(self):
+return self.item_for_recombine.get_filetype()
+
+def get_file_ext(self):
+return self.item_for_recombine.get_file_ext()
+
+def get_dumpname(self):
+return self.item_for_recombine.get_dumpname()
+
+def build_command(self, runner, to_recombine_dfnames, output_dfname):
+input_dfnames = []
+for in_dfname in to_recombine_dfnames:
+if in_dfname.dumpname == output_dfname.dumpname:
+input_dfnames.append(in_dfname)
+if not len(input_dfnames):
+self.set_status("failed")
+raise BackupError("No input files for %s found" % self.name())
+if not exists(runner.wiki.config.gzip):
+raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
+compression_command = "%s > " % runner.wiki.config.gzip
+uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
+recombine_command_string = self.build_recombine_command_string(
+runner, input_dfnames, output_dfname, compression_command,
+uncompression_command, "")
+recombine_command = [recombine_command_string]
+recombine_pipeline = [recombine_command]
+series = [recombine_pipeline]
+return series
+
+def run(self, runner):
+error = 0
+to_recombine_dfnames = 
self.item_for_recombine.list_outfiles_for_input(runner.dump_dir)
+output_dfnames = self.list_outfiles_for_build_command(runner.dump_dir)
+for output_dfname in output_dfnames:
+command_series = self.build_command(runner, to_recombine_dfnames, 
output_dfname)
+self.setup_command_info(runner, command_series, [output_dfname])
+result, broken = runner.run_command(
+[command_series], callback_timed=self.progress_callback,
+callback_timed_arg=runner, shell=True,
+callback_on_completion=self.command_completion_callback)
+if result:
+error = result
+if error:
+raise BackupError("error recombining log event files")
diff --git a/xmldumps-backup/dumps/runner.py b/xmldumps-backup/dumps/runner.py
index 662f581..74df719 100644
--- a/xmldumps-backup/dumps/runner.py
+++ b/xmldumps-backup/dumps/runner.py
@@ -266,7 +266,12 @@
 self.find_item_by_name('metacurrentdump')))
 
 self.dump_items.append(
-XmlLogging("Log events to all pages and users."))
+XmlLogging("Log events to all pages and users.",
+   self.filepart.get_pages_per_filepart_pagelogs()))
+
+self.append_job_if_needed(RecombineXmlLoggingDump(
+

[MediaWiki-commits] [Gerrit] integration/jenkins[master]: Swap node for jq

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394856 )

Change subject: Swap node for jq
..

Swap node for jq

Bug: T181938
Change-Id: Ifc2c2484fbfc617134da70abf027755b72ac41bd
---
M bin/mw-fetch-composer-dev.sh
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/56/394856/2

diff --git a/bin/mw-fetch-composer-dev.sh b/bin/mw-fetch-composer-dev.sh
index 01ed093..b359fdc 100755
--- a/bin/mw-fetch-composer-dev.sh
+++ b/bin/mw-fetch-composer-dev.sh
@@ -5,10 +5,8 @@
 cd "$MW_INSTALL_PATH/vendor"
 
 # Load require-dev packages on top of mediawiki/vendor (T112895)
-# Once jq 1.4 is available, the following may be used instead:
-# > jq -r '.["require-dev"]|to_entries|map([.key,.value])[]|join("=")' 
../composer.json
 set -o pipefail
-node $(dirname $0)/../tools/composer-dev-args.js 
"$MW_INSTALL_PATH/composer.json" | xargs --verbose composer require --dev 
--ansi --no-progress --prefer-dist -v
+jq -r '.["require-dev"]|to_entries|map([.key,.value])[]|join("=")' 
"$MW_INSTALL_PATH/composer.json" | xargs --verbose composer require --dev 
--ansi --no-progress --prefer-dist -v
 
 # Point composer-merge-plugin to mediawiki/core to have it to merge
 # autoload-dev. T158674

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc2c2484fbfc617134da70abf027755b72ac41bd
Gerrit-PatchSet: 2
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/jenkins[master]: Wrap values in composer-dev-args.js

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394855 )

Change subject: Wrap values in composer-dev-args.js
..

Wrap values in composer-dev-args.js

Bug: T181937
Change-Id: I121488eb179d35f540e77a354c9a62832e57ac4a
---
M tools/composer-dev-args.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/55/394855/2

diff --git a/tools/composer-dev-args.js b/tools/composer-dev-args.js
index 5026807..f317162 100755
--- a/tools/composer-dev-args.js
+++ b/tools/composer-dev-args.js
@@ -3,5 +3,5 @@
 
 devPackages = require( process.argv[ 2 ] )[ 'require-dev' ];
 for ( package in devPackages ) {
-   console.log( package + '=' + devPackages[ package ] );
+   console.log( package + '="' + devPackages[ package ] + '"' );
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I121488eb179d35f540e77a354c9a62832e57ac4a
Gerrit-PatchSet: 2
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] translatewiki[master]: Viva il RepoNG!

2017-12-03 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394853 )

Change subject: Viva il RepoNG!
..

Viva il RepoNG!

Moved MediaWiki skins and extensions to RepoNG. This completes the
migration of old scripts to RepoNG.

Notice: extensions have been moved from mediawiki-extensions/extensions
to one level up to mediawiki-extensions! Old extensions directory
should be deleted afterwards.

* Implemented @generator option so that list of repositories can
  be constructred dynamically. Generator must return JSON.
* Created a script that creates repositories from mediawiki-extensions.txt
  or mediawiki-skins.txt by using the name or first part of file = ...
  declaration to figure out the name of the repository.
* Some tweaks in TranslateSettings to simplify code.
* Deleted bunch of now unused scripts.
* Simplified repo{export,commit,update} scripts and removed
  repocreate.
* Added list command to RepoNG so that we don't have to maintain
  EXTERNAL-PROJECTS, REPONG-PROJECTS or the list in nike-export-all
  anymore.
* Increased parallelism in autosync scripts.
* Added a small optimization in RepoNG exports so that we only
  run two scripts instead of three if always-export-languages is
  defined.
* Removed --hours parameter from mediawiki and its extensions and
  skins. RepoNG should be fast enough for this.

Change-Id: I04064dda5ab4f2ad1de00bf50010586864658d9c
---
M TranslateSettings.php
D bin/EXTERNAL-PROJECTS
D bin/REPONG-PROJECTS
D bin/add-extensions
M bin/autosync-mediawiki.sh
M bin/autosync.sh
D bin/export-by-prefix
M bin/nike-export-all
M bin/repocommit
D bin/repocreate
M bin/repoexport
M bin/repoupdate
D bin/update-externals
A groups/MediaWiki/repong-generator.php
M repoconfig.yaml
M repong/repong.php
16 files changed, 119 insertions(+), 399 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/53/394853/1

diff --git a/TranslateSettings.php b/TranslateSettings.php
index 21a074a..869d51a 100644
--- a/TranslateSettings.php
+++ b/TranslateSettings.php
@@ -98,46 +98,30 @@
$deps[] = new FileDependency( realpath( $code ) );
 };
 
-$wgHooks['TranslatePostInitGroups'][] = [ 'setupMediaWikiExtensions' ];
-function setupMediaWikiExtensions( &$list, &$deps, &$autoload ) {
-   global $GROUPS;
-
+$wgHooks['TranslatePostInitGroups'][] = function ( &$list, &$deps, &$autoload 
) use ( $GROUPS ) {
$def = "$GROUPS/MediaWiki/mediawiki-extensions.txt";
-   $path = '%GROUPROOT%/mediawiki-extensions/extensions/';
+   $path = '%GROUPROOT%/mediawiki-extensions/';
 
$foo = new PremadeMediawikiExtensionGroups( $def, $path );
$foo->register( $list, $deps, $autoload );
-
-   return true;
 }
 
-$wgHooks['TranslatePostInitGroups'][] = [ 'setupMediaWikiSkins' ];
-function setupMediaWikiSkins( &$list, &$deps, &$autoload ) {
-   global $GROUPS;
-
+$wgHooks['TranslatePostInitGroups'][] = function ( &$list, &$deps, &$autoload 
) use ( $GROUPS ) {
$def = "$GROUPS/MediaWiki/mediawiki-skins.txt";
$path = '%GROUPROOT%/mediawiki-skins/';
 
$foo = new PremadeMediawikiExtensionGroups( $def, $path );
-   $foo->setNamespace( NS_MEDIAWIKI );
$foo->setGroupPrefix( 'mediawiki-skin-' );
$foo->setUseConfigure( false );
$foo->register( $list, $deps, $autoload );
-
-   return true;
 }
 
-$wgHooks['TranslatePostInitGroups'][] = [ 'setupIntuition' ];
-function setupIntuition( &$list, &$deps, &$autoload ) {
-   global $GROUPS;
-
+$wgHooks['TranslatePostInitGroups'][] = function ( &$list, &$deps, &$autoload 
) use ( $GROUPS ) {
$def = "$GROUPS/Intuition/intuition-textdomains.txt";
$path = '%GROUPROOT%/intuition/language/messages/';
 
$foo = new PremadeIntuitionTextdomains( $def, $path );
$foo->register( $list, $deps, $autoload );
-
-   return true;
 }
 
 $wgTranslateAuthorBlacklist[] = [ 'black', '/^.*;.*;(Andre Engels|Gangleri|Jon 
Harald 
Søby|IAlex|M.M.S.|BotMultichill|Nike|Piivaat|Raymond|RobertL|SieBot|Siebrand|SPQRobin|Suradnik13|Verdy
 p)$/Ui' ];
diff --git a/bin/EXTERNAL-PROJECTS b/bin/EXTERNAL-PROJECTS
deleted file mode 100644
index 203a3e1..000
--- a/bin/EXTERNAL-PROJECTS
+++ /dev/null
@@ -1,47 +0,0 @@
-blockly
-citationhunt
-codev
-commons-android
-copypatrol
-crosswatch
-dissemin
-eol
-etherpad-lite
-freecol
-fudforum
-gapfinder
-hivejs
-huggle
-ia-upload
-inaturalist
-internetarchivebot
-intuition
-intuition-tools
-jquery.uls
-kiwix
-lib.reviews
-mantis
-mathjax
-mifos
-mwgerrit
-mwgithub
-nfcring-control
-nocc
-oppia
-osm
-pageviews
-proveit
-pywikibot
-vicuna
-video2commons
-waymarked-trails-site
-wiki-ai
-wikiblame
-wikidata
-wikiedudashboard
-wikimania
-wikimedia-portals
-wikinity
-wikipedia-android
-wikipedia-ios
-xtools
diff --git a/bin/REPONG-PROJECTS b/bin/REPONG-PROJECTS
deleted file mode 100644
index 5d71130..000
--- a/bin/REPONG-PROJECTS
+++ /dev/null

[MediaWiki-commits] [Gerrit] operations/puppet[production]: move various misc dump cron jobs to new nfs server

2017-12-03 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394852 )

Change subject: move various misc dump cron jobs to new nfs server
..

move various misc dump cron jobs to new nfs server

Jobs moved in this batch: categoriesrfd, pagetitles,mediatitles,
media-per-project lists, cirrussearch

All will run using the dumpsgen user now, writing output to
dumpsdata1001. CLeanup of old files for these jobs is already
in place.

Bug:T179942
Change-Id: Ifefe6735c58e55efffed39852e4f31df1e610768
---
M modules/dumps/manifests/generation/server/dirs.pp
M modules/snapshot/files/cron/create-media-per-project-lists.sh
M modules/snapshot/files/cron/dumpcategoriesrdf.sh
M modules/snapshot/files/cron/dumpcirrussearch.sh
M modules/snapshot/manifests/cron.pp
M modules/snapshot/manifests/cron/pagetitles.pp
6 files changed, 15 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/52/394852/1

diff --git a/modules/dumps/manifests/generation/server/dirs.pp 
b/modules/dumps/manifests/generation/server/dirs.pp
index 16f95b0..be01134 100644
--- a/modules/dumps/manifests/generation/server/dirs.pp
+++ b/modules/dumps/manifests/generation/server/dirs.pp
@@ -46,8 +46,8 @@
 file { $cirrussearchdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $deprecated_user,
-group  => $deprecated_group,
+owner  => $user,
+group  => $group,
 }
 
 file { $xlationdir:
@@ -67,8 +67,8 @@
 file { $medialistsdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $deprecated_user,
-group  => $deprecated_group,
+owner  => $user,
+group  => $group,
 }
 
 file { $incrsdir:
diff --git a/modules/snapshot/files/cron/create-media-per-project-lists.sh 
b/modules/snapshot/files/cron/create-media-per-project-lists.sh
index d5cbe30..b51512b 100755
--- a/modules/snapshot/files/cron/create-media-per-project-lists.sh
+++ b/modules/snapshot/files/cron/create-media-per-project-lists.sh
@@ -8,7 +8,7 @@
 source /usr/local/etc/set_dump_dirs.sh
 
 DATE=`/bin/date '+%Y%m%d'`
-outputdir="${otherdir}/imageinfo/$DATE"
+outputdir="${cronsdir}/imageinfo/$DATE"
 configfile="${confsdir}/wikidump.conf:media"
 errors=0
 
diff --git a/modules/snapshot/files/cron/dumpcategoriesrdf.sh 
b/modules/snapshot/files/cron/dumpcategoriesrdf.sh
index dd1ebed..9ce2364 100755
--- a/modules/snapshot/files/cron/dumpcategoriesrdf.sh
+++ b/modules/snapshot/files/cron/dumpcategoriesrdf.sh
@@ -64,7 +64,7 @@
 done
 
 today=$(date +'%Y%m%d')
-targetDirBase="${otherdir}/categoriesrdf"
+targetDirBase="${cronsdir}/categoriesrdf"
 targetDir="${targetDirBase}/${today}"
 timestampsDir="${targetDirBase}/lastdump"
 multiVersionScript="${deployDir}/multiversion/MWScript.php"
diff --git a/modules/snapshot/files/cron/dumpcirrussearch.sh 
b/modules/snapshot/files/cron/dumpcirrussearch.sh
index 33b35b9..c6d7547 100644
--- a/modules/snapshot/files/cron/dumpcirrussearch.sh
+++ b/modules/snapshot/files/cron/dumpcirrussearch.sh
@@ -53,7 +53,7 @@
 done
 
 today=$(date +'%Y%m%d')
-targetDirBase="${otherdir}/cirrussearch"
+targetDirBase="${cronsdir}/cirrussearch"
 targetDir="$targetDirBase/$today"
 multiVersionScript="$deployDir/multiversion/MWScript.php"
 
diff --git a/modules/snapshot/manifests/cron.pp 
b/modules/snapshot/manifests/cron.pp
index 6043285..e759540 100644
--- a/modules/snapshot/manifests/cron.pp
+++ b/modules/snapshot/manifests/cron.pp
@@ -16,10 +16,10 @@
 source => 'puppet:///modules/snapshot/cron/dump_functions.sh',
 }
 
-class { '::snapshot::cron::mediaperprojectlists': user => $depr_user }
-class { '::snapshot::cron::pagetitles': user   => $depr_user }
-class { '::snapshot::cron::cirrussearch': user   => $depr_user }
-class { '::snapshot::cron::categoriesrdf': user   => $depr_user }
+class { '::snapshot::cron::mediaperprojectlists': user => $miscdumpuser }
+class { '::snapshot::cron::pagetitles': user   => $miscdumpuser }
+class { '::snapshot::cron::cirrussearch': user   => $miscdumpuser }
+class { '::snapshot::cron::categoriesrdf': user   => $miscdumpuser }
 class { '::snapshot::cron::dumplists': user   => $depr_user }
 class { '::snapshot::cron::dump_global_blocks': user   => $miscdumpsuser }
 class { '::snapshot::cron::wikidatadumps':
diff --git a/modules/snapshot/manifests/cron/pagetitles.pp 
b/modules/snapshot/manifests/cron/pagetitles.pp
index 9bff3b0..ab01cdb 100644
--- a/modules/snapshot/manifests/cron/pagetitles.pp
+++ b/modules/snapshot/manifests/cron/pagetitles.pp
@@ -1,7 +1,7 @@
 class snapshot::cron::pagetitles(
 $user=undef,
 ) {
-$otherdir = $snapshot::dumps::dirs::otherdir
+$cronsdir = $snapshot::dumps::dirs::cronsdir
 $repodir = $snapshot::dumps::dirs::repodir
 $confsdir = $snapshot::dumps::dirs::confsdir
 
@@ -9,7 +9,7 @@
 ensure   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: cleanup xml/sql dumps on all hosts that have them

2017-12-03 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394842 )

Change subject: cleanup xml/sql dumps on all hosts that have them
..


cleanup xml/sql dumps on all hosts that have them

On generator hosts, keep a small number for use for prefetch
for the next run.
On hosts serving the dumps, keep as many as
we can make available to the public, given disk space.

Bug: T181895
Change-Id: I04fc060fa607e0bedc7971e2fd4b830aec1b66d2
---
M hieradata/hosts/dataset1001.yaml
M hieradata/hosts/dumpsdata1001.yaml
M hieradata/hosts/dumpsdata1002.yaml
M hieradata/hosts/labstore1006.yaml
M hieradata/hosts/labstore1007.yaml
M hieradata/hosts/ms1001.yaml
M modules/dumps/manifests/web/cleanup.pp
M modules/dumps/manifests/web/cleanups/xmldumps.pp
M modules/dumps/manifests/web/xmldumps_active.pp
M modules/profile/manifests/dumps/web/cleanup.pp
M modules/profile/manifests/dumps/web/xmldumps_active.pp
11 files changed, 38 insertions(+), 20 deletions(-)

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



diff --git a/hieradata/hosts/dataset1001.yaml b/hieradata/hosts/dataset1001.yaml
index 967f0c7..47ec977 100644
--- a/hieradata/hosts/dataset1001.yaml
+++ b/hieradata/hosts/dataset1001.yaml
@@ -1,5 +1,6 @@
 profile::dumps::cleanup::isreplica: true
 profile::dumps::miscdumpsdir: '/data/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
 
 profile::dumps::rsyncer:
   dumps_user: 'datasets'
diff --git a/hieradata/hosts/dumpsdata1001.yaml 
b/hieradata/hosts/dumpsdata1001.yaml
index 12f28b6..a435ccd 100644
--- a/hieradata/hosts/dumpsdata1001.yaml
+++ b/hieradata/hosts/dumpsdata1001.yaml
@@ -1,2 +1,4 @@
 profile::dumps::miscdumpsdir: '/data/otherdumps'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
+
 profile::dumps::cleanup::isreplica: false
diff --git a/hieradata/hosts/dumpsdata1002.yaml 
b/hieradata/hosts/dumpsdata1002.yaml
index 6cba27b..871da47 100644
--- a/hieradata/hosts/dumpsdata1002.yaml
+++ b/hieradata/hosts/dumpsdata1002.yaml
@@ -1,4 +1,5 @@
 profile::dumps::miscdumpsdir: '/data/otherdumps'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
 
 # this is currently a dumps generation fallback host,
 # we configure cleanups of old files there the
diff --git a/hieradata/hosts/labstore1006.yaml 
b/hieradata/hosts/labstore1006.yaml
index 549439b..e0cbf4f 100644
--- a/hieradata/hosts/labstore1006.yaml
+++ b/hieradata/hosts/labstore1006.yaml
@@ -1,4 +1,5 @@
 profile::dumps::miscdumpsdir: '/srv/dumps/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/srv/dumps/xmldatadumps/public'
 profile::dumps::cleanup::isreplica: true
 
 profile::dumps::rsyncer:
diff --git a/hieradata/hosts/labstore1007.yaml 
b/hieradata/hosts/labstore1007.yaml
index c74bbdb..e0cbf4f 100644
--- a/hieradata/hosts/labstore1007.yaml
+++ b/hieradata/hosts/labstore1007.yaml
@@ -1,3 +1,7 @@
+profile::dumps::miscdumpsdir: '/srv/dumps/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/srv/dumps/xmldatadumps/public'
+profile::dumps::cleanup::isreplica: true
+
 profile::dumps::rsyncer:
   dumps_user: 'dumpsgen'
   dumps_group: 'dumpsgen'
diff --git a/hieradata/hosts/ms1001.yaml b/hieradata/hosts/ms1001.yaml
index 1f7dd46..0dd4675 100644
--- a/hieradata/hosts/ms1001.yaml
+++ b/hieradata/hosts/ms1001.yaml
@@ -1,5 +1,6 @@
 profile::dumps::cleanup::isreplica: true
 profile::dumps::miscdumpsdir: '/data/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
 
 profile::dumps::rsyncer:
   dumps_user: 'datasets'
diff --git a/modules/dumps/manifests/web/cleanup.pp 
b/modules/dumps/manifests/web/cleanup.pp
index e173d52..6360fc6 100644
--- a/modules/dumps/manifests/web/cleanup.pp
+++ b/modules/dumps/manifests/web/cleanup.pp
@@ -1,6 +1,8 @@
 class dumps::web::cleanup(
 $miscdumpsdir = undef,
 $isreplica = undef,
+$publicdir = undef,
+$user = undef,
 ) {
 file { '/etc/dumps':
 ensure => 'directory',
@@ -22,4 +24,10 @@
 miscdumpsdir => $miscdumpsdir,
 isreplica=> $isreplica,
 }
+
+class {'::dumps::web::cleanups::xmldumps':
+publicdir => $publicdir,
+user  => $user,
+isreplica => $isreplica,
+}
 }
diff --git a/modules/dumps/manifests/web/cleanups/xmldumps.pp 
b/modules/dumps/manifests/web/cleanups/xmldumps.pp
index 9784525..0b140ef 100644
--- a/modules/dumps/manifests/web/cleanups/xmldumps.pp
+++ b/modules/dumps/manifests/web/cleanups/xmldumps.pp
@@ -1,7 +1,7 @@
 class dumps::web::cleanups::xmldumps(
-$wikilist_url = undef,
 $publicdir = undef,
 $user = undef,
+$isreplica = undef,
 ) {
 $wikilist_dir = '/etc/dumps/dblists'
 file { $wikilist_dir:
@@ -16,7 +16,7 @@
 # each type of wiki we keep.
 $bigwikis = ['dewiki', 'eswiki', 'frwiki', 'itwiki', 'jawiki',
   'metawiki', 'nlwiki', 'plwiki', 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow PHPUnit 5 and 6 versions optionally in require-dev

2017-12-03 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394851 )

Change subject: Allow PHPUnit 5 and 6 versions optionally in require-dev
..

Allow PHPUnit 5 and 6 versions optionally in require-dev

Bug: T181931
Change-Id: I497712c7693d137be197a69873baa58383ce9646
---
M composer.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/394851/1

diff --git a/composer.json b/composer.json
index 35783f2..bf8cb6f 100644
--- a/composer.json
+++ b/composer.json
@@ -58,7 +58,7 @@
"monolog/monolog": "~1.22.1",
"nikic/php-parser": "2.1.0",
"nmred/kafka-php": "0.1.5",
-   "phpunit/phpunit": "4.8.36",
+   "phpunit/phpunit": "4.8.36 || 5.7.25 || 6.5.2",
"psy/psysh": "0.8.11",
"wikimedia/avro": "1.7.7",
"wikimedia/testing-access-wrapper": "~1.0",

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Remove MediawikiExtensionFFS

2017-12-03 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394850 )

Change subject: Remove MediawikiExtensionFFS
..

Remove MediawikiExtensionFFS

* All extensions have been converted to JsonFFS
* It is a bad format and I want to discourage its use

Change-Id: I7e5d96d0a6d4081672e15db85358c2aa0573f046
---
D ffs/MediaWikiExtensionFFS.php
M ffs/MediaWikiExtensions.php
M tests/phpunit/MediaWikiExtensionTest.php
D tests/phpunit/data/MediaWikiExtensionTest-conf1.yaml
M tests/phpunit/data/MediaWikiExtensionTest-conf2.yaml
M tests/phpunit/data/MediaWikiExtensionTest-conf4.yaml
M tests/phpunit/data/mediawiki-extensions.txt
D tests/phpunit/ffs/MediaWikiExtensionFFSTest.php
8 files changed, 7 insertions(+), 462 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/50/394850/1

diff --git a/ffs/MediaWikiExtensionFFS.php b/ffs/MediaWikiExtensionFFS.php
deleted file mode 100644
index a1aef9d..000
--- a/ffs/MediaWikiExtensionFFS.php
+++ /dev/null
@@ -1,288 +0,0 @@
-group->getSourceFilePath( $code );
-   if ( !file_exists( $filename ) ) {
-   return false;
-   }
-
-   if ( isset( self::$cache[$filename]['parsed'][$code] ) ) {
-   return self::$cache[$filename]['parsed'][$code];
-   }
-
-   if ( !isset( self::$cache[$filename] ) ) {
-   // Clear the cache if the filename changes to reduce 
memory use
-   self::$cache = [];
-
-   $contents = file_get_contents( $filename );
-   self::$cache[$filename]['sections'] =
-   $this->splitSections( $contents, $filename );
-   }
-
-   // Shorten
-   $cache = ::$cache[$filename];
-
-   $value = false;
-   if ( isset( $cache['sections'][$code] ) ) {
-   $value = $this->readFromVariable( 
$cache['sections'][$code] );
-   }
-
-   $cache['parsed'][$code] = $value;
-
-   return $value;
-   }
-
-   /**
-* @param string $data
-* @return array Parsed data.
-* @throws MWException
-*/
-   public function readFromVariable( $data ) {
-   $messages = [];
-   eval( $data );
-
-   $c = count( $messages );
-   if ( $c !== 1 ) {
-   throw new MWException( "MWEFFS3: Expected 1, got $c: 
$data" );
-   }
-
-   $messages = array_shift( $messages );
-   $mangler = $this->group->getMangler();
-   $messages = $mangler->mangle( $messages );
-
-   return [
-   'MESSAGES' => $messages,
-   ];
-   }
-
-   // Handled in writeReal
-   protected function tryReadSource( $filename, MessageCollection 
$collection ) {
-   }
-
-   /**
-* @param MessageCollection $collection
-* @return string
-*/
-   protected function writeReal( MessageCollection $collection ) {
-   $mangler = $this->group->getMangler();
-   $code = $collection->getLanguage();
-
-   $block = $this->generateMessageBlock( $collection, $mangler );
-   if ( $block === false ) {
-   return '';
-   }
-
-   // Ugly code, relies on side effects
-   // Avoid parsing stuff with fake language code
-   // Premature optimization
-   $this->read( 'mul' );
-   $filename = $this->group->getSourceFilePath( $code );
-   $cache = ::$cache[$filename];
-
-   // Generating authors
-   if ( isset( $cache['sections'][$code] ) ) {
-   // More premature optimization
-   $fromFile = self::parseAuthorsFromString( 
$cache['sections'][$code] );
-   $collection->addCollectionAuthors( $fromFile );
-   }
-
-   $authors = $collection->getAuthors();
-   $authors = $this->filterAuthors( $authors, $code );
-
-   $authorList = '';
-   foreach ( $authors as $author ) {
-   $authorList .= "\n * @author $author";
-   }
-
-   // And putting all together
-   $name = TranslateUtils::getLanguageName( $code );
-   $native = TranslateUtils::getLanguageName( $code, $code );
-
-   $section = <getSourceLanguage(),
-   $wgTranslateDocumentationLanguageCode,
-   ];
-   foreach ( $codes as $pcode ) {
-   if ( isset( $sections[$pcode] ) ) {
-   $priority[] = $sections[$pcode];
-   unset( 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add anchors to Special:ListDatatypes

2017-12-03 Thread Code Review
Matěj Suchánek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394849 )

Change subject: Add anchors to Special:ListDatatypes
..

Add anchors to Special:ListDatatypes

Bug: T181371
Change-Id: I2d499f3774b4d84148d699b17cec4d1b5c863d76
---
M repo/includes/Specials/SpecialListDatatypes.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/Specials/SpecialListDatatypes.php 
b/repo/includes/Specials/SpecialListDatatypes.php
index 6175626..742121d 100644
--- a/repo/includes/Specials/SpecialListDatatypes.php
+++ b/repo/includes/Specials/SpecialListDatatypes.php
@@ -68,7 +68,7 @@
 
return Html::rawElement(
'dt',
-   [],
+   [ 'id' => $dataTypeId ],
$this->msg( $baseKey . '-head' )->parse()
)
. Html::rawElement( 'dd', [],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d499f3774b4d84148d699b17cec4d1b5c863d76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add Spanish namespace translations to Wikibase

2017-12-03 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394848 )

Change subject: Add Spanish namespace translations to Wikibase
..

Add Spanish namespace translations to Wikibase

Bug: T181927
Change-Id: I2f8fe23c67b1e15153eec7d22d6bcd596e97
---
M repo/Wikibase.i18n.namespaces.php
1 file changed, 11 insertions(+), 0 deletions(-)


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

diff --git a/repo/Wikibase.i18n.namespaces.php 
b/repo/Wikibase.i18n.namespaces.php
index ab01cd2..4885818 100644
--- a/repo/Wikibase.i18n.namespaces.php
+++ b/repo/Wikibase.i18n.namespaces.php
@@ -76,6 +76,17 @@
WB_NS_QUERY_TALK => 'Abfragediskussion',
 ];
 
+$namespaceNames['es'] = [
+   WB_NS_ITEM  => 'Elemento',
+   WB_NS_ITEM_TALK => 'Elemento_discusión',
+
+   WB_NS_PROPERTY  => 'Propiedad',
+   WB_NS_PROPERTY_TALK => 'Propiedad_discusión',
+
+   WB_NS_QUERY  => 'Consulta',
+   WB_NS_QUERY_TALK => 'Consulta_discusión',
+];
+
 $namespaceNames['he'] = [
WB_NS_ITEM  => 'פריט',
WB_NS_ITEM_TALK => 'שיחת_פריט',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Component: Add some CSS spacing before table collapsing button

2017-12-03 Thread Eflyjason (Code Review)
Eflyjason has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394847 )

Change subject: Component: Add some CSS spacing before table collapsing button
..

Component: Add some CSS spacing before table collapsing button

Also addressing the problem of an extra return line before  which 
results in some extra space. (https://phabricator.wikimedia.org/T178998#3805423)

Bug: T178998
Change-Id: Iabae4e2d32be1adaf27bcefe9041afbea70342c5
---
M includes/parser/Parser.php
M resources/src/jquery/jquery.makeCollapsible.css
M tests/parser/parserTests.txt
3 files changed, 117 insertions(+), 118 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/394847/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 3548da9..14c9ab9 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -1076,7 +1076,7 @@
$attributes = $this->mStripState->unstripBoth( 
$matches[2] );
$attributes = Sanitizer::fixTagAttributes( 
$attributes, 'table' );
 
-   $outLine = str_repeat( '', 
$indent_level ) . "";
+   $outLine = str_repeat( '', 
$indent_level ) . "\n";
array_push( $td_history, false );
array_push( $last_tag_history, '' );
array_push( $tr_history, false );
@@ -1088,7 +1088,7 @@
continue;
} elseif ( $first_two === '|}' ) {
# We are ending a table
-   $line = '' . substr( $line, 2 );
+   $line = "\n" . substr( $line, 2 );
$last_tag = array_pop( $last_tag_history );
 
if ( !array_pop( $has_opened_tr ) ) {
@@ -1096,7 +1096,7 @@
}
 
if ( array_pop( $tr_history ) ) {
-   $line = "{$line}";
+   $line = "\n{$line}";
}
 
if ( array_pop( $td_history ) ) {
@@ -1120,11 +1120,11 @@
array_push( $has_opened_tr, true );
 
if ( array_pop( $tr_history ) ) {
-   $line = '';
+   $line = "\n";
}
 
if ( array_pop( $td_history ) ) {
-   $line = "{$line}";
+   $line = "\n{$line}";
}
 
$outLine = $line;
@@ -1207,7 +1207,7 @@
array_push( $td_history, true );
}
}
-   $out .= $outLine . "\n";
+   $out .= $outLine;
}
 
# Closing open td, tr && table
diff --git a/resources/src/jquery/jquery.makeCollapsible.css 
b/resources/src/jquery/jquery.makeCollapsible.css
index 2e5efba..b6322ba 100644
--- a/resources/src/jquery/jquery.makeCollapsible.css
+++ b/resources/src/jquery/jquery.makeCollapsible.css
@@ -5,6 +5,7 @@
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
+   padding-left: 0.2em;
 }
 /* Align the toggle based on the direction of the content language */
 /* @noflip */
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 7af3a36..4566a7f 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -355,7 +355,7 @@
 b
 
 a
-
+   
 b
 
 a
@@ -420,12 +420,12 @@
 !! wikitext
 
 a
- 
+
 b
 
 a
- 
- 
+
+
 b
 
 !! html
@@ -435,7 +435,7 @@
 
 
 a
- 
+
 b
 
 
@@ -455,16 +455,16 @@
 b
 
 a
- 
+
 
  
 b
 
 a
- 
+
  
  
- 
+
 b
 
 !! html
@@ -482,7 +482,7 @@
 
 
 a
- 
+
 b
 
 
@@ -1707,7 +1707,7 @@
 !! html
 a
 
- b 
+ b
 
 c
 
@@ -1839,7 +1839,7 @@
 Comment on its own line post-expand with non-significant whitespace
 !! wikitext
 a
- {{blank}}  
+ {{blank}} 
 b
 !! html
 a
@@ -2752,7 +2752,7 @@
 
 {{echo|{{echo|b}} }}
 
-{{echo| c 
+{{echo| c
 }}
 
 {{echo| {{echo|d}}
@@ -2767,10 +2767,10 @@
 {{echo|
  }}g
 !! html
-a 
-b 
+a
+b
 
-c 
+c
 
 
 
@@ -2810,8 +2810,8 @@
 !! options
 parsoid=wt2html
 !! wikitext
-{{  
-  echo  
+{{
+  echo
   
 
  |foo}}
@@ -3117,14 +3117,13 @@
  |}
 !! html
 
-
 
 h1
-h2
-
+h2
 foo
-bar
-
+bar
+
+
 
 !!end
 
@@ -3137,10 +3136,10 @@
 |}
 !! html
 
-
 
-foo
-
+foo
+
+
 
 !!end
 
@@ -3153,11 +3152,11 @@
 |}
 !! html
 
- foo
-
+ foo
 
- bar
-
+ bar
+
+
 
 !!end
 
@@ -3173,8 +3172,9 @@
 
 
 
- b
-
+ b
+
+
 
 

[MediaWiki-commits] [Gerrit] mediawiki...TocTree[master]: Rename TocTree.hooks.php to TocTreeHooks.php

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

Change subject: Rename TocTree.hooks.php to TocTreeHooks.php
..


Rename TocTree.hooks.php to TocTreeHooks.php

This avoids the MediaWiki.Files.ClassMatchesFilename.NotMatch exception
in .phpcs.xml.

Change-Id: I0aac6d8f2d1b9cae38974e012e930cfb7ce03e36
---
M .phpcs.xml
M TocTree.php
R TocTreeHooks.php
M extension.json
4 files changed, 3 insertions(+), 5 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index 88acdef..58669e2 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -1,8 +1,6 @@
 
 
-   
-   
-   
+   
.


diff --git a/TocTree.php b/TocTree.php
index 7d71d55..9fad96f 100644
--- a/TocTree.php
+++ b/TocTree.php
@@ -18,7 +18,7 @@
 $wgMessagesDirs['TocTree'] = __DIR__ . '/i18n';
 
 // autoloader
-$wgAutoloadClasses['TocTreeHooks'] = __DIR__ . '/TocTree.hooks.php';
+$wgAutoloadClasses['TocTreeHooks'] = __DIR__ . '/TocTreeHooks.php';
 
 // hooks
 $wgHooks['BeforePageDisplay'][] = 'TocTreeHooks::wfTocTreeParserOutput';
diff --git a/TocTree.hooks.php b/TocTreeHooks.php
similarity index 100%
rename from TocTree.hooks.php
rename to TocTreeHooks.php
diff --git a/extension.json b/extension.json
index c983b6d..f81fe7c 100644
--- a/extension.json
+++ b/extension.json
@@ -19,7 +19,7 @@
]
},
"AutoloadClasses": {
-   "TocTreeHooks": "TocTree.hooks.php"
+   "TocTreeHooks": "TocTreeHooks.php"
},
"ResourceModules": {
"ext.toctree": {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0aac6d8f2d1b9cae38974e012e930cfb7ce03e36
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TocTree
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
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] mediawiki...CodeMirror[master]: Rename CodeMirror.hooks.php to CodeMirrorHooks.php

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

Change subject: Rename CodeMirror.hooks.php to CodeMirrorHooks.php
..


Rename CodeMirror.hooks.php to CodeMirrorHooks.php

This avoids the MediaWiki.Files.ClassMatchesFilename.NotMatch exception
in .phpcs.xml.

Change-Id: I599016f4754f24b16394bdf1ba45bb20862fcd2a
---
M .phpcs.xml
R CodeMirrorHooks.php
M extension.json
3 files changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index d8ec4f6..3553f4e 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -2,7 +2,6 @@
 


-   

.

diff --git a/CodeMirror.hooks.php b/CodeMirrorHooks.php
similarity index 100%
rename from CodeMirror.hooks.php
rename to CodeMirrorHooks.php
diff --git a/extension.json b/extension.json
index 3456b07..58cf74c 100644
--- a/extension.json
+++ b/extension.json
@@ -18,7 +18,7 @@
]
},
"AutoloadClasses": {
-   "CodeMirrorHooks": "CodeMirror.hooks.php",
+   "CodeMirrorHooks": "CodeMirrorHooks.php",
"ResourceLoaderCodeMirrorModule": 
"ResourceLoaderCodeMirrorModule.php"
},
"ResourceModules": {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I599016f4754f24b16394bdf1ba45bb20862fcd2a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
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] operations/mediawiki-config[master]: Delete mowiki and mowiktionary

2017-12-03 Thread MarcoAurelio (Code Review)
MarcoAurelio has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394846 )

Change subject: Delete mowiki and mowiktionary
..

Delete mowiki and mowiktionary

Bug: T181923
Change-Id: I0555ba09cfc6807fb446bc1c60d9d405cf508f1e
---
M dblists/all.dblist
M dblists/closed.dblist
M dblists/deleted.dblist
M dblists/flow.dblist
M dblists/group0.dblist
M dblists/nowikidatadescriptiontaglines.dblist
M dblists/pp_stage1.dblist
M dblists/s3.dblist
M dblists/securepollglobal.dblist
M dblists/small.dblist
M dblists/visualeditor-nondefault.dblist
M dblists/wikidataclient.dblist
M dblists/wikipedia-english.dblist
M dblists/wikipedia.dblist
M dblists/wiktionary.dblist
M wikiversions.json
16 files changed, 3 insertions(+), 24 deletions(-)


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

diff --git a/dblists/all.dblist b/dblists/all.dblist
index 8f6e706..b16a0a9 100644
--- a/dblists/all.dblist
+++ b/dblists/all.dblist
@@ -516,8 +516,6 @@
 mnwikibooks
 mnwiktionary
 movementroleswiki
-mowiki
-mowiktionary
 mrjwiki
 mrwiki
 mrwikibooks
diff --git a/dblists/closed.dblist b/dblists/closed.dblist
index 3a779e1..2e502f2 100644
--- a/dblists/closed.dblist
+++ b/dblists/closed.dblist
@@ -62,8 +62,6 @@
 mhwiktionary
 miwikibooks
 mnwikibooks
-mowiki
-mowiktionary
 muswiki
 mywikibooks
 nahwikibooks
diff --git a/dblists/deleted.dblist b/dblists/deleted.dblist
index 08257fe..5b0379a 100644
--- a/dblists/deleted.dblist
+++ b/dblists/deleted.dblist
@@ -10,6 +10,8 @@
 flaggedrevs_labswikimedia
 langcomwiki
 liquidthreads_labswikimedia
+mowiki
+mowiktionary
 noboardwiki
 nomcomwiki
 readerfeedback_labswikimedia
@@ -27,4 +29,4 @@
 ukwikimedia
 vewikimedia
 zh_cnwiki
-zh_twwiki
+zh_twwiki
\ No newline at end of file
diff --git a/dblists/flow.dblist b/dblists/flow.dblist
index 4a36f5e..dab03fa 100644
--- a/dblists/flow.dblist
+++ b/dblists/flow.dblist
@@ -480,8 +480,6 @@
 mnwiki
 mnwikibooks
 mnwiktionary
-mowiki
-mowiktionary
 mrjwiki
 mrwiki
 mrwikibooks
diff --git a/dblists/group0.dblist b/dblists/group0.dblist
index 9ac731a..18c4c8a 100644
--- a/dblists/group0.dblist
+++ b/dblists/group0.dblist
@@ -63,8 +63,6 @@
 mhwiktionary
 miwikibooks
 mnwikibooks
-mowiki
-mowiktionary
 muswiki
 mywikibooks
 nahwikibooks
diff --git a/dblists/nowikidatadescriptiontaglines.dblist 
b/dblists/nowikidatadescriptiontaglines.dblist
index 6ccf727..68627d4 100644
--- a/dblists/nowikidatadescriptiontaglines.dblist
+++ b/dblists/nowikidatadescriptiontaglines.dblist
@@ -265,7 +265,6 @@
 mnwikibooks
 mnwiktionary
 movementroleswiki
-mowiktionary
 mrwikibooks
 mrwikisource
 mrwiktionary
diff --git a/dblists/pp_stage1.dblist b/dblists/pp_stage1.dblist
index bee10a2..5769af5 100644
--- a/dblists/pp_stage1.dblist
+++ b/dblists/pp_stage1.dblist
@@ -167,7 +167,6 @@
 mkwiki
 mlwiki
 mnwiki
-mowiki
 mrjwiki
 mrwiki
 mswiki
diff --git a/dblists/s3.dblist b/dblists/s3.dblist
index 4761693..86195b0 100644
--- a/dblists/s3.dblist
+++ b/dblists/s3.dblist
@@ -492,8 +492,6 @@
 mnwikibooks
 mnwiktionary
 movementroleswiki
-mowiki
-mowiktionary
 mrjwiki
 mrwiki
 mrwikibooks
diff --git a/dblists/securepollglobal.dblist b/dblists/securepollglobal.dblist
index 44f4aa5..858ec5f 100644
--- a/dblists/securepollglobal.dblist
+++ b/dblists/securepollglobal.dblist
@@ -509,8 +509,6 @@
 mnwikibooks
 mnwiktionary
 movementroleswiki
-mowiki
-mowiktionary
 mrjwiki
 mrwiki
 mrwikibooks
diff --git a/dblists/small.dblist b/dblists/small.dblist
index 3d80cd7..1428446 100644
--- a/dblists/small.dblist
+++ b/dblists/small.dblist
@@ -276,8 +276,6 @@
 mlwikiquote
 mnwikibooks
 movementroleswiki
-mowiki
-mowiktionary
 mrwikibooks
 mrwikiquote
 mrwikisource
diff --git a/dblists/visualeditor-nondefault.dblist 
b/dblists/visualeditor-nondefault.dblist
index 5c12baa..ccc2575 100644
--- a/dblists/visualeditor-nondefault.dblist
+++ b/dblists/visualeditor-nondefault.dblist
@@ -334,7 +334,6 @@
 mnwikibooks
 mnwiktionary
 movementroleswiki
-mowiktionary
 mrwikibooks
 mrwikiquote
 mrwikisource
diff --git a/dblists/wikidataclient.dblist b/dblists/wikidataclient.dblist
index 2284dbf..c5f804b 100644
--- a/dblists/wikidataclient.dblist
+++ b/dblists/wikidataclient.dblist
@@ -379,7 +379,6 @@
 mlwikisource
 mnwiki
 mnwikibooks
-mowiki
 mrjwiki
 mrwiki
 mrwikibooks
diff --git a/dblists/wikipedia-english.dblist b/dblists/wikipedia-english.dblist
index 8661b9a..0266015 100644
--- a/dblists/wikipedia-english.dblist
+++ b/dblists/wikipedia-english.dblist
@@ -163,7 +163,6 @@
 mkwiki
 mlwiki
 mnwiki
-mowiki
 mrjwiki
 mswiki
 mtwiki
diff --git a/dblists/wikipedia.dblist b/dblists/wikipedia.dblist
index 11c82b7..cf99f7e 100644
--- a/dblists/wikipedia.dblist
+++ b/dblists/wikipedia.dblist
@@ -174,7 +174,6 @@
 mkwiki
 mlwiki
 mnwiki
-mowiki
 mrjwiki
 mrwiki
 mswiki
diff --git a/dblists/wiktionary.dblist b/dblists/wiktionary.dblist
index eb0f2af..f859156 100644
--- a/dblists/wiktionary.dblist

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: .gitignore: Exclude Extension:Score generated files

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

Change subject: .gitignore: Exclude Extension:Score generated files
..


.gitignore: Exclude Extension:Score generated files

Change-Id: Ic9cd0051cc8bd241b933037466a2af76d0f6a287
---
M .gitignore
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index b991e11..bb3a946 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,8 @@
 /images/thumb
 ## Extension:EasyTimeline
 /images/timeline
+## Extension:Score
+/images/lilypond
 /images/tmp
 /maintenance/.mweval_history
 /maintenance/.mwsql_history

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9cd0051cc8bd241b933037466a2af76d0f6a287
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: 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] mediawiki...codesniffer[master]: Use only PSR2.Files.EndFileNewline

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

Change subject: Use only PSR2.Files.EndFileNewline
..


Use only PSR2.Files.EndFileNewline

The PSR2 sniff was picked over the Generic.Files.EndFileNewline one because
the PSR2 version specifically looks for Unix file endings ("\n").

Bug: T179998
Change-Id: I66992c8c35fdab584e05dd39721e3ef1b6dd1cea
---
M MediaWiki/ruleset.xml
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index 538fa79..bdabe2e 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -29,7 +29,6 @@

-->

-   




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66992c8c35fdab584e05dd39721e3ef1b6dd1cea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Addshore 
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] mediawiki...MinervaNeue[master]: Use png as fallback when svg fails to load

2017-12-03 Thread Divadsn (Code Review)
Divadsn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394845 )

Change subject: Use png as fallback when svg fails to load
..

Use png as fallback when svg fails to load

This patch will add a error handler when the original copyright logo a svg 
image is.
Should fix the bug after merging change 394820.

Bug: T166684
Change-Id: I2337b750c80e79c816dc817dfe230e063eed0345
---
M includes/skins/SkinMinerva.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/45/394845/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 659ed5e..68d48a9 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -51,6 +51,9 @@
'src' => $customLogos['copyright'],
'alt' => $footerSitename,
];
+   if ( strtolower( pathinfo( $customLogos['copyright'], 
PATHINFO_EXTENSION ) ) === "svg" ) {
+   $attributes['onerror'] = 
"this.src=this.src.replace( '.svg', '.png' ); this.onerror=null;";
+   }
if ( isset( $customLogos['copyright-height'] ) ) {
$attributes['height'] = 
$customLogos['copyright-height'];
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2337b750c80e79c816dc817dfe230e063eed0345
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: Divadsn 

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


[MediaWiki-commits] [Gerrit] mediawiki...FlickrAPI[master]: Add license-name to extension.json

2017-12-03 Thread Samwilson (Code Review)
Samwilson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394844 )

Change subject: Add license-name to extension.json
..

Add license-name to extension.json

Bug: T123943
Change-Id: Ie9d78eec13a5e67a1530c785a24e6e0368fa81ab
---
M extension.json
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlickrAPI 
refs/changes/44/394844/1

diff --git a/extension.json b/extension.json
index 5ca6384..e4b069a 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,7 @@
 {
"name": "FlickrAPI",
-   "version": "2.0.0",
+   "version": "2.0.1",
+   "license-name": "GPL-2.0+",
"author": [
"Ike Hecht",
"Sam Wilson"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9d78eec13a5e67a1530c785a24e6e0368fa81ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlickrAPI
Gerrit-Branch: master
Gerrit-Owner: Samwilson 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add Koreant translation for Wikibase Respository

2017-12-03 Thread Revi (Code Review)
Revi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394843 )

Change subject: Add Koreant translation for Wikibase Respository
..

Add Koreant translation for Wikibase Respository

Change-Id: Id25259658dc8bc9f006dbea739173c9316a72194
Signed-off-by: Yongmin Hong 
---
M repo/Wikibase.i18n.namespaces.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/43/394843/1

diff --git a/repo/Wikibase.i18n.namespaces.php 
b/repo/Wikibase.i18n.namespaces.php
index ab01cd2..690676f 100644
--- a/repo/Wikibase.i18n.namespaces.php
+++ b/repo/Wikibase.i18n.namespaces.php
@@ -98,6 +98,17 @@
WB_NS_QUERY_TALK => 'Discussioni_query',
 ];
 
+$namespaceNames['ko'] = [
+   WB_NS_ITEM  => '항목',
+   WB_NS_ITEM_TALK => '항목토론',
+
+   WB_NS_PROPERTY  => '속성',
+   WB_NS_PROPERTY_TALK => '속성토론',
+
+   WB_NS_QUERY  => '쿼리',
+   WB_NS_QUERY_TALK => '쿼리토론',
+];
+
 $namespaceNames['nl'] = [
WB_NS_ITEM  => 'Item',
WB_NS_ITEM_TALK => 'Overleg_item',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id25259658dc8bc9f006dbea739173c9316a72194
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Revi 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: cleanup xml/sql dumps on all hosts that have them

2017-12-03 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394842 )

Change subject: cleanup xml/sql dumps on all hosts that have them
..

cleanup xml/sql dumps on all hosts that have them

on generator hosts, keep a small number for use for prefetch
for the next runl on hosts serving the dumps, keep as many as
we can make available to the public, given disk space

Bug: T181895
Change-Id: I04fc060fa607e0bedc7971e2fd4b830aec1b66d2
---
M hieradata/hosts/dataset1001.yaml
M hieradata/hosts/dumpsdata1001.yaml
M hieradata/hosts/dumpsdata1002.yaml
M hieradata/hosts/labstore1006.yaml
M hieradata/hosts/labstore1007.yaml
M hieradata/hosts/ms1001.yaml
M modules/dumps/manifests/web/cleanup.pp
M modules/dumps/manifests/web/cleanups/xmldumps.pp
M modules/dumps/manifests/web/xmldumps_active.pp
M modules/profile/manifests/dumps/web/cleanup.pp
10 files changed, 35 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/42/394842/1

diff --git a/hieradata/hosts/dataset1001.yaml b/hieradata/hosts/dataset1001.yaml
index 967f0c7..47ec977 100644
--- a/hieradata/hosts/dataset1001.yaml
+++ b/hieradata/hosts/dataset1001.yaml
@@ -1,5 +1,6 @@
 profile::dumps::cleanup::isreplica: true
 profile::dumps::miscdumpsdir: '/data/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
 
 profile::dumps::rsyncer:
   dumps_user: 'datasets'
diff --git a/hieradata/hosts/dumpsdata1001.yaml 
b/hieradata/hosts/dumpsdata1001.yaml
index 12f28b6..a435ccd 100644
--- a/hieradata/hosts/dumpsdata1001.yaml
+++ b/hieradata/hosts/dumpsdata1001.yaml
@@ -1,2 +1,4 @@
 profile::dumps::miscdumpsdir: '/data/otherdumps'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
+
 profile::dumps::cleanup::isreplica: false
diff --git a/hieradata/hosts/dumpsdata1002.yaml 
b/hieradata/hosts/dumpsdata1002.yaml
index 6cba27b..871da47 100644
--- a/hieradata/hosts/dumpsdata1002.yaml
+++ b/hieradata/hosts/dumpsdata1002.yaml
@@ -1,4 +1,5 @@
 profile::dumps::miscdumpsdir: '/data/otherdumps'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
 
 # this is currently a dumps generation fallback host,
 # we configure cleanups of old files there the
diff --git a/hieradata/hosts/labstore1006.yaml 
b/hieradata/hosts/labstore1006.yaml
index 549439b..e0cbf4f 100644
--- a/hieradata/hosts/labstore1006.yaml
+++ b/hieradata/hosts/labstore1006.yaml
@@ -1,4 +1,5 @@
 profile::dumps::miscdumpsdir: '/srv/dumps/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/srv/dumps/xmldatadumps/public'
 profile::dumps::cleanup::isreplica: true
 
 profile::dumps::rsyncer:
diff --git a/hieradata/hosts/labstore1007.yaml 
b/hieradata/hosts/labstore1007.yaml
index c74bbdb..e0cbf4f 100644
--- a/hieradata/hosts/labstore1007.yaml
+++ b/hieradata/hosts/labstore1007.yaml
@@ -1,3 +1,7 @@
+profile::dumps::miscdumpsdir: '/srv/dumps/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/srv/dumps/xmldatadumps/public'
+profile::dumps::cleanup::isreplica: true
+
 profile::dumps::rsyncer:
   dumps_user: 'dumpsgen'
   dumps_group: 'dumpsgen'
diff --git a/hieradata/hosts/ms1001.yaml b/hieradata/hosts/ms1001.yaml
index 1f7dd46..0dd4675 100644
--- a/hieradata/hosts/ms1001.yaml
+++ b/hieradata/hosts/ms1001.yaml
@@ -1,5 +1,6 @@
 profile::dumps::cleanup::isreplica: true
 profile::dumps::miscdumpsdir: '/data/xmldatadumps/public/other'
+profile::dumps::xmldumpspublicdir: '/data/xmldatadumps/public'
 
 profile::dumps::rsyncer:
   dumps_user: 'datasets'
diff --git a/modules/dumps/manifests/web/cleanup.pp 
b/modules/dumps/manifests/web/cleanup.pp
index e173d52..12cf8a4 100644
--- a/modules/dumps/manifests/web/cleanup.pp
+++ b/modules/dumps/manifests/web/cleanup.pp
@@ -1,6 +1,8 @@
 class dumps::web::cleanup(
 $miscdumpsdir = undef,
 $isreplica = undef,
+$publicdir = undef,
+$user = undef,
 ) {
 file { '/etc/dumps':
 ensure => 'directory',
@@ -22,4 +24,9 @@
 miscdumpsdir => $miscdumpsdir,
 isreplica=> $isreplica,
 }
+
+class {'::dumps::web::cleanups::xmldumps':
+publicdir=> $publicdir,
+user => $user,
+}
 }
diff --git a/modules/dumps/manifests/web/cleanups/xmldumps.pp 
b/modules/dumps/manifests/web/cleanups/xmldumps.pp
index 9784525..c36527d 100644
--- a/modules/dumps/manifests/web/cleanups/xmldumps.pp
+++ b/modules/dumps/manifests/web/cleanups/xmldumps.pp
@@ -44,8 +44,20 @@
 # less, so that when a new dump run starts and partial dumps are
 # copied over to the web server, space is available for that new
 # run BEFORE it is copied.
-$keeps = ['hugewikis.dblist:7', 'bigwikis.dblist:8', 'default:10']
-$keeps_content = join($keeps, "\n")
+
+# on generator hosts we must keep a minimum of 3 so that at any time
+# we have at least one old full dump around, with all revision content
+# which can be stolen 

[MediaWiki-commits] [Gerrit] mediawiki/debian[master]: Finalize 1:1.27.4-3 changelog

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

Change subject: Finalize 1:1.27.4-3 changelog
..

Finalize 1:1.27.4-3 changelog

Change-Id: I3ea94e02556bc5feba88038777fb1a6582fa7e9f
---
M debian/changelog
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/debian 
refs/changes/41/394841/1

diff --git a/debian/changelog b/debian/changelog
index cc3797b..5d3da93 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mediawiki (1:1.27.4-3) UNRELEASED; urgency=medium
+mediawiki (1:1.27.4-3) unstable; urgency=medium
 
   * Add basic tests via autopkgtest
   * Document mediawiki-jobrunner systemd unit in README.Debian

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ea94e02556bc5feba88038777fb1a6582fa7e9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/debian
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki/debian[master]: Document mediawiki-jobrunner systemd unit in README.Debian

2017-12-03 Thread Legoktm (Code Review)
Legoktm has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394839 )

Change subject: Document mediawiki-jobrunner systemd unit in README.Debian
..


Document mediawiki-jobrunner systemd unit in README.Debian

Change-Id: I643cbd48e53a2cae6a24b1b482a7b8948e521e0c
---
M debian/README.Debian
M debian/changelog
2 files changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/debian/README.Debian b/debian/README.Debian
index 622f44e..1361c59 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -12,6 +12,9 @@
If you wish to customize MediaWiki after installation, you can do
so. 
has details on how to go about that.
+   For a better experience, setting up a background job processor is
+   recommended, and a systemd service unit is provided for convenience.
+   Run $ systemctl enable mediawiki-jobrunner; to start it.
 
 Upgrading:
Upgrading to a new major MediaWiki version usually has associated
diff --git a/debian/changelog b/debian/changelog
index a9ac1de..cc3797b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
 mediawiki (1:1.27.4-3) UNRELEASED; urgency=medium
 
   * Add basic tests via autopkgtest
+  * Document mediawiki-jobrunner systemd unit in README.Debian
 
- -- Kunal Mehta   Sat, 25 Nov 2017 16:29:10 -0800
+ -- Kunal Mehta   Sun, 03 Dec 2017 00:20:33 -0800
 
 mediawiki (1:1.27.4-2) unstable; urgency=medium
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I643cbd48e53a2cae6a24b1b482a7b8948e521e0c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/debian
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Muehlenhoff 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: simplify cleanup of old xml/sql dumps

2017-12-03 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394763 )

Change subject: simplify cleanup of old xml/sql dumps
..


simplify cleanup of old xml/sql dumps

Don't bother retrieving a list of all wikis, just walk through all
the immediate subdirs of the dumps tree and process those with
dirs that look like dump runs (names MMDD)

Since there's no all.dblist any more, have a default entry
in the conf file for the number of dumps to keep

Bug: T181895
Change-Id: Ic62c381f087c4c018b261f85b8b6db81a3f15ea0
---
M modules/dumps/files/web/cleanups/cleanup_old_xmldumps.py
R modules/dumps/manifests/web/cleanups/xmldumps.pp
M modules/dumps/manifests/web/xmldumps_active.pp
3 files changed, 64 insertions(+), 44 deletions(-)

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



diff --git a/modules/dumps/files/web/cleanups/cleanup_old_xmldumps.py 
b/modules/dumps/files/web/cleanups/cleanup_old_xmldumps.py
index b58294d..b268257 100644
--- a/modules/dumps/files/web/cleanups/cleanup_old_xmldumps.py
+++ b/modules/dumps/files/web/cleanups/cleanup_old_xmldumps.py
@@ -11,6 +11,7 @@
 import sys
 import getopt
 import shutil
+import re
 
 
 def usage(message=None):
@@ -24,13 +25,13 @@
 sys.stderr.write("\n")
 usage_message = """
 Usage: cleanup_old_xmldumps.py --keeps_conffile path --wikilists dir
-   [--help]
+   [--subdirs] [--dryrun] [--help]
 
 Given a directory with files with lists of wikis,
 settings in a file describing how many dumps to keep
 for wikis in each list, and the path of the directory
 tree of the dumps, looks through each directory
-treepath/wiki/ to be sure that there are no more than
+treepath/wikiname/ to be sure that there are no more than
 the specified number of dump directories. Dump directories
 are subdirectories with the format MMDD; the rest are
 ignored.
@@ -45,6 +46,12 @@
   dumps per wiki we keep, for each file
   containing a list of wikis
   --wiki   (-w):  wiki for which to dump config settings
+  --subdirs(-s):  directories in treepath must
+  match this expression in order to
+  be examined and cleaned up.
+  default: '*wik*'
+  --dryrun (-D):  don't remove anything, display what
+  would be removed
   --help   (-h):  display this usage message
 
 File formats:
@@ -56,7 +63,8 @@
dumps to keep.  Example: enwiki:3
Note that blank lines or lines starting with '#' in both types
of files will be skipped.
-
+   An entry 'default:number' will be the value used for any wikis
+   not in one of the specified lists.
 Example:
   cleanup_old_xmldumps.py -k /etc/dumps/xml_keeps.conf \
-d /mnt/dumpsdata/xmldatadumps/public -w /etc/dumps/dblists
@@ -65,7 +73,7 @@
 sys.exit(1)
 
 
-def get_wikilists(wikilists_dir):
+def get_wikilists(wikilists_dir, knownlists):
 """
 read lists of wikis from files in a specified dir,
 skipping comments and blank lines, return dict of
@@ -74,10 +82,22 @@
 wikilists = {}
 files = os.listdir(wikilists_dir)
 for filename in files:
-with open(os.path.join(wikilists_dir, filename), "r") as fhandle:
-lines = fhandle.readlines()
-wikilists[filename] = [line.strip() for line in lines if line and not 
line.startswith('#')]
+if filename in knownlists:
+with open(os.path.join(wikilists_dir, filename), "r") as fhandle:
+lines = fhandle.readlines()
+wikilists[filename] = [line.strip() for line in lines
+   if line and not line.startswith('#')]
 return wikilists
+
+
+def get_allwikis(dumpsdir, match):
+"""
+return list of all subdirectories of dumpsdir matching the
+supplied regular expression
+"""
+subdirs = os.listdir(dumpsdir)
+return [subdir for subdir in subdirs
+if re.match(match, subdir) and 
os.path.isdir(os.path.join(dumpsdir, subdir))]
 
 
 def get_keeps(keeps_conffile):
@@ -109,21 +129,37 @@
 """
 methods for finding and cleaning up old wiki dump dirs
 """
-def __init__(self, keeps_conffile, wikilists_dir, dumpsdir, dryrun):
+def __init__(self, keeps_conffile, wikilists_dir, dumpsdir, wikipattern, 
dryrun):
 self.keeps_per_list = get_keeps(keeps_conffile)
-self.wikilists = get_wikilists(wikilists_dir)
+self.wikilists = get_wikilists(wikilists_dir, 
self.keeps_per_list.keys())
 self.dumpsdir = dumpsdir
+self.wikistoclean = get_allwikis(self.dumpsdir, wikipattern)
 self.dryrun = dryrun
 
 def get_dumps(self, wiki):
 """
 get list of subdirs for dumpsdir/wiki/ in format DDMM
+all other subdirs are skipped.
 """
 path = os.path.join(self.dumpsdir, wiki)
 if 

[MediaWiki-commits] [Gerrit] mediawiki/debian[master]: Finalize 1:1.27.4-3 changelog

2017-12-03 Thread Legoktm (Code Review)
Legoktm has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394841 )

Change subject: Finalize 1:1.27.4-3 changelog
..


Finalize 1:1.27.4-3 changelog

Change-Id: I3ea94e02556bc5feba88038777fb1a6582fa7e9f
---
M debian/changelog
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/debian/changelog b/debian/changelog
index cc3797b..5d3da93 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mediawiki (1:1.27.4-3) UNRELEASED; urgency=medium
+mediawiki (1:1.27.4-3) unstable; urgency=medium
 
   * Add basic tests via autopkgtest
   * Document mediawiki-jobrunner systemd unit in README.Debian

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ea94e02556bc5feba88038777fb1a6582fa7e9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/debian
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 

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