[MediaWiki-commits] [Gerrit] Add php-composer-validate for wikimedia/wikimania-scholarships - change (integration/config)

2015-01-04 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Add php-composer-validate for wikimedia/wikimania-scholarships
..

Add php-composer-validate for wikimedia/wikimania-scholarships

Change-Id: Ib32ce56d0407d90dcf04b9ad61fcfebb25668fcb
---
M zuul/layout.yaml
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/69/182769/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 60e5b82..08775b0 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2697,14 +2697,17 @@
 check:
  - wikimedia-wikimania-scholarships-jslint
  - wikimedia-wikimania-scholarships-phplint
+ - php-composer-validate
 test:
  - wikimedia-wikimania-scholarships-jslint
  - wikimedia-wikimania-scholarships-phplint
  - wikimedia-wikimania-scholarships-phpunit
+ - php-composer-validate
 gate-and-submit:
  - wikimedia-wikimania-scholarships-jslint
  - wikimedia-wikimania-scholarships-phplint
  - wikimedia-wikimania-scholarships-phpunit
+ - php-composer-validate
 
  MediaWiki extensions ##
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib32ce56d0407d90dcf04b9ad61fcfebb25668fcb
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] Install the ldap-codfw cert on nembus. - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Install the ldap-codfw cert on nembus.
..


Install the ldap-codfw cert on nembus.

Nembus will soon replace labcontrol2001 as the codfw ldap server.

Phab T84751

Change-Id: I33f90c3eb602ae9714d17953661a070929e15577
---
M modules/ldap/manifests/role/server.pp
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/modules/ldap/manifests/role/server.pp 
b/modules/ldap/manifests/role/server.pp
index bdcba94..446abc7 100644
--- a/modules/ldap/manifests/role/server.pp
+++ b/modules/ldap/manifests/role/server.pp
@@ -20,6 +20,11 @@
 'production': {
 case $::hostname {
 'labcontrol2001': {
+# Remove this section once nembus is up and running
+$ca_name = 'GlobalSign_CA.pem'
+$certificate = 'ldap-codfw.wikimedia.org'
+}
+'nembus': {
 $ca_name = 'GlobalSign_CA.pem'
 $certificate = 'ldap-codfw.wikimedia.org'
 }
@@ -28,7 +33,7 @@
 $certificate = 'ldap-eqiad.wikimedia.org'
 }
 'default': {
-fail('Production realm ldap certificates for 
virt1000/labcontrol2001 only!')
+fail('Production realm ldap certificates for 
nembus/neptunium only!')
 }
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I33f90c3eb602ae9714d17953661a070929e15577
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Install the ldap-codfw cert on nembus. - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Install the ldap-codfw cert on nembus.
..

Install the ldap-codfw cert on nembus.

Nembus will soon replace labcontrol2001 as the codfw ldap server.

Phab T84751

Change-Id: I33f90c3eb602ae9714d17953661a070929e15577
---
M modules/ldap/manifests/role/server.pp
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/70/182770/1

diff --git a/modules/ldap/manifests/role/server.pp 
b/modules/ldap/manifests/role/server.pp
index bdcba94..446abc7 100644
--- a/modules/ldap/manifests/role/server.pp
+++ b/modules/ldap/manifests/role/server.pp
@@ -20,6 +20,11 @@
 'production': {
 case $::hostname {
 'labcontrol2001': {
+# Remove this section once nembus is up and running
+$ca_name = 'GlobalSign_CA.pem'
+$certificate = 'ldap-codfw.wikimedia.org'
+}
+'nembus': {
 $ca_name = 'GlobalSign_CA.pem'
 $certificate = 'ldap-codfw.wikimedia.org'
 }
@@ -28,7 +33,7 @@
 $certificate = 'ldap-eqiad.wikimedia.org'
 }
 'default': {
-fail('Production realm ldap certificates for 
virt1000/labcontrol2001 only!')
+fail('Production realm ldap certificates for 
nembus/neptunium only!')
 }
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33f90c3eb602ae9714d17953661a070929e15577
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Make nembus an ldap server - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Make nembus an ldap server
..

Make nembus an ldap server

Phab T84751

Change-Id: I1044c93417e2549883afb528e7525edca51e0065
---
M manifests/site.pp
1 file changed, 10 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/68/182768/1

diff --git a/manifests/site.pp b/manifests/site.pp
index f03e24c..db889a2 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2823,21 +2823,24 @@
 #include role::deployment::salt_masters::labs
 }
 
+# Eqiad ldap server, aka ldap-eqiad
 node 'neptunium.wikimedia.org' {
 $cluster   = 'virt'
-#$is_puppet_master  = true
-#$is_labs_puppet_master = true
-#$use_neutron   = false
 
 include standard
 include admin
 include ldap::role::server::labs
 include ldap::role::client::labs
+}
 
-#include role::nova::controller
-#include role::nova::manager
-#include role::salt::masters::labs
-#include role::deployment::salt_masters::labs
+# Codfw ldap server
+node 'nembus.wikimedia.org' {
+$cluster   = 'virt'
+
+include standard
+include admin
+include ldap::role::server::labs
+include ldap::role::client::labs
 }
 
 node 'labnet1001.eqiad.wmnet' {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1044c93417e2549883afb528e7525edca51e0065
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Make nembus an ldap server - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Make nembus an ldap server
..


Make nembus an ldap server

Phab T84751

Change-Id: I1044c93417e2549883afb528e7525edca51e0065
---
M manifests/site.pp
1 file changed, 10 insertions(+), 7 deletions(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index f03e24c..db889a2 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2823,21 +2823,24 @@
 #include role::deployment::salt_masters::labs
 }
 
+# Eqiad ldap server, aka ldap-eqiad
 node 'neptunium.wikimedia.org' {
 $cluster   = 'virt'
-#$is_puppet_master  = true
-#$is_labs_puppet_master = true
-#$use_neutron   = false
 
 include standard
 include admin
 include ldap::role::server::labs
 include ldap::role::client::labs
+}
 
-#include role::nova::controller
-#include role::nova::manager
-#include role::salt::masters::labs
-#include role::deployment::salt_masters::labs
+# Codfw ldap server
+node 'nembus.wikimedia.org' {
+$cluster   = 'virt'
+
+include standard
+include admin
+include ldap::role::server::labs
+include ldap::role::client::labs
 }
 
 node 'labnet1001.eqiad.wmnet' {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1044c93417e2549883afb528e7525edca51e0065
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add README to provide synopsis of data aggregations - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add README to provide synopsis of data aggregations
..

Add README to provide synopsis of data aggregations

Change-Id: I1d718b6621974ff7348597870e1641d1a6adec11
---
A projectcounts/README.txt
1 file changed, 41 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator/data 
refs/changes/82/182682/1

diff --git a/projectcounts/README.txt b/projectcounts/README.txt
new file mode 100644
index 000..f867b88
--- /dev/null
+++ b/projectcounts/README.txt
@@ -0,0 +1,41 @@
+Projectcounts aggregates
+
+
+This directory holds aggregates of pageviews per wiki.
+
+
+
+Sources
+---
+
+The per wiki files underneath this directory take Webstatscollector's
+projectfiles as input. The data for 2008-01-01 up to 2014-09-22 is
+obtained from
+
+  http://dumps.wikimedia.org/other/pagecounts-ez/projectcounts/
+
+(and only contains numbers for the desktop site). The data from
+2014-09-23 onwards is obtained from
+
+  http://dumps.wikimedia.org/other/pagecounts-all-sites/
+
+(and contains numbers for the desktop, mobile, and zero site).
+
+
+
+Available aggregations
+--
+
+The following aggregations are available
+
+* `daily_raw`: Per wiki CSVs containing daily aggregates of the
+  projectcounts numbers. Those files are not sanitized in any way. So
+  it contains data for days that are known to be wrong. The `daily`
+  filters those bad dates out.
+
+* `daily`: Per wiki CSVs containing daily aggregates of the
+  projectcounts numbers. Those files only contain data for which no
+  further issues are known.
+
+For aggregations that filter away bad dates, `BAD_DATES.csv` contains
+the bad dates in a machine readable format.
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d718b6621974ff7348597870e1641d1a6adec11
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator/data
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Split between daily and daily_raw - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Split between daily and daily_raw
..

Split between daily and daily_raw

Change-Id: I93ebe5fd25d1fa5da27449622f39f25562407767
---
A projectcounts/BAD_DATES.csv
M projectcounts/daily/aawiki.csv
M projectcounts/daily/aawikibooks.csv
M projectcounts/daily/aawiktionary.csv
M projectcounts/daily/abwiki.csv
M projectcounts/daily/abwiktionary.csv
M projectcounts/daily/acewiki.csv
M projectcounts/daily/advisorywiki.csv
M projectcounts/daily/afwiki.csv
M projectcounts/daily/afwikibooks.csv
M projectcounts/daily/afwikiquote.csv
M projectcounts/daily/afwiktionary.csv
M projectcounts/daily/akwiki.csv
M projectcounts/daily/akwikibooks.csv
M projectcounts/daily/akwiktionary.csv
M projectcounts/daily/alswiki.csv
M projectcounts/daily/alswikibooks.csv
M projectcounts/daily/alswikiquote.csv
M projectcounts/daily/alswiktionary.csv
M projectcounts/daily/amwiki.csv
M projectcounts/daily/amwikiquote.csv
M projectcounts/daily/amwiktionary.csv
M projectcounts/daily/angwiki.csv
M projectcounts/daily/angwikibooks.csv
M projectcounts/daily/angwikiquote.csv
M projectcounts/daily/angwikisource.csv
M projectcounts/daily/angwiktionary.csv
M projectcounts/daily/anwiki.csv
M projectcounts/daily/anwiktionary.csv
M projectcounts/daily/arcwiki.csv
M projectcounts/daily/arwiki.csv
M projectcounts/daily/arwikibooks.csv
M projectcounts/daily/arwikimedia.csv
M projectcounts/daily/arwikinews.csv
M projectcounts/daily/arwikiquote.csv
M projectcounts/daily/arwikisource.csv
M projectcounts/daily/arwikiversity.csv
M projectcounts/daily/arwiktionary.csv
M projectcounts/daily/arzwiki.csv
M projectcounts/daily/astwiki.csv
M projectcounts/daily/astwikibooks.csv
M projectcounts/daily/astwikiquote.csv
M projectcounts/daily/astwiktionary.csv
M projectcounts/daily/aswiki.csv
M projectcounts/daily/aswikibooks.csv
M projectcounts/daily/aswikisource.csv
M projectcounts/daily/aswiktionary.csv
M projectcounts/daily/avwiki.csv
M projectcounts/daily/avwiktionary.csv
M projectcounts/daily/aywiki.csv
M projectcounts/daily/aywikibooks.csv
M projectcounts/daily/aywiktionary.csv
M projectcounts/daily/azwiki.csv
M projectcounts/daily/azwikibooks.csv
M projectcounts/daily/azwikiquote.csv
M projectcounts/daily/azwikisource.csv
M projectcounts/daily/azwiktionary.csv
M projectcounts/daily/barwiki.csv
M projectcounts/daily/bat_smgwiki.csv
M projectcounts/daily/bawiki.csv
M projectcounts/daily/bawikibooks.csv
M projectcounts/daily/bclwiki.csv
M projectcounts/daily/bdwikimedia.csv
M projectcounts/daily/be_x_oldwiki.csv
M projectcounts/daily/betawikiversity.csv
M projectcounts/daily/bewiki.csv
M projectcounts/daily/bewikibooks.csv
M projectcounts/daily/bewikimedia.csv
M projectcounts/daily/bewikiquote.csv
M projectcounts/daily/bewikisource.csv
M projectcounts/daily/bewiktionary.csv
M projectcounts/daily/bgwiki.csv
M projectcounts/daily/bgwikibooks.csv
M projectcounts/daily/bgwikinews.csv
M projectcounts/daily/bgwikiquote.csv
M projectcounts/daily/bgwikisource.csv
M projectcounts/daily/bgwiktionary.csv
M projectcounts/daily/bhwiki.csv
M projectcounts/daily/bhwiktionary.csv
M projectcounts/daily/biwiki.csv
M projectcounts/daily/biwikibooks.csv
M projectcounts/daily/biwiktionary.csv
M projectcounts/daily/bjnwiki.csv
M projectcounts/daily/bmwiki.csv
M projectcounts/daily/bmwikibooks.csv
M projectcounts/daily/bmwikiquote.csv
M projectcounts/daily/bmwiktionary.csv
M projectcounts/daily/bnwiki.csv
M projectcounts/daily/bnwikibooks.csv
M projectcounts/daily/bnwikisource.csv
M projectcounts/daily/bnwiktionary.csv
M projectcounts/daily/bowiki.csv
M projectcounts/daily/bowikibooks.csv
M projectcounts/daily/bowiktionary.csv
M projectcounts/daily/bpywiki.csv
M projectcounts/daily/brwiki.csv
M projectcounts/daily/brwikimedia.csv
M projectcounts/daily/brwikiquote.csv
M projectcounts/daily/brwikisource.csv
M projectcounts/daily/brwiktionary.csv
M projectcounts/daily/bswiki.csv
M projectcounts/daily/bswikibooks.csv
M projectcounts/daily/bswikinews.csv
M projectcounts/daily/bswikiquote.csv
M projectcounts/daily/bswikisource.csv
M projectcounts/daily/bswiktionary.csv
M projectcounts/daily/bugwiki.csv
M projectcounts/daily/bxrwiki.csv
M projectcounts/daily/cawiki.csv
M projectcounts/daily/cawikibooks.csv
M projectcounts/daily/cawikinews.csv
M projectcounts/daily/cawikiquote.csv
M projectcounts/daily/cawikisource.csv
M projectcounts/daily/cawiktionary.csv
M projectcounts/daily/cbk_zamwiki.csv
M projectcounts/daily/cdowiki.csv
M projectcounts/daily/cebwiki.csv
M projectcounts/daily/cewiki.csv
M projectcounts/daily/chowiki.csv
M projectcounts/daily/chrwiki.csv
M projectcounts/daily/chrwiktionary.csv
M projectcounts/daily/chwiki.csv
M projectcounts/daily/chwikibooks.csv
M projectcounts/daily/chwiktionary.csv
M projectcounts/daily/chywiki.csv
M projectcounts/daily/ckbwiki.csv
M projectcounts/daily/commonswiki.csv
M 

[MediaWiki-commits] [Gerrit] Strip line ending from internal CSV data representation - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Strip line ending from internal CSV data representation
..

Strip line ending from internal CSV data representation

Since we stripped the lines anyways upon reading, there is no need to
add the CRLF line ending right away. We now only add it upon
writing. This will make it easier to further aggregate CSV data, as we
need not take line ending into consideration there.

Change-Id: I70ced84bfc932d6fc219503727d9121be8051371
---
M aggregator/util.py
M tests/test_util.py
2 files changed, 23 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/74/182674/1

diff --git a/aggregator/util.py b/aggregator/util.py
index cb259bc..0d14e14 100644
--- a/aggregator/util.py
+++ b/aggregator/util.py
@@ -173,7 +173,7 @@
 
 if first_column != 'Date':
 # No header line
-csv_data[first_column] = line.strip() + CSV_LINE_ENDING
+csv_data[first_column] = line.strip()
 return csv_data
 
 
@@ -188,7 +188,8 @@
 with open(csv_file_abs, 'w') as csv_file:
 if header:
 csv_file.write('%s%s' % (header, CSV_LINE_ENDING))
-csv_file.writelines(sorted(csv_data.itervalues()))
+csv_file.writelines([line + CSV_LINE_ENDING
+ for line in sorted(csv_data.itervalues())])
 
 
 def update_csv_data_dict(csv_data, first_column, *other_columns):
@@ -202,5 +203,5 @@
 line = first_column
 for column in other_columns:
 line += ',%s' % (column)
-csv_data[first_column] = line + CSV_LINE_ENDING
+csv_data[first_column] = line
 return csv_data
diff --git a/tests/test_util.py b/tests/test_util.py
index 1861ce2..75e4011 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -237,14 +237,14 @@
 csv_data = {}
 actual = aggregator.update_csv_data_dict(csv_data, '2014-06-12')
 self.assertEqual(actual, {
-'2014-06-12': '2014-06-12\r\n'
+'2014-06-12': '2014-06-12'
 })
 
 def test_update_csv_data_dict_two_columns(self):
 csv_data = {}
 actual = aggregator.update_csv_data_dict(csv_data, '2014-06-12', '47')
 self.assertEqual(actual, {
-'2014-06-12': '2014-06-12,47\r\n'
+'2014-06-12': '2014-06-12,47'
 })
 
 def test_update_csv_data_dict_three_columns(self):
@@ -252,7 +252,7 @@
 actual = aggregator.update_csv_data_dict(csv_data, '2014-06-12', '47',
  '4711')
 self.assertEqual(actual, {
-'2014-06-12': '2014-06-12,47,4711\r\n'
+'2014-06-12': '2014-06-12,47,4711'
 })
 
 
@@ -308,8 +308,8 @@
 actual = aggregator.parse_csv_to_first_column_dict(csv_file_abs)
 
 self.assertEqual(actual, {
-'2014-05-12': '2014-05-12,1,2\r\n',
-'2014-05-13': '2014-05-13,3,4\r\n',
+'2014-05-12': '2014-05-12,1,2',
+'2014-05-13': '2014-05-13,3,4',
 })
 
 def test_csv_parser_small_with_header(self):
@@ -318,8 +318,8 @@
 actual = aggregator.parse_csv_to_first_column_dict(csv_file_abs)
 
 self.assertEqual(actual, {
-'2014-05-12': '2014-05-12,1,2\r\n',
-'2014-05-13': '2014-05-13,3,4\r\n',
+'2014-05-12': '2014-05-12,1,2',
+'2014-05-13': '2014-05-13,3,4',
 })
 
 def test_csv_parser_trailing_CR(self):
@@ -329,10 +329,10 @@
 actual = aggregator.parse_csv_to_first_column_dict(csv_file_abs)
 
 self.assertEqual(actual, {
-'2014-05-12': '2014-05-12,foo\r\n',
-'2014-05-13': '2014-05-13,bar\r\n',
-'2014-05-14': '2014-05-14,baz\r\n',
-'2014-05-15': '2014-05-15,quux\r\n',
+'2014-05-12': '2014-05-12,foo',
+'2014-05-13': '2014-05-13,bar',
+'2014-05-14': '2014-05-14,baz',
+'2014-05-15': '2014-05-15,quux',
 })
 
 def test_csv_writer_empty_dict_without_header(self):
@@ -353,8 +353,8 @@
 
 def test_csv_writer_simple_dict_without_header(self):
 csv_data = {
-2014-05-12: 2014-05-12,1,2\r\n,
-2014-05-13: 2014-05-13,3,4\r\n,
+2014-05-12: 2014-05-12,1,2,
+2014-05-13: 2014-05-13,3,4,
 }
 
 aggregator.write_dict_values_sorted_to_csv(
@@ -367,8 +367,8 @@
 
 def test_csv_writer_simple_dict_without_header_reverse(self):
 csv_data = {
-2014-05-13: 2014-05-13,3,4\r\n,
-2014-05-12: 2014-05-12,1,2\r\n,
+2014-05-13: 2014-05-13,3,4,
+2014-05-12: 2014-05-12,1,2,
 }
 
 aggregator.write_dict_values_sorted_to_csv(
@@ -381,8 +381,8 @@
 
 def 

[MediaWiki-commits] [Gerrit] Extracts CSV reading and writing into separate functions - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Extracts CSV reading and writing into separate functions
..

Extracts CSV reading and writing into separate functions

This change prepares for adding further aggregations, which have to
read and write csvs too.

Change-Id: I50a2ed9cae288383858ed688e640387f32b891d6
---
M aggregator/projectcounts.py
M aggregator/util.py
A tests/fixtures/csv_small_with_header.csv
A tests/fixtures/csv_small_without_header.csv
A tests/fixtures/csv_with_different_line_endings.csv
M tests/test_util.py
6 files changed, 259 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/73/182673/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 673fb80..e831c16 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -30,8 +30,6 @@
 PROJECTCOUNTS_STRFTIME_PATTERN = ('%%Y%s%%Y-%%m%sprojectcounts-%%Y%%m%%d-'
   '%%H' % (os.sep, os.sep))
 
-CSV_LINE_ENDING = '\r\n'
-
 cache = {}
 
 
@@ -150,21 +148,10 @@
 target_dir_abs, '*.csv'))):
 logging.info(Updating csv '%s' % (csv_file_abs))
 
-csv_data = {}
-
 dbname = os.path.basename(csv_file_abs)
 dbname = dbname.rsplit('.csv', 1)[0]
 
-with open(csv_file_abs, 'r') as csv_file:
-for line in csv_file:
-date_str = line.split(',')[0]
-if date_str in csv_data:
-raise RuntimeError(
-CSV contains the date '%s' twice % (date_str))
-
-if date_str != 'Date':
-# No header line
-csv_data[date_str] = line.strip() + CSV_LINE_ENDING
+csv_data = util.parse_csv_to_first_column_dict(csv_file_abs)
 
 for date in util.generate_dates(first_date, last_date):
 date_str = date.isoformat()
@@ -190,18 +177,18 @@
 source_dir_abs, abbreviation, date)
 
 # injecting obtained data
-csv_data[date_str] = '%s,%d,%d,%d,%d%s' % (
+util.update_csv_data_dict(
+csv_data,
 date_str,
 count_desktop + count_mobile + count_zero,
 count_desktop,
 count_mobile,
-count_zero,
-CSV_LINE_ENDING)
+count_zero)
 
-with open(csv_file_abs, 'w') as csv_file:
-csv_file.write('Date,Total,Desktop site,Mobile site,Zero site%s'
-   % (CSV_LINE_ENDING))
-csv_file.writelines(sorted(csv_data.itervalues()))
+util.write_dict_values_sorted_to_csv(
+csv_file_abs,
+csv_data,
+header='Date,Total,Desktop site,Mobile site,Zero site')
 
 
 def get_validity_issues_for_aggregated_projectcounts(data_dir_abs):
diff --git a/aggregator/util.py b/aggregator/util.py
index 08ec886..cb259bc 100644
--- a/aggregator/util.py
+++ b/aggregator/util.py
@@ -51,6 +51,8 @@
 ('wiki', ''),
 ]
 
+CSV_LINE_ENDING = '\r\n'
+
 
 def parse_string_to_date(date_str):
 Parse a string into a datetime.date.
@@ -141,3 +143,64 @@
 
 return abbreviation
 return None
+
+
+def parse_csv_to_first_column_dict(csv_file_abs):
+Parses a csv to a dictionary indexed by the first column
+
+The returned dictionary is indexed by a row's first column. And the
+corresponding value is the /whole/ line.
+
+If the file does not exist, the empty dictionary is returned.
+
+Rows starting in 'Date' are ignored.
+
+In case two different rows have the same first column, a RuntimeError gets
+raised.
+
+:param csv_file_abs: Absolute file name of the CSV that should get parsed.
+
+csv_data = {}
+
+if os.path.isfile(csv_file_abs):
+with open(csv_file_abs, 'r') as csv_file:
+for line in csv_file:
+first_column = line.split(',')[0]
+if first_column in csv_data:
+raise RuntimeError(
+CSV contains at least two rows starting in '%s' % (
+first_column))
+
+if first_column != 'Date':
+# No header line
+csv_data[first_column] = line.strip() + CSV_LINE_ENDING
+return csv_data
+
+
+def write_dict_values_sorted_to_csv(csv_file_abs, csv_data, header=None):
+
+Writes a dictionary's values sorted to a file.
+
+:param csv_file_abs: Absolute file name of where to wrie the csv data to.
+:param csv_file_abs: The csv data to write. Needs to be a dictionary.
+:param header: If given, gets used as header for the file.
+
+with open(csv_file_abs, 'w') as csv_file:
+if header:
+csv_file.write('%s%s' % 

[MediaWiki-commits] [Gerrit] Add weekly aggregations - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add weekly aggregations
..

Add weekly aggregations

Change-Id: Ia13ed04f59eb496d6014474b15b7b5a2de060c8f
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
M tests/test_projectcounts/test_helpers.py
M tests/test_projectcounts/test_monitoring.py
A tests/test_projectcounts/test_weekly_aggregation.py
M tests/test_projectcounts/testcases.py
6 files changed, 758 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/76/182676/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 983ad23..1fa39ed 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -184,6 +184,115 @@
 header=CSV_HEADER)
 
 
+def rescale_counts(csv_data, dates, bad_dates, rescale_to):
+Extracts relevant dates from CSV data, sums them up, and rescales them.
+
+If the dates only cover bad dates, None is returned.
+
+All dates are expected to have the same number of columns. In case they
+have not, the first good date is taken as reference. Missing columns for
+good dates are assumed to be 0.
+
+Upon other errors, a RuntimeError is raised.
+
+The rescaled counts are returned as list of integers.
+
+:param csv_data_input: The data dict to get data from
+:param dates: The dates to sum up counts for
+:param bad_dates: List of dates considered having bad data.
+:param rescale_to: Rescale the good entries to this many entries.
+
+ret = None
+aggregations = 0
+for date in dates:
+if date in bad_dates:
+continue
+date_str = date.isoformat()
+try:
+csv_line_items = csv_data[date_str].split(',')
+except KeyError:
+raise RuntimeError(No data for '%s' % (date_str))
+del csv_line_items[0]  # getting rid of date column
+if ret is None:
+ret = [0 for i in range(len(csv_line_items))]
+for i in range(len(ret)):
+try:
+ret[i] += int(csv_line_items[i])
+except IndexError:
+# csv_line_items has less items than the first good row.
+# We assume 0.
+pass
+aggregations += 1
+
+if ret is not None:
+# Since we found readings, rescale.
+ret = [(ret[i] * rescale_to) / aggregations for i in range(len(ret))]
+return ret
+
+
+def update_weekly_csv(target_dir_abs, dbname, csv_data_input, first_date,
+  last_date, bad_dates=[], force_recomputation=False):
+Updates weekly per project CSVs from a csv data dictionary.
+
+The existing per project CSV files in target_dir_abs/weekly are updated for
+all weeks where Sunday in in the date interval from first_date up to (and
+including) last_date.
+
+For weekly aggregations, a week's total data is rescaled to 7 days.
+
+If a week under consideration contains no good date, it is removed.
+
+Upon any error, the function raises an exception.
+
+:param target_dir_abs: Absolute directory. CSVs are getting written to the
+'weekly_rescaled' subdirectory of target_dir_abs.
+:param dbname: The database name of the wiki to consider (E.g.: 'enwiki')
+:param csv_data_input: The data dict to aggregate from
+:param first_date: The first date to compute non-existing data for.
+:param last_date: The last date to compute non-existing data for.
+:param bad_dates: List of dates considered having bad data. (Default: [])
+:param force_recomputation: If True, recompute data for the given days,
+even if it is already in the CSV. (Default: False)
+
+csv_dir_abs = os.path.join(target_dir_abs, 'weekly_rescaled')
+if not os.path.exists(csv_dir_abs):
+os.mkdir(csv_dir_abs)
+csv_file_abs = os.path.join(csv_dir_abs, dbname + '.csv')
+
+csv_data = util.parse_csv_to_first_column_dict(csv_file_abs)
+
+for date in util.generate_dates(first_date, last_date):
+if date.weekday() == 6:  # Sunday. End of ISO week
+date_str = date.strftime('%YW%W')
+logging.debug(Updating csv '%s' for date '%s' % (
+dbname, str(date)))
+week_dates = set(date + datetime.timedelta(days=offset)
+ for offset in range(-6, 1))
+expected_good_dates = len(week_dates - set(bad_dates))
+need_recomputation = force_recomputation
+need_recomputation |= expected_good_dates != 7
+need_recomputation |= date_str not in csv_data
+if need_recomputation:
+if expected_good_dates == 0:
+try:
+del csv_data[date_str]
+except KeyError:
+# No reading was there to remove. That's 

[MediaWiki-commits] [Gerrit] Separate daily into daily_raw and daily - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Separate daily into daily_raw and daily
..

Separate daily into daily_raw and daily

Change-Id: If89c191c3205be70ceed8ce26b4938dae844f240
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
A tests/test_projectcounts/test_daily_aggregation.py
M tests/test_projectcounts/test_helpers.py
M tests/test_projectcounts/test_monitoring.py
M tests/test_projectcounts/test_per_project_aggregation.py
M tests/test_projectcounts/testcases.py
7 files changed, 805 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/75/182675/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index e831c16..983ad23 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -30,6 +30,8 @@
 PROJECTCOUNTS_STRFTIME_PATTERN = ('%%Y%s%%Y-%%m%sprojectcounts-%%Y%%m%%d-'
   '%%H' % (os.sep, os.sep))
 
+CSV_HEADER = 'Date,Total,Desktop site,Mobile site,Zero site'
+
 cache = {}
 
 
@@ -39,7 +41,7 @@
 cache = {}
 
 
-def aggregate_for_date(source_dir_abs, date):
+def aggregate_for_date(source_dir_abs, date, allow_bad_data=False):
 Aggregates hourly projectcounts for a given day.
 
 This function does not attempt to cache the aggregated data. Either cache
@@ -55,6 +57,8 @@
 :param source_dir_abs: Absolute directory to read the hourly projectcounts
 files from.
 :param date: The date to get the count for.
+:param allow_bad_data: If True, do not bail out, if some data is
+bad or missing. (Default: False)
 
 daily_data = {}
 
@@ -71,8 +75,13 @@
 hourly_file_datetime.strftime(PROJECTCOUNTS_STRFTIME_PATTERN))
 
 if not os.path.isfile(hourly_file_abs):
-raise RuntimeError('%s' is not an existing file % (
-hourly_file_abs))
+if allow_bad_data:
+# The file does not exist, but bad data is explicitly
+# allowed, so we continue aggregating
+continue
+else:
+raise RuntimeError('%s' is not an existing file % (
+hourly_file_abs))
 
 logging.debug(Reading %s % (hourly_file_abs))
 
@@ -93,7 +102,8 @@
 return daily_data
 
 
-def get_daily_count(source_dir_abs, webstatscollector_abbreviation, date):
+def get_daily_count(source_dir_abs, webstatscollector_abbreviation, date,
+allow_bad_data=False):
 Obtains the daily count for a webstatscollector abbreviation.
 
 Data gets cached upon read. For a day, the data is 50KB, so having many
@@ -104,6 +114,8 @@
 :param webstatscollector_abbreviation: The webstatscollector abbreviation
 to get the count for
 :param date: The date to get the count for.
+:param allow_bad_data: If True, do not bail out, if some data is
+bad or missing. (Default: False)
 
 global cache
 try:
@@ -115,21 +127,74 @@
 try:
 date_data = source_dir_cache[date]
 except KeyError:
-date_data = aggregate_for_date(source_dir_abs, date)
+date_data = aggregate_for_date(source_dir_abs, date, allow_bad_data)
 source_dir_cache[date] = date_data
 
 return date_data.get(webstatscollector_abbreviation, 0)
 
 
+def update_daily_csv(target_dir_abs, dbname, csv_data_input, first_date,
+ last_date, bad_dates=[], force_recomputation=False):
+Updates daily per project CSVs from a csv data dictionary.
+
+The existing per project CSV files in target_dir_abs/daily are updated from
+first_date up to (and including) last_date.
+
+If the CSVs already has data for a given day, it is not recomputed, unless
+force_recomputation is True. But if a day is in the set of days that are
+considered, and it is also in bad_dates, the data for this day is removed
+regardless of force_recomputation.
+
+Upon any error, the function raises an exception.
+
+:param target_dir_abs: Absolute directory. CSVs are getting written to the
+'daily' subdirectory of target_dir_abs.
+:param dbname: The database name of the wiki to consider (E.g.: 'enwiki')
+:param csv_data_input: The data dict to aggregate from
+:param first_date: The first date to compute non-existing data for.
+:param last_date: The last date to compute non-existing data for.
+:param bad_dates: List of dates considered having bad data. (Default: [])
+:param force_recomputation: If True, recompute data for the given days,
+even if it is already in the CSV. (Default: False)
+
+csv_dir_abs = os.path.join(target_dir_abs, 'daily')
+if not os.path.exists(csv_dir_abs):
+os.mkdir(csv_dir_abs)
+csv_file_abs = os.path.join(csv_dir_abs, dbname + '.csv')
+
+csv_data = 

[MediaWiki-commits] [Gerrit] Add monthly aggregations - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add monthly aggregations
..

Add monthly aggregations

Change-Id: I9de48b1a5fd571317b6d1d0f12bfa346bf02f86a
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
M tests/test_projectcounts/test_monitoring.py
A tests/test_projectcounts/test_monthly_aggregation.py
M tests/test_projectcounts/testcases.py
5 files changed, 412 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/77/182677/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 1fa39ed..c745ef9 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -293,6 +293,72 @@
 header=CSV_HEADER)
 
 
+def update_monthly_csv(target_dir_abs, dbname, csv_data_input, first_date,
+   last_date, bad_dates=[], force_recomputation=False):
+Updates monthly per project CSVs from a csv data dictionary.
+
+The existing per project CSV files in target_dir_abs/monthly_rescaled are
+updated for all months where the last day of the month is in the date
+interval from first_date up to (and including) last_date.
+
+For monthly aggregations, a month's total data is rescaled to 30 days.
+
+If a month under consideration contains no good date, it is removed.
+
+Upon any error, the function raises an exception.
+
+:param target_dir_abs: Absolute directory. CSVs are getting written to the
+'monthly_rescaled' subdirectory of target_dir_abs.
+:param dbname: The database name of the wiki to consider (E.g.: 'enwiki')
+:param csv_data_input: The data dict to aggregate from
+:param first_date: The first date to compute non-existing data for.
+:param last_date: The last date to compute non-existing data for.
+:param bad_dates: List of dates considered having bad data. (Default: [])
+:param force_recomputation: If True, recompute data for the given days,
+even if it is already in the CSV. (Default: False)
+
+csv_dir_abs = os.path.join(target_dir_abs, 'monthly_rescaled')
+if not os.path.exists(csv_dir_abs):
+os.mkdir(csv_dir_abs)
+csv_file_abs = os.path.join(csv_dir_abs, dbname + '.csv')
+
+csv_data = util.parse_csv_to_first_column_dict(csv_file_abs)
+
+for date in util.generate_dates(first_date, last_date):
+if (date + datetime.timedelta(days=1)).day == 1:
+# date + 1 day is the first of a month, so date is the last of a
+# month. Let's compute for this month
+date_str = date.strftime('%Y-%m')
+logging.debug(Updating csv '%s' for date '%s' % (
+dbname, date_str))
+days_in_month = date.day
+month_dates = set(datetime.date(date.year, date.month, day)
+  for day in range(1, days_in_month+1))
+expected_good_dates = len(month_dates - set(bad_dates))
+need_recomputation = force_recomputation
+need_recomputation |= expected_good_dates != days_in_month
+need_recomputation |= date_str not in csv_data
+if need_recomputation:
+if expected_good_dates == 0:
+try:
+del csv_data[date_str]
+except KeyError:
+# No reading was there to remove. That's ok :-)
+pass
+else:
+monthly_counts = rescale_counts(csv_data_input,
+month_dates, bad_dates, 30)
+util.update_csv_data_dict(
+csv_data,
+date_str,
+*monthly_counts)
+
+util.write_dict_values_sorted_to_csv(
+csv_file_abs,
+csv_data,
+header=CSV_HEADER)
+
+
 def update_per_project_csvs_for_dates(
 source_dir_abs, target_dir_abs, first_date, last_date,
 bad_dates=[], additional_aggregators=[], force_recomputation=False):
@@ -557,4 +623,15 @@
 set((date - datetime.timedelta(days=6)).strftime('%YW%W')
 for date in current_dates)
 ))
+
+# monthly files
+issues.extend(_get_validity_issues_for_aggregated_projectcounts_generic(
+os.path.join(data_dir_abs, 'monthly_rescaled'),
+5000, 5000, 50, 5000,
+set((
+datetime.date(date.year, date.month, 1)
+- datetime.timedelta(days=1)
+).strftime('%Y-%m')
+for date in current_dates)
+))
 return issues
diff --git a/bin/aggregate_projectcounts b/bin/aggregate_projectcounts
index 968ab3d..306f637 100755
--- a/bin/aggregate_projectcounts
+++ b/bin/aggregate_projectcounts
@@ -54,12 +54,14 @@
 
 
 This script computes the following aggregations (in separate 

[MediaWiki-commits] [Gerrit] Call parents setUp and tearDown in test cases - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Call parents setUp and tearDown in test cases
..

Call parents setUp and tearDown in test cases

Change-Id: I44d1271c93ae0784422001bbfb2b6ad329e0f7cd
---
M tests/test_projectcounts/testcases.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/67/182667/1

diff --git a/tests/test_projectcounts/testcases.py 
b/tests/test_projectcounts/testcases.py
index bfa000e..f2235f1 100644
--- a/tests/test_projectcounts/testcases.py
+++ b/tests/test_projectcounts/testcases.py
@@ -76,6 +76,7 @@
 pass
 
 def setUp(self):
+super(ProjectcountsTestCase, self).setUp()
 aggregator.clear_cache()
 
 def tearDown(self):
@@ -86,3 +87,5 @@
 shutil.rmtree(tmp_dir_abs)
 except AttributeError:
 pass
+finally:
+super(ProjectcountsTestCase, self).tearDown()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44d1271c93ae0784422001bbfb2b6ad329e0f7cd
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Collect projectcounts test modules in separate package - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Collect projectcounts test modules in separate package
..

Collect projectcounts test modules in separate package

Change-Id: Ia2ff4bbfa962e7b29f95bb41448ca68e0b691581
---
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-00
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-01
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-02
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-03
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-04
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-05
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-06
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-07
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-08
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-09
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-10
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-11
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-12
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-13
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-14
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-15
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-16
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-17
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-18
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-19
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-20
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-21
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-22
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141101-23
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-00
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-01
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-02
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-03
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-04
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-05
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-06
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-07
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-08
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-09
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-10
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-11
R 
tests/test_projectcounts/fixtures/2014-11-3days-enwiki-day-times-100-plus-hour/2014/2014-11/projectcounts-20141102-12
R 

[MediaWiki-commits] [Gerrit] Get rid of focus on daily aggregates - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Get rid of focus on daily aggregates
..

Get rid of focus on daily aggregates

This switch prepares to have different kinds of projectcount
aggregates.

Change-Id: Id483f01ec9d8507466cfb1e268d5ee803c98654e
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
M tests/test_projectcounts.py
3 files changed, 26 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/62/182662/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 230b2ec..96b13e8 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -123,8 +123,9 @@
 return date_data.get(webstatscollector_abbreviation, 0)
 
 
-def update_daily_per_project_csvs(source_dir_abs, target_dir_abs, first_date,
-  last_date, force_recomputation=False):
+def update_per_project_csvs_for_dates(
+source_dir_abs, target_dir_abs, first_date, last_date,
+force_recomputation=False):
 Updates daily per project CSVs from hourly projectcounts files.
 
 The existing per project CSV files in target_dir_abs are updated with daily
diff --git a/bin/aggregate_projectcounts b/bin/aggregate_projectcounts
index 5b10343..b463bd4 100755
--- a/bin/aggregate_projectcounts
+++ b/bin/aggregate_projectcounts
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 
-Aggregates Wikimedia's hourly projectcount files into daily per project files
+Aggregates Wikimedia's hourly projectcount files into per project CSVs
 
 Usage: aggregate_projectcounts [--source SOURCE_DIR] [--target TARGET_DIR]
[--first-date FIRST_DATE] [--last-date LAST_DATE] [--date DATE]
@@ -166,7 +166,7 @@
 run_git(['pull', '--quiet'])
 run_git(['reset', '--quiet', '--hard', 'origin/master'])
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 source_dir_abs,
 target_dir_abs,
 first_date,
diff --git a/tests/test_projectcounts.py b/tests/test_projectcounts.py
index f9336fe..94efdef 100644
--- a/tests/test_projectcounts.py
+++ b/tests/test_projectcounts.py
@@ -216,17 +216,17 @@
 
 self.assertEquals(actual, 0)
 
-def test_update_daily_per_project_no_csvs(self):
+def test_update_per_project_no_csvs(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
 date = datetime.date(2014, 11, 1)
 
 tmp_dir_abs = self.create_tmp_dir_abs()
 
-aggregator.update_daily_per_project_csvs(fixture, tmp_dir_abs,
- date, date)
+aggregator.update_per_project_csvs_for_dates(fixture, tmp_dir_abs,
+ date, date)
 
-def test_update_daily_per_project_single_csvs_missing_hours(self):
+def test_update_per_project_single_csvs_missing_hours(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
 date = datetime.date(2014, 11, 1)
@@ -238,13 +238,13 @@
 
 nose.tools.assert_raises(
 RuntimeError,
-aggregator.update_daily_per_project_csvs,
+aggregator.update_per_project_csvs_for_dates,
 fixture,
 tmp_dir_abs,
 date,
 date)
 
-def test_update_daily_per_project_single_csvs_missing_hours_existing(self):
+def test_update_per_project_single_csvs_missing_hours_existing(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-3days-enwiki-day-times-100-plus-hour')
 date = datetime.date(2014, 11, 1)
@@ -256,7 +256,7 @@
 '2014-11-01,1,2,3,4'
 ])
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 fixture,
 tmp_dir_abs,
 date,
@@ -266,7 +266,7 @@
 '2014-11-01,1,2,3,4',
 ])
 
-def test_update_daily_per_project_single_csvs_3days_2014_11_01(self):
+def test_update_per_project_single_csvs_3days_2014_11_01(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-3days-enwiki-day-times-100-plus-hour')
 date = datetime.date(2014, 11, 1)
@@ -276,7 +276,7 @@
 enwiki_file_abs = os.path.join(tmp_dir_abs, 'enwiki.csv')
 self.create_empty_file(enwiki_file_abs)
 
-aggregator.update_daily_per_project_csvs(
+aggregator.update_per_project_csvs_for_dates(
 fixture,
 tmp_dir_abs,
 date,
@@ -286,7 +286,7 @@
 '2014-11-01,24276,24276,0,0',
 ])
 
-def test_update_daily_per_project_single_csvs_3days_2014_11_02(self):
+def 

[MediaWiki-commits] [Gerrit] Get fixture name through test case - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Get fixture name through test case
..

Get fixture name through test case

This switch prepraes to split out the test cases into separate modules
in a follow-up commit.

Change-Id: Id28f131e49d4acb88137cd288c561c286238c17b
---
M tests/test_projectcounts.py
1 file changed, 57 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/64/182664/1

diff --git a/tests/test_projectcounts.py b/tests/test_projectcounts.py
index 23dfb8d..8cf2404 100644
--- a/tests/test_projectcounts.py
+++ b/tests/test_projectcounts.py
@@ -33,6 +33,9 @@
 
 
 class ProjectcountsTestCase(unittest.TestCase):
+def get_fixture_dir_abs(self, fixture_name):
+return os.path.join(FIXTURES_DIR_ABS, fixture_name)
+
 def create_tmp_dir_abs(self):
 # Since we have to have the file visible in the file system, we cannot
 # use *TemporaryFile, and have to resort to mkdtemp
@@ -90,32 +93,33 @@
 class BasicTestCase(ProjectcountsTestCase):
 TestCase for helper functions
 def test_aggregate_for_date_missing_hours_2014_11_01(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-missing-hours')
+fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
+
 date = datetime.date(2014, 11, 1)
 
 nose.tools.assert_raises(RuntimeError,
  aggregator.aggregate_for_date, fixture, date)
 
 def test_aggregate_for_date_missing_hours_2014_11_02(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-missing-hours')
+fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
+
 date = datetime.date(2014, 11, 2)
 
 nose.tools.assert_raises(RuntimeError,
  aggregator.aggregate_for_date, fixture, date)
 
 def test_aggregate_for_date_missing_hours_2014_11_03(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-missing-hours')
+fixture = self.get_fixture_dir_abs('2014-11-missing-hours')
+
 date = datetime.date(2014, 11, 3)
 
 nose.tools.assert_raises(RuntimeError,
  aggregator.aggregate_for_date, fixture, date)
 
 def test_aggregate_for_date_enwiki_different_per_day_1(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-3days-enwiki-day-times-100-plus-hour')
+fixture = self.get_fixture_dir_abs(
+'2014-11-3days-enwiki-day-times-100-plus-hour')
+
 date = datetime.date(2014, 11, 1)
 
 actual = aggregator.aggregate_for_date(fixture, date)
@@ -127,8 +131,9 @@
 self.assertEquals(actual, expected)
 
 def test_aggregate_for_date_enwiki_different_per_day_2(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-3days-enwiki-day-times-100-plus-hour')
+fixture = self.get_fixture_dir_abs(
+'2014-11-3days-enwiki-day-times-100-plus-hour')
+
 date = datetime.date(2014, 11, 2)
 
 actual = aggregator.aggregate_for_date(fixture, date)
@@ -140,8 +145,9 @@
 self.assertEquals(actual, expected)
 
 def test_aggregate_for_date_enwiki_different_per_day_3(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-3days-enwiki-day-times-100-plus-hour')
+fixture = self.get_fixture_dir_abs(
+'2014-11-3days-enwiki-day-times-100-plus-hour')
+
 date = datetime.date(2014, 11, 3)
 
 actual = aggregator.aggregate_for_date(fixture, date)
@@ -153,8 +159,8 @@
 self.assertEquals(actual, expected)
 
 def test_aggregate_for_date_different_wiki(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-different-wikis')
+fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
+
 date = datetime.date(2014, 11, 1)
 
 actual = aggregator.aggregate_for_date(fixture, date)
@@ -164,8 +170,8 @@
 self.assertEquals(actual, expected)
 
 def test_get_daily_count_en(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-different-wikis')
+fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
+
 date = datetime.date(2014, 11, 1)
 
 actual = aggregator.get_daily_count(fixture, 'en', date)
@@ -173,8 +179,8 @@
 self.assertEquals(actual, 1)
 
 def test_get_daily_count_de(self):
-fixture = os.path.join(FIXTURES_DIR_ABS,
-   '2014-11-different-wikis')
+fixture = self.get_fixture_dir_abs('2014-11-different-wikis')
+
 date = datetime.date(2014, 11, 1)
 
 actual = 

[MediaWiki-commits] [Gerrit] Split projectcounts tests into modules - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Split projectcounts tests into modules
..

Split projectcounts tests into modules

Change-Id: Id3d4ee495c459dd89cf800267327f272748b76b5
---
A tests/projectcounts_testcases.py
D tests/test_projectcounts.py
A tests/test_projectcounts_helpers.py
A tests/test_projectcounts_monitoring.py
A tests/test_projectcounts_per_project_aggregation.py
5 files changed, 705 insertions(+), 625 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/65/182665/1

diff --git a/tests/projectcounts_testcases.py b/tests/projectcounts_testcases.py
new file mode 100644
index 000..bfa000e
--- /dev/null
+++ b/tests/projectcounts_testcases.py
@@ -0,0 +1,88 @@
+# -*- coding: utf-8 -*-
+
+# Licensed under the Apache License, Version 2.0 (the License);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an AS IS BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+  Test case base classes
+  ~~
+
+  This module contains bas classes for test cases.
+
+
+
+import aggregator
+import unittest
+import os
+import tempfile
+import logging
+import shutil
+
+FIXTURES_DIR_ABS = os.path.join(os.path.dirname(__file__), fixtures)
+
+
+class ProjectcountsTestCase(unittest.TestCase):
+def get_fixture_dir_abs(self, fixture_name):
+return os.path.join(FIXTURES_DIR_ABS, fixture_name)
+
+def create_tmp_dir_abs(self):
+# Since we have to have the file visible in the file system, we cannot
+# use *TemporaryFile, and have to resort to mkdtemp
+tmp_dir_abs = tempfile.mkdtemp(prefix='test_projectcounts')
+
+logging.error(Creating tmp directory '%s' % (
+tmp_dir_abs))
+
+try:
+self.tmp_dirs_abs.append(tmp_dir_abs)
+except AttributeError:
+self.tmp_dirs_abs = [tmp_dir_abs]
+
+return tmp_dir_abs
+
+def create_empty_file(self, file_abs):
+open(os.path.join(file_abs), 'w').close()
+
+def create_file(self, file_abs, lines):
+with open(file_abs, 'w') as file:
+for line in lines:
+file.write(line + aggregator.CSV_LINE_ENDING)
+
+def assert_file_content_equals(self, actual_file_abs, expected_lines):
+header = 'Date,Total,Desktop site,Mobile site,Zero site'
+expected_lines.insert(0, header)
+with open(actual_file_abs, 'r') as file:
+for expected_line in expected_lines:
+try:
+self.assertEquals(file.next(), expected_line +
+  aggregator.CSV_LINE_ENDING)
+except StopIteration:
+self.fail(File '%s' is missing the line:\n%s % (
+actual_file_abs, expected_line))
+try:
+extra_line = file.next()
+self.fail(More lines than expected in file '%s'. First 
+  extra line:\n%s % (actual_file_abs, extra_line))
+except StopIteration:
+pass
+
+def setUp(self):
+aggregator.clear_cache()
+
+def tearDown(self):
+try:
+for tmp_dir_abs in self.tmp_dirs_abs:
+logging.error(Cleaning up tmp directory '%s' % (
+tmp_dir_abs))
+shutil.rmtree(tmp_dir_abs)
+except AttributeError:
+pass
diff --git a/tests/test_projectcounts.py b/tests/test_projectcounts.py
deleted file mode 100644
index 8cf2404..000
--- a/tests/test_projectcounts.py
+++ /dev/null
@@ -1,625 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Licensed under the Apache License, Version 2.0 (the License);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an AS IS BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-  projectcounts unit tests
-  
-
-  This module contains tests for aggregator.projectcounts.
-
-
-
-import aggregator
-import unittest
-import os
-import datetime
-import nose
-import tempfile
-import logging
-import shutil
-
-FIXTURES_DIR_ABS = os.path.join(os.path.dirname(__file__), fixtures)
-
-
-class 

[MediaWiki-commits] [Gerrit] Add separate test case for tests using a data directory - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add separate test case for tests using a data directory
..

Add separate test case for tests using a data directory

Change-Id: I1fe3c8dec8b937baa288d121a3f9efa3f3301aa3
---
M tests/test_projectcounts/test_monitoring.py
M tests/test_projectcounts/test_per_project_aggregation.py
M tests/test_projectcounts/testcases.py
3 files changed, 59 insertions(+), 95 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/69/182669/1

diff --git a/tests/test_projectcounts/test_monitoring.py 
b/tests/test_projectcounts/test_monitoring.py
index 567f136..476f1fe 100644
--- a/tests/test_projectcounts/test_monitoring.py
+++ b/tests/test_projectcounts/test_monitoring.py
@@ -27,9 +27,9 @@
 import nose
 
 
-class MonitoringTestCase(testcases.ProjectcountsTestCase):
+class MonitoringTestCase(testcases.ProjectcountsDataTestCase):
 TestCase for monitoring functions
-def create_valid_aggregated_projects(self, tmp_dir_abs):
+def create_valid_aggregated_projects(self):
 today = datetime.date.today()
 for dbname in [
 'enwiki',
@@ -41,7 +41,7 @@
 'itwiki',
 'foo',
 ]:
-csv_file_abs = os.path.join(tmp_dir_abs, dbname + '.csv')
+csv_file_abs = os.path.join(self.data_dir_abs, dbname + '.csv')
 with open(csv_file_abs, 'w') as file:
 for day_offset in range(-10, 0):
 date = (today + datetime.timedelta(days=day_offset))
@@ -50,63 +50,53 @@
 date_str, aggregator.CSV_LINE_ENDING))
 
 def test_validity_no_csvs(self):
-tmp_dir_abs = self.create_tmp_dir_abs()
-
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
-tmp_dir_abs)
+self.data_dir_abs)
 
 # At least one issue, as no csvs could get found
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_no_enwiki(self):
-tmp_dir_abs = self.create_tmp_dir_abs()
+self.create_valid_aggregated_projects()
 
-self.create_valid_aggregated_projects(tmp_dir_abs)
-
-enwiki_file_abs = os.path.join(tmp_dir_abs, 'enwiki.csv')
+enwiki_file_abs = os.path.join(self.data_dir_abs, 'enwiki.csv')
 os.unlink(enwiki_file_abs)
 
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
-tmp_dir_abs)
+self.data_dir_abs)
 
 # At least one issue, as enwiki.csv is missing
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_only_big_wikis(self):
-tmp_dir_abs = self.create_tmp_dir_abs()
+self.create_valid_aggregated_projects()
 
-self.create_valid_aggregated_projects(tmp_dir_abs)
-
-foo_file_abs = os.path.join(tmp_dir_abs, 'foo.csv')
+foo_file_abs = os.path.join(self.data_dir_abs, 'foo.csv')
 os.unlink(foo_file_abs)
 
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
-tmp_dir_abs)
+self.data_dir_abs)
 
 # At least one issue, as no csvs for other wikis than the big wikis are
 # present.
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_enwiki_empty(self):
-tmp_dir_abs = self.create_tmp_dir_abs()
+self.create_valid_aggregated_projects()
 
-self.create_valid_aggregated_projects(tmp_dir_abs)
-
-enwiki_file_abs = os.path.join(tmp_dir_abs, 'enwiki.csv')
+enwiki_file_abs = os.path.join(self.data_dir_abs, 'enwiki.csv')
 self.create_empty_file(enwiki_file_abs)
 
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
-tmp_dir_abs)
+self.data_dir_abs)
 
 # At least one issue, as enwiki has no reading
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_enwiki_no_today(self):
-tmp_dir_abs = self.create_tmp_dir_abs()
+self.create_valid_aggregated_projects()
 
-self.create_valid_aggregated_projects(tmp_dir_abs)
-
-enwiki_file_abs = os.path.join(tmp_dir_abs, 'enwiki.csv')
+enwiki_file_abs = os.path.join(self.data_dir_abs, 'enwiki.csv')
 yesterday = aggregator.parse_string_to_date('yesterday')
 lines = []
 for day_offset in range(-10, 0):
@@ -116,17 +106,15 @@
 self.create_file(enwiki_file_abs, lines)
 
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
-tmp_dir_abs)
+self.data_dir_abs)
 
 # At least one issue, as enwiki has no reading for today
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_enwiki_too_low_desktop(self):
-tmp_dir_abs = self.create_tmp_dir_abs()
+

[MediaWiki-commits] [Gerrit] For monitoring script, check for expected issues - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: For monitoring script, check for expected issues
..

For monitoring script, check for expected issues

Previously, we only assured that at least one issue is present. This
is bound to give false positives, as more and more checks are
added. Hence, we now match against expected messages.

Change-Id: I56e33cfd7e5bb15be3d640bc93ef1398d8e4a1fe
---
M tests/test_projectcounts/test_monitoring.py
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/72/182672/1

diff --git a/tests/test_projectcounts/test_monitoring.py 
b/tests/test_projectcounts/test_monitoring.py
index af2829a..928b557 100644
--- a/tests/test_projectcounts/test_monitoring.py
+++ b/tests/test_projectcounts/test_monitoring.py
@@ -25,6 +25,7 @@
 import os
 import datetime
 import nose
+import re
 
 
 class MonitoringTestCase(testcases.ProjectcountsDataTestCase):
@@ -49,12 +50,19 @@
 file.write('%s,137037034,123456789,12345678,1234567%s' % (
 date_str, aggregator.CSV_LINE_ENDING))
 
+def assert_has_item_by_re(self, haystack, pattern):
+for straw in haystack:
+if re.search(pattern, straw):
+return
+self.fail(Could not find '%s' in %s % (pattern, haystack))
+
 def test_validity_no_csvs(self):
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
 self.data_dir_abs)
 
 # At least one issue, as no csvs could get found
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, 'not find any CSVs')
 
 def test_validity_no_enwiki(self):
 self.create_valid_aggregated_projects()
@@ -67,6 +75,7 @@
 
 # At least one issue, as enwiki.csv is missing
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, '[mM]issing.*enwiki')
 
 def test_validity_only_big_wikis(self):
 self.create_valid_aggregated_projects()
@@ -80,6 +89,7 @@
 # At least one issue, as no csvs for other wikis than the big wikis are
 # present.
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, 'big wikis')
 
 def test_validity_enwiki_empty(self):
 self.create_valid_aggregated_projects()
@@ -92,6 +102,7 @@
 
 # At least one issue, as enwiki has no reading
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, '[nN]o lines')
 
 def test_validity_enwiki_no_today(self):
 self.create_valid_aggregated_projects()
@@ -110,6 +121,7 @@
 
 # At least one issue, as enwiki has no reading for today
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, 'too old')
 
 def test_validity_enwiki_too_low_desktop(self):
 self.create_valid_aggregated_projects()
@@ -128,6 +140,7 @@
 
 # At least one issue, as the desktop count is too low
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, '[dD]esktop.*too.*low')
 
 def test_validity_enwiki_too_low_mobile(self):
 self.create_valid_aggregated_projects()
@@ -146,6 +159,7 @@
 
 # At least one issue, as the mobile count is too low
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, '[mM]obile.*too.*low')
 
 def test_validity_enwiki_too_low_zero(self):
 self.create_valid_aggregated_projects()
@@ -164,6 +178,7 @@
 
 # At least one issue, as the zero count is too low
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, '[zZ]ero.*too low')
 
 def test_validity_enwiki_total_does_not_add_up(self):
 self.create_valid_aggregated_projects()
@@ -182,6 +197,7 @@
 
 # At least one issue, as the total is not the sum of tho other colums.
 nose.tools.assert_greater_equal(len(issues), 1)
+self.assert_has_item_by_re(issues, '[tT]otal.*not.*sum')
 
 def test_validity_valid(self):
 self.create_valid_aggregated_projects()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56e33cfd7e5bb15be3d640bc93ef1398d8e4a1fe
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Fix error message if mobile count is too low - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Fix error message if mobile count is too low
..

Fix error message if mobile count is too low

Change-Id: I1c70c523e8772b2cc00d3b07e96f89521fea9c3d
---
M aggregator/projectcounts.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/70/182670/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 96b13e8..673fb80 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -277,7 +277,7 @@
 # Check mobile count
 try:
 if int(last_line_split[3])  1:
-issues.append(Desktop count of last line of 
+issues.append(Mobile count of last line of 
   %s is too low '%s' % (
   csv_file_abs, last_line))
 except ValueError:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c70c523e8772b2cc00d3b07e96f89521fea9c3d
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Fix comments in checks for too low readings - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Fix comments in checks for too low readings
..

Fix comments in checks for too low readings

Change-Id: I088d9354dd11a322d26b707cd93a80c70b2c7cb6
---
M tests/test_projectcounts/test_monitoring.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/71/182671/1

diff --git a/tests/test_projectcounts/test_monitoring.py 
b/tests/test_projectcounts/test_monitoring.py
index 476f1fe..af2829a 100644
--- a/tests/test_projectcounts/test_monitoring.py
+++ b/tests/test_projectcounts/test_monitoring.py
@@ -126,7 +126,7 @@
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
 self.data_dir_abs)
 
-# At least one issue, as enwiki has no reading for today
+# At least one issue, as the desktop count is too low
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_enwiki_too_low_mobile(self):
@@ -144,7 +144,7 @@
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
 self.data_dir_abs)
 
-# At least one issue, as enwiki has no reading for today
+# At least one issue, as the mobile count is too low
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_enwiki_too_low_zero(self):
@@ -162,7 +162,7 @@
 issues = aggregator.get_validity_issues_for_aggregated_projectcounts(
 self.data_dir_abs)
 
-# At least one issue, as enwiki has no reading for today
+# At least one issue, as the zero count is too low
 nose.tools.assert_greater_equal(len(issues), 1)
 
 def test_validity_enwiki_total_does_not_add_up(self):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I088d9354dd11a322d26b707cd93a80c70b2c7cb6
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Split projectcounts tests in separate test cases - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Split projectcounts tests in separate test cases
..

Split projectcounts tests in separate test cases

Change-Id: Ica2dd5ac3fe454c628f13bad5b3806913a6c0095
---
M tests/test_projectcounts.py
1 file changed, 29 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/63/182663/1

diff --git a/tests/test_projectcounts.py b/tests/test_projectcounts.py
index 94efdef..23dfb8d 100644
--- a/tests/test_projectcounts.py
+++ b/tests/test_projectcounts.py
@@ -56,26 +56,6 @@
 for line in lines:
 file.write(line + aggregator.CSV_LINE_ENDING)
 
-def create_valid_aggregated_projects(self, tmp_dir_abs):
-today = datetime.date.today()
-for dbname in [
-'enwiki',
-'jawiki',
-'dewiki',
-'eswiki',
-'frwiki',
-'ruwiki',
-'itwiki',
-'foo',
-]:
-csv_file_abs = os.path.join(tmp_dir_abs, dbname + '.csv')
-with open(csv_file_abs, 'w') as file:
-for day_offset in range(-10, 0):
-date = (today + datetime.timedelta(days=day_offset))
-date_str = date.isoformat()
-file.write('%s,137037034,123456789,12345678,1234567%s' % (
-date_str, aggregator.CSV_LINE_ENDING))
-
 def assert_file_content_equals(self, actual_file_abs, expected_lines):
 header = 'Date,Total,Desktop site,Mobile site,Zero site'
 expected_lines.insert(0, header)
@@ -106,6 +86,9 @@
 except AttributeError:
 pass
 
+
+class BasicTestCase(ProjectcountsTestCase):
+TestCase for helper functions
 def test_aggregate_for_date_missing_hours_2014_11_01(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
@@ -216,6 +199,9 @@
 
 self.assertEquals(actual, 0)
 
+
+class ProjectAggregationTestCase(ProjectcountsTestCase):
+TestCase for project aggregation functions
 def test_update_per_project_no_csvs(self):
 fixture = os.path.join(FIXTURES_DIR_ABS,
'2014-11-missing-hours')
@@ -439,6 +425,29 @@
 date,
 True)
 
+
+class MonitoringTestCase(ProjectcountsTestCase):
+TestCase for monitoring functions
+def create_valid_aggregated_projects(self, tmp_dir_abs):
+today = datetime.date.today()
+for dbname in [
+'enwiki',
+'jawiki',
+'dewiki',
+'eswiki',
+'frwiki',
+'ruwiki',
+'itwiki',
+'foo',
+]:
+csv_file_abs = os.path.join(tmp_dir_abs, dbname + '.csv')
+with open(csv_file_abs, 'w') as file:
+for day_offset in range(-10, 0):
+date = (today + datetime.timedelta(days=day_offset))
+date_str = date.isoformat()
+file.write('%s,137037034,123456789,12345678,1234567%s' % (
+date_str, aggregator.CSV_LINE_ENDING))
+
 def test_validity_no_csvs(self):
 tmp_dir_abs = self.create_tmp_dir_abs()
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica2dd5ac3fe454c628f13bad5b3806913a6c0095
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Document relation between csv and computed projects - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Document relation between csv and computed projects
..

Document relation between csv and computed projects

Change-Id: I9b56eb9be13dee0b24e55764373bb0da7366753f
---
M bin/aggregate_projectcounts
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/68/182668/1

diff --git a/bin/aggregate_projectcounts b/bin/aggregate_projectcounts
index b463bd4..665ccb6 100755
--- a/bin/aggregate_projectcounts
+++ b/bin/aggregate_projectcounts
@@ -25,7 +25,14 @@
 
 --source SOURCE_DIR  Read hourly projectcount files from SOURCE_DIR.
  [default: /mnt/hdfs/wmf/data/archive/webstats]
---target TARGET_DIR  Write daily aggregated CSV files into TARGET_DIR
+--target TARGET_DIR  Write daily aggregated CSV files into TARGET_DIR.
+ For each wiki that has a (maybe still empty) csv
+ with the corresponding database name in
+ TARGET_DIR, the CSV is updated with the wiki's
+ projectcounts for the specified dates.
+ So for example to compute data for the English
+ Wikipedia, put a file 'enwiki.csv' in
+ TARGET_DIR.
  [default: ./data]
 
 --first-date FIRST_DATE  First day to aggregate for

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b56eb9be13dee0b24e55764373bb0da7366753f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Stop treating missing values as 0 - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Stop treating missing values as 0
..

Stop treating missing values as 0

By no longer treating missing values as 0, but as missing values, we
can properly aggregate over periods during which a column got added
(like mobile, or zero).

Bug: T76406
Change-Id: Ie810327d3f2b617b1888a64c1216999ed31adbd5
---
M aggregator/projectcounts.py
M aggregator/util.py
M tests/test_projectcounts/test_helpers.py
M tests/test_projectcounts/test_monthly_aggregation.py
M tests/test_projectcounts/test_weekly_aggregation.py
M tests/test_projectcounts/test_yearly_aggregation.py
6 files changed, 158 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/79/182679/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 01b6b78..f5224d7 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -190,9 +190,8 @@
 
 If the dates only cover bad dates, None is returned.
 
-All dates are expected to have the same number of columns. In case they
-have not, the first good date is taken as reference. Missing columns for
-good dates are assumed to be 0.
+Each column is rescaled separatedly.
+Missing columns for good dates are not assumed to be 0.
 
 Upon other errors, a RuntimeError is raised.
 
@@ -204,7 +203,8 @@
 :param rescale_to: Rescale the good entries to this many entries.
 
 ret = None
-aggregations = 0
+aggregations = None
+columns = 0
 for date in dates:
 if date in bad_dates:
 continue
@@ -214,20 +214,33 @@
 except KeyError:
 raise RuntimeError(No data for '%s' % (date_str))
 del csv_line_items[0]  # getting rid of date column
+
 if ret is None:
-ret = [0 for i in range(len(csv_line_items))]
-for i in range(len(ret)):
+ret = []
+aggregations = []
+
+# Make sure we can fit csv_line_items's columns into the aggregations
+while columns  len(csv_line_items):
+ret.append(0)
+aggregations.append(0)
+columns += 1
+
+for i in range(columns):
 try:
-ret[i] += int(csv_line_items[i])
+ret[i] += int(csv_line_items[i].strip())
+aggregations[i] += 1
 except IndexError:
-# csv_line_items has less items than the first good row.
-# We assume 0.
+# csv_line_times is shorter than ret.
 pass
-aggregations += 1
+except ValueError:
+# No valid reading. (E.g. the empty string)
+pass
 
 if ret is not None:
 # Since we found readings, rescale.
-ret = [(ret[i] * rescale_to) / aggregations for i in range(len(ret))]
+ret = [(ret[i] * rescale_to) / aggregations[i] if aggregations[i]
+   else None
+   for i in range(columns)]
 return ret
 
 
diff --git a/aggregator/util.py b/aggregator/util.py
index 0d14e14..9527b6d 100644
--- a/aggregator/util.py
+++ b/aggregator/util.py
@@ -202,6 +202,6 @@
 
 line = first_column
 for column in other_columns:
-line += ',%s' % (column)
+line += ',%s' % ('' if column is None else column)
 csv_data[first_column] = line
 return csv_data
diff --git a/tests/test_projectcounts/test_helpers.py 
b/tests/test_projectcounts/test_helpers.py
index 81b8636..acc7c1f 100644
--- a/tests/test_projectcounts/test_helpers.py
+++ b/tests/test_projectcounts/test_helpers.py
@@ -577,7 +577,7 @@
  bad_dates,
  5)
 
-def test_rescale_counts_more_days_missing_columns_upscale(self):
+def test_rescale_counts_zero_and_empty_columns(self):
 dates = [
 datetime.date(2014, 8, 4),
 datetime.date(2014, 8, 5),
@@ -585,11 +585,36 @@
 ]
 
 csv_data = {
-'2014-08-03': '2014-08-03,1,2,3,4,5',
-'2014-08-04': '2014-08-04,1000,100,10',
-'2014-08-05': '2014-08-05,2000,200,20',
-'2014-08-06': '2014-08-06,3000,300',
-'2014-08-07': '2014-08-07,1,2,3',
+'2014-08-03': '2014-08-03,100',
+'2014-08-04': '2014-08-04,0,3,5,0,7,10,',
+'2014-08-05': '2014-08-05,1,,  ,0,8,  ,',
+'2014-08-06': '2014-08-06,2,4,6,0,9,0 ,',
+'2014-08-07': '2014-08-07,11,12,13,14,15,16,17',
+}
+
+bad_dates = []
+
+actual = aggregator.rescale_counts(
+csv_data,
+dates,
+bad_dates,
+3)
+
+self.assertEquals(actual, [3, 10, 16, 0, 24, 15, None])
+
+def test_rescale_counts_zero_and_empty_columns_upscale(self):
+dates = [
+

[MediaWiki-commits] [Gerrit] Teach the aggregation script from when on to expect mobile a... - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Teach the aggregation script from when on to expect mobile and 
zero counts
..

Teach the aggregation script from when on to expect mobile and zero counts

Thereby, the whole dataset can easily be regenerated from scratch if
needed.

Change-Id: Ie97983397eee61870fbd0491e677ba1859561418
---
M aggregator/projectcounts.py
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/80/182680/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index f5224d7..b0b2481 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -33,6 +33,8 @@
 
 CSV_HEADER = 'Date,Total,Desktop site,Mobile site,Zero site'
 
+DATE_MOBILE_ADDED = datetime.date(2014, 9, 23)
+
 cache = {}
 
 
@@ -507,14 +509,18 @@
 count_zero = get_daily_count(
 source_dir_abs, abbreviation, date, allow_bad_data)
 
+count_total = count_desktop
+if date = DATE_MOBILE_ADDED:
+count_total += count_mobile + count_zero
+
 # injecting obtained data
 util.update_csv_data_dict(
 csv_data,
 date_str,
-count_desktop + count_mobile + count_zero,
+count_total,
 count_desktop,
-count_mobile,
-count_zero)
+count_mobile if date = DATE_MOBILE_ADDED else None,
+count_zero if date = DATE_MOBILE_ADDED else None)
 
 util.write_dict_values_sorted_to_csv(
 csv_file_abs,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie97983397eee61870fbd0491e677ba1859561418
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Add yearly aggregations - change (analytics/aggregator)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add yearly aggregations
..

Add yearly aggregations

Change-Id: I58e64c7798f67a5c31c26bd87176f3152bc788d3
---
M aggregator/projectcounts.py
M bin/aggregate_projectcounts
M tests/test_projectcounts/test_monitoring.py
A tests/test_projectcounts/test_yearly_aggregation.py
M tests/test_projectcounts/testcases.py
5 files changed, 387 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aggregator 
refs/changes/78/182678/1

diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index c745ef9..01b6b78 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -22,6 +22,7 @@
 
 
 import logging
+import calendar
 import datetime
 import os
 import glob
@@ -359,6 +360,71 @@
 header=CSV_HEADER)
 
 
+def update_yearly_csv(target_dir_abs, dbname, csv_data_input, first_date,
+  last_date, bad_dates=[], force_recomputation=False):
+Updates yearly per project CSVs from a csv data dictionary.
+
+The existing per project CSV files in target_dir_abs/yearly_rescaled are
+updated for all years where the last day of the year is in the date
+interval from first_date up to (and including) last_date.
+
+For yearly aggregations, a year's total data is rescaled to 365 days.
+
+If a year under consideration contains no good date, it is removed.
+
+Upon any error, the function raises an exception.
+
+:param target_dir_abs: Absolute directory. CSVs are getting written to the
+'yearly_rescaled' subdirectory of target_dir_abs.
+:param dbname: The database name of the wiki to consider (E.g.: 'enwiki')
+:param csv_data_input: The data dict to aggregate from
+:param first_date: The first date to compute non-existing data for.
+:param last_date: The last date to compute non-existing data for.
+:param bad_dates: List of dates considered having bad data. (Default: [])
+:param force_recomputation: If True, recompute data for the given days,
+even if it is already in the CSV. (Default: False)
+
+csv_dir_abs = os.path.join(target_dir_abs, 'yearly_rescaled')
+if not os.path.exists(csv_dir_abs):
+os.mkdir(csv_dir_abs)
+csv_file_abs = os.path.join(csv_dir_abs, dbname + '.csv')
+
+csv_data = util.parse_csv_to_first_column_dict(csv_file_abs)
+
+for date in util.generate_dates(first_date, last_date):
+if date.month == 12 and date.day == 31:
+# date is the last day of a year. Let's compute for this year
+date_str = date.strftime('%Y')
+logging.debug(Updating csv '%s' for date '%s' % (
+dbname, date_str))
+days_in_year = 366 if calendar.isleap(date.year) else 365
+year_dates = set(date - datetime.timedelta(days=offset)
+ for offset in range(0, days_in_year))
+expected_good_dates = len(year_dates - set(bad_dates))
+need_recomputation = force_recomputation
+need_recomputation |= expected_good_dates != days_in_year
+need_recomputation |= date_str not in csv_data
+if need_recomputation:
+if expected_good_dates == 0:
+try:
+del csv_data[date_str]
+except KeyError:
+# No reading was there to remove. That's ok :-)
+pass
+else:
+yearly_counts = rescale_counts(csv_data_input, year_dates,
+   bad_dates, 365)
+util.update_csv_data_dict(
+csv_data,
+date_str,
+*yearly_counts)
+
+util.write_dict_values_sorted_to_csv(
+csv_file_abs,
+csv_data,
+header=CSV_HEADER)
+
+
 def update_per_project_csvs_for_dates(
 source_dir_abs, target_dir_abs, first_date, last_date,
 bad_dates=[], additional_aggregators=[], force_recomputation=False):
@@ -634,4 +700,14 @@
 ).strftime('%Y-%m')
 for date in current_dates)
 ))
+
+# yearly files
+issues.extend(_get_validity_issues_for_aggregated_projectcounts_generic(
+os.path.join(data_dir_abs, 'yearly_rescaled'),
+7, 7, 700, 7,
+set((
+datetime.date(date.year, 1, 1) - datetime.timedelta(days=1)
+).strftime('%Y')
+for date in current_dates)
+))
 return issues
diff --git a/bin/aggregate_projectcounts b/bin/aggregate_projectcounts
index 306f637..9ac743a 100755
--- a/bin/aggregate_projectcounts
+++ b/bin/aggregate_projectcounts
@@ -62,6 +62,8 @@
   7 days per week.
TARGET_DIR/monthly_rescaled -- daily 

[MediaWiki-commits] [Gerrit] Add weekly projectcounts - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add weekly projectcounts
..

Add weekly projectcounts

Change-Id: Ie277a524cba4a4485ca955ff5a2c18fc23e24977
---
M projectcounts/BAD_DATES.csv
M projectcounts/README.txt
A projectcounts/weekly_rescaled/aawiki.csv
A projectcounts/weekly_rescaled/aawikibooks.csv
A projectcounts/weekly_rescaled/aawiktionary.csv
A projectcounts/weekly_rescaled/abwiki.csv
A projectcounts/weekly_rescaled/abwiktionary.csv
A projectcounts/weekly_rescaled/acewiki.csv
A projectcounts/weekly_rescaled/advisorywiki.csv
A projectcounts/weekly_rescaled/afwiki.csv
A projectcounts/weekly_rescaled/afwikibooks.csv
A projectcounts/weekly_rescaled/afwikiquote.csv
A projectcounts/weekly_rescaled/afwiktionary.csv
A projectcounts/weekly_rescaled/akwiki.csv
A projectcounts/weekly_rescaled/akwikibooks.csv
A projectcounts/weekly_rescaled/akwiktionary.csv
A projectcounts/weekly_rescaled/alswiki.csv
A projectcounts/weekly_rescaled/alswikibooks.csv
A projectcounts/weekly_rescaled/alswikiquote.csv
A projectcounts/weekly_rescaled/alswiktionary.csv
A projectcounts/weekly_rescaled/amwiki.csv
A projectcounts/weekly_rescaled/amwikiquote.csv
A projectcounts/weekly_rescaled/amwiktionary.csv
A projectcounts/weekly_rescaled/angwiki.csv
A projectcounts/weekly_rescaled/angwikibooks.csv
A projectcounts/weekly_rescaled/angwikiquote.csv
A projectcounts/weekly_rescaled/angwikisource.csv
A projectcounts/weekly_rescaled/angwiktionary.csv
A projectcounts/weekly_rescaled/anwiki.csv
A projectcounts/weekly_rescaled/anwiktionary.csv
A projectcounts/weekly_rescaled/arcwiki.csv
A projectcounts/weekly_rescaled/arwiki.csv
A projectcounts/weekly_rescaled/arwikibooks.csv
A projectcounts/weekly_rescaled/arwikimedia.csv
A projectcounts/weekly_rescaled/arwikinews.csv
A projectcounts/weekly_rescaled/arwikiquote.csv
A projectcounts/weekly_rescaled/arwikisource.csv
A projectcounts/weekly_rescaled/arwikiversity.csv
A projectcounts/weekly_rescaled/arwiktionary.csv
A projectcounts/weekly_rescaled/arzwiki.csv
A projectcounts/weekly_rescaled/astwiki.csv
A projectcounts/weekly_rescaled/astwikibooks.csv
A projectcounts/weekly_rescaled/astwikiquote.csv
A projectcounts/weekly_rescaled/astwiktionary.csv
A projectcounts/weekly_rescaled/aswiki.csv
A projectcounts/weekly_rescaled/aswikibooks.csv
A projectcounts/weekly_rescaled/aswikisource.csv
A projectcounts/weekly_rescaled/aswiktionary.csv
A projectcounts/weekly_rescaled/avwiki.csv
A projectcounts/weekly_rescaled/avwiktionary.csv
A projectcounts/weekly_rescaled/aywiki.csv
A projectcounts/weekly_rescaled/aywikibooks.csv
A projectcounts/weekly_rescaled/aywiktionary.csv
A projectcounts/weekly_rescaled/azwiki.csv
A projectcounts/weekly_rescaled/azwikibooks.csv
A projectcounts/weekly_rescaled/azwikiquote.csv
A projectcounts/weekly_rescaled/azwikisource.csv
A projectcounts/weekly_rescaled/azwiktionary.csv
A projectcounts/weekly_rescaled/barwiki.csv
A projectcounts/weekly_rescaled/bat_smgwiki.csv
A projectcounts/weekly_rescaled/bawiki.csv
A projectcounts/weekly_rescaled/bawikibooks.csv
A projectcounts/weekly_rescaled/bclwiki.csv
A projectcounts/weekly_rescaled/bdwikimedia.csv
A projectcounts/weekly_rescaled/be_x_oldwiki.csv
A projectcounts/weekly_rescaled/betawikiversity.csv
A projectcounts/weekly_rescaled/bewiki.csv
A projectcounts/weekly_rescaled/bewikibooks.csv
A projectcounts/weekly_rescaled/bewikimedia.csv
A projectcounts/weekly_rescaled/bewikiquote.csv
A projectcounts/weekly_rescaled/bewikisource.csv
A projectcounts/weekly_rescaled/bewiktionary.csv
A projectcounts/weekly_rescaled/bgwiki.csv
A projectcounts/weekly_rescaled/bgwikibooks.csv
A projectcounts/weekly_rescaled/bgwikinews.csv
A projectcounts/weekly_rescaled/bgwikiquote.csv
A projectcounts/weekly_rescaled/bgwikisource.csv
A projectcounts/weekly_rescaled/bgwiktionary.csv
A projectcounts/weekly_rescaled/bhwiki.csv
A projectcounts/weekly_rescaled/bhwiktionary.csv
A projectcounts/weekly_rescaled/biwiki.csv
A projectcounts/weekly_rescaled/biwikibooks.csv
A projectcounts/weekly_rescaled/biwiktionary.csv
A projectcounts/weekly_rescaled/bjnwiki.csv
A projectcounts/weekly_rescaled/bmwiki.csv
A projectcounts/weekly_rescaled/bmwikibooks.csv
A projectcounts/weekly_rescaled/bmwikiquote.csv
A projectcounts/weekly_rescaled/bmwiktionary.csv
A projectcounts/weekly_rescaled/bnwiki.csv
A projectcounts/weekly_rescaled/bnwikibooks.csv
A projectcounts/weekly_rescaled/bnwikisource.csv
A projectcounts/weekly_rescaled/bnwiktionary.csv
A projectcounts/weekly_rescaled/bowiki.csv
A projectcounts/weekly_rescaled/bowikibooks.csv
A projectcounts/weekly_rescaled/bowiktionary.csv
A projectcounts/weekly_rescaled/bpywiki.csv
A projectcounts/weekly_rescaled/brwiki.csv
A projectcounts/weekly_rescaled/brwikimedia.csv
A projectcounts/weekly_rescaled/brwikiquote.csv
A projectcounts/weekly_rescaled/brwikisource.csv
A projectcounts/weekly_rescaled/brwiktionary.csv

[MediaWiki-commits] [Gerrit] Add monthly projectcounts - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add monthly projectcounts
..

Add monthly projectcounts

Change-Id: I7204032e90278431846c6b070c94da9811eda7e3
---
M projectcounts/README.txt
A projectcounts/monthly_rescaled/aawiki.csv
A projectcounts/monthly_rescaled/aawikibooks.csv
A projectcounts/monthly_rescaled/aawiktionary.csv
A projectcounts/monthly_rescaled/abwiki.csv
A projectcounts/monthly_rescaled/abwiktionary.csv
A projectcounts/monthly_rescaled/acewiki.csv
A projectcounts/monthly_rescaled/advisorywiki.csv
A projectcounts/monthly_rescaled/afwiki.csv
A projectcounts/monthly_rescaled/afwikibooks.csv
A projectcounts/monthly_rescaled/afwikiquote.csv
A projectcounts/monthly_rescaled/afwiktionary.csv
A projectcounts/monthly_rescaled/akwiki.csv
A projectcounts/monthly_rescaled/akwikibooks.csv
A projectcounts/monthly_rescaled/akwiktionary.csv
A projectcounts/monthly_rescaled/alswiki.csv
A projectcounts/monthly_rescaled/alswikibooks.csv
A projectcounts/monthly_rescaled/alswikiquote.csv
A projectcounts/monthly_rescaled/alswiktionary.csv
A projectcounts/monthly_rescaled/amwiki.csv
A projectcounts/monthly_rescaled/amwikiquote.csv
A projectcounts/monthly_rescaled/amwiktionary.csv
A projectcounts/monthly_rescaled/angwiki.csv
A projectcounts/monthly_rescaled/angwikibooks.csv
A projectcounts/monthly_rescaled/angwikiquote.csv
A projectcounts/monthly_rescaled/angwikisource.csv
A projectcounts/monthly_rescaled/angwiktionary.csv
A projectcounts/monthly_rescaled/anwiki.csv
A projectcounts/monthly_rescaled/anwiktionary.csv
A projectcounts/monthly_rescaled/arcwiki.csv
A projectcounts/monthly_rescaled/arwiki.csv
A projectcounts/monthly_rescaled/arwikibooks.csv
A projectcounts/monthly_rescaled/arwikimedia.csv
A projectcounts/monthly_rescaled/arwikinews.csv
A projectcounts/monthly_rescaled/arwikiquote.csv
A projectcounts/monthly_rescaled/arwikisource.csv
A projectcounts/monthly_rescaled/arwikiversity.csv
A projectcounts/monthly_rescaled/arwiktionary.csv
A projectcounts/monthly_rescaled/arzwiki.csv
A projectcounts/monthly_rescaled/astwiki.csv
A projectcounts/monthly_rescaled/astwikibooks.csv
A projectcounts/monthly_rescaled/astwikiquote.csv
A projectcounts/monthly_rescaled/astwiktionary.csv
A projectcounts/monthly_rescaled/aswiki.csv
A projectcounts/monthly_rescaled/aswikibooks.csv
A projectcounts/monthly_rescaled/aswikisource.csv
A projectcounts/monthly_rescaled/aswiktionary.csv
A projectcounts/monthly_rescaled/avwiki.csv
A projectcounts/monthly_rescaled/avwiktionary.csv
A projectcounts/monthly_rescaled/aywiki.csv
A projectcounts/monthly_rescaled/aywikibooks.csv
A projectcounts/monthly_rescaled/aywiktionary.csv
A projectcounts/monthly_rescaled/azwiki.csv
A projectcounts/monthly_rescaled/azwikibooks.csv
A projectcounts/monthly_rescaled/azwikiquote.csv
A projectcounts/monthly_rescaled/azwikisource.csv
A projectcounts/monthly_rescaled/azwiktionary.csv
A projectcounts/monthly_rescaled/barwiki.csv
A projectcounts/monthly_rescaled/bat_smgwiki.csv
A projectcounts/monthly_rescaled/bawiki.csv
A projectcounts/monthly_rescaled/bawikibooks.csv
A projectcounts/monthly_rescaled/bclwiki.csv
A projectcounts/monthly_rescaled/bdwikimedia.csv
A projectcounts/monthly_rescaled/be_x_oldwiki.csv
A projectcounts/monthly_rescaled/betawikiversity.csv
A projectcounts/monthly_rescaled/bewiki.csv
A projectcounts/monthly_rescaled/bewikibooks.csv
A projectcounts/monthly_rescaled/bewikimedia.csv
A projectcounts/monthly_rescaled/bewikiquote.csv
A projectcounts/monthly_rescaled/bewikisource.csv
A projectcounts/monthly_rescaled/bewiktionary.csv
A projectcounts/monthly_rescaled/bgwiki.csv
A projectcounts/monthly_rescaled/bgwikibooks.csv
A projectcounts/monthly_rescaled/bgwikinews.csv
A projectcounts/monthly_rescaled/bgwikiquote.csv
A projectcounts/monthly_rescaled/bgwikisource.csv
A projectcounts/monthly_rescaled/bgwiktionary.csv
A projectcounts/monthly_rescaled/bhwiki.csv
A projectcounts/monthly_rescaled/bhwiktionary.csv
A projectcounts/monthly_rescaled/biwiki.csv
A projectcounts/monthly_rescaled/biwikibooks.csv
A projectcounts/monthly_rescaled/biwiktionary.csv
A projectcounts/monthly_rescaled/bjnwiki.csv
A projectcounts/monthly_rescaled/bmwiki.csv
A projectcounts/monthly_rescaled/bmwikibooks.csv
A projectcounts/monthly_rescaled/bmwikiquote.csv
A projectcounts/monthly_rescaled/bmwiktionary.csv
A projectcounts/monthly_rescaled/bnwiki.csv
A projectcounts/monthly_rescaled/bnwikibooks.csv
A projectcounts/monthly_rescaled/bnwikisource.csv
A projectcounts/monthly_rescaled/bnwiktionary.csv
A projectcounts/monthly_rescaled/bowiki.csv
A projectcounts/monthly_rescaled/bowikibooks.csv
A projectcounts/monthly_rescaled/bowiktionary.csv
A projectcounts/monthly_rescaled/bpywiki.csv
A projectcounts/monthly_rescaled/brwiki.csv
A projectcounts/monthly_rescaled/brwikimedia.csv
A projectcounts/monthly_rescaled/brwikiquote.csv
A 

[MediaWiki-commits] [Gerrit] Add yearly projectcounts - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add yearly projectcounts
..

Add yearly projectcounts

Change-Id: I3b5ef8bfaf523c96680568511d8f091099728e59
---
M projectcounts/README.txt
A projectcounts/yearly_rescaled/aawiki.csv
A projectcounts/yearly_rescaled/aawikibooks.csv
A projectcounts/yearly_rescaled/aawiktionary.csv
A projectcounts/yearly_rescaled/abwiki.csv
A projectcounts/yearly_rescaled/abwiktionary.csv
A projectcounts/yearly_rescaled/acewiki.csv
A projectcounts/yearly_rescaled/advisorywiki.csv
A projectcounts/yearly_rescaled/afwiki.csv
A projectcounts/yearly_rescaled/afwikibooks.csv
A projectcounts/yearly_rescaled/afwikiquote.csv
A projectcounts/yearly_rescaled/afwiktionary.csv
A projectcounts/yearly_rescaled/akwiki.csv
A projectcounts/yearly_rescaled/akwikibooks.csv
A projectcounts/yearly_rescaled/akwiktionary.csv
A projectcounts/yearly_rescaled/alswiki.csv
A projectcounts/yearly_rescaled/alswikibooks.csv
A projectcounts/yearly_rescaled/alswikiquote.csv
A projectcounts/yearly_rescaled/alswiktionary.csv
A projectcounts/yearly_rescaled/amwiki.csv
A projectcounts/yearly_rescaled/amwikiquote.csv
A projectcounts/yearly_rescaled/amwiktionary.csv
A projectcounts/yearly_rescaled/angwiki.csv
A projectcounts/yearly_rescaled/angwikibooks.csv
A projectcounts/yearly_rescaled/angwikiquote.csv
A projectcounts/yearly_rescaled/angwikisource.csv
A projectcounts/yearly_rescaled/angwiktionary.csv
A projectcounts/yearly_rescaled/anwiki.csv
A projectcounts/yearly_rescaled/anwiktionary.csv
A projectcounts/yearly_rescaled/arcwiki.csv
A projectcounts/yearly_rescaled/arwiki.csv
A projectcounts/yearly_rescaled/arwikibooks.csv
A projectcounts/yearly_rescaled/arwikimedia.csv
A projectcounts/yearly_rescaled/arwikinews.csv
A projectcounts/yearly_rescaled/arwikiquote.csv
A projectcounts/yearly_rescaled/arwikisource.csv
A projectcounts/yearly_rescaled/arwikiversity.csv
A projectcounts/yearly_rescaled/arwiktionary.csv
A projectcounts/yearly_rescaled/arzwiki.csv
A projectcounts/yearly_rescaled/astwiki.csv
A projectcounts/yearly_rescaled/astwikibooks.csv
A projectcounts/yearly_rescaled/astwikiquote.csv
A projectcounts/yearly_rescaled/astwiktionary.csv
A projectcounts/yearly_rescaled/aswiki.csv
A projectcounts/yearly_rescaled/aswikibooks.csv
A projectcounts/yearly_rescaled/aswikisource.csv
A projectcounts/yearly_rescaled/aswiktionary.csv
A projectcounts/yearly_rescaled/avwiki.csv
A projectcounts/yearly_rescaled/avwiktionary.csv
A projectcounts/yearly_rescaled/aywiki.csv
A projectcounts/yearly_rescaled/aywikibooks.csv
A projectcounts/yearly_rescaled/aywiktionary.csv
A projectcounts/yearly_rescaled/azwiki.csv
A projectcounts/yearly_rescaled/azwikibooks.csv
A projectcounts/yearly_rescaled/azwikiquote.csv
A projectcounts/yearly_rescaled/azwikisource.csv
A projectcounts/yearly_rescaled/azwiktionary.csv
A projectcounts/yearly_rescaled/barwiki.csv
A projectcounts/yearly_rescaled/bat_smgwiki.csv
A projectcounts/yearly_rescaled/bawiki.csv
A projectcounts/yearly_rescaled/bawikibooks.csv
A projectcounts/yearly_rescaled/bclwiki.csv
A projectcounts/yearly_rescaled/bdwikimedia.csv
A projectcounts/yearly_rescaled/be_x_oldwiki.csv
A projectcounts/yearly_rescaled/betawikiversity.csv
A projectcounts/yearly_rescaled/bewiki.csv
A projectcounts/yearly_rescaled/bewikibooks.csv
A projectcounts/yearly_rescaled/bewikimedia.csv
A projectcounts/yearly_rescaled/bewikiquote.csv
A projectcounts/yearly_rescaled/bewikisource.csv
A projectcounts/yearly_rescaled/bewiktionary.csv
A projectcounts/yearly_rescaled/bgwiki.csv
A projectcounts/yearly_rescaled/bgwikibooks.csv
A projectcounts/yearly_rescaled/bgwikinews.csv
A projectcounts/yearly_rescaled/bgwikiquote.csv
A projectcounts/yearly_rescaled/bgwikisource.csv
A projectcounts/yearly_rescaled/bgwiktionary.csv
A projectcounts/yearly_rescaled/bhwiki.csv
A projectcounts/yearly_rescaled/bhwiktionary.csv
A projectcounts/yearly_rescaled/biwiki.csv
A projectcounts/yearly_rescaled/biwikibooks.csv
A projectcounts/yearly_rescaled/biwiktionary.csv
A projectcounts/yearly_rescaled/bjnwiki.csv
A projectcounts/yearly_rescaled/bmwiki.csv
A projectcounts/yearly_rescaled/bmwikibooks.csv
A projectcounts/yearly_rescaled/bmwikiquote.csv
A projectcounts/yearly_rescaled/bmwiktionary.csv
A projectcounts/yearly_rescaled/bnwiki.csv
A projectcounts/yearly_rescaled/bnwikibooks.csv
A projectcounts/yearly_rescaled/bnwikisource.csv
A projectcounts/yearly_rescaled/bnwiktionary.csv
A projectcounts/yearly_rescaled/bowiki.csv
A projectcounts/yearly_rescaled/bowikibooks.csv
A projectcounts/yearly_rescaled/bowiktionary.csv
A projectcounts/yearly_rescaled/bpywiki.csv
A projectcounts/yearly_rescaled/brwiki.csv
A projectcounts/yearly_rescaled/brwikimedia.csv
A projectcounts/yearly_rescaled/brwikiquote.csv
A projectcounts/yearly_rescaled/brwikisource.csv
A projectcounts/yearly_rescaled/brwiktionary.csv
A 

[MediaWiki-commits] [Gerrit] Reprocess data with upstream fixes for 0 vs. “no value”, and... - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Reprocess data with upstream fixes for 0 vs. “no value”, and 
site detection
..

Reprocess data with upstream fixes for 0 vs. “no value”, and site detection

For dates before 2014-09-23, there is no value for mobile and zero
sites. We used to mark that with 0, but it should be empty to help
plotting libraries distinguish between “no value” and 0.

Also the upstream fixes weed out outliers on the mobile site, and
allow to detect mobile site for foundationwiki and mediawikiwiki.

Bug: T76406
Change-Id: I5b3368ebf0739c5a60f09a5b0408b0fb494de97f
---
M projectcounts/daily/aawiki.csv
M projectcounts/daily/aawikibooks.csv
M projectcounts/daily/aawiktionary.csv
M projectcounts/daily/abwiki.csv
M projectcounts/daily/abwiktionary.csv
M projectcounts/daily/acewiki.csv
M projectcounts/daily/advisorywiki.csv
M projectcounts/daily/afwiki.csv
M projectcounts/daily/afwikibooks.csv
M projectcounts/daily/afwikiquote.csv
M projectcounts/daily/afwiktionary.csv
M projectcounts/daily/akwiki.csv
M projectcounts/daily/akwikibooks.csv
M projectcounts/daily/akwiktionary.csv
M projectcounts/daily/alswiki.csv
M projectcounts/daily/alswikibooks.csv
M projectcounts/daily/alswikiquote.csv
M projectcounts/daily/alswiktionary.csv
M projectcounts/daily/amwiki.csv
M projectcounts/daily/amwikiquote.csv
M projectcounts/daily/amwiktionary.csv
M projectcounts/daily/angwiki.csv
M projectcounts/daily/angwikibooks.csv
M projectcounts/daily/angwikiquote.csv
M projectcounts/daily/angwikisource.csv
M projectcounts/daily/angwiktionary.csv
M projectcounts/daily/anwiki.csv
M projectcounts/daily/anwiktionary.csv
M projectcounts/daily/arcwiki.csv
M projectcounts/daily/arwiki.csv
M projectcounts/daily/arwikibooks.csv
M projectcounts/daily/arwikimedia.csv
M projectcounts/daily/arwikinews.csv
M projectcounts/daily/arwikiquote.csv
M projectcounts/daily/arwikisource.csv
M projectcounts/daily/arwikiversity.csv
M projectcounts/daily/arwiktionary.csv
M projectcounts/daily/arzwiki.csv
M projectcounts/daily/astwiki.csv
M projectcounts/daily/astwikibooks.csv
M projectcounts/daily/astwikiquote.csv
M projectcounts/daily/astwiktionary.csv
M projectcounts/daily/aswiki.csv
M projectcounts/daily/aswikibooks.csv
M projectcounts/daily/aswikisource.csv
M projectcounts/daily/aswiktionary.csv
M projectcounts/daily/avwiki.csv
M projectcounts/daily/avwiktionary.csv
M projectcounts/daily/aywiki.csv
M projectcounts/daily/aywikibooks.csv
M projectcounts/daily/aywiktionary.csv
M projectcounts/daily/azwiki.csv
M projectcounts/daily/azwikibooks.csv
M projectcounts/daily/azwikiquote.csv
M projectcounts/daily/azwikisource.csv
M projectcounts/daily/azwiktionary.csv
M projectcounts/daily/barwiki.csv
M projectcounts/daily/bat_smgwiki.csv
M projectcounts/daily/bawiki.csv
M projectcounts/daily/bawikibooks.csv
M projectcounts/daily/bclwiki.csv
M projectcounts/daily/bdwikimedia.csv
M projectcounts/daily/be_x_oldwiki.csv
M projectcounts/daily/betawikiversity.csv
M projectcounts/daily/bewiki.csv
M projectcounts/daily/bewikibooks.csv
M projectcounts/daily/bewikimedia.csv
M projectcounts/daily/bewikiquote.csv
M projectcounts/daily/bewikisource.csv
M projectcounts/daily/bewiktionary.csv
M projectcounts/daily/bgwiki.csv
M projectcounts/daily/bgwikibooks.csv
M projectcounts/daily/bgwikinews.csv
M projectcounts/daily/bgwikiquote.csv
M projectcounts/daily/bgwikisource.csv
M projectcounts/daily/bgwiktionary.csv
M projectcounts/daily/bhwiki.csv
M projectcounts/daily/bhwiktionary.csv
M projectcounts/daily/biwiki.csv
M projectcounts/daily/biwikibooks.csv
M projectcounts/daily/biwiktionary.csv
M projectcounts/daily/bjnwiki.csv
M projectcounts/daily/bmwiki.csv
M projectcounts/daily/bmwikibooks.csv
M projectcounts/daily/bmwikiquote.csv
M projectcounts/daily/bmwiktionary.csv
M projectcounts/daily/bnwiki.csv
M projectcounts/daily/bnwikibooks.csv
M projectcounts/daily/bnwikisource.csv
M projectcounts/daily/bnwiktionary.csv
M projectcounts/daily/bowiki.csv
M projectcounts/daily/bowikibooks.csv
M projectcounts/daily/bowiktionary.csv
M projectcounts/daily/bpywiki.csv
M projectcounts/daily/brwiki.csv
M projectcounts/daily/brwikimedia.csv
M projectcounts/daily/brwikiquote.csv
M projectcounts/daily/brwikisource.csv
M projectcounts/daily/brwiktionary.csv
M projectcounts/daily/bswiki.csv
M projectcounts/daily/bswikibooks.csv
M projectcounts/daily/bswikinews.csv
M projectcounts/daily/bswikiquote.csv
M projectcounts/daily/bswikisource.csv
M projectcounts/daily/bswiktionary.csv
M projectcounts/daily/bugwiki.csv
M projectcounts/daily/bxrwiki.csv
M projectcounts/daily/cawiki.csv
M projectcounts/daily/cawikibooks.csv
M projectcounts/daily/cawikinews.csv
M projectcounts/daily/cawikiquote.csv
M projectcounts/daily/cawikisource.csv
M projectcounts/daily/cawiktionary.csv
M projectcounts/daily/cbk_zamwiki.csv
M projectcounts/daily/cdowiki.csv
M 

[MediaWiki-commits] [Gerrit] Add projectcounts for 2015-01-02 - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add projectcounts for 2015-01-02
..

Add projectcounts for 2015-01-02

Change-Id: I73787bf371a3ae6537e5a5ddf147d064679b6945
---
M projectcounts/daily/aawiki.csv
M projectcounts/daily/aawikibooks.csv
M projectcounts/daily/aawiktionary.csv
M projectcounts/daily/abwiki.csv
M projectcounts/daily/abwiktionary.csv
M projectcounts/daily/acewiki.csv
M projectcounts/daily/advisorywiki.csv
M projectcounts/daily/afwiki.csv
M projectcounts/daily/afwikibooks.csv
M projectcounts/daily/afwikiquote.csv
M projectcounts/daily/afwiktionary.csv
M projectcounts/daily/akwiki.csv
M projectcounts/daily/akwikibooks.csv
M projectcounts/daily/akwiktionary.csv
M projectcounts/daily/alswiki.csv
M projectcounts/daily/alswikibooks.csv
M projectcounts/daily/alswikiquote.csv
M projectcounts/daily/alswiktionary.csv
M projectcounts/daily/amwiki.csv
M projectcounts/daily/amwikiquote.csv
M projectcounts/daily/amwiktionary.csv
M projectcounts/daily/angwiki.csv
M projectcounts/daily/angwikibooks.csv
M projectcounts/daily/angwikiquote.csv
M projectcounts/daily/angwikisource.csv
M projectcounts/daily/angwiktionary.csv
M projectcounts/daily/anwiki.csv
M projectcounts/daily/anwiktionary.csv
M projectcounts/daily/arcwiki.csv
M projectcounts/daily/arwiki.csv
M projectcounts/daily/arwikibooks.csv
M projectcounts/daily/arwikimedia.csv
M projectcounts/daily/arwikinews.csv
M projectcounts/daily/arwikiquote.csv
M projectcounts/daily/arwikisource.csv
M projectcounts/daily/arwikiversity.csv
M projectcounts/daily/arwiktionary.csv
M projectcounts/daily/arzwiki.csv
M projectcounts/daily/astwiki.csv
M projectcounts/daily/astwikibooks.csv
M projectcounts/daily/astwikiquote.csv
M projectcounts/daily/astwiktionary.csv
M projectcounts/daily/aswiki.csv
M projectcounts/daily/aswikibooks.csv
M projectcounts/daily/aswikisource.csv
M projectcounts/daily/aswiktionary.csv
M projectcounts/daily/avwiki.csv
M projectcounts/daily/avwiktionary.csv
M projectcounts/daily/aywiki.csv
M projectcounts/daily/aywikibooks.csv
M projectcounts/daily/aywiktionary.csv
M projectcounts/daily/azwiki.csv
M projectcounts/daily/azwikibooks.csv
M projectcounts/daily/azwikiquote.csv
M projectcounts/daily/azwikisource.csv
M projectcounts/daily/azwiktionary.csv
M projectcounts/daily/barwiki.csv
M projectcounts/daily/bat_smgwiki.csv
M projectcounts/daily/bawiki.csv
M projectcounts/daily/bawikibooks.csv
M projectcounts/daily/bclwiki.csv
M projectcounts/daily/bdwikimedia.csv
M projectcounts/daily/be_x_oldwiki.csv
M projectcounts/daily/betawikiversity.csv
M projectcounts/daily/bewiki.csv
M projectcounts/daily/bewikibooks.csv
M projectcounts/daily/bewikimedia.csv
M projectcounts/daily/bewikiquote.csv
M projectcounts/daily/bewikisource.csv
M projectcounts/daily/bewiktionary.csv
M projectcounts/daily/bgwiki.csv
M projectcounts/daily/bgwikibooks.csv
M projectcounts/daily/bgwikinews.csv
M projectcounts/daily/bgwikiquote.csv
M projectcounts/daily/bgwikisource.csv
M projectcounts/daily/bgwiktionary.csv
M projectcounts/daily/bhwiki.csv
M projectcounts/daily/bhwiktionary.csv
M projectcounts/daily/biwiki.csv
M projectcounts/daily/biwikibooks.csv
M projectcounts/daily/biwiktionary.csv
M projectcounts/daily/bjnwiki.csv
M projectcounts/daily/bmwiki.csv
M projectcounts/daily/bmwikibooks.csv
M projectcounts/daily/bmwikiquote.csv
M projectcounts/daily/bmwiktionary.csv
M projectcounts/daily/bnwiki.csv
M projectcounts/daily/bnwikibooks.csv
M projectcounts/daily/bnwikisource.csv
M projectcounts/daily/bnwiktionary.csv
M projectcounts/daily/bowiki.csv
M projectcounts/daily/bowikibooks.csv
M projectcounts/daily/bowiktionary.csv
M projectcounts/daily/bpywiki.csv
M projectcounts/daily/brwiki.csv
M projectcounts/daily/brwikimedia.csv
M projectcounts/daily/brwikiquote.csv
M projectcounts/daily/brwikisource.csv
M projectcounts/daily/brwiktionary.csv
M projectcounts/daily/bswiki.csv
M projectcounts/daily/bswikibooks.csv
M projectcounts/daily/bswikinews.csv
M projectcounts/daily/bswikiquote.csv
M projectcounts/daily/bswikisource.csv
M projectcounts/daily/bswiktionary.csv
M projectcounts/daily/bugwiki.csv
M projectcounts/daily/bxrwiki.csv
M projectcounts/daily/cawiki.csv
M projectcounts/daily/cawikibooks.csv
M projectcounts/daily/cawikinews.csv
M projectcounts/daily/cawikiquote.csv
M projectcounts/daily/cawikisource.csv
M projectcounts/daily/cawiktionary.csv
M projectcounts/daily/cbk_zamwiki.csv
M projectcounts/daily/cdowiki.csv
M projectcounts/daily/cebwiki.csv
M projectcounts/daily/cewiki.csv
M projectcounts/daily/chowiki.csv
M projectcounts/daily/chrwiki.csv
M projectcounts/daily/chrwiktionary.csv
M projectcounts/daily/chwiki.csv
M projectcounts/daily/chwikibooks.csv
M projectcounts/daily/chwiktionary.csv
M projectcounts/daily/chywiki.csv
M projectcounts/daily/ckbwiki.csv
M projectcounts/daily/commonswiki.csv
M projectcounts/daily/cowiki.csv
M 

[MediaWiki-commits] [Gerrit] Add projectcounts for 2015-01-01 - change (analytics...data)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Add projectcounts for 2015-01-01
..

Add projectcounts for 2015-01-01

Change-Id: Ia8190d0bfac765239c970fbd3811dde00d69027c
---
M projectcounts/daily/aawiki.csv
M projectcounts/daily/aawikibooks.csv
M projectcounts/daily/aawiktionary.csv
M projectcounts/daily/abwiki.csv
M projectcounts/daily/abwiktionary.csv
M projectcounts/daily/acewiki.csv
M projectcounts/daily/advisorywiki.csv
M projectcounts/daily/afwiki.csv
M projectcounts/daily/afwikibooks.csv
M projectcounts/daily/afwikiquote.csv
M projectcounts/daily/afwiktionary.csv
M projectcounts/daily/akwiki.csv
M projectcounts/daily/akwikibooks.csv
M projectcounts/daily/akwiktionary.csv
M projectcounts/daily/alswiki.csv
M projectcounts/daily/alswikibooks.csv
M projectcounts/daily/alswikiquote.csv
M projectcounts/daily/alswiktionary.csv
M projectcounts/daily/amwiki.csv
M projectcounts/daily/amwikiquote.csv
M projectcounts/daily/amwiktionary.csv
M projectcounts/daily/angwiki.csv
M projectcounts/daily/angwikibooks.csv
M projectcounts/daily/angwikiquote.csv
M projectcounts/daily/angwikisource.csv
M projectcounts/daily/angwiktionary.csv
M projectcounts/daily/anwiki.csv
M projectcounts/daily/anwiktionary.csv
M projectcounts/daily/arcwiki.csv
M projectcounts/daily/arwiki.csv
M projectcounts/daily/arwikibooks.csv
M projectcounts/daily/arwikimedia.csv
M projectcounts/daily/arwikinews.csv
M projectcounts/daily/arwikiquote.csv
M projectcounts/daily/arwikisource.csv
M projectcounts/daily/arwikiversity.csv
M projectcounts/daily/arwiktionary.csv
M projectcounts/daily/arzwiki.csv
M projectcounts/daily/astwiki.csv
M projectcounts/daily/astwikibooks.csv
M projectcounts/daily/astwikiquote.csv
M projectcounts/daily/astwiktionary.csv
M projectcounts/daily/aswiki.csv
M projectcounts/daily/aswikibooks.csv
M projectcounts/daily/aswikisource.csv
M projectcounts/daily/aswiktionary.csv
M projectcounts/daily/avwiki.csv
M projectcounts/daily/avwiktionary.csv
M projectcounts/daily/aywiki.csv
M projectcounts/daily/aywikibooks.csv
M projectcounts/daily/aywiktionary.csv
M projectcounts/daily/azwiki.csv
M projectcounts/daily/azwikibooks.csv
M projectcounts/daily/azwikiquote.csv
M projectcounts/daily/azwikisource.csv
M projectcounts/daily/azwiktionary.csv
M projectcounts/daily/barwiki.csv
M projectcounts/daily/bat_smgwiki.csv
M projectcounts/daily/bawiki.csv
M projectcounts/daily/bawikibooks.csv
M projectcounts/daily/bclwiki.csv
M projectcounts/daily/bdwikimedia.csv
M projectcounts/daily/be_x_oldwiki.csv
M projectcounts/daily/betawikiversity.csv
M projectcounts/daily/bewiki.csv
M projectcounts/daily/bewikibooks.csv
M projectcounts/daily/bewikimedia.csv
M projectcounts/daily/bewikiquote.csv
M projectcounts/daily/bewikisource.csv
M projectcounts/daily/bewiktionary.csv
M projectcounts/daily/bgwiki.csv
M projectcounts/daily/bgwikibooks.csv
M projectcounts/daily/bgwikinews.csv
M projectcounts/daily/bgwikiquote.csv
M projectcounts/daily/bgwikisource.csv
M projectcounts/daily/bgwiktionary.csv
M projectcounts/daily/bhwiki.csv
M projectcounts/daily/bhwiktionary.csv
M projectcounts/daily/biwiki.csv
M projectcounts/daily/biwikibooks.csv
M projectcounts/daily/biwiktionary.csv
M projectcounts/daily/bjnwiki.csv
M projectcounts/daily/bmwiki.csv
M projectcounts/daily/bmwikibooks.csv
M projectcounts/daily/bmwikiquote.csv
M projectcounts/daily/bmwiktionary.csv
M projectcounts/daily/bnwiki.csv
M projectcounts/daily/bnwikibooks.csv
M projectcounts/daily/bnwikisource.csv
M projectcounts/daily/bnwiktionary.csv
M projectcounts/daily/bowiki.csv
M projectcounts/daily/bowikibooks.csv
M projectcounts/daily/bowiktionary.csv
M projectcounts/daily/bpywiki.csv
M projectcounts/daily/brwiki.csv
M projectcounts/daily/brwikimedia.csv
M projectcounts/daily/brwikiquote.csv
M projectcounts/daily/brwikisource.csv
M projectcounts/daily/brwiktionary.csv
M projectcounts/daily/bswiki.csv
M projectcounts/daily/bswikibooks.csv
M projectcounts/daily/bswikinews.csv
M projectcounts/daily/bswikiquote.csv
M projectcounts/daily/bswikisource.csv
M projectcounts/daily/bswiktionary.csv
M projectcounts/daily/bugwiki.csv
M projectcounts/daily/bxrwiki.csv
M projectcounts/daily/cawiki.csv
M projectcounts/daily/cawikibooks.csv
M projectcounts/daily/cawikinews.csv
M projectcounts/daily/cawikiquote.csv
M projectcounts/daily/cawikisource.csv
M projectcounts/daily/cawiktionary.csv
M projectcounts/daily/cbk_zamwiki.csv
M projectcounts/daily/cdowiki.csv
M projectcounts/daily/cebwiki.csv
M projectcounts/daily/cewiki.csv
M projectcounts/daily/chowiki.csv
M projectcounts/daily/chrwiki.csv
M projectcounts/daily/chrwiktionary.csv
M projectcounts/daily/chwiki.csv
M projectcounts/daily/chwikibooks.csv
M projectcounts/daily/chwiktionary.csv
M projectcounts/daily/chywiki.csv
M projectcounts/daily/ckbwiki.csv
M projectcounts/daily/commonswiki.csv
M projectcounts/daily/cowiki.csv
M 

[MediaWiki-commits] [Gerrit] Fetch patrol token for MW 1.20 - change (pywikibot/core)

2015-01-04 Thread Mpaa (Code Review)
Mpaa has uploaded a new change for review.

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

Change subject: Fetch patrol token for MW  1.20
..

Fetch patrol token for MW  1.20

Get patrol token for versions  MW 1.20.

Since patrol was added in v1.14, until v1.16, the patrol token is the
same as the edit token.

For MW 1.17-19, the patrol token must be obtained from the query list
recentchanges.

Bug: TT85727
Change-Id: Ibbba1f8e0093f28d8cefd86a71f225938bc4a8a1
---
M pywikibot/site.py
1 file changed, 32 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/90/182690/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 973edaf..c87d42c 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2608,6 +2608,12 @@
 _version = MediaWikiVersion(self.version())
 if _version  MediaWikiVersion('1.20'):
 valid_types = [token for token in types if token in self.TOKENS_0]
+
+# Pre 1.17, preload token was was the same as the edit token.
+if _version  MediaWikiVersion('1.17'):
+if 'patrol' in types and 'edit' not in valid_types:
+valid_types.append('edit')
+
 elif _version  MediaWikiVersion('1.24wmf19'):
 valid_types = [token for token in types if token in self.TOKENS_1]
 else:
@@ -2630,13 +2636,19 @@
 system was introduced which reduced the amount of tokens available.
 Most of them were merged into the 'csrf' token. If the token type in
 the parameter is not known it will default to the 'csrf' token.
+
 The other token types available are:
  - deleteglobalaccount
- - patrol
+ - patrol (*)
  - rollback
  - setglobalaccountstatus
  - userrights
  - watch
+
+ (*) Patrol was added in v1.14.
+ Until v1.16, the patrol token is same as the edit token.
+ For v1.17-19, the patrol token must be obtained from the query
+ list recentchanges.
 
 @param types: the types of token (e.g., edit, move, delete);
 see API documentation for full list of types
@@ -2670,6 +2682,25 @@
 if (tokentype + 'token') in item:
 user_tokens[tokentype] = item[tokentype + 'token']
 
+# patrol token require special handling.
+# TODO: try to catch exceptions?
+if 'patrol' in types:
+if MediaWikiVersion('1.14') = _version  
MediaWikiVersion('1.17'):
+user_tokens['patrol'] = user_tokens['edit']
+else:
+req = api.Request(site=self, action='query',
+  list='recentchanges',
+  rctoken='patrol', rclimit=1)
+
+req._warning_handler = warn_handler
+data = req.submit()
+
+if 'query' in data:
+data = data['query']
+if 'recentchanges' in data:
+item = data['recentchanges'][0]
+user_tokens['patrol'] = item.get('patroltoken', 
None)
+
 else:
 if _version  MediaWikiVersion('1.24wmf19'):
 if all is not False:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbba1f8e0093f28d8cefd86a71f225938bc4a8a1
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa mpaa.w...@gmail.com

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


[MediaWiki-commits] [Gerrit] update i18n files from json - change (pywikibot/i18n)

2015-01-04 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: update i18n files from json
..

update i18n files from json

update made by script

Change-Id: I517a8b8473632d443a214a74a439ce245c0b1aee
---
M add_text.py
M archivebot.py
M basic.py
M blockpageschecker.py
M capitalize_redirects.py
M casechecker.py
M catall.py
M category.py
M category_redirect.py
M clean_sandbox.py
M commons.py
M commons_link.py
M cosmetic_changes.py
M delete.py
M djvutext.py
M editarticle.py
M featured.py
M fixing_redirects.py
M interwiki.py
M isbn.py
M lonelypages.py
M makecat.py
M misspelling.py
M movepages.py
M ndashredir.py
M noreferences.py
M pagefromfile.py
M protect.py
M pywikibot.py
M redirect.py
M reflinks.py
M replace.py
M revertbot.py
M selflink.py
M solve_disambiguation.py
M spamremove.py
M spellcheck.py
M table2wiki.py
M template.py
M thirdparty.py
M undelete.py
M unlink.py
M weblinkchecker.py
M welcome.py
44 files changed, 3,140 insertions(+), 3,208 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/i18n 
refs/changes/91/182691/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I517a8b8473632d443a214a74a439ce245c0b1aee
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Fix documentation of mw.loader.getState - change (mediawiki/core)

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

Change subject: Fix documentation of mw.loader.getState
..


Fix documentation of mw.loader.getState

The misleading comment was copied from mw.loader.getVersion
in commit 6a1ec17e79.

Change-Id: I73ddb67901da808fd402742232b4b4dd2ad31ebc
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 40f8ef9..df6b33a 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1927,7 +1927,7 @@
 * Get the state of a module.
 *
 * @param {string} module Name of module
-* @return {string|null} The state, or null if 
the module (or its version) is not
+* @return {string|null} The state, or null if 
the module (or its state) is not
 *  in the registry.
 */
getState: function ( module ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I73ddb67901da808fd402742232b4b4dd2ad31ebc
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org
Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] reassign db1057 to s1 - change (operations/puppet)

2015-01-04 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: reassign db1057 to s1
..

reassign db1057 to s1

Change-Id: Ibbdf23df97fd74b6808a9d3b18603de2482b11eb
---
M manifests/site.pp
1 file changed, 1 insertion(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/92/182692/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 8e86454..2aa16b1 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -765,7 +765,7 @@
 }
 
 # MariaDB 10
-node /^db10(55|61|62|65|66|72|73)\.eqiad\.wmnet/ {
+node /^db10(55|57|61|62|65|66|72|73)\.eqiad\.wmnet/ {
 
 include admin
 $cluster = 'mysql'
@@ -991,44 +991,6 @@
 include admin
 $cluster = 'mysql'
 include role::mariadb::analytics
-}
-
-## SANITARIUM
-
-node 'db1057.eqiad.wmnet' {
-
-include admin
-$cluster = 'mysql'
-$ganglia_aggregator = true
-class { 'role::db::sanitarium':
-instances = {
-'s3' = {
-'port'= '3306',
-'innodb_log_file_size'= '500M',
-'ram' = '24G',
-'repl_ignore_dbs' = $::private_wikis,
-'repl_wild_ignore_tables' = $::private_tables,
-'log_bin' = true,
-'binlog_format'   = 'row',
-},
-'s6' = {
-'port'= '3307',
-'innodb_log_file_size'= '500M',
-'ram' = '24G',
-'repl_wild_ignore_tables' = $::private_tables,
-'log_bin' = true,
-'binlog_format'   = 'row',
-},
-'s7' = {
-'port'= '3308',
-'innodb_log_file_size'= '500M',
-'ram' = '24G',
-'repl_wild_ignore_tables' = $::private_tables,
-'log_bin' = true,
-'binlog_format'   = 'row',
-},
-}
-}
 }
 
 node 'db1069.eqiad.wmnet' {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbdf23df97fd74b6808a9d3b18603de2482b11eb
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] DatabaseMssql: Don't duplicate body of makeList() - change (mediawiki/core)

2015-01-04 Thread PleaseStand (Code Review)
PleaseStand has uploaded a new change for review.

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

Change subject: DatabaseMssql: Don't duplicate body of makeList()
..

DatabaseMssql: Don't duplicate body of makeList()

Instead keep only the code that creates blobs for specific columns
and call DatabaseBase:makeList() to handle the rest.

This will allow the fix made in 26235c73376b to work also for MSSQL.

Change-Id: I74ae55a52fcd1dad8b857385396bd8f5d81370ba
---
M includes/db/DatabaseMssql.php
1 file changed, 13 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/93/182693/1

diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index a7bc6dd..acec16a 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -792,6 +792,10 @@
 
/**
 * Makes an encoded list of strings from an array
+*
+* @todo If the custom parameter is in fact necessary, document why, and
+*   move the MS SQL specific code into a separate (private?) method.
+*
 * @param array $a Containing the data
 * @param int $mode Constant
 *  - LIST_COMMA:  comma separated, no field names
@@ -812,64 +816,23 @@
'DatabaseBase::makeList called with incorrect 
parameters' );
}
 
-   $first = true;
-   $list = '';
+   if ( $mode != LIST_NAMES ) {
+   foreach ( array_keys( $a ) as $field ) {
+   if ( !isset( $binaryColumns[$field] ) ) {
+   continue;
+   }
 
-   foreach ( $a as $field = $value ) {
-   if ( $mode != LIST_NAMES  isset( 
$binaryColumns[$field] ) ) {
-   if ( is_array( $value ) ) {
-   foreach ( $value as $v ) {
+   if ( is_array( $a[$field] ) ) {
+   foreach ( $a[$field] as $v ) {
$v = new MssqlBlob( $v );
}
} else {
-   $value = new MssqlBlob( $value );
+   $a[$field] = new MssqlBlob( $a[$field] 
);
}
-   }
-
-   if ( !$first ) {
-   if ( $mode == LIST_AND ) {
-   $list .= ' AND ';
-   } elseif ( $mode == LIST_OR ) {
-   $list .= ' OR ';
-   } else {
-   $list .= ',';
-   }
-   } else {
-   $first = false;
-   }
-
-   if ( ( $mode == LIST_AND || $mode == LIST_OR )  
is_numeric( $field ) ) {
-   $list .= ($value);
-   } elseif ( ( $mode == LIST_SET )  is_numeric( $field 
) ) {
-   $list .= $value;
-   } elseif ( ( $mode == LIST_AND || $mode == LIST_OR )  
is_array( $value ) ) {
-   if ( count( $value ) == 0 ) {
-   throw new MWException( __METHOD__ . : 
empty input for field $field );
-   } elseif ( count( $value ) == 1 ) {
-   // Special-case single values, as IN 
isn't terribly efficient
-   // Don't necessarily assume the single 
key is 0; we don't
-   // enforce linear numeric ordering on 
other arrays here.
-   $value = array_values( $value );
-   $list .= $field .  =  . 
$this-addQuotes( $value[0] );
-   } else {
-   $list .= $field .  IN ( . 
$this-makeList( $value ) . ) ;
-   }
-   } elseif ( $value === null ) {
-   if ( $mode == LIST_AND || $mode == LIST_OR ) {
-   $list .= $field IS ;
-   } elseif ( $mode == LIST_SET ) {
-   $list .= $field = ;
-   }
-   $list .= 'NULL';
-   } else {
-   if ( $mode == LIST_AND || $mode == LIST_OR || 
$mode == LIST_SET ) {
-   $list .= $field = ;
-   }
-   $list 

[MediaWiki-commits] [Gerrit] resourceloader: Make arguments to mw.loader.implement optional - change (mediawiki/core)

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

Change subject: resourceloader: Make arguments to mw.loader.implement optional
..


resourceloader: Make arguments to mw.loader.implement optional

This will allow the server to trim any trailing parameters with
empty objects from invocations.

'templates' was the only parameter added after the initial ResourceLoader
release, the other properties have always been required.

Change-Id: Ie32e7d6a3c09f86a52d60394c474a62cb1b4e1d6
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/suites/resources/mediawiki/mediawiki.test.js
2 files changed, 17 insertions(+), 12 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Fomafix: Looks good to me, but someone else must approve
  Legoktm: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index df6b33a..94b64b9 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1692,7 +1692,7 @@
 * @param {string} module Name of module
 * @param {Function|Array} script Function with 
module code or Array of URLs to
 *  be used as the src attribute of a new 
`script` tag.
-* @param {Object} style Should follow one of 
the following patterns:
+* @param {Object} [style] Should follow one of 
the following patterns:
 *
 * { css: [css, ..] }
 * { url: { media: [url, ..] } }
@@ -1705,25 +1705,25 @@
 * The reason css strings are not concatenated 
anymore is bug 31676. We now check
 * whether it's safe to extend the stylesheet 
(see #canExpandStylesheetWith).
 *
-* @param {Object} msgs List of key/value pairs 
to be added to mw#messages.
+* @param {Object} [msgs] List of key/value 
pairs to be added to mw#messages.
 * @param {Object} [templates] List of 
key/value pairs to be added to mw#templates.
 */
implement: function ( module, script, style, 
msgs, templates ) {
// Validate input
if ( typeof module !== 'string' ) {
-   throw new Error( 'module must 
be a string, not a ' + typeof module );
+   throw new Error( 'module must 
be of type string, not ' + typeof module );
}
if ( !$.isFunction( script )  
!$.isArray( script ) ) {
-   throw new Error( 'script must 
be a function or an array, not a ' + typeof script );
+   throw new Error( 'script must 
be of type function or array, not ' + typeof script );
}
-   if ( !$.isPlainObject( style ) ) {
-   throw new Error( 'style must be 
an object, not a ' + typeof style );
+   if ( style  !$.isPlainObject( style ) 
) {
+   throw new Error( 'style must be 
of type object, not ' + typeof style );
}
-   if ( !$.isPlainObject( msgs ) ) {
-   throw new Error( 'msgs must be 
an object, not a ' + typeof msgs );
+   if ( msgs  !$.isPlainObject( msgs ) ) 
{
+   throw new Error( 'msgs must be 
of type object, not a ' + typeof msgs );
}
-   if ( templates !== undefined  
!$.isPlainObject( templates ) ) {
-   throw new Error( 'templates 
must be an object, not a ' + typeof templates );
+   if ( templates  !$.isPlainObject( 
templates ) ) {
+   throw new Error( 'templates 
must be of type object, not a ' + typeof templates );
}
// Automatically register module
if ( !hasOwn.call( registry, module ) ) 
{
@@ -1735,8 +1735,8 @@
}
// Attach 

[MediaWiki-commits] [Gerrit] reassign db1057 to s1 - change (operations/puppet)

2015-01-04 Thread Springle (Code Review)
Springle has submitted this change and it was merged.

Change subject: reassign db1057 to s1
..


reassign db1057 to s1

Change-Id: Ibbdf23df97fd74b6808a9d3b18603de2482b11eb
---
M manifests/site.pp
1 file changed, 2 insertions(+), 39 deletions(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index 8e86454..f03e24c 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -765,7 +765,8 @@
 }
 
 # MariaDB 10
-node /^db10(55|61|62|65|66|72|73)\.eqiad\.wmnet/ {
+
+node /^db10(55|57|61|62|65|66|72|73)\.eqiad\.wmnet/ {
 
 include admin
 $cluster = 'mysql'
@@ -991,44 +992,6 @@
 include admin
 $cluster = 'mysql'
 include role::mariadb::analytics
-}
-
-## SANITARIUM
-
-node 'db1057.eqiad.wmnet' {
-
-include admin
-$cluster = 'mysql'
-$ganglia_aggregator = true
-class { 'role::db::sanitarium':
-instances = {
-'s3' = {
-'port'= '3306',
-'innodb_log_file_size'= '500M',
-'ram' = '24G',
-'repl_ignore_dbs' = $::private_wikis,
-'repl_wild_ignore_tables' = $::private_tables,
-'log_bin' = true,
-'binlog_format'   = 'row',
-},
-'s6' = {
-'port'= '3307',
-'innodb_log_file_size'= '500M',
-'ram' = '24G',
-'repl_wild_ignore_tables' = $::private_tables,
-'log_bin' = true,
-'binlog_format'   = 'row',
-},
-'s7' = {
-'port'= '3308',
-'innodb_log_file_size'= '500M',
-'ram' = '24G',
-'repl_wild_ignore_tables' = $::private_tables,
-'log_bin' = true,
-'binlog_format'   = 'row',
-},
-}
-}
 }
 
 node 'db1069.eqiad.wmnet' {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbdf23df97fd74b6808a9d3b18603de2482b11eb
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Springle sprin...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Make use of DatabaseBase::selectRowCount in Title - change (mediawiki/core)

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

Change subject: Make use of DatabaseBase::selectRowCount in Title
..


Make use of DatabaseBase::selectRowCount in Title

Change-Id: I686f4f785ffa6323ac94b679794ba50539d951f0
---
M includes/Title.php
1 file changed, 1 insertion(+), 8 deletions(-)

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



diff --git a/includes/Title.php b/includes/Title.php
index d0c8b3b..24f4331 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -4046,20 +4046,13 @@
if ( $this-mIsBigDeletion === null ) {
$dbr = wfGetDB( DB_SLAVE );
 
-   $innerQuery = $dbr-selectSQLText(
+   $revCount = $dbr-selectRowCount(
'revision',
'1',
array( 'rev_page' = $this-getArticleID() ),
__METHOD__,
array( 'LIMIT' = $wgDeleteRevisionsLimit + 1 )
);
-
-   $revCount = $dbr-query(
-   'SELECT COUNT(*) FROM (' . $innerQuery . ') AS 
innerQuery',
-   __METHOD__
-   );
-   $revCount = $revCount-fetchRow();
-   $revCount = $revCount['COUNT(*)'];
 
$this-mIsBigDeletion = $revCount  
$wgDeleteRevisionsLimit;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I686f4f785ffa6323ac94b679794ba50539d951f0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: PleaseStand pleasest...@live.com
Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Reactivate translations for the Wikimania 2015 cycle - change (translatewiki)

2015-01-04 Thread Niharika29 (Code Review)
Niharika29 has uploaded a new change for review.

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

Change subject: Reactivate translations for the Wikimania 2015 cycle
..

Reactivate translations for the Wikimania 2015 cycle

2015 Wikimania is coming up. The committee has finalized the
string changes they require in the app. They're good to be put
up for translation again.

Bug: T76959
Change-Id: I589d10486c65b94829eefd0f7c5f9d44fb485b1e
---
M TranslateSettings.php
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/TranslateSettings.php b/TranslateSettings.php
index 9288639..1433673 100644
--- a/TranslateSettings.php
+++ b/TranslateSettings.php
@@ -229,8 +229,9 @@
 wfAddNamespace( 1206, 'Wikimedia' );
 $wgTranslateGroupFiles[] = $GROUPS/Wikimedia/jquery.uls.yaml;
 $wgTranslateGroupFiles[] = $GROUPS/Wikimedia/WikiBlame.yaml;
-# Keep disabled until the 2015 cycle.
-#$wgTranslateGroupFiles[] = $GROUPS/Wikimedia/Wikimania.yaml;
+
+# Reactivate translations for Wikimania 2015 cycle.
+$wgTranslateGroupFiles[] = $GROUPS/Wikimedia/Wikimania.yaml;
 $wgTranslateGroupFiles[] = $GROUPS/Wikimedia/WikimediaMobile.yaml;
 $wgTranslateGroupFiles[] = $GROUPS/Wikimedia/WikimediaMobile-android.yaml;
 $wgTranslateGroupFiles[] = $GROUPS/Wikimedia/WikimediaMobile-ios.yaml;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I589d10486c65b94829eefd0f7c5f9d44fb485b1e
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Niharika29 niharikakohl...@gmail.com

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


[MediaWiki-commits] [Gerrit] Clarifications in the API help messages regarding daysago - change (mediawiki...UserDailyContribs)

2015-01-04 Thread Whym (Code Review)
Whym has uploaded a new change for review.

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

Change subject: Clarifications in the API help messages regarding daysago
..

Clarifications in the API help messages regarding daysago

Clarifying that when daysago=0 API returns the edit number for today.
since this many days ago looks ambiguous (or at least prone
to translation errors) as to whether it is inclusive or not.

Change-Id: I2acf2dd7038dae4e1e8815874e5dba1ceafe48cc
---
M api/ApiUserDailyContribs.php
M i18n/en.json
2 files changed, 4 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UserDailyContribs 
refs/changes/54/182654/1

diff --git a/api/ApiUserDailyContribs.php b/api/ApiUserDailyContribs.php
index 38166d0..c267a7b 100644
--- a/api/ApiUserDailyContribs.php
+++ b/api/ApiUserDailyContribs.php
@@ -62,7 +62,8 @@
public function getParamDescription() {
return array(
'user' = 'Username to query',
-   'daysago' = 'Number of edits since this many days ago',
+   'daysago' = array('Number of edits since this many 
days ago',
+   '0 means the last single day only.'),
'basetimestamp' = array( 'Date from which daysago will 
be calculated (instead of today).',
'Count returned in timeFrameEdits will be 
editcount between this date and the date',
'daysago from it.'
diff --git a/i18n/en.json b/i18n/en.json
index cd917a9..daded57 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,7 +7,7 @@
userdailycontribs-desc: User daily contributions for the click 
tracking extension,
apihelp-userdailycontribs-description: Get the total number of user 
edits, time of registration, and edits in a given timeframe.,
apihelp-userdailycontribs-param-user: Username to query.,
-   apihelp-userdailycontribs-param-daysago: Number of edits since this 
many days ago.,
+   apihelp-userdailycontribs-param-daysago: Number of edits since this 
many days ago. 0 means the last single day only.,
apihelp-userdailycontribs-param-basetimestamp: Date from which 
$1daysago will be calculated, instead of \today\. Count returned in 
timeFrameEdits will be editcount between this date and the date \$1daysago\ 
from it.,
-   apihelp-userdailycontribs-example-1: Get edit statistics for 
[[User:WikiSysop]] over the past 5 days
+   apihelp-userdailycontribs-example-1: Get edit statistics for 
[[User:WikiSysop]] over the past 5 days and today
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2acf2dd7038dae4e1e8815874e5dba1ceafe48cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UserDailyContribs
Gerrit-Branch: master
Gerrit-Owner: Whym w...@whym.org

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


[MediaWiki-commits] [Gerrit] Remove not allowed attributes from edit link - change (mediawiki...Wikibase)

2015-01-04 Thread Gerrit Patch Uploader (Code Review)
Gerrit Patch Uploader has uploaded a new change for review.

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

Change subject: Remove not allowed attributes from edit link
..

Remove not allowed attributes from edit link

Bug: T85752
Change-Id: Iceeebe69e474903b4722a07cd485bf75ccf2a19a
---
M client/includes/hooks/BaseTemplateAfterPortletHandler.php
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/client/includes/hooks/BaseTemplateAfterPortletHandler.php 
b/client/includes/hooks/BaseTemplateAfterPortletHandler.php
index 0975b1f..394572a 100644
--- a/client/includes/hooks/BaseTemplateAfterPortletHandler.php
+++ b/client/includes/hooks/BaseTemplateAfterPortletHandler.php
@@ -40,6 +40,9 @@
$action = $link['action'];
$link = Html::element( 'a', $link, $link['text'] );
 
+   unset( $link['action'] );
+   unset( $link['text'] );
+
$html = Html::rawElement(
'span',
array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceeebe69e474903b4722a07cd485bf75ccf2a19a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com
Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com

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


[MediaWiki-commits] [Gerrit] Make use of DatabaseBase::selectRowCount in MobileUserInfo - change (mediawiki...MobileFrontend)

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

Change subject: Make use of DatabaseBase::selectRowCount in MobileUserInfo
..


Make use of DatabaseBase::selectRowCount in MobileUserInfo

Change-Id: I877c706c27ca3efdedb9d2bb61f8c9cd815db10c
---
M includes/MobileUserInfo.php
1 file changed, 6 insertions(+), 14 deletions(-)

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



diff --git a/includes/MobileUserInfo.php b/includes/MobileUserInfo.php
index 5d9bd5e..9e0ac56 100644
--- a/includes/MobileUserInfo.php
+++ b/includes/MobileUserInfo.php
@@ -44,19 +44,15 @@
$constraints = array(
'LIMIT' = self::LIMIT + 1,
);
-   $innerSelect = $dbr-selectSQLText(
+
+   $result = $dbr-selectRowCount(
'recentchanges',
'rc_timestamp',
$where,
__METHOD__,
$constraints
);
-   $res = $dbr-query( SELECT COUNT(*) FROM ($innerSelect) t, 
__METHOD__ );
-   $row = $res-fetchRow();
-   $result = 0;
-   if ( $row ) {
-   $result = $row[0];
-   }
+
wfProfileOut( __METHOD__ );
return $result;
}
@@ -90,13 +86,9 @@
$constraints = array(
'LIMIT' = self::LIMIT + 1,
);
-   $innerSelect = $dbr-selectSQLText( 'image', 'img_timestamp', 
$where, __METHOD__, $constraints );
-   $res = $dbr-query( SELECT COUNT(*) FROM ($innerSelect) t, 
__METHOD__ );
-   $row = $res-fetchRow();
-   $result = 0;
-   if ( $row ) {
-   $result = $row[0];
-   }
+
+   $result = $dbr-selectRowCount( 'image', 'img_timestamp', 
$where, __METHOD__, $constraints );
+
wfProfileOut( __METHOD__ );
return $result;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I877c706c27ca3efdedb9d2bb61f8c9cd815db10c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de
Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jdlrobson jrob...@wikimedia.org
Gerrit-Reviewer: MaxSem maxsem.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Split 'form-rights' text into four separate messages for eas... - change (wikimedia/wikimania-scholarships)

2015-01-04 Thread Niharika29 (Code Review)
Niharika29 has uploaded a new change for review.

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

Change subject: Split 'form-rights' text into four separate messages for easier 
translation
..

Split 'form-rights' text into four separate messages for easier translation

Bug: T60768
Change-Id: I85a010fad98c90633c1a10d17522087fde242398
---
M data/i18n/en.json
M data/i18n/qqq.json
M data/templates/apply.html
3 files changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/wikimania-scholarships 
refs/changes/56/182656/1

diff --git a/data/i18n/en.json b/data/i18n/en.json
index 67181eb..b4b8851 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -134,7 +134,10 @@
form-review: All information contained in this application will be 
reviewed by the members of the Wikimania Scholarship Committee. All personal 
information will be held strictly confidential by the Committee, and the a 
href=\//wikimediafoundation.org/\Wikimedia Foundation/a.,
form-chapteragree: I would like to be considered for a a 
href=\https://meta.wikimedia.org/wiki/Wikimedia%20chapters\;Wikimedia 
chapter/a or a 
href=\https://meta.wikimedia.org/wiki/Wikimedia_thematic_organizations\;thematic
 organization/a scholarship, and agree to share my information with chapters 
and thematic organizations for purpose of selecting and awarding scholarships.,
form-rights-heading: Applicant Rights  Consent to Data Processing 
and Transfer,
-   form-rights: I as an applicant for a Wikimedia Foundation ('WMF') 
scholarship relating to my participation in the 2015 Wikimania conference 
hosted in Mexico City, hereby acknowledge and affirmatively consent to the 
following as a prerequisite to the consideration of my 2015 Wikimania 
scholarship application ('Application'):\n/pp\n(a) Any personal data or 
sensitive personal data that I submit as part of or in relation to my 
Application (collectively 'my Data') may be accessed and reviewed by: (i) WMF; 
(ii) members of a scholarship committee made up of Wikimedia movement members, 
a representative list of which can be found at: a 
href=\//wikimania2015.wikimedia.org/wiki/Scholarship_committee\https://wikimania2015.wikimedia.org/wiki/Scholarship_committee/a
 ('Scholarship Committee'); and if you indicated that you want to be considered 
for a WM Chapter or WM Thematic Org scholarship, (iii) official Wikimedia 
Chapters, a representative list of which can be found at: a 
href=\//meta.wikimedia.org/wiki/Wikimedia_chapters\https://meta.wikimedia.org/wiki/Wikimedia_chapters/a
 ('WM Chapters'), and official thematic organizations, a representative list of 
which can be found at: a 
href=\//meta.wikimedia.org/wiki/Wikimedia_thematic_organizations\https://meta.wikimedia.org/wiki/Wikimedia_thematic_organizations/a
 ('WM Thematic Orgs'); for the purposes of evaluating my 
Application.\n/pp\n(b) Any Data that I submit as a part of or in relation 
to my Application may be collected, stored, used, modified, communicated, 
archived, destroyed, or otherwise processed (collectively 'Processed' or 
'Processing') by: (i) WMF; (ii) members of the Scholarship Committee; and if 
you indicated that you want to be considered for a WM Chapter or WM Thematic 
Org scholarship, (iii) WM Chapters and WM Thematic Orgs. My Data may be 
retained by WMF until I request in writing to WMF that my Data be destroyed or 
for as long as required by applicable law.\n/pp\n(c) My Data may be 
transmitted to or from: (i) WMF in the United States; (ii) members of the 
Scholarship Committee in the country which they reside; and if you indicated 
that you want to be considered for a WM Chapter or WM Thematic Org scholarship, 
(iii) WM Chapters and/or WM Thematic Orgs in the country which the 
organizations are based.,
+   form-rights1: I as an applicant for a Wikimedia Foundation ('WMF') 
scholarship relating to my participation in the 2015 Wikimania conference 
hosted in Mexico City, hereby acknowledge and affirmatively consent to the 
following as a prerequisite to the consideration of my 2015 Wikimania 
scholarship application ('Application'):\n/p,
+   form-rights2:p\n(a) Any personal data or sensitive personal data 
that I submit as part of or in relation to my Application (collectively 'my 
Data') may be accessed and reviewed by: (i) WMF; (ii) members of a scholarship 
committee made up of Wikimedia movement members, a representative list of which 
can be found at: a 
href=\//wikimania2015.wikimedia.org/wiki/Scholarship_committee\https://wikimania2015.wikimedia.org/wiki/Scholarship_committee/a
 ('Scholarship Committee'); and if you indicated that you want to be considered 
for a WM Chapter or WM Thematic Org scholarship, (iii) official Wikimedia 
Chapters, a representative list of which can be found at: a 
href=\//meta.wikimedia.org/wiki/Wikimedia_chapters\https://meta.wikimedia.org/wiki/Wikimedia_chapters/a

[MediaWiki-commits] [Gerrit] Cleanup whitespace in modules/overlay/ext.echo.overlay.less - change (mediawiki...Echo)

2015-01-04 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Cleanup whitespace in modules/overlay/ext.echo.overlay.less
..

Cleanup whitespace in modules/overlay/ext.echo.overlay.less

According to
https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS#LESS

Change-Id: I361909fcea67fa5e0e3cbb69711ede91417c4e2e
---
M modules/overlay/ext.echo.overlay.less
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/modules/overlay/ext.echo.overlay.less 
b/modules/overlay/ext.echo.overlay.less
index 41b2064..fd9ad4d 100644
--- a/modules/overlay/ext.echo.overlay.less
+++ b/modules/overlay/ext.echo.overlay.less
@@ -6,6 +6,7 @@
 @offset: 200px;
 @chevronHeight: 11px;
 @headerFontSize: 13px;
+
 .mw-echo-overlay {
position: absolute;
top: 30px + @chevronHeight;
@@ -42,6 +43,7 @@
 
.mw-ui-progressive {
cursor: pointer;
+
.mw-ui-quiet {
pointer-events: none;
}
@@ -135,8 +137,6 @@
}
 }
 
-
-
 .mw-echo-notification-primary-link {
display: none;
 }
@@ -156,6 +156,7 @@
content:  · ;
padding: 0 .25em;
}
+
:last-child {
::after {
content: '';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I361909fcea67fa5e0e3cbb69711ede91417c4e2e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] Fix the overlay caret position for RTL - change (mediawiki...Echo)

2015-01-04 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Fix the overlay caret position for RTL
..

Fix the overlay caret position for RTL

Bug: T78330
Change-Id: Ie438042bc24b8ace429eec68c8b75c09da56aa95
---
M modules/overlay/ext.echo.overlay.less
1 file changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/modules/overlay/ext.echo.overlay.less 
b/modules/overlay/ext.echo.overlay.less
index fd9ad4d..77f4d88 100644
--- a/modules/overlay/ext.echo.overlay.less
+++ b/modules/overlay/ext.echo.overlay.less
@@ -30,8 +30,16 @@
position: absolute;
z-index: 101;
top: -@chevronHeight;
-   // subtract half the width from the offset and then add the 
left box shadow
-   left: @offset - 10px + 3px;
+
+   /* @noflip */ body.ltr  {
+   // subtract half the width from the offset and then add 
the left box shadow
+   /* @noflip */ left: @offset - 10px + 3px;
+   }
+
+   /* @noflip */ body.rtl  {
+   // subtract the box shadow
+   /* @noflip */ left: @offset - 3px;
+   }
}
 
button {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie438042bc24b8ace429eec68c8b75c09da56aa95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il

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


[MediaWiki-commits] [Gerrit] Fix pruning - change (translatewiki)

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

Change subject: Fix pruning
..


Fix pruning

ls -tr sorts newest files on bottom, head -n-# removes N files from
the bottom.

Change-Id: Id4931dc40098ad5c56e70e8f7a19edaa44968d5f
---
M bin/oregano
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/bin/oregano b/bin/oregano
index 72f6e55..5e572e4 100755
--- a/bin/oregano
+++ b/bin/oregano
@@ -74,10 +74,10 @@
echo Created tag $TAG
 
cd tags/
-   ls -1t | head -n-$MAX | xargs --no-run-if-empty -d\n echo Pruning
+   ls -1tr | head -n-$MAX | xargs --no-run-if-empty -d\n echo Pruning
# Need to restore the write permissions we removed
-   ls -1t | head -n-$MAX | xargs --no-run-if-empty -d\n chmod -R ug+w
-   ls -1t | head -n-$MAX | xargs --no-run-if-empty -d\n rm -r
+   ls -1tr | head -n-$MAX | xargs --no-run-if-empty -d\n chmod -R ug+w
+   ls -1tr | head -n-$MAX | xargs --no-run-if-empty -d\n rm -r
;;
 
 *)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id4931dc40098ad5c56e70e8f7a19edaa44968d5f
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Batch page id lookups for addLinks to ParserOutput - change (mediawiki...Wikibase)

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

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

Change subject: Batch page id lookups for addLinks to ParserOutput
..

Batch page id lookups for addLinks to ParserOutput

This uses LinkBatch which takes care of batching the queries
to get page data, including page id.

Then, ParserOutput::addLink accepts page_id as the second
parameter and then skips database lookup (one-by-one) there.

For my large test item, this change saves about a second
of parsing time.

Change-Id: Ie58704b167d3778445980e1ccfd338a917c75397
---
M repo/includes/EntityParserOutputGenerator.php
1 file changed, 17 insertions(+), 2 deletions(-)


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

diff --git a/repo/includes/EntityParserOutputGenerator.php 
b/repo/includes/EntityParserOutputGenerator.php
index 958a529..38b85ee 100644
--- a/repo/includes/EntityParserOutputGenerator.php
+++ b/repo/includes/EntityParserOutputGenerator.php
@@ -2,7 +2,9 @@
 
 namespace Wikibase;
 
+use LinkBatch;
 use ParserOutput;
+use Title;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\Item;
@@ -175,8 +177,21 @@
 * @param EntityId[] $entityIds
 */
private function addEntityLinksToParserOutput( ParserOutput 
$parserOutput, array $entityIds ) {
-   foreach ( $entityIds as $entityId ) {
-   $parserOutput-addLink( 
$this-entityTitleLookup-getTitleForId( $entityId ) );
+   $linkBatch = new LinkBatch();
+
+   foreach( $entityIds as $entityId ) {
+   $linkBatch-addObj( 
$this-entityTitleLookup-getTitleForId( $entityId ) );
+   }
+
+   $pages = $linkBatch-doQuery();
+
+   if ( $pages === false ) {
+   return;
+   }
+
+   foreach( $pages as $page ) {
+   $title = Title::makeTitle( $page-page_namespace, 
$page-page_title );
+   $parserOutput-addLink( $title, $page-page_id );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie58704b167d3778445980e1ccfd338a917c75397
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add --force-protocol to the populateSitesTable.php maintenan... - change (mediawiki...Wikibase)

2015-01-04 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Add --force-protocol to the populateSitesTable.php maintenance 
script
..

Add --force-protocol to the populateSitesTable.php maintenance script

Bug: T85755
Change-Id: I6494bcf5a5aadcf08be3b66ac7d12b173a45cad0
---
M lib/includes/sites/SiteMatrixParser.php
M lib/maintenance/populateSitesTable.php
M lib/tests/phpunit/sites/SiteMatrixParserTest.php
3 files changed, 42 insertions(+), 10 deletions(-)


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

diff --git a/lib/includes/sites/SiteMatrixParser.php 
b/lib/includes/sites/SiteMatrixParser.php
index 0712797..6f156f9 100644
--- a/lib/includes/sites/SiteMatrixParser.php
+++ b/lib/includes/sites/SiteMatrixParser.php
@@ -25,21 +25,32 @@
private $expandGroup;
 
/**
-* @var string
+* @var bool
 */
private $stripProtocol;
 
/**
+* @var string|null
+*/
+   private $forceProtocol;
+
+   /**
 * @param string $scriptPath (e.g. '/w/$1')
 * @param string $articlePath (e.g. '/wiki/$1')
-* @param string $stripProtocol
+* @param bool $stripProtocol
+* @param string|null $forceProtocol
 * @param boolean $expandGroup expands site matrix group codes from 
wiki to wikipedia
 */
-   public function __construct( $scriptPath, $articlePath, $stripProtocol, 
$expandGroup = true ) {
+   public function __construct( $scriptPath, $articlePath, $stripProtocol, 
$forceProtocol, $expandGroup = true ) {
$this-scriptPath = $scriptPath;
$this-articlePath = $articlePath;
$this-stripProtocol = $stripProtocol;
+   $this-forceProtocol = $forceProtocol;
$this-expandGroup = $expandGroup;
+
+   if ( $this-stripProtocol  $this-forceProtocol !== null ) {
+   throw new MWException( '$stripProtocol and 
$forceProtocol can not be used together.' );
+   }
}
 
/**
@@ -150,6 +161,8 @@
 
if ( $this-stripProtocol ) {
$url = preg_replace( '@^https?:@', '', $url );
+   } elseif ( $this-forceProtocol !== null ) {
+   $url = preg_replace( '@^https?:@', $this-forceProtocol 
. ':', $url );
}
 
$site-setFilePath( $url . $this-scriptPath );
diff --git a/lib/maintenance/populateSitesTable.php 
b/lib/maintenance/populateSitesTable.php
index 9d85396..7e7cf84 100644
--- a/lib/maintenance/populateSitesTable.php
+++ b/lib/maintenance/populateSitesTable.php
@@ -20,6 +20,7 @@
$this-mDescription = 'Populate the sites table from another 
wiki that runs the SiteMatrix extension';
 
$this-addOption( 'strip-protocols', Strip http/https from 
URLs to make them protocol relative. );
+   $this-addOption( 'force-protocol', Force a specific protocol 
for all URLs (like http/https)., false, true );
$this-addOption( 'load-from', Full URL to the API of the wiki 
to fetch the site info from. 
. Default is 
https://meta.wikimedia.org/w/api.php;, false, true );
$this-addOption( 'script-path', 'Script path to use for wikis 
in the site matrix. '
@@ -37,13 +38,18 @@
}
 
public function execute() {
-   $stripProtocols = $this-getOption( 'strip-protocols', false );
+   $stripProtocols = (bool)$this-getOption( 'strip-protocols', 
false );
+   $forceProtocol = $this-getOption( 'force-protocol', null );
$url = $this-getOption( 'load-from', 
'https://meta.wikimedia.org/w/api.php' );
$scriptPath = $this-getOption( 'script-path', '/w/$1' );
$articlePath = $this-getOption( 'article-path', '/wiki/$1' );
$expandGroup = !$this-getOption( 'no-expand-group', false );
$siteGroup = $this-getOption( 'site-group' );
$wikiId = $this-getOption( 'wiki' );
+
+   if ( $stripProtocols  is_string( $forceProtocol ) ) {
+   $this-error( You can't use both strip-protocols and 
force-protocol, 1 );
+   }
 
// @todo make it configurable, such as from a config file.
$validGroups = array( 'wikipedia', 'wikivoyage', 'wikiquote', 
'wiktionary',
@@ -53,7 +59,7 @@
$json = $this-getSiteMatrixData( $url );
 
$siteMatrixParser = new SiteMatrixParser( $scriptPath, 
$articlePath,
-   $stripProtocols, $expandGroup );
+   $stripProtocols, $forceProtocol, $expandGroup );
 
$sites = $siteMatrixParser-sitesFromJson( $json );
 
diff --git 

[MediaWiki-commits] [Gerrit] Stop using jQuery.live - change (mediawiki...MoodBar)

2015-01-04 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Stop using jQuery.live
..

Stop using jQuery.live

It was removed in jQuery 1.9

Bug: T85300
Change-Id: I688a69fcbb55933bb221fc9096a495de42f97ddf
---
M modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
1 file changed, 10 insertions(+), 9 deletions(-)


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

diff --git a/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js 
b/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
index 9113af5..57e 100644
--- a/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
+++ b/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js
@@ -696,8 +696,8 @@
$item.find( '.fbd-item-response' ).append( $tooltip );
 
// Close event, closure remembers object
-   $( '.fbd-tooltip-close' )
-   .live( 'click' , function () {
+   $( document )
+   .on( 'click', '.fbd-tooltip-close', function () {
$tooltip.remove();
} );
 
@@ -709,21 +709,22 @@
}
 
// On-load stuff
-   $( '.fbd-item-show a' ).live( 'click', showHiddenItem );
-   $( '.fbd-item-hide a' ).live( 'click', hideItem );
-   $( '.fbd-item-delete a' ).live( 'click', deleteItem );
-   $( '.fbd-item-restore' ).live( 'click', restoreItem );
-   $( '.fbd-respond-link' ).live ( 'click', showResponseForm );
+   $( document )
+   .on( 'click', '.fbd-item-show a', showHiddenItem )
+   .on( 'click', '.fbd-item-hide a', hideItem )
+   .on( 'click', '.fbd-item-delete a', deleteItem )
+   .on( 'click', '.fbd-item-restore', restoreItem )
+   .on( 'click', '.fbd-respond-link', showResponseForm );
 
// Handle preview back button
-   $( '.fbd-response-preview-back' ).live( 'click', function () {
+   $( document ).on( 'click', '.fbd-response-preview-back', function () {
var $item = $(this).parent().parent();
$item.find( '.fbd-response-submit, .fbd-response-wikitext, 
.fbd-response-preview-back, .ula' ).hide();
$item.find( '.fbd-response-preview, .fbd-response-text' 
).show();
});
 
// Handle response submit
-   $( '.fbd-response-submit' ).live( 'click', function () {
+   $( document ).on( 'click', '.fbd-response-submit', function () {
var $item, fbResponse, clientData, item_id, resData, 
$responseStatus, $responseForm;
 
$item = $(this).parent().parent();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I688a69fcbb55933bb221fc9096a495de42f97ddf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MoodBar
Gerrit-Branch: master
Gerrit-Owner: Alex Monk kren...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Remove defaults for choices in test fixtures - change (mediawiki...CentralNotice)

2015-01-04 Thread AndyRussG (Code Review)
AndyRussG has uploaded a new change for review.

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

Change subject: Remove defaults for choices in test fixtures
..

Remove defaults for choices in test fixtures

The use of default values in test fixtures helped make the fixtures
more compact, but as the fixtures become more complex, it will
make them more difficult to read. This is the first step in removing
them. The next step will be to remove them for the setup property
of test fixtures (used by PHPUnit tests).

Also added a tidbit of fixture documentation (since comments are not
allowed in json).

Change-Id: I1e1e807deb86806f9c19e42dabeb857529e43e22
---
M tests/data/AllocationsFixtures.json
A tests/data/allocation_fixtures_doc.md
M 
tests/qunit/ext.centralNotice.bannerController.lib/bannerController.lib.tests.js
3 files changed, 219 insertions(+), 56 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/95/182695/1

diff --git a/tests/data/AllocationsFixtures.json 
b/tests/data/AllocationsFixtures.json
index 6e239d6..3a44e22 100644
--- a/tests/data/AllocationsFixtures.json
+++ b/tests/data/AllocationsFixtures.json
@@ -24,25 +24,30 @@
 },
 choices: [
 {
+name: c1,
+start: 0,
+end: 1,
 preferred: 1,
 throttle: 50,
 bucket_count: 1,
 geotargeted: true,
-countries: [
-FR,
-GR,
-XX
-],
 banners: [
 {
 name: b1,
-weight: 5,
 bucket: 0,
+weight: 5,
 category: fundraising,
+display_anon: true,
+display_account: true,
 devices: [
 desktop
 ]
 }
+],
+countries: [
+FR,
+GR,
+XX
 ]
 }
 ],
@@ -77,36 +82,67 @@
 choices: [
 {
 name: c1,
-geotargeted: false,
+start: 0,
+end: 1,
 preferred: 3,
 throttle: 60,
+bucket_count: 1,
+geotargeted: false,
 banners: [
 {
 name: c1b1,
+bucket: 0,
 weight: 25,
-category: fundraising
+category: fundraising,
+display_anon: true,
+display_account: true,
+devices: [
+desktop
+]
 },
 {
 name: c1b2,
+bucket: 0,
 weight: 25,
-category: fundraising
+category: fundraising,
+display_anon: true,
+display_account: true,
+devices: [
+desktop
+]
 }
 ]
 },
 {
 name: c2,
+start: 0,
+end: 1,
 preferred: 1,
 throttle: 100,
+bucket_count: 1,
+geotargeted: false,
 banners: [
 {
 name: c2b1,
+bucket: 0,
 weight: 25,
-category: fundraising
+category: fundraising,
+display_anon: true,
+display_account: true,
+devices: [
+desktop
+]
 },
 {
 name: c2b2,
+bucket: 0,
 weight: 25,
-category: fundraising
+category: fundraising,
+display_anon: true,
+display_account: true,
+

[MediaWiki-commits] [Gerrit] Refactor: replace all usages of Persistance with Persiste... - change (apps...wikipedia)

2015-01-04 Thread Deskana (Code Review)
Deskana has uploaded a new change for review.

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

Change subject: Refactor: replace all usages of Persistance with 
Persistence.
..

Refactor: replace all usages of Persistance with Persistence.

Change-Id: Iba43739e6bf658ebf4e35afe03ff63bda8aed57f
---
M wikipedia/src/main/java/org/wikipedia/data/ContentPersister.java
M wikipedia/src/main/java/org/wikipedia/data/DBOpenHelper.java
R wikipedia/src/main/java/org/wikipedia/data/PersistenceHelper.java
M wikipedia/src/main/java/org/wikipedia/data/SQLiteContentProvider.java
M wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummary.java
R 
wikipedia/src/main/java/org/wikipedia/editing/summaries/EditSummaryPersistenceHelper.java
M wikipedia/src/main/java/org/wikipedia/history/HistoryEntry.java
R 
wikipedia/src/main/java/org/wikipedia/history/HistoryEntryPersistenceHelper.java
M wikipedia/src/main/java/org/wikipedia/pageimages/PageImage.java
R 
wikipedia/src/main/java/org/wikipedia/pageimages/PageImagePersistenceHelper.java
M wikipedia/src/main/java/org/wikipedia/savedpages/SavedPage.java
R 
wikipedia/src/main/java/org/wikipedia/savedpages/SavedPagePersistenceHelper.java
M wikipedia/src/main/java/org/wikipedia/search/RecentSearch.java
R 
wikipedia/src/main/java/org/wikipedia/search/RecentSearchPersistenceHelper.java
14 files changed, 37 insertions(+), 36 deletions(-)


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

diff --git a/wikipedia/src/main/java/org/wikipedia/data/ContentPersister.java 
b/wikipedia/src/main/java/org/wikipedia/data/ContentPersister.java
index 8774a64..e8659cd 100644
--- a/wikipedia/src/main/java/org/wikipedia/data/ContentPersister.java
+++ b/wikipedia/src/main/java/org/wikipedia/data/ContentPersister.java
@@ -6,17 +6,17 @@
 
 public abstract class ContentPersisterT {
 private final ContentProviderClient client;
-private final PersistanceHelperT persistanceHelper;
+private final PersistenceHelperT persistenceHelper;
 
-public ContentPersister(ContentProviderClient client, PersistanceHelperT 
persistanceHelper) {
+public ContentPersister(ContentProviderClient client, PersistenceHelperT 
persistenceHelper) {
 this.client = client;
-this.persistanceHelper = persistanceHelper;
+this.persistenceHelper = persistenceHelper;
 }
 
 public void persist(T obj) {
-Uri uri = persistanceHelper.getBaseContentURI();
+Uri uri = persistenceHelper.getBaseContentURI();
 try {
-client.insert(uri, persistanceHelper.toContentValues(obj));
+client.insert(uri, persistenceHelper.toContentValues(obj));
 } catch (RemoteException e) {
 // This shouldn't happen
 throw new RuntimeException(e);
@@ -28,7 +28,7 @@
 }
 
 public void deleteWhere(String selection, String[] selectionArgs) {
-Uri uri = persistanceHelper.getBaseContentURI();
+Uri uri = persistenceHelper.getBaseContentURI();
 try {
 client.delete(uri, selection, selectionArgs);
 } catch (RemoteException e) {
@@ -38,12 +38,12 @@
 }
 
 public void delete(T obj) {
-Uri uri = persistanceHelper.getBaseContentURI();
+Uri uri = persistenceHelper.getBaseContentURI();
 try {
 client.delete(
 uri,
-persistanceHelper.getPrimaryKeySelection(),
-persistanceHelper.getPrimaryKeySelectionArgs(obj)
+persistenceHelper.getPrimaryKeySelection(),
+persistenceHelper.getPrimaryKeySelectionArgs(obj)
 );
 } catch (RemoteException e) {
 throw new RuntimeException(e);
@@ -51,13 +51,13 @@
 }
 
 public void upsert(T obj) {
-Uri uri = persistanceHelper.getBaseContentURI();
+Uri uri = persistenceHelper.getBaseContentURI();
 try {
 int rowsUpdated = client.update(
 uri,
-persistanceHelper.toContentValues(obj),
-persistanceHelper.getPrimaryKeySelection(),
-persistanceHelper.getPrimaryKeySelectionArgs(obj)
+persistenceHelper.toContentValues(obj),
+persistenceHelper.getPrimaryKeySelection(),
+persistenceHelper.getPrimaryKeySelectionArgs(obj)
 );
 if (rowsUpdated == 0) {
 // Insert!
diff --git a/wikipedia/src/main/java/org/wikipedia/data/DBOpenHelper.java 
b/wikipedia/src/main/java/org/wikipedia/data/DBOpenHelper.java
index eb91d60..4ed140c 100644
--- a/wikipedia/src/main/java/org/wikipedia/data/DBOpenHelper.java
+++ b/wikipedia/src/main/java/org/wikipedia/data/DBOpenHelper.java
@@ -18,7 +18,7 @@
 super(context, DATABASE_NAME, null, DATABASE_VERSION);
 }
 
-private PersistanceHelper[] persistanceHelpers 

[MediaWiki-commits] [Gerrit] refactor SprintListController - change (phabricator...Sprint)

2015-01-04 Thread Christopher Johnson (WMDE) (Code Review)
Christopher Johnson (WMDE) has uploaded a new change for review.

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

Change subject: refactor SprintListController
..

refactor SprintListController

adds ProjectsTableView
adds tests for SprintBuildStats
refactor SprintController
split getAuxFields method to allow testing
pass $can_edit as a parameter to crumb builders

Change-Id: I3b3440fc1788f5335a30b4aca6c7b02192821694
---
M src/__phutil_library_map__.php
M src/controller/SprintController.php
M src/controller/SprintDataViewController.php
M src/controller/SprintListController.php
M src/controller/SprintReportController.php
D src/controller/SprintUIInterface.php
D src/controller/ViewController.php
M src/query/SprintQuery.php
M src/tests/SprintBuildStatsTest.php
M src/tests/SprintControllerTest.php
M src/tests/SprintQueryTest.php
A src/view/ProjectsTableView.php
M src/view/burndown/SprintDataView.php
M src/view/reports/ProjectOpenTasksView.php
14 files changed, 361 insertions(+), 174 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint 
refs/changes/97/182697/1

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
index ba22c60..7a8185b 100644
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -22,6 +22,7 @@
 'OpenTasksView' = 'view/reports/OpenTasksView.php',
 'PhabricatorFactSprintEngine' = 'fact/PhabricatorFactSprintEngine.php',
 'ProjectOpenTasksView' = 'view/reports/ProjectOpenTasksView.php',
+'ProjectsTableView' = 'view/ProjectsTableView.php',
 'SprintApplication' = 'application/SprintApplication.php',
 'SprintApplicationTest' = 'tests/SprintApplicationTest.php',
 'SprintBeginDateField' = 'customfield/SprintBeginDateField.php',
diff --git a/src/controller/SprintController.php 
b/src/controller/SprintController.php
index a7041b4..61b7ff1 100644
--- a/src/controller/SprintController.php
+++ b/src/controller/SprintController.php
@@ -82,11 +82,8 @@
 
 return $crumbs;
   }
-  protected function buildSprintApplicationCrumbs() {
+  protected function buildSprintApplicationCrumbs($can_create) {
 $crumbs = $this-buildCrumbs('slowvote', '/sprint/');
-
-  $can_create = $this-hasApplicationCapability(
-ProjectCreateProjectsCapability::CAPABILITY);
 
 $crumbs-addAction(
 id(new PHUIListItemView())
diff --git a/src/controller/SprintDataViewController.php 
b/src/controller/SprintDataViewController.php
index 4c44c57..0526ed4 100644
--- a/src/controller/SprintDataViewController.php
+++ b/src/controller/SprintDataViewController.php
@@ -2,7 +2,6 @@
 
 final class SprintDataViewController extends SprintController {
 
-  // Project data
   private $projectID;
 
   public function willProcessRequest(array $data) {
@@ -13,41 +12,24 @@
 
 $request = $this-getRequest();
 $viewer = $request-getUser();
-
-// Load the project we're looking at, based on the project ID in the URL.
-$project = id(new PhabricatorProjectQuery())
--setViewer($viewer)
--withIDs(array($this-projectID))
--executeOne();
+$pid = $this-projectID;
+$project = $this-loadProject($viewer, $pid);
 if (!$project) {
   return new Aphront404Response();
 }
 
-$error_box = false;
-$burndown_view = false;
+$error_box = null;
+$burndown_view = null;
 
 try {
-  $burndown_view = id(new SprintDataView())
-  -setProject($project)
-  -setViewer($viewer)
-  -setRequest($request);
+  $burndown_view = $this-getBurndownView($request, $project, $viewer);
   } catch (BurndownException $e) {
-  $error_box = id(new AphrontErrorView())
-  -setTitle(pht('Burndown could not be rendered for this project'))
-  -setErrors(array($e-getMessage()));
+  $error_box = $this-getErrorBox($e);
 }
 
-$pid = $project-getID();
-$crumbs = $this-buildSprintApplicationCrumbs();
-$crumbs-addTextCrumb(
-$project-getName(),
-'/project/view/'.$pid);
-$crumbs-addTextCrumb(pht('Burndown'));
-$crumbs-addAction(
-id(new PHUIListItemView())
--setName(pht('Sprint Board'))
--setHref('/sprint/board/'.$pid)
--setIcon('fa-columns'));
+$can_create = $this-hasApplicationCapability(
+ProjectCreateProjectsCapability::CAPABILITY);
+$crumbs = $this-getCrumbs($project, $can_create);
 
 return $this-buildApplicationPage(
 array(
@@ -60,4 +42,44 @@
 'device' = true,
 ));
   }
+
+  public function loadProject($viewer, $pid) {
+// Load the project we're looking at, based on the project ID in the URL.
+$project = id(new PhabricatorProjectQuery())
+-setViewer($viewer)
+-withIDs(array($pid))
+-executeOne();
+   return $project;
+  }
+
+  public function getCrumbs($project, $can_create) {
+$pid = $project-getID();
+
+$crumbs = 

[MediaWiki-commits] [Gerrit] refactor SprintListController - change (phabricator...Sprint)

2015-01-04 Thread Christopher Johnson (WMDE) (Code Review)
Christopher Johnson (WMDE) has submitted this change and it was merged.

Change subject: refactor SprintListController
..


refactor SprintListController

adds ProjectsTableView
adds tests for SprintBuildStats
refactor SprintController
split getAuxFields method to allow testing
pass $can_edit as a parameter to crumb builders

Change-Id: I3b3440fc1788f5335a30b4aca6c7b02192821694
---
M src/__phutil_library_map__.php
M src/controller/SprintController.php
M src/controller/SprintDataViewController.php
M src/controller/SprintListController.php
M src/controller/SprintReportController.php
D src/controller/SprintUIInterface.php
D src/controller/ViewController.php
M src/query/SprintQuery.php
M src/tests/SprintBuildStatsTest.php
M src/tests/SprintControllerTest.php
M src/tests/SprintQueryTest.php
A src/view/ProjectsTableView.php
M src/view/burndown/SprintDataView.php
M src/view/reports/ProjectOpenTasksView.php
14 files changed, 361 insertions(+), 174 deletions(-)

Approvals:
  Christopher Johnson (WMDE): Verified; Looks good to me, approved



diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
index ba22c60..7a8185b 100644
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -22,6 +22,7 @@
 'OpenTasksView' = 'view/reports/OpenTasksView.php',
 'PhabricatorFactSprintEngine' = 'fact/PhabricatorFactSprintEngine.php',
 'ProjectOpenTasksView' = 'view/reports/ProjectOpenTasksView.php',
+'ProjectsTableView' = 'view/ProjectsTableView.php',
 'SprintApplication' = 'application/SprintApplication.php',
 'SprintApplicationTest' = 'tests/SprintApplicationTest.php',
 'SprintBeginDateField' = 'customfield/SprintBeginDateField.php',
diff --git a/src/controller/SprintController.php 
b/src/controller/SprintController.php
index a7041b4..61b7ff1 100644
--- a/src/controller/SprintController.php
+++ b/src/controller/SprintController.php
@@ -82,11 +82,8 @@
 
 return $crumbs;
   }
-  protected function buildSprintApplicationCrumbs() {
+  protected function buildSprintApplicationCrumbs($can_create) {
 $crumbs = $this-buildCrumbs('slowvote', '/sprint/');
-
-  $can_create = $this-hasApplicationCapability(
-ProjectCreateProjectsCapability::CAPABILITY);
 
 $crumbs-addAction(
 id(new PHUIListItemView())
diff --git a/src/controller/SprintDataViewController.php 
b/src/controller/SprintDataViewController.php
index 4c44c57..0526ed4 100644
--- a/src/controller/SprintDataViewController.php
+++ b/src/controller/SprintDataViewController.php
@@ -2,7 +2,6 @@
 
 final class SprintDataViewController extends SprintController {
 
-  // Project data
   private $projectID;
 
   public function willProcessRequest(array $data) {
@@ -13,41 +12,24 @@
 
 $request = $this-getRequest();
 $viewer = $request-getUser();
-
-// Load the project we're looking at, based on the project ID in the URL.
-$project = id(new PhabricatorProjectQuery())
--setViewer($viewer)
--withIDs(array($this-projectID))
--executeOne();
+$pid = $this-projectID;
+$project = $this-loadProject($viewer, $pid);
 if (!$project) {
   return new Aphront404Response();
 }
 
-$error_box = false;
-$burndown_view = false;
+$error_box = null;
+$burndown_view = null;
 
 try {
-  $burndown_view = id(new SprintDataView())
-  -setProject($project)
-  -setViewer($viewer)
-  -setRequest($request);
+  $burndown_view = $this-getBurndownView($request, $project, $viewer);
   } catch (BurndownException $e) {
-  $error_box = id(new AphrontErrorView())
-  -setTitle(pht('Burndown could not be rendered for this project'))
-  -setErrors(array($e-getMessage()));
+  $error_box = $this-getErrorBox($e);
 }
 
-$pid = $project-getID();
-$crumbs = $this-buildSprintApplicationCrumbs();
-$crumbs-addTextCrumb(
-$project-getName(),
-'/project/view/'.$pid);
-$crumbs-addTextCrumb(pht('Burndown'));
-$crumbs-addAction(
-id(new PHUIListItemView())
--setName(pht('Sprint Board'))
--setHref('/sprint/board/'.$pid)
--setIcon('fa-columns'));
+$can_create = $this-hasApplicationCapability(
+ProjectCreateProjectsCapability::CAPABILITY);
+$crumbs = $this-getCrumbs($project, $can_create);
 
 return $this-buildApplicationPage(
 array(
@@ -60,4 +42,44 @@
 'device' = true,
 ));
   }
+
+  public function loadProject($viewer, $pid) {
+// Load the project we're looking at, based on the project ID in the URL.
+$project = id(new PhabricatorProjectQuery())
+-setViewer($viewer)
+-withIDs(array($pid))
+-executeOne();
+   return $project;
+  }
+
+  public function getCrumbs($project, $can_create) {
+$pid = $project-getID();
+
+$crumbs = $this-buildSprintApplicationCrumbs($can_create);
+

[MediaWiki-commits] [Gerrit] Remove sendBeacon experiment - change (mediawiki...WikimediaEvents)

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

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

Change subject: Remove sendBeacon experiment
..

Remove sendBeacon experiment

As I understand it, adequate data has been collected, so this can be
decommissioned.

Change-Id: I8c6057ded2c3ce4fb22c556936838a674fd656f7
---
M WikimediaEvents.php
D modules/ext.wikimediaEvents.sendBeacon.js
2 files changed, 1 insertion(+), 38 deletions(-)


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

diff --git a/WikimediaEvents.php b/WikimediaEvents.php
index 6746c6d..b39dcc2 100644
--- a/WikimediaEvents.php
+++ b/WikimediaEvents.php
@@ -64,11 +64,6 @@
'schema' = 'Edit',
'revision' = 10676603,
),
-   'schema.SendBeaconReliability' = array(
-   'class' = 'ResourceLoaderSchemaModule',
-   'schema' = 'SendBeaconReliability',
-   'revision' = 10735916,
-   ),
'ext.wikimediaEvents.ve' = array(
'scripts'   = 'ext.wikimediaEvents.ve.js',
'dependencies'  = 'ext.visualEditor.base',
@@ -93,9 +88,7 @@
// permanently (even if empty, to avoid errors on cached pages), and 
future code
// meeting this criteria be added to it.
'ext.wikimediaEvents' = array(
-   'scripts' = array(
-   'ext.wikimediaEvents.sendBeacon.js',
-   ),
+   'scripts' = array(),
'localBasePath' = __DIR__ . '/modules',
'remoteExtPath' = 'WikimediaEvents/modules',
'targets' = array( 'desktop', 'mobile' ),
diff --git a/modules/ext.wikimediaEvents.sendBeacon.js 
b/modules/ext.wikimediaEvents.sendBeacon.js
deleted file mode 100644
index 57c9724..000
--- a/modules/ext.wikimediaEvents.sendBeacon.js
+++ /dev/null
@@ -1,30 +0,0 @@
-( function ( mw, $ ) {
-   var odds, isBeaconAvailable, baseEvent, imgEvent, beaconEvent;
-
-   odds = 0.0001; // 1 in 10,000 chance
-
-   if ( Math.random()  odds ) {
-   mw.loader.using( [ 'mediawiki.user', 
'schema.SendBeaconReliability' ] ).done( function () {
-   isBeaconAvailable = !!navigator.sendBeacon;
-
-   baseEvent = {
-   browserSupportsSendBeacon: isBeaconAvailable,
-   logId: mw.user.generateRandomSessionId()
-   };
-
-   imgEvent = $.extend( { method: 'logEvent' }, baseEvent 
);
-
-   // We always log via logEvent (to at least get data on 
user agent and whether
-   // it supports sendBeacon).  If sendBeacon is 
available, we also log via
-   // logPersistentEvent.  Since logId is the same for 
both events, this allows
-   // us to determine how common it is to have logEvent 
without
-   // logPersistentEvent, or vice-versa.
-   mw.eventLog.logEvent( 'SendBeaconReliability', imgEvent 
);
-
-   if ( isBeaconAvailable ) {
-   beaconEvent = $.extend( { method: 
'logPersistentEvent' }, baseEvent );
-   mw.eventLog.logPersistentEvent( 
'SendBeaconReliability', beaconEvent );
-   }
-   } );
-   }
-}( mediaWiki, jQuery ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c6057ded2c3ce4fb22c556936838a674fd656f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] beta: Rename shinken config file to make more sense - change (operations/puppet)

2015-01-04 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: beta: Rename shinken config file to make more sense
..

beta: Rename shinken config file to make more sense

Initially it was supposed to contain only shinken hosts definitions
but now it contains service definitions too

Change-Id: I3d2b481125ffc8744e8a7f243b8642afdc3a76be
---
R modules/beta/files/shinken.cfg
M modules/beta/manifests/monitoring/shinken.pp
2 files changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/99/182699/1

diff --git a/modules/beta/files/shinken/hosts.cfg 
b/modules/beta/files/shinken.cfg
similarity index 100%
rename from modules/beta/files/shinken/hosts.cfg
rename to modules/beta/files/shinken.cfg
diff --git a/modules/beta/manifests/monitoring/shinken.pp 
b/modules/beta/manifests/monitoring/shinken.pp
index 497b2ea..434fa53 100644
--- a/modules/beta/manifests/monitoring/shinken.pp
+++ b/modules/beta/manifests/monitoring/shinken.pp
@@ -2,6 +2,6 @@
 # Sets up shinken monitoring for betacluster
 class beta::monitoring::shinken {
 shinken::config { 'betacluster-hosts':
-source = 'puppet:///modules/beta/shinken/hosts.cfg',
+source = 'puppet:///modules/beta/shinken.cfg',
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d2b481125ffc8744e8a7f243b8642afdc3a76be
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com

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


[MediaWiki-commits] [Gerrit] beta: Rename shinken config file to make more sense - change (operations/puppet)

2015-01-04 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: beta: Rename shinken config file to make more sense
..


beta: Rename shinken config file to make more sense

Initially it was supposed to contain only shinken hosts definitions
but now it contains service definitions too

Change-Id: I3d2b481125ffc8744e8a7f243b8642afdc3a76be
---
R modules/beta/files/shinken.cfg
M modules/beta/manifests/monitoring/shinken.pp
2 files changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/beta/files/shinken/hosts.cfg 
b/modules/beta/files/shinken.cfg
similarity index 100%
rename from modules/beta/files/shinken/hosts.cfg
rename to modules/beta/files/shinken.cfg
diff --git a/modules/beta/manifests/monitoring/shinken.pp 
b/modules/beta/manifests/monitoring/shinken.pp
index 497b2ea..434fa53 100644
--- a/modules/beta/manifests/monitoring/shinken.pp
+++ b/modules/beta/manifests/monitoring/shinken.pp
@@ -2,6 +2,6 @@
 # Sets up shinken monitoring for betacluster
 class beta::monitoring::shinken {
 shinken::config { 'betacluster-hosts':
-source = 'puppet:///modules/beta/shinken/hosts.cfg',
+source = 'puppet:///modules/beta/shinken.cfg',
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d2b481125ffc8744e8a7f243b8642afdc3a76be
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 1653fcc..deaa5e5 - change (mediawiki/extensions)

2015-01-04 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 1653fcc..deaa5e5
..


Syncronize VisualEditor: 1653fcc..deaa5e5

Change-Id: Ifd7a8de22ac6923ddeced53045f5f83fd96e7e1b
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 1653fcc..deaa5e5 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 1653fcc5eb2ea3b76e9f5ecff7629f9d71b37d69
+Subproject commit deaa5e5cd3fe2169ffcea807c46eea6a61f2c656

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd7a8de22ac6923ddeced53045f5f83fd96e7e1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org
Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 1653fcc..deaa5e5 - change (mediawiki/extensions)

2015-01-04 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 1653fcc..deaa5e5
..

Syncronize VisualEditor: 1653fcc..deaa5e5

Change-Id: Ifd7a8de22ac6923ddeced53045f5f83fd96e7e1b
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/VisualEditor b/VisualEditor
index 1653fcc..deaa5e5 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 1653fcc5eb2ea3b76e9f5ecff7629f9d71b37d69
+Subproject commit deaa5e5cd3fe2169ffcea807c46eea6a61f2c656

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd7a8de22ac6923ddeced53045f5f83fd96e7e1b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Compatible with Composer and new Universal tracking - change (mediawiki...googleAnalytics)

2015-01-04 Thread Toniher (Code Review)
Toniher has uploaded a new change for review.

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

Change subject: Compatible with Composer and new Universal tracking
..

Compatible with Composer and new Universal tracking

Change-Id: Ica0930bb809079c1c75d5be7b776cec23563e5ba
---
A composer.json
M googleAnalytics.php
2 files changed, 121 insertions(+), 28 deletions(-)


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

diff --git a/composer.json b/composer.json
new file mode 100644
index 000..1c0b5c2
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,29 @@
+{
+   name: mediawiki/google-analytics,
+   type: mediawiki-extension,
+   description: ,
+   keywords: [
+   MediaWiki,
+   Analytics,
+   Google
+   ],
+   homepage: 
https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration;,
+   license: GPL-2.0+,
+   authors: [
+   {
+   name: Tim Laqua,
+   role: Creator
+   },
+   {
+   name: Toni Hermoso Pulido,
+   role: Developer
+   }
+   ],
+   require: {
+   php: =5.3.0,
+   composer/installers: 1.*,=1.0.1
+   },
+   autoload: {
+   files: [googleAnalytics.php]
+   }
+}
diff --git a/googleAnalytics.php b/googleAnalytics.php
index 530080b..2aaec7f 100644
--- a/googleAnalytics.php
+++ b/googleAnalytics.php
@@ -3,30 +3,45 @@
die( 'This file is a MediaWiki extension, it is not a valid entry 
point' );
 }
 
-$wgExtensionCredits['other'][] = array(
-   'path'   = __FILE__,
-   'name'   = 'Google Analytics Integration',
-   'version'= '2.1.0',
-   'author' = 'Tim Laqua',
-   'descriptionmsg' = 'googleanalytics-desc',
-   'url'= 
'https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration',
-);
+//self executing anonymous function to prevent global scope assumptions
+call_user_func( function() {
 
-$wgMessagesDirs['googleAnalytics'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['googleAnalytics'] = dirname(__FILE__) . 
'/googleAnalytics.i18n.php';
+   $GLOBALS['wgExtensionCredits']['other'][] = array(
+   'path'   = __FILE__,
+   'name'   = 'Google Analytics Integration',
+   'version'= '2.2.0',
+   'author' = 'Tim Laqua, Toni Hermoso',
+   'descriptionmsg' = 'googleanalytics-desc',
+   'url'= 
'https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration',
+   );
 
-$wgHooks['SkinAfterBottomScripts'][]  = 'efGoogleAnalyticsHookText';
-$wgHooks['ParserAfterTidy'][] = 'efGoogleAnalyticsASAC';
+   $GLOBALS['wgMessagesDirs']['googleAnalytics'] = __DIR__ . '/i18n';
+   $GLOBALS['wgExtensionMessagesFiles']['googleAnalytics'] = 
dirname(__FILE__) . '/googleAnalytics.i18n.php';
 
-$wgGoogleAnalyticsAccount = ;
-$wgGoogleAnalyticsAddASAC = false;
+   $GLOBALS['wgHooks']['SkinAfterBottomScripts'][]  = 
'efGoogleAnalyticsHookText';
+   $GLOBALS['wgHooks']['ParserAfterTidy'][] = 'efGoogleAnalyticsASAC';
 
+   $GLOBALS['wgGoogleAnalyticsAccount'] = ;
+   $GLOBALS['wgGoogleAnalyticsAddASAC'] = false;
 
-// These options are deprecated.
-// You should add the noanalytics right to the group
-// Ex: $wgGroupPermissions[sysop][noanalytics] = true;
-$wgGoogleAnalyticsIgnoreSysops = true;
-$wgGoogleAnalyticsIgnoreBots = true;
+   // https://support.google.com/analytics/answer/2558867?hl=en
+   $GLOBALS['wgGoogleAnalyticsLinkAttr'] = true;
+
+   // 
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
+   $GLOBALS['wgGoogleAnalyticsSetDomain'] = ;
+
+   // New Universal: 
https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs
+   $GLOBALS['wgGoogleAnalyticsUniversal'] = true;
+
+   // These options are deprecated.
+   // You should add the noanalytics right to the group
+   // Ex: $wgGroupPermissions[sysop][noanalytics] = true;
+   // Default not analytics for sysops
+   $GLOBALS['wgGroupPermissions'][sysop][noanalytics] = true;
+   $GLOBALS['wgGoogleAnalyticsIgnoreSysops'] = true;
+   $GLOBALS['wgGoogleAnalyticsIgnoreBots'] = true;
+
+});
 
 function efGoogleAnalyticsASAC( $parser, $text ) {
global $wgOut, $wgGoogleAnalyticsAccount, $wgGoogleAnalyticsAddASAC;
@@ -44,7 +59,11 @@
 }
 
 function efAddGoogleAnalytics() {
-   global $wgGoogleAnalyticsAccount, $wgGoogleAnalyticsIgnoreSysops, 
$wgGoogleAnalyticsIgnoreBots, $wgUser;
+   global $wgGoogleAnalyticsAccount;
+   global $wgGoogleAnalyticsIgnoreSysops, $wgGoogleAnalyticsIgnoreBots;
+   global $wgGoogleAnalyticsUniversal, 

[MediaWiki-commits] [Gerrit] Don't log HttpErrors targeted at SpecialEntityData - change (mediawiki...Wikibase)

2015-01-04 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Don't log HttpErrors targeted at SpecialEntityData
..

Don't log HttpErrors targeted at SpecialEntityData

Bug: T76458
Change-Id: I57d46dc961fa1018d0caf961bcda391d60b27310
---
M repo/includes/specials/SpecialEntityData.php
1 file changed, 26 insertions(+), 1 deletion(-)


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

diff --git a/repo/includes/specials/SpecialEntityData.php 
b/repo/includes/specials/SpecialEntityData.php
index f9571fb..5f08907 100644
--- a/repo/includes/specials/SpecialEntityData.php
+++ b/repo/includes/specials/SpecialEntityData.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Repo\Specials;
 
 use HttpError;
+use HttpStatus;
 use Wikibase\EntityFactory;
 use Wikibase\Lib\Serializers\SerializationOptions;
 use Wikibase\Lib\Serializers\SerializerFactory;
@@ -150,7 +151,31 @@
return;
}
 
-   $this-requestHandler-handleRequest( $subPage, 
$this-getRequest(), $this-getOutput() );
+   try {
+   $this-requestHandler-handleRequest( $subPage, 
$this-getRequest(), $this-getOutput() );
+   } catch( HttpError $exception ) {
+   // Something went wrong: Just report the HttpError to 
the user (but don't let it bubble up
+   // into the log)
+   $this-reportHttpError( $exception );
+   }
+   }
+
+   private function reportHttpError( HttpError $exception ) {
+   $this-getOutput()-disable();
+
+   $httpStatusCode = $exception-getStatusCode();
+   $httpMessage = HttpStatus::getMessage( $httpStatusCode );
+
+   $response = $this-getRequest()-response();
+   $response-header( Status: $httpStatusCode $httpMessage, 
true, $httpStatusCode );
+   $response-header( 'Content-type: text/html; charset=utf-8' );
+
+   echo $exception-getHTML();
+
+   wfDebugLog(
+   'SpecialEntityData',
+   'Request failed with http ' . $httpStatusCode . ': ' . 
$exception-getMessage()
+   );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57d46dc961fa1018d0caf961bcda391d60b27310
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de

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


[MediaWiki-commits] [Gerrit] Make Gerrit only comment for published drafts that add new t... - change (operations/puppet)

2015-01-04 Thread QChris (Code Review)
QChris has uploaded a new change for review.

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

Change subject: Make Gerrit only comment for published drafts that add new task 
references
..

Make Gerrit only comment for published drafts that add new task references

Previously, Gerrit added a comment for /each/ published draft Patch Set
that had a relevant task reference. Hence, if a change has a two draft
Patch Sets with the same task references published, it would cause two
comments on the task in Phabricator. To avoid duplicate comments, we
only comment for published drafts that add /new/ task references.

Bug: T77961
Change-Id: I8ff9fae3d17489be7417fca9d6fc79196f0a42b3
---
M modules/gerrit/files/its/action.config
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/gerrit/files/its/action.config 
b/modules/gerrit/files/its/action.config
index 6f663eb..56feb9e 100644
--- a/modules/gerrit/files/its/action.config
+++ b/modules/gerrit/files/its/action.config
@@ -15,6 +15,6 @@
 
 [rule changeDraftPublished]
event-type = draft-published
-   association = subject,footer-Bug,footer-bug
+   association = added@subject,added@footer-Bug,added@footer-bug
its-name = its-phabricator
action = add-velocity-comment DraftPublished

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ff9fae3d17489be7417fca9d6fc79196f0a42b3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: QChris christ...@quelltextlich.at

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


[MediaWiki-commits] [Gerrit] Add MediaWiki to the projects list - change (wikimedia/wikimania-scholarships)

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

Change subject: Add MediaWiki to the projects list
..


Add MediaWiki to the projects list

Bug: T85287
Change-Id: I87415f93ab5e98b91c94f42ad010951a1b737783
---
M data/i18n/en.json
M public/js/site.js
M src/Wikimania/Scholarship/Wikis.php
3 files changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/data/i18n/en.json b/data/i18n/en.json
index 67181eb..3ee7f25 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -91,7 +91,7 @@
form-participation: Participation in the Wikimedia projects,
form-username: Username on your primary Wikimedia project (Please 
omit the 'User:' prefix before your username):,
form-other-usernames: (If applicable) Other Wikimedia usernames used 
for editing:,
-   form-multilingual-community: I primarily/only contribute to Commons, 
Species, Data, or Incubator, and therefore cannot pick a language community,
+   form-multilingual-community: I primarily/only contribute to Commons, 
Species, Data, Mediawiki, Tool Labs or Incubator, and therefore cannot pick a 
language community,
form-engagement: Please select all of the following that describe 
how you have engaged in the Wikimedia movement.,
form-engagement-option1: Active contributor to a Wikimedia project 
(e.g. Wikipedia, Commons, Wikisource), with at least 50 contributions (edits),
form-engagement-option2: Mediawiki code contributor, gadget or other 
tool-builder for Wikimedia projects,
diff --git a/public/js/site.js b/public/js/site.js
index 25bb7c3..d44516f 100644
--- a/public/js/site.js
+++ b/public/js/site.js
@@ -26,7 +26,9 @@
 if( projectvalue == 'Wikimedia Commons' ||
 projectvalue == 'Wikidata' ||
 projectvalue == 'Wikispecies' ||
-projectvalue == 'Incubator'
+projectvalue == 'Incubator' ||
+projectvalue == 'MediaWiki' ||
+projectvalue == 'Tool Labs'
   ) {
 $('#community').val( 'MULTILINGUAL' );
 } else {
diff --git a/src/Wikimania/Scholarship/Wikis.php 
b/src/Wikimania/Scholarship/Wikis.php
index 852f6b5..4f51a06 100644
--- a/src/Wikimania/Scholarship/Wikis.php
+++ b/src/Wikimania/Scholarship/Wikis.php
@@ -46,6 +46,7 @@
'Outreach',
'Incubator',
'Tool Labs',
+   'MediaWiki'
);
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I87415f93ab5e98b91c94f42ad010951a1b737783
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: Niharika29 niharikakohl...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@wikimedia.org
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Split 'form-rights' text into four separate messages for eas... - change (wikimedia/wikimania-scholarships)

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

Change subject: Split 'form-rights' text into four separate messages for easier 
translation
..


Split 'form-rights' text into four separate messages for easier translation

Bug: T60768
Change-Id: I85a010fad98c90633c1a10d17522087fde242398
---
M data/i18n/en.json
M data/i18n/qqq.json
M data/templates/apply.html
3 files changed, 12 insertions(+), 5 deletions(-)

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



diff --git a/data/i18n/en.json b/data/i18n/en.json
index 3ee7f25..c4ae719 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -134,7 +134,10 @@
form-review: All information contained in this application will be 
reviewed by the members of the Wikimania Scholarship Committee. All personal 
information will be held strictly confidential by the Committee, and the a 
href=\//wikimediafoundation.org/\Wikimedia Foundation/a.,
form-chapteragree: I would like to be considered for a a 
href=\https://meta.wikimedia.org/wiki/Wikimedia%20chapters\;Wikimedia 
chapter/a or a 
href=\https://meta.wikimedia.org/wiki/Wikimedia_thematic_organizations\;thematic
 organization/a scholarship, and agree to share my information with chapters 
and thematic organizations for purpose of selecting and awarding scholarships.,
form-rights-heading: Applicant Rights  Consent to Data Processing 
and Transfer,
-   form-rights: I as an applicant for a Wikimedia Foundation ('WMF') 
scholarship relating to my participation in the 2015 Wikimania conference 
hosted in Mexico City, hereby acknowledge and affirmatively consent to the 
following as a prerequisite to the consideration of my 2015 Wikimania 
scholarship application ('Application'):\n/pp\n(a) Any personal data or 
sensitive personal data that I submit as part of or in relation to my 
Application (collectively 'my Data') may be accessed and reviewed by: (i) WMF; 
(ii) members of a scholarship committee made up of Wikimedia movement members, 
a representative list of which can be found at: a 
href=\//wikimania2015.wikimedia.org/wiki/Scholarship_committee\https://wikimania2015.wikimedia.org/wiki/Scholarship_committee/a
 ('Scholarship Committee'); and if you indicated that you want to be considered 
for a WM Chapter or WM Thematic Org scholarship, (iii) official Wikimedia 
Chapters, a representative list of which can be found at: a 
href=\//meta.wikimedia.org/wiki/Wikimedia_chapters\https://meta.wikimedia.org/wiki/Wikimedia_chapters/a
 ('WM Chapters'), and official thematic organizations, a representative list of 
which can be found at: a 
href=\//meta.wikimedia.org/wiki/Wikimedia_thematic_organizations\https://meta.wikimedia.org/wiki/Wikimedia_thematic_organizations/a
 ('WM Thematic Orgs'); for the purposes of evaluating my 
Application.\n/pp\n(b) Any Data that I submit as a part of or in relation 
to my Application may be collected, stored, used, modified, communicated, 
archived, destroyed, or otherwise processed (collectively 'Processed' or 
'Processing') by: (i) WMF; (ii) members of the Scholarship Committee; and if 
you indicated that you want to be considered for a WM Chapter or WM Thematic 
Org scholarship, (iii) WM Chapters and WM Thematic Orgs. My Data may be 
retained by WMF until I request in writing to WMF that my Data be destroyed or 
for as long as required by applicable law.\n/pp\n(c) My Data may be 
transmitted to or from: (i) WMF in the United States; (ii) members of the 
Scholarship Committee in the country which they reside; and if you indicated 
that you want to be considered for a WM Chapter or WM Thematic Org scholarship, 
(iii) WM Chapters and/or WM Thematic Orgs in the country which the 
organizations are based.,
+   form-rights1: I as an applicant for a Wikimedia Foundation ('WMF') 
scholarship relating to my participation in the 2015 Wikimania conference 
hosted in Mexico City, hereby acknowledge and affirmatively consent to the 
following as a prerequisite to the consideration of my 2015 Wikimania 
scholarship application ('Application'):,
+   form-rights2:(a) Any personal data or sensitive personal data that I 
submit as part of or in relation to my Application (collectively 'my Data') may 
be accessed and reviewed by: (i) WMF; (ii) members of a scholarship committee 
made up of Wikimedia movement members, a representative list of which can be 
found at: a 
href=\//wikimania2015.wikimedia.org/wiki/Scholarship_committee\https://wikimania2015.wikimedia.org/wiki/Scholarship_committee/a
 ('Scholarship Committee'); and if you indicated that you want to be considered 
for a WM Chapter or WM Thematic Org scholarship, (iii) official Wikimedia 
Chapters, a representative list of which can be found at: a 
href=\//meta.wikimedia.org/wiki/Wikimedia_chapters\https://meta.wikimedia.org/wiki/Wikimedia_chapters/a
 ('WM Chapters'), and official thematic organizations, a 

[MediaWiki-commits] [Gerrit] Add columns for Global North/South and Language Group for Ph... - change (wikimedia/wikimania-scholarships)

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

Change subject: Add columns for Global North/South and Language Group for Phase 
2 filtering
..


Add columns for Global North/South and Language Group for Phase 2 filtering

Bug: T85487
Change-Id: I95cd52399080a7559cab18a89a20dedeacd30356
---
M data/templates/review/p2/list.html
M src/Wikimania/Scholarship/Controllers/Review/Phase2List.php
M src/Wikimania/Scholarship/Dao/Apply.php
3 files changed, 68 insertions(+), 4 deletions(-)

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



diff --git a/data/templates/review/p2/list.html 
b/data/templates/review/p2/list.html
index df4cd04..70ea470 100644
--- a/data/templates/review/p2/list.html
+++ b/data/templates/review/p2/list.html
@@ -9,13 +9,30 @@
 
 form class=form-inline method=get action={{ urlFor( 'review_p2_list' ) 
}} role=form
   div class=form-group
+
 label for=regionRegion:/label
 select class=form-control input-sm name=region id=region
   {% for r in regionList %}
   option value={{ r }} {{ r == region ? 'selected=selected' }}{{ r 
}}/option
   {% endfor %}
-/select
+/select nbsp;
+
+label for=globalnsGlobal North/South:/label
+select class=form-control input-sm name=globalns id=globalns
+  {% for r in globalnsList %}
+  option value={{ r }} {{ r == globalns ? 'selected=selected' }}{{ r 
}}/option
+  {% endfor %}
+/select nbsp;
+
+label for=languageGroupLanguage Group:/label
+select class=form-control input-sm name=languageGroup 
id=languageGroup
+  {% for r in languageGroupList %}
+  option value={{ r }} {{ r == languageGroup ? 'selected=selected' 
}}{{ r }}/option
+  {% endfor %}
+/select nbsp;
+
   /div
+
   div class=checkbox
 label for=export
   input type=checkbox name=export id=export value=1/
diff --git a/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php 
b/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php
index cc0ae45..2aeb3b8 100644
--- a/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php
+++ b/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php
@@ -36,14 +36,37 @@
$regionList = $this-dao-getRegionList();
array_unshift( $regionList, 'All' );
 
+   $globalnsList = array(
+   'Global South',
+   'Global North',
+   );
+
+   $languageGroupList = array(
+   'Small',
+   'Medium',
+   'Large',
+   'Multilingual',
+   );
+
+   array_unshift( $globalnsList, 'All' );
+   array_unshift( $languageGroupList, 'All' );
+
$this-form-requireInArray( 'region', $regionList, array(
+   'default' = 'All',
+   ) );
+   $this-form-requireInArray( 'globalns', $globalnsList, array(
+   'default' = 'All',
+   ) );
+   $this-form-requireInArray( 'languageGroup', 
$languageGroupList, array(
'default' = 'All',
) );
$this-form-expectBool( 'export' );
$this-form-validate( $_GET );
 
$region = $this-form-get( 'region' );
-   $rows = $this-dao-getP2List( $region );
+   $globalns = $this-form-get( 'globalns' );
+   $languageGroup = $this-form-get( 'languageGroup' );
+   $rows = $this-dao-getP2List( $region, $globalns, 
$languageGroup );
 
if ( $this-request-get( 'export' ) ) {
$ts = gmdate( 'Ymd\THi' );
@@ -75,7 +98,11 @@
 
} else {
$this-view-set( 'regionList', $regionList );
+   $this-view-set( 'globalnsList', $globalnsList );
+   $this-view-set( 'languageGroupList', 
$languageGroupList );
$this-view-set( 'region', $region );
+   $this-view-set( 'globalns', $globalns );
+   $this-view-set( 'languageGroup', $languageGroup );
$this-view-set( 'records', $rows );
$this-render( 'review/p2/list.html' );
}
diff --git a/src/Wikimania/Scholarship/Dao/Apply.php 
b/src/Wikimania/Scholarship/Dao/Apply.php
index a3bd267..1149e33 100644
--- a/src/Wikimania/Scholarship/Dao/Apply.php
+++ b/src/Wikimania/Scholarship/Dao/Apply.php
@@ -527,8 +527,11 @@
return array_map( function ($row) { return $row['region']; }, 
$res );
}
 
-
-   public function getP2List( $region = 'All' ) {
+   /*
+* Function to fetch records for Phase 2 filtered by region,
+* global north/south, language group
+*/
+   public function getP2List( $region = 'All', $globalns = 'All', 

[MediaWiki-commits] [Gerrit] Update scoring criteria in Phase 2 - change (wikimedia/wikimania-scholarships)

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

Change subject: Update scoring criteria in Phase 2
..


Update scoring criteria in Phase 2

Only two dropdowns:
- Relevant experience
- Experience sharing

Bug: T85486
Change-Id: I3ead90e8fa8996eea297d2449f8ec55a3f90045e
---
M data/i18n/en.json
M data/i18n/qqq.json
M data/templates/review/p2/list.html
M data/templates/review/scores.html
M data/templates/review/view.html
M src/Wikimania/Scholarship/Controllers/Review/Application.php
M src/Wikimania/Scholarship/Controllers/Review/Phase2List.php
M src/Wikimania/Scholarship/Dao/Apply.php
8 files changed, 48 insertions(+), 57 deletions(-)

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



diff --git a/data/i18n/en.json b/data/i18n/en.json
index c4ae719..4cb6817 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -246,9 +246,8 @@
review-list-gender: Gender,
review-list-age: Age,
review-list-num-p2: # p2 scorers,
-   review-list-onwiki: Onwiki,
-   review-list-offwiki: Offwiki,
-   review-list-interest: Interest,
+   review-list-relexp: Relevant Experience,
+   review-list-expshare: Experience Sharing,
 
review-countries-country: Country,
review-countries-region: Region,
@@ -294,8 +293,8 @@
 
review-view-rankings: Rankings,
review-view-valid: Valid:,
-   review-view-onwiki: In Wikimedia movement:,
-   review-view-offwiki: Outside Wikimedia movement:,
+   review-view-relexp: Relevant Experience:,
+   review-view-expshare: Experience Sharing:,
review-view-interest: Interest in Wikimania:,
review-view-notes: Notes:,
review-view-save: Save,
diff --git a/data/i18n/qqq.json b/data/i18n/qqq.json
index f9ed227..ea2364c 100644
--- a/data/i18n/qqq.json
+++ b/data/i18n/qqq.json
@@ -218,9 +218,8 @@
 review-list-gender: Table column header, applicant 
gender.\n{{Related|Wsa-review-list}}\n{{Identical|Gender}},
 review-list-age: Table column header, applicant age.\n\nPreceded by 
{{msg-wm|Wsa-review-list-gender}}.\n{{Identical|Age}},
 review-list-num-p2: Table column header, number of phase 2 reviewers of 
submission.\n{{Related|Wsa-review-list}},
-review-list-onwiki: Table column header, average onwiki review score of 
submission.\n{{Related|Wsa-review-list}},
-review-list-offwiki: Table column header, average offwiki review score 
of submission.\n{{Related|Wsa-review-list}},
-review-list-interest: Table column header, average interest review 
score of submission.\n{{Related|Wsa-review-list}}\n{{Identical|Interest}},
+review-list-relexp: Table column header, average relevant experience 
review score of submission.\n{{Related|Wsa-review-list}},
+review-list-expshare: Table column header, average experience sharing 
review score of submission.\n{{Related|Wsa-review-list}},
 review-countries-country: Table column header, country 
name.\n{{Identical|Country}},
 review-countries-region: Table column header, geographic 
region.\n{{Identical|Region}},
 review-countries-count: Table column header, number of scholarship 
applications received,
@@ -262,9 +261,8 @@
 review-view-reviewers: List header, list contains usernames of 
reviewers.\n{{Identical|Reviewer}},
 review-view-rankings: Header for scholarship application evaluation 
form,
 review-view-valid: Input label, followed by select 
list.\n{{Identical|Valid}},
-review-view-onwiki: Input label, followed by select list,
-review-view-offwiki: Input label, followed by select list,
-review-view-interest: Input label, followed by select list,
+review-view-relexp: Input label, followed by select list,
+review-view-expshare: Input label, followed by select list,
 review-view-notes: Input label, followed by multi-line text 
box.\n{{Identical|Note}},
 review-view-save: Form submission button.\n{{Identical|Save}},
 page-of-pages: Paginated report page indicator. Parameters:\n* $1 - 
current page number\n* $2 - total page count,
diff --git a/data/templates/review/p2/list.html 
b/data/templates/review/p2/list.html
index 70ea470..825cce6 100644
--- a/data/templates/review/p2/list.html
+++ b/data/templates/review/p2/list.html
@@ -55,9 +55,8 @@
 th{{ wgLang.message( 'review-list-gender' ) }}/th
 th{{ wgLang.message( 'review-list-age' ) }}/th
 th{{ wgLang.message( 'review-list-num-p2' ) }}/th
-th{{ wgLang.message( 'review-list-onwiki' ) }}/th
-th{{ wgLang.message( 'review-list-offwiki' ) }}/th
-th{{ wgLang.message( 'review-list-interest' ) }}/th
+th{{ wgLang.message( 'review-list-relexp' ) }}/th
+th{{ wgLang.message( 'review-list-expshare' ) }}/th
 th{{ wgLang.message( 'review-list-p2-score' ) }}/th
   /tr
   {% for row in records %}
@@ -70,9 +69,8 @@
 td{{ row.gender }}/td
 td{{ row.age }}/td
 td{{ row.nscorers }}/td
-td{{ 

[MediaWiki-commits] [Gerrit] Update settings for new phase 2 evaluation criteria - change (wikimedia/wikimania-scholarships)

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

Change subject: Update settings for new phase 2 evaluation criteria
..


Update settings for new phase 2 evaluation criteria

Bug: T85486
Change-Id: I7558c9326c1e8f75e43d8af716b0df22efd24d72
---
A data/db/migrations/20150104-01-update-settings.mysql
M data/db/schema.mysql
M data/i18n/en.json
M data/i18n/qqq.json
M data/templates/admin/settings.html
M src/Wikimania/Scholarship/Controllers/Admin/Settings.php
6 files changed, 31 insertions(+), 34 deletions(-)

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



diff --git a/data/db/migrations/20150104-01-update-settings.mysql 
b/data/db/migrations/20150104-01-update-settings.mysql
new file mode 100644
index 000..5ddbee1
--- /dev/null
+++ b/data/db/migrations/20150104-01-update-settings.mysql
@@ -0,0 +1,11 @@
+-- Change phase 2 scoring criteria
+-- Bug: T85486
+
+TRUNCATE settings;
+
+INSERT IGNORE INTO settings (setting_name, value) VALUES
+('phase1pass', 1)
+  , ('relexp', 0.5)
+  , ('expshare', 0.5)
+  , ('apply_open', '2015-01-19')
+  , ('apply_close', '2015-02-17');
diff --git a/data/db/schema.mysql b/data/db/schema.mysql
index 15762ca..2c2f4f0 100644
--- a/data/db/schema.mysql
+++ b/data/db/schema.mysql
@@ -359,10 +359,11 @@
 ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
 
 INSERT IGNORE INTO settings (setting_name, value) VALUES
- ('phase1pass',3)
-,('weightonwiki',0.5)
-,('weightoffwiki',0.2)
-,('weightinterest',0.3);
+('phase1pass',1)
+  , ('relexp',0.5)
+  , ('expshare',0.5)
+  , ('apply_open', '2015-01-19')
+  , ('apply_close', '2015-02-17');
 
 CREATE TABLE IF NOT EXISTS language_communities (
 code VARCHAR(255)
diff --git a/data/i18n/en.json b/data/i18n/en.json
index 4cb6817..e3b4e3a 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -310,9 +310,8 @@
 
admin-settings-phase1pass: Phase 1 pass score:,
admin-settings-phase2pass: Phase 2 pass score:,
-   admin-settings-weightonwiki: Weight of contributions to Wikimedia:,
-   admin-settings-weightoffwiki: Weight of contributions other than 
Wikimedia:,
-   admin-settings-weightinterest: Weight of Interest:,
+   admin-settings-relexp: Weight of relevant experience:,
+   admin-settings-expshare: Weight of experience sharing:,
settings-pass-scores: Pass scores,
settings-weighing-factors: Weighing factors,
settings-app-period: Application period,
diff --git a/data/i18n/qqq.json b/data/i18n/qqq.json
index ea2364c..a38aaa5 100644
--- a/data/i18n/qqq.json
+++ b/data/i18n/qqq.json
@@ -279,7 +279,6 @@
 settings-app-period-close: Input label, for application period close 
date,
 admin-settings-phase1pass: Input label, for phase 1 pass score,
 admin-settings-phase2pass: Input label, for phase 2 pass score,
-admin-settings-weightonwiki: Input label, for weight of contributions 
to Wikimedia,
-admin-settings-weightoffwiki: Input label, for weight of contributions 
other than Wikimedia,
-admin-settings-weightinterest: Input label, for weight of Interest
+admin-settings-relexp: Input label, for weight of relevant experience,
+admin-settings-expshare: Input label, for weight of experience sharing
 }
diff --git a/data/templates/admin/settings.html 
b/data/templates/admin/settings.html
index be0fc30..f6df9d5 100644
--- a/data/templates/admin/settings.html
+++ b/data/templates/admin/settings.html
@@ -39,31 +39,23 @@
fieldset
legend{{ wgLang.message( 'settings-weighing-factors' ) 
}}/legend
div class=form-group
-   label for=weightonwiki class=col-sm-2 
control-label
-   {{ wgLang.message( 
'admin-settings-weightonwiki' ) }}
+   label for=relexp class=col-sm-2 control-label
+   {{ wgLang.message( 'admin-settings-relexp' ) }}
/label
div class=col-sm-5
-   input type=text class=form-control 
name=weightonwiki id=weightonwiki value={{ set.weightonwiki }} 
required=required
+   input type=text class=form-control 
name=relexp id=relexp value={{ set.relexp }} required=required
/div
/div
 
div class=form-group
-   label for=weightoffwiki class=col-sm-2 
control-label
-   {{ wgLang.message( 
'admin-settings-weightoffwiki' ) }}
+   label for=expshare class=col-sm-2 control-label
+   {{ wgLang.message( 'admin-settings-expshare' ) 
}}
/label
div class=col-sm-5
-   input type=text class=form-control 
name=weightoffwiki id=weightoffwiki value={{ set.weightoffwiki }} 
required=required

[MediaWiki-commits] [Gerrit] Detect and request PMID/PCMID info - change (mediawiki...citoid)

2015-01-04 Thread Sn1per (Code Review)
Sn1per has uploaded a new change for review.

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

Change subject: Detect and request PMID/PCMID info
..

Detect and request PMID/PCMID info

- Add regex for PMID and PCMID (with or
without 'PMC' prefix)
- If PMID or PCMID detected, use
requestFromPubMedID to request proper
information

Bug: T78769
Change-Id: I068e686603251bfd8ce53c6d93c67916cedfd8fa
---
M lib/distinguish.js
1 file changed, 26 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/52/182752/1

diff --git a/lib/distinguish.js b/lib/distinguish.js
index 9205013..51c9132 100644
--- a/lib/distinguish.js
+++ b/lib/distinguish.js
@@ -10,7 +10,8 @@
 var request = require('request'),
urlParse = require('url'),
requestFromURL = require('./requests.js').requestFromURL,
-   requestFromDOI = require('./requests.js').requestFromDOI;
+   requestFromDOI = require('./requests.js').requestFromDOI,
+   requestFromPubMedID = require('./requests.js').requestFromPubMedID;
 
 /**
  * Determine type of string (doi, url) and callback on correct handler
@@ -18,25 +19,39 @@
  * @param  {Function} callback callback(extractedValue, correctFunction)
  */
 var distinguish = function (searchString, callback){
-   var search, match, reDOI, parsedURL;
+   var search, reDOI, rePMID, rePMCID, rePMCID2, parsedURL;
 
searchString.trim();
 
search = searchString;
 
reDOI = new RegExp('\\b10[.][0-9]{4,}[//].*\\b');
+   rePMID = new RegExp('\\b\\d{8}\\b');
+   rePMCID = new RegExp('\\bPMC\\d{7}\\b');
+   rePMCID2 = new RegExp('\\b\\d{7}\\b');
 
-   match = search.match(reDOI);
+   var matchDOI = search.match(reDOI);
+   var matchPMID = search.match(rePMID);
+   var matchPMCID = search.match(rePMCID);
 
-   if (match){
-   callback(match[0], requestFromDOI);
+   if (matchDOI) {
+   callback(matchDOI[0], requestFromDOI);
+   } else if (matchPMID) {
+   callback(matchPMID[0], requestFromPubMedID);
+   } else if (matchPMCID) {
+   callback(matchPMCID[0], requestFromPubMedID);
} else {
-   parsedURL = urlParse.parse(search);
-   if (!parsedURL.protocol){
-   search = 'http://'+ search;
-   callback(search, requestFromURL);
+   matchPMCID = search.match(rePMCID2);
+   if (matchPMCID) {
+   callback('PMC' + matchPMCID[0], requestFromPubMedID);
} else {
-   callback(search, requestFromURL); //assume url if not 
doi
+   parsedURL = urlParse.parse(search);
+   if (!parsedURL.protocol){
+   search = 'http://'+ search;
+   callback(search, requestFromURL);
+   } else {
+   callback(search, requestFromURL); //assume url 
if not doi
+   }
}
}
 };
@@ -52,4 +67,4 @@
 /* Exports */
 module.exports = {
distinguish: distinguish
-};
\ No newline at end of file
+};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I068e686603251bfd8ce53c6d93c67916cedfd8fa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Sn1per geof...@gmail.com

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


[MediaWiki-commits] [Gerrit] Ping server to keep the session alive - change (wikimedia/wikimania-scholarships)

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

Change subject: Ping server to keep the session alive
..


Ping server to keep the session alive

Ping the server every 5 minutes to refresh the server side session and
the local CSRF token. Pings are only made if there has been activity in
the window (typing or mouse movement) since the last ping.

Bug: T63269
Co-Authored-By: Bryan Davis bd...@wikimedia.org
Change-Id: I6babb68ddb77296afbd67947dbc7f79e611df882
---
M data/templates/apply.html
A data/templates/apply.js
A data/templates/csrf.json
M src/Wikimania/Scholarship/App.php
A src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php
5 files changed, 119 insertions(+), 2 deletions(-)

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



diff --git a/data/templates/apply.html b/data/templates/apply.html
index 90a411d..e7419d4 100644
--- a/data/templates/apply.html
+++ b/data/templates/apply.html
@@ -17,6 +17,12 @@
 
 {% block nav_li_apply %}class=active{% endblock %}
 
+{% block javascript %}
+script type=text/javascript
+{% include 'apply.js' %}
+/script
+{% endblock javascript %}
+
 {% block content %}
 {% spaceless %}
 
@@ -71,8 +77,8 @@
 
 div class=row
   div class=col-md-8 col-md-offset-2
-form action={{ urlFor( 'apply_post' ) }} method=post role=form
-  input type=hidden name={{ csrf_param }} value={{ csrf_token }} /
+form id=appform action={{ urlFor( 'apply_post' ) }} method=post 
role=form
+  input id=token type=hidden name={{ csrf_param }} value={{ csrf_token 
}} /
   input type=hidden name=lang id=lang value={{ lang }} /
   div class=form-group
 label class=required{{ wgLang.message( 'required-field' ) }}/label
diff --git a/data/templates/apply.js b/data/templates/apply.js
new file mode 100644
index 000..14070c0
--- /dev/null
+++ b/data/templates/apply.js
@@ -0,0 +1,48 @@
+(function( $, document ) {
+var timeout = 5 * 60 * 1000,
+lastActive = 0,
+refreshCsrf = function() {
+return $.getJSON(
+'{{ urlFor( revalidatecsrf) }}',
+function( data ) {
+var $token = $( '#token' );
+$token.val( data[ {{ csrf_param }} ] );
+console.log( 'csrf token: ' + $token.val() );
+}
+);
+},
+ping = setInterval(function() {
+if ( new Date().getTime() - lastActive  timeout ) {
+console.log( 'Killing keep-alive job due to inactivity' );
+clearInterval( ping );
+} else {
+console.log( 'Refreshing csrf token' );
+refreshCsrf();
+}
+}, timeout ),
+debounce = function( func, wait ) {
+// Adapted from http://davidwalsh.name/javascript-debounce-function
+var timeout;
+return function() {
+var that = this,
+args = arguments,
+later = function() {
+timeout = null;
+func.apply( that, args );
+};
+clearTimeout( timeout );
+timeout = setTimeout( later, wait );
+};
+},
+$document = $( document );
+
+$document.keydown( debounce(
+function() { lastActive = new Date().getTime(); },
+1000
+) );
+$document.mousemove( debounce(
+function() { lastActive = new Date().getTime(); },
+1000
+) );
+// TODO: refresh token on form submit?
+})( jQuery, document );
diff --git a/data/templates/csrf.json b/data/templates/csrf.json
new file mode 100644
index 000..188c5ee
--- /dev/null
+++ b/data/templates/csrf.json
@@ -0,0 +1 @@
+{{{  csrf_param|escape('js') }}: {{ csrf_token|escape('js') }}}
diff --git a/src/Wikimania/Scholarship/App.php 
b/src/Wikimania/Scholarship/App.php
index a8f2611..4db0517 100644
--- a/src/Wikimania/Scholarship/App.php
+++ b/src/Wikimania/Scholarship/App.php
@@ -323,6 +323,11 @@
$page();
})-name( 'apply_post' );
 
+   $slim-get( 'apply/revalidatecsrf', function () use ( 
$slim ) {
+   $page = new Controllers\RevalidateCsrf( $slim );
+   $page();
+   })-name( 'revalidatecsrf' );
+
App::template( $slim, 'contact' );
App::template( $slim, 'credits' );
App::template( $slim, 'privacy' );
diff --git a/src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php 
b/src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php
new file mode 100644
index 000..47f576f
--- /dev/null
+++ b/src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php
@@ -0,0 +1,57 @@
+?php
+/**
+ * @section LICENSE
+ * This file is part of Wikimania Scholarship Application.
+ *
+ * 

[MediaWiki-commits] [Gerrit] Update documentation - change (mediawiki...MaintenanceShell)

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

Change subject: Update documentation
..


Update documentation

Change-Id: I9b2fc3f5ccf54adce2e32008eb90591155d2087e
---
M includes/SpecialMaintenanceShell.php
M tests/MaintenanceShellArgumentsParserTest.php
2 files changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/includes/SpecialMaintenanceShell.php 
b/includes/SpecialMaintenanceShell.php
index 4b1ab87..cb998a3 100644
--- a/includes/SpecialMaintenanceShell.php
+++ b/includes/SpecialMaintenanceShell.php
@@ -107,6 +107,9 @@
/**
 * Execute the script and echo output
 * to the browser as plain text.
+*
+* @param string $filePath
+* @param string $arguments
 */
private function mainshellExec( $filePath, $arguments ) {
global $wgMaintenanceShellPath, $wgTitle;
diff --git a/tests/MaintenanceShellArgumentsParserTest.php 
b/tests/MaintenanceShellArgumentsParserTest.php
index faf6722..8acccef 100644
--- a/tests/MaintenanceShellArgumentsParserTest.php
+++ b/tests/MaintenanceShellArgumentsParserTest.php
@@ -105,6 +105,9 @@
 
/**
 * @dataProvider provideArguments
+* @param string $input
+* @param array $expected
+* @param string $message
 */
public function testParseArguments( $input, Array $expected, $message ) 
{
$parser = new MaintenanceShellArgumentsParser( $input );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b2fc3f5ccf54adce2e32008eb90591155d2087e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MaintenanceShell
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove unneeded parentheses in require statement - change (mediawiki...MaintenanceShell)

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

Change subject: Remove unneeded parentheses in require statement
..


Remove unneeded parentheses in require statement

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

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



diff --git a/includes/SpecialMaintenanceShell.php 
b/includes/SpecialMaintenanceShell.php
index cb998a3..c22dd06 100644
--- a/includes/SpecialMaintenanceShell.php
+++ b/includes/SpecialMaintenanceShell.php
@@ -132,7 +132,7 @@
// Output non-empty string before `exit` (bug 45338)
echo \n;
 
-   require_once( $filePath );
+   require_once $filePath;
 
// We could eval the entire extension, but lets only eval the 
part
// we need, namely the variable class extension.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6f828d09ce9f47d8fb73a4013860045283e4525
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MaintenanceShell
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove unused class property and commented out code - change (mediawiki...MaintenanceShell)

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

Change subject: Remove unused class property and commented out code
..


Remove unused class property and commented out code

Change-Id: I17d98c1740fc30013ab10fa4b7059b480ca43e6f
---
M includes/SpecialMaintenanceShell.php
1 file changed, 0 insertions(+), 6 deletions(-)

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



diff --git a/includes/SpecialMaintenanceShell.php 
b/includes/SpecialMaintenanceShell.php
index 5f50c3f..4b1ab87 100644
--- a/includes/SpecialMaintenanceShell.php
+++ b/includes/SpecialMaintenanceShell.php
@@ -7,8 +7,6 @@
  * That's good but ideally we'd use a custom token (Like FormAction allows).
  */
 class SpecialMaintenanceShell extends FormSpecialPage {
-   private $maintshellOutput = '';
-
public function __construct() {
parent::__construct( 'MaintenanceShell', 'maintenanceshell' );
$out = $this-getOutput();
@@ -94,10 +92,6 @@
}
 
$this-mainshellExec( $filePath, $data['Arguments'] );
-
-   #$this-maintshellPrompt = getcwd() . '$ php ' . 
$data['Script'] . ' ' . $data['Arguments'];
-   #$this-maintshellOutput = $this-mainshellExec( $filePath, 
$data['Arguments'] );
-   #return true;
}
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I17d98c1740fc30013ab10fa4b7059b480ca43e6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MaintenanceShell
Gerrit-Branch: master
Gerrit-Owner: Siebrand siebr...@kitano.nl
Gerrit-Reviewer: BryanDavis bda...@wikimedia.org
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Raimond Spekking raimond.spekk...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Minor bug fix - change (mediawiki...MsCatSelect)

2015-01-04 Thread Luis Felipe Schenone (Code Review)
Luis Felipe Schenone has uploaded a new change for review.

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

Change subject: Minor bug fix
..

Minor bug fix

Change-Id: I755f726bfe97469140dcbfa98afab6680d5c9f7f
---
M MsCatSelect.js
M MsCatSelect.php
2 files changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsCatSelect 
refs/changes/54/182754/1

diff --git a/MsCatSelect.js b/MsCatSelect.js
index 277e68b..e4cd039 100755
--- a/MsCatSelect.js
+++ b/MsCatSelect.js
@@ -67,14 +67,13 @@
 
 function mscsCreateDropDown( maincat, ebene ) {
var dd = jQuery( 'select/' ).attr( 'id', 'mscs_dd_' + ebene ).change( 
function () {
-
var container = jQuery( '#mscs_subcat_' + ebene ).empty();
 
-   if ( jQuery( this ).val() !== 0 ) { //not ---
+   if ( jQuery( this ).val() !== '0' ) { //not ---
selectedCat = jQuery( 'option:selected', this ).text();
-   mscsGetSubcats( selectedCat, ebene,container );
+   mscsGetSubcats( selectedCat, ebene, container );
} else if ( ebene === 0 ) { //--- and nothing
-   selectedCat = ''; //zuruecksetzen
+   selectedCat = ''; //Fall back to the previous category, 
if any
} else {
selectedCat = jQuery( '#MsCatSelect 
option:selected:eq(' + ( ebene - 1 ) + ')' ).text();
}
diff --git a/MsCatSelect.php b/MsCatSelect.php
index 491ee80..9b3bfac 100755
--- a/MsCatSelect.php
+++ b/MsCatSelect.php
@@ -3,7 +3,7 @@
 $wgExtensionCredits['parserhook'][] = array(
'name' = 'MsCatSelect',
'url' = 'http://www.mediawiki.org/wiki/Extension:MsCatSelect',
-   'version' = '6.0',
+   'version' = '6.1',
'descriptionmsg' = 'mscs-desc',
'license-name' = 'GPLv2+',
'author' = array( '[mailto:w...@ratin.de Martin Schwindl]', 
'[mailto:w...@keyler-consult.de Martin Keyler]', 
'[https://www.mediawiki.org/wiki/User:Luis_Felipe_Schenone Luis Felipe 
Schenone]' ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I755f726bfe97469140dcbfa98afab6680d5c9f7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MsCatSelect
Gerrit-Branch: master
Gerrit-Owner: Luis Felipe Schenone scheno...@gmail.com

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


[MediaWiki-commits] [Gerrit] Minor bug fix - change (mediawiki...MsCatSelect)

2015-01-04 Thread Luis Felipe Schenone (Code Review)
Luis Felipe Schenone has submitted this change and it was merged.

Change subject: Minor bug fix
..


Minor bug fix

Change-Id: I755f726bfe97469140dcbfa98afab6680d5c9f7f
---
M MsCatSelect.js
M MsCatSelect.php
2 files changed, 4 insertions(+), 5 deletions(-)

Approvals:
  Luis Felipe Schenone: Verified; Looks good to me, approved



diff --git a/MsCatSelect.js b/MsCatSelect.js
index 277e68b..e4cd039 100755
--- a/MsCatSelect.js
+++ b/MsCatSelect.js
@@ -67,14 +67,13 @@
 
 function mscsCreateDropDown( maincat, ebene ) {
var dd = jQuery( 'select/' ).attr( 'id', 'mscs_dd_' + ebene ).change( 
function () {
-
var container = jQuery( '#mscs_subcat_' + ebene ).empty();
 
-   if ( jQuery( this ).val() !== 0 ) { //not ---
+   if ( jQuery( this ).val() !== '0' ) { //not ---
selectedCat = jQuery( 'option:selected', this ).text();
-   mscsGetSubcats( selectedCat, ebene,container );
+   mscsGetSubcats( selectedCat, ebene, container );
} else if ( ebene === 0 ) { //--- and nothing
-   selectedCat = ''; //zuruecksetzen
+   selectedCat = ''; //Fall back to the previous category, 
if any
} else {
selectedCat = jQuery( '#MsCatSelect 
option:selected:eq(' + ( ebene - 1 ) + ')' ).text();
}
diff --git a/MsCatSelect.php b/MsCatSelect.php
index 491ee80..9b3bfac 100755
--- a/MsCatSelect.php
+++ b/MsCatSelect.php
@@ -3,7 +3,7 @@
 $wgExtensionCredits['parserhook'][] = array(
'name' = 'MsCatSelect',
'url' = 'http://www.mediawiki.org/wiki/Extension:MsCatSelect',
-   'version' = '6.0',
+   'version' = '6.1',
'descriptionmsg' = 'mscs-desc',
'license-name' = 'GPLv2+',
'author' = array( '[mailto:w...@ratin.de Martin Schwindl]', 
'[mailto:w...@keyler-consult.de Martin Keyler]', 
'[https://www.mediawiki.org/wiki/User:Luis_Felipe_Schenone Luis Felipe 
Schenone]' ),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I755f726bfe97469140dcbfa98afab6680d5c9f7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MsCatSelect
Gerrit-Branch: master
Gerrit-Owner: Luis Felipe Schenone scheno...@gmail.com
Gerrit-Reviewer: Luis Felipe Schenone scheno...@gmail.com

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


[MediaWiki-commits] [Gerrit] Don't specify provider = upstart - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Don't specify provider = upstart
..


Don't specify provider = upstart

I'm pretty sure puppet can sort this out on its own; in any
case, specifying upstart causes a failure on debian systems.

Change-Id: I5ef78091932bc280604abc1211fe97076e350de7
---
M manifests/role/labs.pp
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  Faidon Liambotis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/labs.pp b/manifests/role/labs.pp
index 55cb0a5..e784c47 100644
--- a/manifests/role/labs.pp
+++ b/manifests/role/labs.pp
@@ -134,7 +134,6 @@
 service { 'idmapd':
 ensure= running,
 subscribe = File['/etc/idmapd.conf'],
-provider  = upstart,
 }
 
 file { '/etc/idmapd.conf':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ef78091932bc280604abc1211fe97076e350de7
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Faidon Liambotis fai...@wikimedia.org
Gerrit-Reviewer: Matanya mata...@foss.co.il
Gerrit-Reviewer: coren mpellet...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Don't include base::instance-upstarts on Debian. - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Don't include base::instance-upstarts on Debian.
..


Don't include base::instance-upstarts on Debian.

Probably harmless but I can't imagine it does anything
useful.

Change-Id: I709c504c41dfea723b4439877463e09d590a7469
---
M manifests/role/labs.pp
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/manifests/role/labs.pp b/manifests/role/labs.pp
index e784c47..36ced47 100644
--- a/manifests/role/labs.pp
+++ b/manifests/role/labs.pp
@@ -1,9 +1,12 @@
 class role::labs::instance {
 
 include standard
-include base::instance-upstarts
 include sudo
 
+if os_version('ubuntu  lucid') {
+include base::instance-upstarts
+}
+
 sudo::group { 'ops':
 privileges = ['ALL=(ALL) NOPASSWD: ALL'],
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I709c504c41dfea723b4439877463e09d590a7469
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Faidon Liambotis fai...@wikimedia.org
Gerrit-Reviewer: Matanya mata...@foss.co.il
Gerrit-Reviewer: coren mpellet...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove generate-ganglia-conf and the projectgid fact. - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Remove generate-ganglia-conf and the projectgid fact.
..

Remove generate-ganglia-conf and the projectgid fact.

Both of these are now unused, since we've stopped using ganglia
on labs.

Change-Id: I9f418c1b6f07e6b093e04bd6f7a461dfe3af3969
---
D files/ganglia/generate-ganglia-conf.py
D modules/base/lib/facter/projectgid.rb
2 files changed, 0 insertions(+), 170 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/55/182755/1

diff --git a/files/ganglia/generate-ganglia-conf.py 
b/files/ganglia/generate-ganglia-conf.py
deleted file mode 100644
index 93a2203..000
--- a/files/ganglia/generate-ganglia-conf.py
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/python
-# Update ganglia config files for the ganglia aggregator in labs:
-# add gmetad data_source, gmond udp_recv_channel, and gmond tcp_accept_channel
-# lines for each labs project, as stored in ldap (cn, gidNumber).
-# Runs via cron.
-
-import filecmp
-import ldap
-import os
-import shutil
-import sys
-import syslog
-
-# ldap variables
-ldapconffile = '/etc/ldap.conf'  # ldap conf with bind parameters
-basedn = 'ou=groups,dc=wikimedia,dc=org'  # basedn for ldap query
-lfilter = '(objectclass=groupofnames)'  # filter for ldap query
-attrs = ['cn', 'gidNumber']  # attributes to return from ldap query
-
-# gmetad and gmond shared variables
-gdir = '/etc/ganglia'  # ganglia directory
-
-# gmetad variables
-gmetadconf = os.path.join(gdir, 'gmetad.conf')  # live gmetad conf file
-gmetadconfstub = gmetadconf + '.labsstub'  # gmetad conf stub file
-gmetadconfnew = gmetadconf + '.new'  # location to stage new gmetad conf file
-gserver = 'aggregator.eqiad.wmflabs'  # hostname of the aggregator server
-gmetadaemon = 'gmetad'  # name of gmetad daemon (for restarting)
-gmetadps = 'gmetad'  # name of gmetad ps (for verifying restart)
-
-# gmond variables
-gmondconfstub = os.path.join(gdir, 'gmond.conf.labsstub')
-gmondaemon = 'ganglia-monitor'  # name of gmond daemon (for restarting)
-gmondps = 'gmond'  # name of gmond daemon (for verifying restart)
-
-
-def _get_projects_gids():
-Query ldap and return a dictionary of all projects (cn) and their
-   corresponding group IDs (gidNumber);
-   raise LDAPError on any ldap failures
-# get ldap connect parameters (e.g., uri, binddn, bindpw) from conf file
-ldapconf = {}
-for line in open(ldapconffile):
-splitline = line.strip().split()
-ldapconf[splitline[0]] = splitline[1]
-
-# establish ldap connection
-con = ldap.initialize(ldapconf['uri'])
-con.protocol_version = ldap.VERSION3
-con.start_tls_s()
-con.simple_bind_s(ldapconf['binddn'], ldapconf['bindpw'])
-
-# ldap search
-res = con.search_s(basedn, ldap.SCOPE_SUBTREE, lfilter, attrs)
-projectgid = {}
-for (dn, record) in res:
-projectgid[record['cn'][0]] = int(record['gidNumber'][0])
-return projectgid
-
-
-def gen_ganglia_conf():
-Generate new ganglia config files, using defaults from gconfstub and
-   dynamically adding data_source lines for each project (found in ldap),
-   e.g., data_source testlabs aggregator.eqiad.wmflabs:21002
-# get dict of project names and group IDs from ldap, or exit on failure
-try:
-pg = _get_projects_gids()
-except ldap.LDAPError, e:
-syslog.syslog(e)
-sys.exit(3)
-
-# write new gmetad conf file
-f = open(gmetadconfnew, 'w')
-for line in open(gmetadconfstub):
-f.write(line)
-if line == '# BEGIN AUTOGEN FROM CRON\n':
-for p in sorted(pg):
-if p[:8] != 'project-':
-continue
-# write out data_source line to conf file, e.g.,
-# data_source testlabs aggregator.eqiad.wmflabs:21002
-f.write('data_source %s %s:%d\n' % (p[8:], gserver, pg[p]))
-f.close()
-
-# write new gmond conf files
-for p in sorted(pg):
-if p[:8] != 'project-':
-continue
-g = open(os.path.join(gdir, 'gmond-%s.conf.new' % p[8:]), 'w')
-for line in open(gmondconfstub):
-g.write(line)
-if line == '# BEGIN AUTOGEN FROM CRON\n':
-# set cluster so hosts show up grouped by project name
-g.write('cluster {\n  name = %s\n}\n' % p[8:])
-# write out udp_recv_channel and tcp_accept_channel stanzas
-g.write('udp_recv_channel {\n  port = %s\n}\n' % pg[p])
-g.write('tcp_accept_channel {\n  port = %s\n}\n\n' % pg[p])
-g.close()
-
-
-def cond_restart(confs, daemon, ps):
-Restart daemon if any new conf files have changed and verify restart;
-   exit with error code 1 or 2, to indicate 1 or 2 restart failures
-restart = ('/etc/init.d/' + daemon + ' restart  '
-  

[MediaWiki-commits] [Gerrit] Remove generate-ganglia-conf and the projectgid fact. - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Remove generate-ganglia-conf and the projectgid fact.
..


Remove generate-ganglia-conf and the projectgid fact.

Both of these are now unused, since we've stopped using ganglia
on labs.

Change-Id: I9f418c1b6f07e6b093e04bd6f7a461dfe3af3969
---
D files/ganglia/generate-ganglia-conf.py
D modules/base/lib/facter/projectgid.rb
2 files changed, 0 insertions(+), 170 deletions(-)

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



diff --git a/files/ganglia/generate-ganglia-conf.py 
b/files/ganglia/generate-ganglia-conf.py
deleted file mode 100644
index 93a2203..000
--- a/files/ganglia/generate-ganglia-conf.py
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/python
-# Update ganglia config files for the ganglia aggregator in labs:
-# add gmetad data_source, gmond udp_recv_channel, and gmond tcp_accept_channel
-# lines for each labs project, as stored in ldap (cn, gidNumber).
-# Runs via cron.
-
-import filecmp
-import ldap
-import os
-import shutil
-import sys
-import syslog
-
-# ldap variables
-ldapconffile = '/etc/ldap.conf'  # ldap conf with bind parameters
-basedn = 'ou=groups,dc=wikimedia,dc=org'  # basedn for ldap query
-lfilter = '(objectclass=groupofnames)'  # filter for ldap query
-attrs = ['cn', 'gidNumber']  # attributes to return from ldap query
-
-# gmetad and gmond shared variables
-gdir = '/etc/ganglia'  # ganglia directory
-
-# gmetad variables
-gmetadconf = os.path.join(gdir, 'gmetad.conf')  # live gmetad conf file
-gmetadconfstub = gmetadconf + '.labsstub'  # gmetad conf stub file
-gmetadconfnew = gmetadconf + '.new'  # location to stage new gmetad conf file
-gserver = 'aggregator.eqiad.wmflabs'  # hostname of the aggregator server
-gmetadaemon = 'gmetad'  # name of gmetad daemon (for restarting)
-gmetadps = 'gmetad'  # name of gmetad ps (for verifying restart)
-
-# gmond variables
-gmondconfstub = os.path.join(gdir, 'gmond.conf.labsstub')
-gmondaemon = 'ganglia-monitor'  # name of gmond daemon (for restarting)
-gmondps = 'gmond'  # name of gmond daemon (for verifying restart)
-
-
-def _get_projects_gids():
-Query ldap and return a dictionary of all projects (cn) and their
-   corresponding group IDs (gidNumber);
-   raise LDAPError on any ldap failures
-# get ldap connect parameters (e.g., uri, binddn, bindpw) from conf file
-ldapconf = {}
-for line in open(ldapconffile):
-splitline = line.strip().split()
-ldapconf[splitline[0]] = splitline[1]
-
-# establish ldap connection
-con = ldap.initialize(ldapconf['uri'])
-con.protocol_version = ldap.VERSION3
-con.start_tls_s()
-con.simple_bind_s(ldapconf['binddn'], ldapconf['bindpw'])
-
-# ldap search
-res = con.search_s(basedn, ldap.SCOPE_SUBTREE, lfilter, attrs)
-projectgid = {}
-for (dn, record) in res:
-projectgid[record['cn'][0]] = int(record['gidNumber'][0])
-return projectgid
-
-
-def gen_ganglia_conf():
-Generate new ganglia config files, using defaults from gconfstub and
-   dynamically adding data_source lines for each project (found in ldap),
-   e.g., data_source testlabs aggregator.eqiad.wmflabs:21002
-# get dict of project names and group IDs from ldap, or exit on failure
-try:
-pg = _get_projects_gids()
-except ldap.LDAPError, e:
-syslog.syslog(e)
-sys.exit(3)
-
-# write new gmetad conf file
-f = open(gmetadconfnew, 'w')
-for line in open(gmetadconfstub):
-f.write(line)
-if line == '# BEGIN AUTOGEN FROM CRON\n':
-for p in sorted(pg):
-if p[:8] != 'project-':
-continue
-# write out data_source line to conf file, e.g.,
-# data_source testlabs aggregator.eqiad.wmflabs:21002
-f.write('data_source %s %s:%d\n' % (p[8:], gserver, pg[p]))
-f.close()
-
-# write new gmond conf files
-for p in sorted(pg):
-if p[:8] != 'project-':
-continue
-g = open(os.path.join(gdir, 'gmond-%s.conf.new' % p[8:]), 'w')
-for line in open(gmondconfstub):
-g.write(line)
-if line == '# BEGIN AUTOGEN FROM CRON\n':
-# set cluster so hosts show up grouped by project name
-g.write('cluster {\n  name = %s\n}\n' % p[8:])
-# write out udp_recv_channel and tcp_accept_channel stanzas
-g.write('udp_recv_channel {\n  port = %s\n}\n' % pg[p])
-g.write('tcp_accept_channel {\n  port = %s\n}\n\n' % pg[p])
-g.close()
-
-
-def cond_restart(confs, daemon, ps):
-Restart daemon if any new conf files have changed and verify restart;
-   exit with error code 1 or 2, to indicate 1 or 2 restart failures
-restart = ('/etc/init.d/' + daemon + ' restart  '
-   '/usr/bin/pgrep ' + ps)  # 

[MediaWiki-commits] [Gerrit] [IMPROV] Maintenance/wikimedia_sites rewrite - change (pywikibot/core)

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

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

Change subject: [IMPROV] Maintenance/wikimedia_sites rewrite
..

[IMPROV] Maintenance/wikimedia_sites rewrite

Uses the http library of pywikibot, handle_args instead of handleArgs
and doesn't use carriage returns.

Change-Id: I4e2f2990d27e59519523ee358948b1f5e3e94c05
---
M scripts/maintenance/wikimedia_sites.py
1 file changed, 18 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/56/182756/1

diff --git a/scripts/maintenance/wikimedia_sites.py 
b/scripts/maintenance/wikimedia_sites.py
index 83f2080..576bf02 100644
--- a/scripts/maintenance/wikimedia_sites.py
+++ b/scripts/maintenance/wikimedia_sites.py
@@ -12,15 +12,10 @@
 import re
 import codecs
 from xml.etree import cElementTree
-import sys
 
 import pywikibot
 from pywikibot.family import Family
-
-if sys.version_info[0]  2:
-from urllib.request import urlopen
-else:
-from urllib import urlopen
+from pywikibot.comms.http import fetch
 
 URL = 'https://wikistats.wmflabs.org/api.php?action=dumptable=%sformat=xml'
 
@@ -46,8 +41,8 @@
 original = Family.load(family).languages_by_size
 obsolete = Family.load(family).obsolete
 
-feed = urlopen(URL % familiesDict[family])
-tree = cElementTree.parse(feed)
+feed = fetch(URL % familiesDict[family]).content
+tree = cElementTree.fromstring(feed)
 
 new = []
 for field in tree.findall('row/field'):
@@ -58,7 +53,7 @@
 continue
 
 # put the missing languages to the right place
-missing = original != new and set(original) - set(new)
+missing = set(original) - set(new)
 if missing:
 pywikibot.output(uWARNING: ['%s'] not listed at wikistats.
  % ', '.join(missing))
@@ -74,32 +69,27 @@
 pywikibot.output(u'The lists match!')
 else:
 pywikibot.output(uThe lists don't match, the new list is:)
-text = u'self.languages_by_size = [\r\n'
-line = ' ' * 11
+text = u'self.languages_by_size = [\n'
+line = u''
 for code in new:
-if len(line) + len(code) = 76:
-line += u '%s', % code
-else:
-text += u'%s\r\n' % line
-line = ' ' * 11
-line += u '%s', % code
-text += u'%s\r\n' % line
+if len(line) + len(code)  80 - 11 - 4:
+text += u' ' * 11 + u'%s\n' % line
+line = u''
+line += u '%s', % code
+text += u' ' * 11
+text += u'%s\n' % line
 text += u']'
 pywikibot.output(text)
 family_file_name = 'pywikibot/families/%s_family.py' % family
-family_file = codecs.open(family_file_name, 'r', 'utf8')
-family_text = family_file.read()
+with codecs.open(family_file_name, 'r', 'utf8') as family_file:
+family_text = family_file.read()
 old = re.findall(r'(?msu)^ {8}self.languages_by_size.+?\]',
  family_text)[0]
 family_text = family_text.replace(old, text)
-family_file = codecs.open(family_file_name, 'w', 'utf8')
-family_file.write(family_text)
-family_file.close()
+with codecs.open(family_file_name, 'w', 'utf8') as family_file:
+family_file.write(family_text)
 
 
 if __name__ == '__main__':
-fam = []
-for arg in pywikibot.handleArgs():
-if arg in familiesDict.keys() and arg not in fam:
-fam.append(arg)
-update_family(fam)
+fams = set(arg for arg in pywikibot.handle_args() if arg in familiesDict)
+update_family(fams)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e2f2990d27e59519523ee358948b1f5e3e94c05
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise commodorefabia...@gmx.de

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


[MediaWiki-commits] [Gerrit] Separate message for Summary field with 4 tildes - change (mediawiki...LiquidThreads)

2015-01-04 Thread Phoenix303 (Code Review)
Phoenix303 has uploaded a new change for review.

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

Change subject: Separate message for Summary field with 4 tildes
..

Separate message for Summary field with 4 tildes

Bug: T45496
Change-Id: I23adc3112be6a086d012b38cb3d6fb2a984958bc
---
M LiquidThreads.php
M i18n/en.json
M lqt.js
3 files changed, 10 insertions(+), 1 deletion(-)


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

diff --git a/LiquidThreads.php b/LiquidThreads.php
index 076472a..f61e553 100644
--- a/LiquidThreads.php
+++ b/LiquidThreads.php
@@ -38,6 +38,7 @@
'lqt-thread-link-title',
'lqt-thread-link-copy',
'lqt-sign-not-necessary',
+   'lqt-summary-sign-not-necessary',
'lqt-marked-as-read-placeholder',
'lqt-email-undo',
'lqt-change-subject',
diff --git a/i18n/en.json b/i18n/en.json
index 5d9a00e..804b01b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -186,6 +186,7 @@
lqt-thread-link-title: Wikitext link:,
lqt-thread-link-copy: Copy to clipboard,
lqt-sign-not-necessary: It is not necessary to sign your post with 
four tildes.\nThe signature is shown automatically.,
+   lqt-summary-sign-not-necessary: It is not necessary to sign your 
post with four tildes.,
lqt-marked-as-read-placeholder: The thread $1 was marked as read.,
lqt-change-subject: Change subject,
lqt-save-subject: Save,
diff --git a/lqt.js b/lqt.js
index f5114c1..385baca 100644
--- a/lqt.js
+++ b/lqt.js
@@ -1110,7 +1110,14 @@
}
 
// Show the warning
-   var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 'lqt-sign-not-necessary' 
) ),
+   $weLqtSummaryTop = $( this ).closest( 
'.lqt-summarize-form' );
+   
+if ( $weLqtSummaryTop.length ) {
+var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 
'lqt-summary-sign-not-necessary' ) );
+   } else {
+var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 'lqt-sign-not-necessary' 
) );
+   }
+
$weTop = $( this ).closest( '.lqt-edit-form' 
).find( '.wikiEditor-ui-top' );
 
if ( $weTop.length ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23adc3112be6a086d012b38cb3d6fb2a984958bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Phoenix303 divyalife...@gmail.com

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


[MediaWiki-commits] [Gerrit] mw.config: Show deprecation notices when accessing globals - change (mediawiki/core)

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

Change subject: mw.config: Show deprecation notices when accessing globals
..


mw.config: Show deprecation notices when accessing globals

The mw.config.value object is no longer an alias to the global object
when $wgLegacyJavaScriptGlobals is true.

Instead, set() is made to copy to property to the global object. This
matches behaviour of other deprecated properties in that changes to the
deprecated property directly are ignored.

Bug: T58550
Change-Id: I703f7c12b59bc3207b2a291eacc393a8ae92df6f
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/suites/resources/mediawiki/mediawiki.test.js
2 files changed, 73 insertions(+), 9 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 94b64b9..6bf93f4 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -79,12 +79,56 @@
 * @class mw.Map
 *
 * @constructor
-* @param {Object|boolean} [values] Value-bearing object to map, or 
boolean
-*  true to map over the global object. Defaults to an empty object.
+* @param {Object|boolean} [values] Value-bearing object to map, 
defaults to an empty object.
+*  For backwards-compatibility with mw.config, this can also be `true` 
in which case values
+*  will be copied to the Window object as global variables (T72470). 
Values are copied in one
+*  direction only. Changes to globals are not reflected in the map.
 */
function Map( values ) {
-   this.values = values === true ? window : ( values || {} );
-   return this;
+   if ( values === true ) {
+   this.values = {};
+
+   // Override #set to also set the global variable
+   this.set = function ( selection, value ) {
+   var s;
+
+   if ( $.isPlainObject( selection ) ) {
+   for ( s in selection ) {
+   setGlobalMapValue( this, s, 
selection[s] );
+   }
+   return true;
+   }
+   if ( typeof selection === 'string'  
arguments.length ) {
+   setGlobalMapValue( this, selection, 
value );
+   return true;
+   }
+   return false;
+   };
+
+   return;
+   }
+
+   this.values = values || {};
+   }
+
+   /**
+* Alias property to the global object.
+*
+* @private
+* @static
+* @param {mw.Map} map
+* @param {string} key
+* @param {Mixed} value
+*/
+   function setGlobalMapValue( map, key, value ) {
+   map.values[key] = value;
+   mw.log.deprecate(
+   window,
+   key,
+   value,
+   // Deprecation notice for mw.config globals (T58550, 
T72470)
+   map === mw.config  'Use mw.config instead.'
+   );
}
 
Map.prototype = {
@@ -136,7 +180,7 @@
 *
 * @param {string|Object} selection String key to set value 
for, or object mapping keys to values.
 * @param {Mixed} [value] Value to set (optional, only in use 
when key is a string)
-* @return {Boolean} This returns true on success, false on 
failure.
+* @return {boolean} This returns true on success, false on 
failure.
 */
set: function ( selection, value ) {
var s;
@@ -147,7 +191,7 @@
}
return true;
}
-   if ( typeof selection === 'string'  arguments.length 
 1 ) {
+   if ( typeof selection === 'string'  arguments.length 
) {
this.values[selection] = value;
return true;
}
@@ -582,6 +626,7 @@
} );
} catch ( err ) {
// IE8 can throw on 
Object.defineProperty
+   // Create a copy of the value to the 
object.
obj[key] = val;
}
};
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js 

[MediaWiki-commits] [Gerrit] Remove provider = upstart - change (operations/puppet)

2015-01-04 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: Remove provider = upstart
..

Remove provider = upstart

Based on I5ef78091932bc280604abc1211fe97076e350de7

Change-Id: Iad5e91dd969d88052f1fa676855c0199b748bd1a
---
M modules/cxserver/manifests/init.pp
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/modules/cxserver/manifests/init.pp 
b/modules/cxserver/manifests/init.pp
index 8aa628e..9f35126 100644
--- a/modules/cxserver/manifests/init.pp
+++ b/modules/cxserver/manifests/init.pp
@@ -97,7 +97,6 @@
 ensure = running,
 hasstatus  = true,
 hasrestart = true,
-provider   = 'upstart',
 require= [
 File[$log_dir],
 File['/etc/init.d/cxserver']

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad5e91dd969d88052f1fa676855c0199b748bd1a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: KartikMistry kartik.mis...@gmail.com

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


[MediaWiki-commits] [Gerrit] Don't specify provider = upstart - change (operations/puppet)

2015-01-04 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: Don't specify provider = upstart
..

Don't specify provider = upstart

Based on: I5ef78091932bc280604abc1211fe97076e350de7

Change-Id: I2e1b61b9762c6e60ca3787daca8bbdf3e91249c0
---
M modules/gitblit/manifests/init.pp
M modules/hhvm/manifests/init.pp
M modules/ipython/manifests/notebook.pp
M modules/tcpircbot/manifests/instance.pp
M modules/txstatsd/manifests/init.pp
5 files changed, 0 insertions(+), 5 deletions(-)


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

diff --git a/modules/gitblit/manifests/init.pp 
b/modules/gitblit/manifests/init.pp
index 5114840..483bef8 100644
--- a/modules/gitblit/manifests/init.pp
+++ b/modules/gitblit/manifests/init.pp
@@ -65,7 +65,6 @@
 
 service { 'gitblit':
 ensure= running,
-provider  = 'upstart',
 subscribe = File['/var/lib/gitblit/data/gitblit.properties'],
 require   = File['/etc/init/gitblit.conf'],
 }
diff --git a/modules/hhvm/manifests/init.pp b/modules/hhvm/manifests/init.pp
index 5a2d4f8..1bf17c7 100644
--- a/modules/hhvm/manifests/init.pp
+++ b/modules/hhvm/manifests/init.pp
@@ -196,7 +196,6 @@
 
 service { 'hhvm':
 ensure= 'running',
-provider  = 'upstart',
 subscribe = Package['hhvm', 'hhvm-fss', 'hhvm-luasandbox', 
'hhvm-wikidiff2'],
 }
 
diff --git a/modules/ipython/manifests/notebook.pp 
b/modules/ipython/manifests/notebook.pp
index 341da9d..9e197f4 100644
--- a/modules/ipython/manifests/notebook.pp
+++ b/modules/ipython/manifests/notebook.pp
@@ -100,7 +100,6 @@
 
 service { 'ipython-notebook':
 ensure= running,
-provider  = 'upstart',
 subscribe = File['/etc/init/ipython-notebook.conf'],
 require   = [
 Package['ipython-notebook'],
diff --git a/modules/tcpircbot/manifests/instance.pp 
b/modules/tcpircbot/manifests/instance.pp
index 0b14bfa..28540d7 100644
--- a/modules/tcpircbot/manifests/instance.pp
+++ b/modules/tcpircbot/manifests/instance.pp
@@ -83,7 +83,6 @@
 
 service { tcpircbot-${title}:
 ensure= running,
-provider  = 'upstart',
 subscribe = File[/etc/init/tcpircbot-${title}.conf, 
${tcpircbot::dir}/${title}.json],
 require   = [
 Package['python-irclib'],
diff --git a/modules/txstatsd/manifests/init.pp 
b/modules/txstatsd/manifests/init.pp
index b11c80d..7a2e5ba 100644
--- a/modules/txstatsd/manifests/init.pp
+++ b/modules/txstatsd/manifests/init.pp
@@ -58,7 +58,6 @@
 
 service { 'txstatsd':
 ensure= running,
-provider  = upstart,
 subscribe = File['/etc/txstatsd/txstatsd.cfg'],
 require   = [
 File['/etc/init/txstatsd.conf'],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e1b61b9762c6e60ca3787daca8bbdf3e91249c0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: KartikMistry kartik.mis...@gmail.com

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


[MediaWiki-commits] [Gerrit] Enable CORS support logging on beta - change (operations/mediawiki-config)

2015-01-04 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Enable CORS support logging on beta
..

Enable CORS support logging on beta

Soft-depends on I9bc940337a83146f8ecbe8a546c31c93b17161f1

Bug: T507
Change-Id: I82ebf8a9def3359ff78a23a441856ef38e8dd07a
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
3 files changed, 9 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 8ff8461..566a965 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -1985,6 +1985,7 @@
require_once( $IP/extensions/ImageMetrics/ImageMetrics.php );
$wgImageMetricsSamplingFactor = $wmgImageMetricsSamplingFactor;
$wgImageMetricsLoggedinSamplingFactor = 
$wmgImageMetricsLoggedinSamplingFactor;
+   $wgImageMetricsCorsSamplingFactor = $wmgImageMetricsCorsSamplingFactor;
 }
 
 if ( $wmgUsePopups ) {
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 2d07ecb..c032538 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -325,6 +325,10 @@
'default' = 1,
),
 
+   'wmgImageMetricsCorsSamplingFactor' = array(
+   'default' = 1,
+   ),
+
'wmgUseVectorBeta' = array(
'default' = true,
),
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 6c0559b..a522384 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -11788,6 +11788,10 @@
'default' = 10,
 ),
 
+'wmgImageMetricsCorsSamplingFactor' = array(
+   'default' = false,
+),
+
 // -- Shared Parsoid start --
 
 'wmgUseParsoid' = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82ebf8a9def3359ff78a23a441856ef38e8dd07a
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza gti...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Measure CORS script loading support - change (mediawiki...ImageMetrics)

2015-01-04 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Measure CORS script loading support
..

Measure CORS script loading support

Bug: T507
Change-Id: I9bc940337a83146f8ecbe8a546c31c93b17161f1
---
M .jshintrc
M ImageMetrics.php
A resources/cors-test.js
M resources/head.js
M resources/loader.js
A resources/logger/CorsLogger.js
A tests/qunit/logger/CorsLogger.test.js
M tests/qunit/logger/LoadingTimeLogger.test.js
8 files changed, 181 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ImageMetrics 
refs/changes/66/182766/1

diff --git a/.jshintrc b/.jshintrc
index bda7504..719cc3c 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -23,6 +23,7 @@
predef: [
window,
document,
+   XMLHttpRequest,
Geo,
QUnit,
jQuery,
diff --git a/ImageMetrics.php b/ImageMetrics.php
index a494eab..e43a6a7 100644
--- a/ImageMetrics.php
+++ b/ImageMetrics.php
@@ -29,10 +29,14 @@
 /** @var int|bool: If set, logs once per this many requests for logged-in 
users. False if unset. **/
 $wgImageMetricsLoggedinSamplingFactor = false;
 
+/** @var int|bool: If set, tests and logs CORS support once per this many 
requests. False if unset. **/
+$wgImageMetricsCorsSamplingFactor = false;
+
 $wgMessagesDirs['ImageMetrics'] = __DIR__ . '/i18n';
 
 $wgHooks['EventLoggingRegisterSchemas'][] = function( array $schemas ) {
$schemas['ImageMetricsLoadingTime'] = 10078363;
+   $schemas['ImageMetricsCorsSupport'] = 10884476;
 };
 
 
@@ -41,12 +45,14 @@
'scripts'   = array(
'logger/Logger.js',
'logger/LoadingTimeLogger.js',
+   'logger/CorsLogger.js',
),
'localBasePath' = __DIR__ . '/resources',
'remoteExtPath' = 'ImageMetrics/resources',
'dependencies'  = array(
'oojs',
'schema.ImageMetricsLoadingTime',
+   'schema.ImageMetricsCorsSupport',
),
'targets'   = array( 'desktop', 'mobile' ),
),
@@ -71,7 +77,7 @@
  * @return bool
  */
 $wgHooks['BeforePageDisplay'][] = function ( $out, $skin ) {
-   if ( $out-getTitle()-inNamespace( NS_FILE )  Action::getActionName( 
$out-getContext() ) === 'view' ) {
+   if ( Action::getActionName( $out-getContext() ) === 'view' ) {
$out-addModules( array( 'ext.imageMetrics.head', 
'ext.imageMetrics.loader' ) );
}
return true;
@@ -82,11 +88,12 @@
  * @return bool
  */
 $wgHooks[ 'ResourceLoaderGetConfigVars' ][] = function ( $vars ) {
-   global $wgImageMetricsSamplingFactor, 
$wgImageMetricsLoggedinSamplingFactor;
+   global $wgImageMetricsSamplingFactor, 
$wgImageMetricsLoggedinSamplingFactor, $wgImageMetricsCorsSamplingFactor;
$vars[ 'wgImageMetrics' ] = array(
'samplingFactor' = array(
'image' = $wgImageMetricsSamplingFactor,
'imageLoggedin' = 
$wgImageMetricsLoggedinSamplingFactor,
+   'cors' = $wgImageMetricsCorsSamplingFactor,
),
);
return true;
@@ -101,6 +108,7 @@
$testModules['qunit']['ext.imageMetrics.tests'] = array(
'scripts' = array(
'tests/qunit/logger/LoadingTimeLogger.test.js',
+   'tests/qunit/logger/CorsLogger.test.js',
),
'dependencies' = array(
'ext.imageMetrics',
diff --git a/resources/cors-test.js b/resources/cors-test.js
new file mode 100644
index 000..843d1eb
--- /dev/null
+++ b/resources/cors-test.js
@@ -0,0 +1,8 @@
+/**
+ * CORS test payload. This file will not load if the user has a 
CORS-supporting browser and a
+ * proxy that strips CORS headers.
+ */
+( function ( mw ) {
+   'use strict';
+   mw.config.set( 'wgImageMetricsCorsTestSucceeded', true );
+} ( mediaWiki ) );
diff --git a/resources/head.js b/resources/head.js
index a0c9278..0d2eda3 100644
--- a/resources/head.js
+++ b/resources/head.js
@@ -22,7 +22,6 @@
file = $file.get( 0 );
 
if ( !file ) {
-   mw.log( 'ImageMetrics: file missing' );
return;
}
 
diff --git a/resources/loader.js b/resources/loader.js
index 4004604..1dc32d9 100644
--- a/resources/loader.js
+++ b/resources/loader.js
@@ -9,10 +9,11 @@
 ( function ( mw, $ ) {
'use strict';
 
-   var logImage,
+   var logImage, logCors,
config = mw.config.get( 'wgImageMetrics', { samplingFactor: {} 
} ),
imageFactor = config.samplingFactor.image,
-   loggedinImageFactor = 

[MediaWiki-commits] [Gerrit] Separate message for Summary field with 4 tildes - change (mediawiki...LiquidThreads)

2015-01-04 Thread Phoenix303 (Code Review)
Phoenix303 has uploaded a new change for review.

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

Change subject: Separate message for Summary field with 4 tildes
..

Separate message for Summary field with 4 tildes

Bug: T45496
Change-Id: I4681e1fa99bbd79f1bcd51c60415252973e7b038
---
M i18n/qqq.json
M lqt.js
2 files changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/58/182758/1

diff --git a/i18n/qqq.json b/i18n/qqq.json
index 8d11a89..a67e5d0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -210,6 +210,7 @@
lqt-edit-bump: See {{msg-mw|Lqt-edit-bump-tooltip}} for the 
explanation of this feature.,
lqt-reply-subpage: Part of the page title when a LiquidThread answer 
is given. Should probably be translated as a noun and not as a 
verb.\n\n{{Identical|Reply}},
lqt-pagechange-editformopen: Shown as a JavaScript confirmation 
dialog to the user when they try to leave the page while an LQT editing form is 
open.,
+   lqt-summary-sign-not-necessary: Message shown when Summary field has 
4 tildes.,
nstab-thread: Used as tab title of the Thread 
namespace.\n{{Identical|Thread}},
nstab-summary: Used as tab title for the Summary 
namespace.\n{{Identical|Summary}},
echo-pref-email-lqt-new-topic: Used by the Echo extension in the 
Preferences - Notifications tab as a label to enable email notification for 
the lqt-new-topic event.,
diff --git a/lqt.js b/lqt.js
index 385baca..430106f 100644
--- a/lqt.js
+++ b/lqt.js
@@ -1110,15 +1110,13 @@
}
 
// Show the warning
-   $weLqtSummaryTop = $( this ).closest( 
'.lqt-summarize-form' );
-   
+   var $weLqtSummaryTop = $( this ).closest( 
'.lqt-summarize-form' );
 if ( $weLqtSummaryTop.length ) {
 var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 
'lqt-summary-sign-not-necessary' ) );
} else {
 var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 'lqt-sign-not-necessary' 
) );
}
-
-   $weTop = $( this ).closest( '.lqt-edit-form' 
).find( '.wikiEditor-ui-top' );
+   var $weTop = $( this ).closest( '.lqt-edit-form' 
).find( '.wikiEditor-ui-top' );
 
if ( $weTop.length ) {
$weTop.before( elem );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4681e1fa99bbd79f1bcd51c60415252973e7b038
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Phoenix303 divyalife...@gmail.com

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


[MediaWiki-commits] [Gerrit] This is a test - change (mediawiki...examples)

2015-01-04 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: This is a test
..

This is a test

Change-Id: I377e94a2fbd285e93eeb82e5bb61c8922b0ad807
---
A foo
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/foo b/foo
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/foo

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I377e94a2fbd285e93eeb82e5bb61c8922b0ad807
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/examples
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com

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


[MediaWiki-commits] [Gerrit] example - change (mediawiki...examples)

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

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

Change subject: example
..

example

Change-Id: Ib641dc5d6c2169b64ecc3fa42b591ddd92da812b
---
A A
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/A b/A
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/A

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib641dc5d6c2169b64ecc3fa42b591ddd92da812b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/examples
Gerrit-Branch: master
Gerrit-Owner: Krinkle krinklem...@gmail.com

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


[MediaWiki-commits] [Gerrit] contint: Apply contint::qunit_localhost to labs slaves - change (operations/puppet)

2015-01-04 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: contint: Apply contint::qunit_localhost to labs slaves
..


contint: Apply contint::qunit_localhost to labs slaves

Bug: 72063
Change-Id: Ie0a7eafae21513464ee1d46518025e3bdc3bf155
---
M manifests/role/ci.pp
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/manifests/role/ci.pp b/manifests/role/ci.pp
index 2a742c9..7d274e2 100644
--- a/manifests/role/ci.pp
+++ b/manifests/role/ci.pp
@@ -422,12 +422,19 @@
 owner  = 'jenkins-deploy',
 group  = 'root',  # no jenkins-deploy group in labs
 }
+file { '/srv/localhost/qunit':
+ensure = directory,
+mode   = '0775',
+owner  = 'jenkins-deploy',
+group  = 'root',
+}
 contint::localvhost { 'mediawiki':
 port   = 9414,
 docroot= '/srv/localhost/mediawiki',
 log_prefix = 'mediawiki',
 require= File['/srv/localhost/mediawiki'],
 }
+include contint::qunit_localhost
 
 # Trebuchet replacement on labs
 include contint::slave-scripts

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0a7eafae21513464ee1d46518025e3bdc3bf155
Gerrit-PatchSet: 15
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: Adrian Lang adrian.l...@wikimedia.de
Gerrit-Reviewer: Andrew Bogott abog...@wikimedia.org
Gerrit-Reviewer: Hashar has...@free.fr
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Separate message for Summary field with 4 tildes - change (mediawiki...LiquidThreads)

2015-01-04 Thread Phoenix303 (Code Review)
Phoenix303 has uploaded a new change for review.

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

Change subject: Separate message for Summary field with 4 tildes
..

Separate message for Summary field with 4 tildes

Bug: T45496
Change-Id: I8e044d35f3dcdcd4d49dc8755f34d2bae44f030f
---
M LiquidThreads.php
M i18n/en.json
M i18n/qqq.json
M lqt.js
4 files changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/LiquidThreads.php b/LiquidThreads.php
index 076472a..f61e553 100644
--- a/LiquidThreads.php
+++ b/LiquidThreads.php
@@ -38,6 +38,7 @@
'lqt-thread-link-title',
'lqt-thread-link-copy',
'lqt-sign-not-necessary',
+   'lqt-summary-sign-not-necessary',
'lqt-marked-as-read-placeholder',
'lqt-email-undo',
'lqt-change-subject',
diff --git a/i18n/en.json b/i18n/en.json
index 5d9a00e..804b01b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -186,6 +186,7 @@
lqt-thread-link-title: Wikitext link:,
lqt-thread-link-copy: Copy to clipboard,
lqt-sign-not-necessary: It is not necessary to sign your post with 
four tildes.\nThe signature is shown automatically.,
+   lqt-summary-sign-not-necessary: It is not necessary to sign your 
post with four tildes.,
lqt-marked-as-read-placeholder: The thread $1 was marked as read.,
lqt-change-subject: Change subject,
lqt-save-subject: Save,
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 8d11a89..a67e5d0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -210,6 +210,7 @@
lqt-edit-bump: See {{msg-mw|Lqt-edit-bump-tooltip}} for the 
explanation of this feature.,
lqt-reply-subpage: Part of the page title when a LiquidThread answer 
is given. Should probably be translated as a noun and not as a 
verb.\n\n{{Identical|Reply}},
lqt-pagechange-editformopen: Shown as a JavaScript confirmation 
dialog to the user when they try to leave the page while an LQT editing form is 
open.,
+   lqt-summary-sign-not-necessary: Message shown when Summary field has 
4 tildes.,
nstab-thread: Used as tab title of the Thread 
namespace.\n{{Identical|Thread}},
nstab-summary: Used as tab title for the Summary 
namespace.\n{{Identical|Summary}},
echo-pref-email-lqt-new-topic: Used by the Echo extension in the 
Preferences - Notifications tab as a label to enable email notification for 
the lqt-new-topic event.,
diff --git a/lqt.js b/lqt.js
index f5114c1..2a0a693 100644
--- a/lqt.js
+++ b/lqt.js
@@ -1110,8 +1110,13 @@
}
 
// Show the warning
-   var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 'lqt-sign-not-necessary' 
) ),
-   $weTop = $( this ).closest( '.lqt-edit-form' 
).find( '.wikiEditor-ui-top' );
+   var $weLqtSummaryTop = $( this ).closest( 
'.lqt-summarize-form' );
+   if ( $weLqtSummaryTop.length ) {
+var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 
'lqt-summary-sign-not-necessary' ) );
+   } else {
+var elem = $( 'div' ).attr( { 'id': 
'lqt-sign-warning', 'class': 'error' } ).text( mw.msg( 'lqt-sign-not-necessary' 
) );
+   }
+   var $weTop = $( this ).closest( '.lqt-edit-form' 
).find( '.wikiEditor-ui-top' );
 
if ( $weTop.length ) {
$weTop.before( elem );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e044d35f3dcdcd4d49dc8755f34d2bae44f030f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Phoenix303 divyalife...@gmail.com

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


[MediaWiki-commits] [Gerrit] Refactor code to be more modular - change (mediawiki...ImageMetrics)

2015-01-04 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Refactor code to be more modular
..

Refactor code to be more modular

Bug: T507
Change-Id: I414c0b51401597f8acfec472c030c6f2e7d8639f
---
M .jshintrc
M ImageMetrics.php
D resources/ext.imageMetrics.loader.js
R resources/head.js
A resources/loader.js
R resources/logger/LoadingTimeLogger.js
A resources/logger/Logger.js
R tests/qunit/logger/LoadingTimeLogger.test.js
8 files changed, 203 insertions(+), 141 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ImageMetrics 
refs/changes/62/182762/1

diff --git a/.jshintrc b/.jshintrc
index c6a531b..bda7504 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -22,10 +22,12 @@
 
predef: [
window,
+   document,
Geo,
QUnit,
jQuery,
mediaWiki,
-   mediaWikiLoadStart
+   mediaWikiLoadStart,
+   OO
]
 }
diff --git a/ImageMetrics.php b/ImageMetrics.php
index 2898b3e..637af71 100644
--- a/ImageMetrics.php
+++ b/ImageMetrics.php
@@ -38,21 +38,24 @@
 
 $wgResourceModules += array(
'ext.imageMetrics' = array(
-   'scripts'   = 'ext.imageMetrics.js',
+   'scripts'   = array(
+   'logger/Logger.js',
+   'logger/LoadingTimeLogger.js',
+   ),
'localBasePath' = __DIR__ . '/resources',
'remoteExtPath' = 'ImageMetrics/resources',
'dependencies'  = 'schema.ImageMetricsLoadingTime',
'targets'   = array( 'desktop', 'mobile' ),
),
'ext.imageMetrics.head' = array(
-   'scripts'   = 'ext.imageMetrics.head.js',
+   'scripts'   = 'head.js',
'localBasePath' = __DIR__ . '/resources',
'remoteExtPath' = 'ImageMetrics/resources',
'targets'   = array( 'desktop', 'mobile' ),
'position'  = 'top',
),
'ext.imageMetrics.loader' = array(
-   'scripts'   = 'ext.imageMetrics.loader.js',
+   'scripts'   = 'loader.js',
'localBasePath' = __DIR__ . '/resources',
'remoteExtPath' = 'ImageMetrics/resources',
'targets'   = array( 'desktop', 'mobile' ),
@@ -77,8 +80,12 @@
  */
 $wgHooks[ 'ResourceLoaderGetConfigVars' ][] = function ( $vars ) {
global $wgImageMetricsSamplingFactor, 
$wgImageMetricsLoggedinSamplingFactor;
-   $vars[ 'wgImageMetricsSamplingFactor' ] = $wgImageMetricsSamplingFactor;
-   $vars[ 'wgImageMetricsLoggedinSamplingFactor' ] = 
$wgImageMetricsLoggedinSamplingFactor;
+   $vars[ 'wgImageMetrics' ] = array(
+   'samplingFactor' = array(
+   'image' = $wgImageMetricsSamplingFactor,
+   'imageLoggedin' = 
$wgImageMetricsLoggedinSamplingFactor,
+   ),
+   );
return true;
 };
 
@@ -90,7 +97,7 @@
 $wgHooks['ResourceLoaderTestModules'][] = function ( array $testModules, 
ResourceLoader $resourceLoader ) {
$testModules['qunit']['ext.imageMetrics.tests'] = array(
'scripts' = array(
-   'tests/qunit/ext.imageMetrics.test.js',
+   'tests/qunit/logger/LoadingTimeLogger.test.js',
),
'dependencies' = array(
'ext.imageMetrics',
diff --git a/resources/ext.imageMetrics.loader.js 
b/resources/ext.imageMetrics.loader.js
deleted file mode 100644
index e6ae00c..000
--- a/resources/ext.imageMetrics.loader.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * JavaScript module for image-related metrics.
- * @see https://mediawiki.org/wiki/Extension:ImageMetrics
- *
- * @licence GNU GPL v2 or later
- * @author Tisza Gergő gti...@wikimedia.org
- */
-( function ( mw, $ ) {
-   'use strict';
-
-   var factor = mw.config.get( 'wgImageMetricsSamplingFactor', false ),
-   loggedinFactor = mw.config.get( 
'wgImageMetricsLoggedinSamplingFactor', false );
-
-   if ( !mw.user.isAnon()  loggedinFactor ) {
-   factor = loggedinFactor;
-   }
-
-   /**
-* Makes a random decision (based on the sampling factor configuration 
setting) whether the current
-* request should be logged.
-* @return {boolean}
-*/
-   function isInSample() {
-   if ( !$.isNumeric( factor ) || factor  1 ) {
-   return false;
-   }
-   return Math.floor( Math.random() * factor ) === 0;
-   }
-
-   if ( isInSample() ) {
-   mw.loader.using( 'ext.imageMetrics', function () {
-   mw.ImageMetrics.install( factor );
-   } );
-   }
-} ( mediaWiki, jQuery ) );
diff --git 

[MediaWiki-commits] [Gerrit] Enable CORS logging in ImageMetrics vagrant role - change (mediawiki/vagrant)

2015-01-04 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Enable CORS logging in ImageMetrics vagrant role
..

Enable CORS logging in ImageMetrics vagrant role

Bug: T507
Change-Id: I75ce67b8210fcfc87ef021d479d58eb4cad6f435
---
M puppet/modules/role/manifests/imagemetrics.pp
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/65/182765/1

diff --git a/puppet/modules/role/manifests/imagemetrics.pp 
b/puppet/modules/role/manifests/imagemetrics.pp
index 93da0a1..27aba77 100644
--- a/puppet/modules/role/manifests/imagemetrics.pp
+++ b/puppet/modules/role/manifests/imagemetrics.pp
@@ -7,6 +7,7 @@
 mediawiki::extension { 'ImageMetrics':
 settings = {
 wgImageMetricsSamplingFactor = 1,
+wgImageMetricsCorsSamplingFactor = 1,
 },
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75ce67b8210fcfc87ef021d479d58eb4cad6f435
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza gti...@wikimedia.org

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