[MediaWiki-commits] [Gerrit] integration/config[master]: Install xdebug for composer-package image

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

Change subject: Install xdebug for composer-package image
..


Install xdebug for composer-package image

This is needed for PHPUnit coverage reports. We install the module
but enable it in the base php image so that other images can enable
it as needed without needing to install it.

Change-Id: I7693255bbf4a2e4849b9bb905f6d1b2c98495611
---
M dockerfiles/composer-package/Dockerfile
M dockerfiles/composer-package/example-run.sh
M dockerfiles/composer/Dockerfile
M dockerfiles/php/Dockerfile
M jjb/mediawiki.yaml
M jjb/php.yaml
6 files changed, 18 insertions(+), 5 deletions(-)

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



diff --git a/dockerfiles/composer-package/Dockerfile 
b/dockerfiles/composer-package/Dockerfile
index 1af5c3e..a72a545 100644
--- a/dockerfiles/composer-package/Dockerfile
+++ b/dockerfiles/composer-package/Dockerfile
@@ -1,5 +1,9 @@
 FROM wmfreleng/composer:latest
 
+USER root
+# Enable xdebug for PHPUnit coverage reports
+RUN phpenmod xdebug
+
 USER nobody
 COPY run.sh /run.sh
 ENTRYPOINT /bin/bash /run.sh
diff --git a/dockerfiles/composer-package/example-run.sh 
b/dockerfiles/composer-package/example-run.sh
index 0eea69b..50b2ebf 100644
--- a/dockerfiles/composer-package/example-run.sh
+++ b/dockerfiles/composer-package/example-run.sh
@@ -1,7 +1,6 @@
 #!/bin/bash
 
 mkdir -m 777 -p log
-rm -rf src
 mkdir -m 777 -p src
 cd src
 git init
@@ -15,3 +14,5 @@
 --volume /$(pwd)/log://var/lib/jenkins/log \
 --volume /$(pwd)/src://src \
  wmfreleng/composer-package:latest
+rm -rf src
+rm -rf log
diff --git a/dockerfiles/composer/Dockerfile b/dockerfiles/composer/Dockerfile
index b323a3d..473d230 100644
--- a/dockerfiles/composer/Dockerfile
+++ b/dockerfiles/composer/Dockerfile
@@ -9,5 +9,10 @@
 RUN ln -s /srv/composer/vendor/bin/composer /usr/bin/composer
 
 USER nobody
+
+# If a later dockerfile enables xdebug, don't
+# spam warnings about it.
+ENV COMPOSER_DISABLE_XDEBUG_WARN=1
+
 ENTRYPOINT ["/srv/composer/vendor/bin/composer"]
 CMD ["help"]
diff --git a/dockerfiles/php/Dockerfile b/dockerfiles/php/Dockerfile
index b547e5f..8351109 100644
--- a/dockerfiles/php/Dockerfile
+++ b/dockerfiles/php/Dockerfile
@@ -6,9 +6,12 @@
 # Needed for composer to install things from dist
 php7.0-zip \
 # Needed by libraries/MediaWiki
-php-ast php7.0-curl php7.0-dba php7.0-mbstring php-redis php7.0-xml && 
\
+php-ast php7.0-curl php7.0-dba php7.0-mbstring php-redis php-xdebug 
php7.0-xml && \
 apt-get clean && rm -rf /var/lib/apt/lists/*
 
+# Disable xdebug by default due to its performance impact
+RUN phpdismod xdebug
+
 USER nobody
 
 ENTRYPOINT ["php"]
diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index c262506..d955f01 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -404,7 +404,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/mediawiki-phpcs:v2017.10.07.01.12'
+image: 'wmfreleng/mediawiki-phpcs:v2017.10.07.05.45'
 logdir: '/log'
 publishers:
  - checkstyle:
diff --git a/jjb/php.yaml b/jjb/php.yaml
index 1f46f85..23dba1b 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -141,7 +141,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-cache-src:
-image: 'wmfreleng/composer-package:v2017.10.07.01.12'
+image: 'wmfreleng/composer-package:v2017.10.07.05.45'
 logdir: '/log'
 
 - job:
@@ -158,7 +158,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/composer-test:v2017.10.07.01.12'
+image: 'wmfreleng/composer-test:v2017.10.07.05.45'
 logdir: '/log'
 
 # Couple jobs with a {name} prefix

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7693255bbf4a2e4849b9bb905f6d1b2c98495611
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Install xdebug for composer-package image

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

Change subject: Install xdebug for composer-package image
..

Install xdebug for composer-package image

This is needed for PHPUnit coverage reports. We install the module
but enable it in the base php image so that other images can enable
it as needed without needing to install it.

Change-Id: I7693255bbf4a2e4849b9bb905f6d1b2c98495611
---
M dockerfiles/composer-package/Dockerfile
M dockerfiles/composer-package/example-run.sh
M dockerfiles/composer/Dockerfile
M dockerfiles/php/Dockerfile
M jjb/mediawiki.yaml
M jjb/php.yaml
6 files changed, 18 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/39/382939/1

diff --git a/dockerfiles/composer-package/Dockerfile 
b/dockerfiles/composer-package/Dockerfile
index 1af5c3e..a72a545 100644
--- a/dockerfiles/composer-package/Dockerfile
+++ b/dockerfiles/composer-package/Dockerfile
@@ -1,5 +1,9 @@
 FROM wmfreleng/composer:latest
 
+USER root
+# Enable xdebug for PHPUnit coverage reports
+RUN phpenmod xdebug
+
 USER nobody
 COPY run.sh /run.sh
 ENTRYPOINT /bin/bash /run.sh
diff --git a/dockerfiles/composer-package/example-run.sh 
b/dockerfiles/composer-package/example-run.sh
index 0eea69b..50b2ebf 100644
--- a/dockerfiles/composer-package/example-run.sh
+++ b/dockerfiles/composer-package/example-run.sh
@@ -1,7 +1,6 @@
 #!/bin/bash
 
 mkdir -m 777 -p log
-rm -rf src
 mkdir -m 777 -p src
 cd src
 git init
@@ -15,3 +14,5 @@
 --volume /$(pwd)/log://var/lib/jenkins/log \
 --volume /$(pwd)/src://src \
  wmfreleng/composer-package:latest
+rm -rf src
+rm -rf log
diff --git a/dockerfiles/composer/Dockerfile b/dockerfiles/composer/Dockerfile
index b323a3d..473d230 100644
--- a/dockerfiles/composer/Dockerfile
+++ b/dockerfiles/composer/Dockerfile
@@ -9,5 +9,10 @@
 RUN ln -s /srv/composer/vendor/bin/composer /usr/bin/composer
 
 USER nobody
+
+# If a later dockerfile enables xdebug, don't
+# spam warnings about it.
+ENV COMPOSER_DISABLE_XDEBUG_WARN=1
+
 ENTRYPOINT ["/srv/composer/vendor/bin/composer"]
 CMD ["help"]
diff --git a/dockerfiles/php/Dockerfile b/dockerfiles/php/Dockerfile
index b547e5f..8351109 100644
--- a/dockerfiles/php/Dockerfile
+++ b/dockerfiles/php/Dockerfile
@@ -6,9 +6,12 @@
 # Needed for composer to install things from dist
 php7.0-zip \
 # Needed by libraries/MediaWiki
-php-ast php7.0-curl php7.0-dba php7.0-mbstring php-redis php7.0-xml && 
\
+php-ast php7.0-curl php7.0-dba php7.0-mbstring php-redis php-xdebug 
php7.0-xml && \
 apt-get clean && rm -rf /var/lib/apt/lists/*
 
+# Disable xdebug by default due to its performance impact
+RUN phpdismod xdebug
+
 USER nobody
 
 ENTRYPOINT ["php"]
diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index c262506..d955f01 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -404,7 +404,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/mediawiki-phpcs:v2017.10.07.01.12'
+image: 'wmfreleng/mediawiki-phpcs:v2017.10.07.05.45'
 logdir: '/log'
 publishers:
  - checkstyle:
diff --git a/jjb/php.yaml b/jjb/php.yaml
index 1f46f85..23dba1b 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -141,7 +141,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-cache-src:
-image: 'wmfreleng/composer-package:v2017.10.07.01.12'
+image: 'wmfreleng/composer-package:v2017.10.07.05.45'
 logdir: '/log'
 
 - job:
@@ -158,7 +158,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/composer-test:v2017.10.07.01.12'
+image: 'wmfreleng/composer-test:v2017.10.07.05.45'
 logdir: '/log'
 
 # Couple jobs with a {name} prefix

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: DO NOT COMMIT outreachy TASK#1 updated files

2017-10-06 Thread Sofmonk (Code Review)
Sofmonk has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382938 )

Change subject: DO NOT COMMIT outreachy TASK#1 updated files
..

DO NOT COMMIT outreachy TASK#1
updated files

Change-Id: I7c96d54c489fea7ba071ee8c987c95dc3ab832ee
---
M includes/specialpage/LoginSignupSpecialPage.php
M resources/Resources.php
A resources/src/mediawiki.special/mediawiki.special.mouse_position.js
D resources/src/mouse_position.js
4 files changed, 15 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/382938/1

diff --git a/includes/specialpage/LoginSignupSpecialPage.php 
b/includes/specialpage/LoginSignupSpecialPage.php
index 04d391b..ccd076d 100644
--- a/includes/specialpage/LoginSignupSpecialPage.php
+++ b/includes/specialpage/LoginSignupSpecialPage.php
@@ -543,7 +543,8 @@
 
// Additional styles and scripts for signup form
$out->addModules( [
-   'mediawiki.special.userlogin.signup.js'
+   'mediawiki.special.userlogin.signup.js',
+   'mediawiki.special.mouse_position.js'
] );
$out->addModuleStyles( [
'mediawiki.special.userlogin.signup.styles'
diff --git a/resources/Resources.php b/resources/Resources.php
index 6ec5f1d..896d98f 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -2856,6 +2856,6 @@
'themeImages' => 'icons-wikimedia',
],
'mouse_movement' =>[
-   'scripts' => 'resources/src/mouse_position.js'
+   'scripts' => 
'resources/src/mediawiki.special/mediawiki.special.mouse_position.js'
]
 ];
diff --git 
a/resources/src/mediawiki.special/mediawiki.special.mouse_position.js 
b/resources/src/mediawiki.special/mediawiki.special.mouse_position.js
new file mode 100644
index 000..36f191f
--- /dev/null
+++ b/resources/src/mediawiki.special/mediawiki.special.mouse_position.js
@@ -0,0 +1,12 @@
+( function ( mw, $ ) {
+   $( function () {
+   $( '#wpCreateaccount').click( function ( e_event ) {
+   var Coordinates = {
+   x: e_event.clientX,
+   y: e_event.clientY
+   };
+   mw.track( 'mediawiki.special.mouse_postion.js', 
Coordinates );
+   } );
+   } );
+}( mediawiki, jQuery ) );
+
diff --git a/resources/src/mouse_position.js b/resources/src/mouse_position.js
deleted file mode 100644
index 348caee..000
--- a/resources/src/mouse_position.js
+++ /dev/null
@@ -1,9 +0,0 @@
-
-(function (mw, $){
-   $( 'wpCreateaccount').click(function(event) {
-   var x = event.clientX;
-   var y = event.clientY;
-   mw.track('mouse_postion.js', Coordinates);
-   });
-}(mediawiki, jQuery));
-

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: HTMLForms: Reduce `padding` on top as heading `line-height p...

2017-10-06 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382937 )

Change subject: HTMLForms: Reduce `padding` on top as heading `line-height 
provides
..

HTMLForms: Reduce `padding` on top as heading `line-height provides

Reducing `padding` on top of `.mw-htmlform-ooui-wrapper`
as heading's `line-height provides similar distance.

Bug: T177668
Change-Id: Ieb4c0d1a08f9b7f3481a64ada1638c98f53bc90a
---
M resources/src/mediawiki/htmlform/ooui.styles.less
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/382937/1

diff --git a/resources/src/mediawiki/htmlform/ooui.styles.less 
b/resources/src/mediawiki/htmlform/ooui.styles.less
index 84d462e..1607489 100644
--- a/resources/src/mediawiki/htmlform/ooui.styles.less
+++ b/resources/src/mediawiki/htmlform/ooui.styles.less
@@ -1,4 +1,7 @@
 /* OOUIHTMLForm styles */
+.mw-htmlform-ooui-wrapper.oo-ui-panelLayout-padded {
+   padding: 1em 1.25em 1.25em;
+}
 
 .mw-htmlform-ooui {
line-height: 1.4; // Override MediaWiki's default of `1.6`

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...RegexBlock[master]: [DNM] Migrate logging to Special:Log/regexblock

2017-10-06 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382936 )

Change subject: [DNM] Migrate logging to Special:Log/regexblock
..

[DNM] Migrate logging to Special:Log/regexblock

Very early proof-of-concept. Needs some modification first
before this patch is ready to be merged. See below:

TODO:
 - Fully implement migrateLoggingData.php so that current data
   on wikis can migrate their logged data from Special:RegexBlock
   to Special:Log/regexblock
 - Fully implement Special:RegexBlockList so people can view
   currently active blocks made with regular expressions
 - Fix logging parameters
 - Add a logging message for an unblock

Bug: T152165
Change-Id: I8cf039a35e912481ea92bd3fc79e6c0489a7402f
---
M SpecialRegexBlock.php
A SpecialRegexBlockList.php
M extension.json
M i18n/en.json
M i18n/qqq.json
A migrateLoggingData.php
M regexblock.css
7 files changed, 59 insertions(+), 138 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RegexBlock 
refs/changes/36/382936/1

diff --git a/SpecialRegexBlock.php b/SpecialRegexBlock.php
index d757e9a..a25bf17 100644
--- a/SpecialRegexBlock.php
+++ b/SpecialRegexBlock.php
@@ -122,124 +122,6 @@
if ( $form->show() ) {
$this->onSuccess();
}
-   $this->showRegexList();
-   }
-   }
-
-   /**
-* Show the list of regex blocks - current and expired, along with some 
controls (unblock, statistics, etc.)
-*/
-   private function showRegexList() {
-   $out = $this->getOutput();
-
-   $action = htmlspecialchars( $this->getPageTitle()->getFullURL( 
$this->makeListUrlParams() ), ENT_QUOTES );
-
-   $regexData = new RegexBlockData();
-   $lang = $this->getLanguage();
-   $this->numResults = $regexData->fetchNbrResults();
-   $pager = $lang->viewPrevNext(
-   SpecialPage::getTitleFor( 'RegexBlock' ),
-   $this->mOffset,
-   $this->mLimit,
-   array(
-   'filter' => $this->mFilter,
-   'rfilter' => $this->mRegexFilter
-   ),
-   ( $this->numResults - $this->mOffset ) <= $this->mLimit
-   );
-
-   /* allow display by specific blockers only */
-   $blockers = $regexData->fetchBlockers();
-   $blocker_list = array();
-   if ( !empty( $blockers ) ) {
-   $blocker_list = $regexData->getBlockersData( 
$this->mFilter, $this->mRegexFilter, $this->mLimit, $this->mOffset );
-   }
-
-   /* make link to statistics */
-   $out->addHTML( '
-   ' . $this->msg( 'regexblock-currently-blocked' 
)->text() . '
-   ' . $pager . '
-   
-   ' . $this->msg( 'regexblock-view-blocked' 
)->text() . '
-   
-   ' . $this->msg( 
'regexblock-view-all' )->text() . ''
-   );
-
-   if ( is_array( $blockers ) ) {
-   foreach ( $blockers as $id => $blocker ) {
-   $sel = htmlspecialchars( ( $this->mFilter == 
$blocker ) ) ? ' selected="selected"' : '';
-   $out->addHTML( '' . htmlspecialchars( $blocker ) 
. '' );
-   }
-   }
-
-   $out->addHTML(
-   ' ' . $this->msg( 
'regexblock-regex-filter' )->text() . $this->msg( 'word-separator' )->text() .
-   Html::hidden( 'title', $this->getPageTitle() ) .
-   Html::input( 'rfilter', $this->mRegexFilter, 
'text', [ 'id' => 'regex_filter' ] ) .
-   '
-   
-   
-   ' .
-   Html::hidden( 'title', $this->getPageTitle() ) .
-   Html::hidden( 'action', 'stats' ) .
-   $this->msg( 'regexblock-view-block-id' 
)->text() .
-   $this->msg( 'word-separator' )->text() .
-   '
-   
-   '
-   );
-
-   if ( !empty( $blockers ) ) {
-   $out->addHTML( '' );
-   $loop = 0;
-   $comma = ' · '; // the spaces here are 
intentional
-   $dbr = wfGetDB( DB_REPLICA );
-   foreach ( $blocker_list as $id => $row ) {
-   $loop++;
-   $color_expire = '%s';
-  

[MediaWiki-commits] [Gerrit] oojs/ui[master]: WikimediaUI theme: Reduce Checkbox*- & RadioSelectInputWidge...

2017-10-06 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382935 )

Change subject: WikimediaUI theme: Reduce Checkbox*- & RadioSelectInputWidget 
vertical space
..

WikimediaUI theme: Reduce Checkbox*- & RadioSelectInputWidget vertical space

Reducing vertical space taken up by CheckboxMultiselectInputWidget &
RadioSelectInputWidget to be in on par with their JS siblings.

Bug: T177683
Change-Id: Ib00af2f05ba8e3a92c7343e00f5fc438bbb73531
---
M src/themes/wikimediaui/widgets.less
1 file changed, 6 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/35/382935/1

diff --git a/src/themes/wikimediaui/widgets.less 
b/src/themes/wikimediaui/widgets.less
index d4dfebb..754b4a7 100644
--- a/src/themes/wikimediaui/widgets.less
+++ b/src/themes/wikimediaui/widgets.less
@@ -454,14 +454,10 @@
 
 .theme-oo-ui-checkboxMultiselectInputWidget () {
.oo-ui-fieldLayout {
-   margin-top: 0;
+   margin-top: @padding-vertical-label; // 
`@padding-vertical-label` used as `margin-top` here
 
-   .oo-ui-fieldLayout-body {
-   padding: @padding-vertical-label 0;
-
-   .oo-ui-labelElement-label {
-   line-height: @line-height-input-binary-label;
-   }
+   .oo-ui-fieldLayout-body .oo-ui-labelElement-label {
+   line-height: @line-height-input-binary-label;
}
}
 }
@@ -1284,14 +1280,10 @@
 
 .theme-oo-ui-radioSelectInputWidget () {
.oo-ui-fieldLayout {
-   margin-top: 0;
+   margin-top: @padding-vertical-label; // 
`@padding-vertical-label` used as `margin-top` here
 
-   .oo-ui-fieldLayout-body {
-   padding: @padding-vertical-label 0;
-
-   .oo-ui-labelElement-label {
-   line-height: @line-height-input-binary-label;
-   }
+   .oo-ui-fieldLayout-body .oo-ui-labelElement-label {
+   line-height: @line-height-input-binary-label;
}
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add autopatrolled user group to sd.wikipedia

2017-10-06 Thread Jayprakash12345 (Code Review)
Jayprakash12345 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382934 )

Change subject: Add autopatrolled user group to sd.wikipedia
..

Add autopatrolled user group to sd.wikipedia

Change-Id: I536996e2f49a925b241948cef289eef0f2fe5c5b
---
M wmf-config/InitialiseSettings.php
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/34/382934/2

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index a116c45..2b6ac48 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -9276,6 +9276,9 @@
'autopatrolled' => [ 'autopatrol' => true, ],
'flood' => [ 'bot' => true, ], // T111753
],
+   '+sdwiki' => [
+   'autopatrolled' => [ 'autopatrol' => true ], // T177141
+   ],
'+sewikimedia' => [
'*' => [
'edit' => false,
@@ -10288,6 +10291,9 @@
'+scowiki' => [
'sysop' => [ 'rollbacker', 'autopatrolled', 'flood', ] // 
T111753
],
+   '+sdwiki' => [
+   'sysop' => [ 'autopatrolled' ], // T177141
+   ],
'+sewikimedia' => [
'bureaucrat' => [ 'medlem' ],
'sysop' => [ 'medlem' ],
@@ -11051,6 +11057,9 @@
'+scowiki' => [
'sysop' => [ 'rollbacker', 'autopatrolled', 'flood', ] // 
T111753
],
+   '+sdwiki' => [
+   'sysop' => [ 'autopatrolled' ], // T177141
+   ],
'+sewikimedia' => [
'bureaucrat' => [ 'sysop', 'bureaucrat', 'medlem' ],
],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I536996e2f49a925b241948cef289eef0f2fe5c5b
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jayprakash12345 <0freerunn...@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] operations/puppet[production]: ganglia: delete ganglia-web classes and role

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382932 )

Change subject: ganglia: delete ganglia-web classes and role
..

ganglia: delete ganglia-web classes and role

Bug: T177225
Change-Id: Ic0b0958cc1bb5966e56cee7198b17d8a8d573ae6
---
D modules/ganglia/manifests/web.pp
D modules/role/manifests/ganglia/views.pp
D modules/role/manifests/ganglia/web.pp
3 files changed, 0 insertions(+), 200 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/32/382932/1

diff --git a/modules/ganglia/manifests/web.pp b/modules/ganglia/manifests/web.pp
deleted file mode 100644
index 0cfa8ad..000
--- a/modules/ganglia/manifests/web.pp
+++ /dev/null
@@ -1,95 +0,0 @@
-# Class for the ganglia frontend machine
-class ganglia::web(
-$rrdcached_socket,
-$gmetad_root,
-$ensure='present',
-) {
-include ::apache
-include ::apache::mod::php5
-include ::apache::mod::ssl
-include ::apache::mod::rewrite
-include ::apache::mod::headers
-include ::apache::mod::authnz_ldap
-include ::passwords::ldap::production
-
-$ganglia_servername = 'ganglia.wikimedia.org'
-$ganglia_serveralias = 'uranium.wikimedia.org'
-$ganglia_webdir = '/usr/share/ganglia-webfrontend'
-$ganglia_ssl_cert = '/etc/acme/cert/ganglia.crt'
-$ganglia_ssl_chain = '/etc/acme/cert/ganglia.chain.crt'
-$ganglia_ssl_key = '/etc/acme/key/ganglia.key'
-$ssl_settings = ssl_ciphersuite('apache', 'mid', true)
-# Apache's docroot. Used for populating robots.txt
-$doc_root = '/var/www'
-
-package { [ 'php5-gd',
-'php5-mysql',
-'rrdtool',
-'librrds-perl',
-'ganglia-webfrontend',
-]:
-ensure => $ensure,
-}
-
-$proxypass = $passwords::ldap::production::proxypass
-
-apache::site { $ganglia_servername:
-content => template("ganglia/${ganglia_servername}.erb"),
-}
-
-file { '/var/cache/ganglia':
-ensure => ensure_directory($ensure),
-owner  => 'www-data',
-group  => 'www-data',
-mode   => '0755',
-}
-
-file { '/etc/ganglia-webfrontend/conf.php':
-ensure  => $ensure,
-mode=> '0444',
-owner   => 'root',
-group   => 'root',
-content => template('ganglia/conf_production.php.erb'),
-require => Package['ganglia-webfrontend'],
-}
-
-file { "${doc_root}/robots.txt":
-ensure  => $ensure,
-mode=> '0444',
-owner   => 'root',
-group   => 'root',
-source  => 'puppet:///modules/ganglia/robots.txt',
-require => Package['ganglia-webfrontend'],
-}
-
-# Increase the default memory limit
-file_line { 'php.ini-memory':
-line   => 'memory_limit = 768M',
-match  => '^memory_limit\s*=',
-path   => '/etc/php5/apache2/php.ini',
-notify => Class['::apache'],
-}
-file_line { 'php.ini-opcache':
-line   => 'opcache.enable=1',
-path   => '/etc/php5/apache2/php.ini',
-notify => Class['::apache'],
-}
-
-# clean up after ganglia T97637
-tidy { 'cleanup_tmp_ganglia_graph':
-path=> '/tmp',
-age => '1w',
-recurse => true,
-matches => ['ganglia-graph*'],
-type=> 'mtime',
-}
-
-file { "${ganglia_webdir}/templates/default/user_header.tpl":
-ensure  => $ensure,
-mode=> '0444',
-owner   => 'root',
-group   => 'root',
-source  => 'puppet:///modules/ganglia/user_header.tpl',
-require => Package['ganglia-webfrontend'],
-}
-}
diff --git a/modules/role/manifests/ganglia/views.pp 
b/modules/role/manifests/ganglia/views.pp
deleted file mode 100644
index 02068d6..000
--- a/modules/role/manifests/ganglia/views.pp
+++ /dev/null
@@ -1,3 +0,0 @@
-class role::ganglia::views {
-include ganglia::views::dns
-}
diff --git a/modules/role/manifests/ganglia/web.pp 
b/modules/role/manifests/ganglia/web.pp
deleted file mode 100644
index 76db02e..000
--- a/modules/role/manifests/ganglia/web.pp
+++ /dev/null
@@ -1,102 +0,0 @@
-# A role that includes all the needed stuff to run a ganglia web frontend
-class role::ganglia::web {
-include ::base::firewall
-include ::standard
-include role::ganglia::config
-include role::ganglia::views
-
-letsencrypt::cert::integrated { 'ganglia':
-subjects   => 'ganglia.wikimedia.org',
-puppet_svc => 'apache2',
-system_svc => 'apache2',
-require=> Class['apache::mod::ssl']
-}
-
-monitoring::service { 'https':
-description   => 'HTTPS',
-check_command => 'check_ssl_http_letsencrypt!ganglia.wikimedia.org',
-}
-
-$gmetad_root = '/srv/ganglia'
-$rrd_rootdir = "${gmetad_root}/rrds"
-$gmetad_socket = '/va

[MediaWiki-commits] [Gerrit] operations/puppet[production]: hiera/wmflib: drop ganglia_clusters variable entirely?

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382931 )

Change subject: hiera/wmflib: drop ganglia_clusters variable entirely?
..

hiera/wmflib: drop ganglia_clusters variable entirely?

Bug: T177225
Change-Id: I33a999acf54b598d33dcbe9ecb3340b0ffccae64
---
M hieradata/common.yaml
M modules/wmflib/lib/puppet/parser/functions/get_clusters.rb
2 files changed, 2 insertions(+), 287 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/31/382931/1

diff --git a/hieradata/common.yaml b/hieradata/common.yaml
index aef82bc..dd7164a 100644
--- a/hieradata/common.yaml
+++ b/hieradata/common.yaml
@@ -8,292 +8,6 @@
 # Main statsd instance
 statsd: statsd.eqiad.wmnet:8125
 
-# NOTE: Do *not* add new clusters *per site* anymore,
-# the site name will automatically be appended now,
-# and a different IP prefix will be used.
-ganglia_clusters:
-  decommissioned:
-description: "Decommissioned servers"
-id: 1
-sites: {}
-  lvs:
-description: "LVS loadbalancers"
-id: 2
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  ulsfo: []
-  puppet:
-description: "Puppetmasters"
-id: 3
-sites:
-  eqiad: []
-  codfw: []
-  search:
-description: "Search"
-id: 4
-sites: {}
-  mysql:
-description: "MySQL"
-id: 5
-sites:
-  eqiad: []
-  codfw: []
-  etcd:
-description: "Etcd"
-id: 6
-sites:
-  eqiad: []
-  codfw: []
-  eventbus:
-description: "Eventbus"
-id: 7
-sites:
-  eqiad: []
-  misc:
-description: "Miscellaneous"
-id: 8
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  kubernetes:
-description: "Kubernetes"
-id: 9
-sites:
-  eqiad: []
-  codfw: []
-  appserver:
-description: "Application servers"
-id: 11
-sites:
-  eqiad: []
-  codfw: []
-  imagescaler:
-description: "Image scalers"
-id: 12
-sites:
-  eqiad: []
-  codfw: []
-  api_appserver:
-description: "API application servers"
-id: 13
-sites:
-  eqiad: []
-  codfw: []
-  pdf:
-description: "PDF servers"
-id: 15
-sites:
-  eqiad: []
-  cache_text:
-description: "Text caches"
-id: 20
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  ulsfo: []
-  cache_canary:
-description: "Canary caches"
-id: 21
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  ulsfo: []
-  cache_upload:
-description: "Upload caches"
-id: 22
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  ulsfo: []
-  payments:
-description: "Fundraiser payments"
-id: 23
-sites: {}
-  ssl:
-description: "SSL cluster"
-id: 26
-sites: {}
-  swift:
-description: "Swift"
-id: 27
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  labvirt:
-description: "Labs virt hosts"
-id: 29
-sites:
-  eqiad: []
-  labs:
-description: "Labs services"
-id: 30
-sites:
-  eqiad: []
-  jobrunner:
-description: "Jobrunners"
-id: 31
-sites:
-  eqiad: []
-  codfw: []
-  analytics:
-description: "Analytics cluster"
-id: 32
-sites:
-  eqiad: []
-  memcached:
-description: "Memcached"
-id: 33
-sites:
-  eqiad: []
-  codfw: []
-  videoscaler:
-description: "Video scalers"
-id: 34
-sites:
-  eqiad: []
-  codfw: []
-  fundraising:
-description: "Fundraising"
-id: 35
-sites:
-  eqiad:
-- pay-lvs1001.frack.eqiad.wmnet
-- pay-lvs1002.frack.eqiad.wmnet
-  ceph:   # Not used anymore
-description: "Ceph"
-id: 36
-sites: {}
-  parsoid:
-description: "Parsoid"
-id: 37
-sites:
-  eqiad: []
-  codfw: []
-  redis:
-description: "Redis"
-id: 39
-sites:
-  eqiad: []
-  codfw: []
-  labsnfs:
-description: "Labs NFS cluster"
-id: 40
-sites:
-  eqiad: []
-  codfw: []
-  cache_misc:
-description: "Misc Web caching cluster"
-id: 41
-sites:
-  eqiad: []
-  codfw: []
-  esams: []
-  elasticsearch:
-description: "Elasticsearch cluster"
-id: 42
-sites:
-  eqiad: []
-  codfw: []
-  logstash:
-description: "Logstash cluster"
-id: 43
-sites:
-  eqiad: []
-  analytics_kafka:
-description: "Analytics Kafka cluster"
-id: 45
-sites:
-  eqiad: []
-  sca:
-description: "Service Cluster A"
-id: 46
-sites:
-  eqiad: []
-  codfw: []
-  restbase:
-description: "Restbase"
-id: 48
-sites:
-  eqiad: []
-  codfw: []
-  wdqs:
-description: "Wikidata Query Service"
-id: 49
-sites:
-  eqiad: []
-  maps:
-description: "Maps Cluster"
-id: 50
-sites:
-  eqiad: []
-  codfw: []
-  ganeti:
-description: "Ganeti Virt cluster"
-id: 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: pybal: support RunCommand everywhere, not just appservers?

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382930 )

Change subject: pybal: support RunCommand everywhere, not just appservers?
..

pybal: support RunCommand everywhere, not just appservers?

This is part of removing Ganglia support globally,
so it was found because it's using ganglia_clusters.

This is an open question from me for now, how can we
replace that separation between appserver or not without
Ganglia?

Or, as i am doing here, would it be ok if we simply
add the RunCommand monitor everywhere, regardless of that?

Bug: T177225
Change-Id: I78475d5129258f51f90da8ce42f91d35180bc461
---
M modules/profile/manifests/pybal.pp
1 file changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/modules/profile/manifests/pybal.pp 
b/modules/profile/manifests/pybal.pp
index 06177c7..e8bb2e0 100644
--- a/modules/profile/manifests/pybal.pp
+++ b/modules/profile/manifests/pybal.pp
@@ -6,7 +6,6 @@
 $conftool_prefix = hiera('conftool_prefix'),
 $config_source = hiera('profile::pybal::config_source'),
 $config_host = hiera('profile::pybal::config_host'),
-$ganglia_clusters = hiera('ganglia_clusters'),
 ) {
 
 requires_os('debian >= jessie')
@@ -56,8 +55,5 @@
 class { '::pybal::monitoring': }
 
 # Sites with MediaWiki appservers need runcommand
-if $::site in keys($ganglia_clusters['appserver']['sites']) {
-class { '::lvs::balancer::runcommand': }
-}
-
+class { '::lvs::balancer::runcommand': }
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: dnsrecursor: drop ganglia metrics support

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382929 )

Change subject: dnsrecursor: drop ganglia metrics support
..

dnsrecursor: drop ganglia metrics support

Bug: T177225
Change-Id: I1cc7367b4ad6bf337ac5f102ac74c9b763ce7909
---
D modules/dnsrecursor/files/pdns_gmetric
M modules/dnsrecursor/manifests/init.pp
D modules/dnsrecursor/manifests/metrics.pp
3 files changed, 0 insertions(+), 238 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/29/382929/1

diff --git a/modules/dnsrecursor/files/pdns_gmetric 
b/modules/dnsrecursor/files/pdns_gmetric
deleted file mode 100755
index 9f0a305..000
--- a/modules/dnsrecursor/files/pdns_gmetric
+++ /dev/null
@@ -1,221 +0,0 @@
-#!/usr/bin/env python
-#
-# pdns gmetric wrapper for Ganglia
-# written using gmetric instead of the python modules because rec_control 
requires root privs
-#
-# Copyright (C) Wikimedia Foundation
-#
-# Released under the GPLv2 or later
-#
-# Ben Hartshorne 
-# 2012-05-18
-
-## all pdns metrics:
-# all-outqueries  counts the number of outgoing UDP queries since starting
-# answers0-1  counts the number of queries answered within 1 
millisecond
-# answers100-1000 counts the number of queries answered within 1 second
-# answers10-100   counts the number of queries answered within 100 
milliseconds
-# answers1-10 counts the number of queries answered within 10 
milliseconds
-# answers-slowcounts the number of queries answered after 1 second
-# cache-bytes Size of the cache in bytes (since 3.3.1)
-# cache-entries   shows the number of entries in the cache
-# cache-hits  counts the number of cache hits since starting
-# cache-missescounts the number of cache misses since starting
-# chain-resends   number of queries chained to existing outstanding query
-# client-parse-errors counts number of client packets that could not be parsed
-# concurrent-queries  shows the number of MThreads currently running
-# dlg-only-drops  number of records dropped because of delegation only 
setting
-# dont-outqueries number of outgoing queries dropped because of 
'dont-query' setting (since 3.3)
-# ipv6-outqueries number of outgoing queries over IPv6
-# max-mthread-stack   maximum amount of thread stack ever used
-# negcache-entriesshows the number of entries in the Negative answer cache
-# noerror-answers counts the number of times it answered NOERROR since 
starting
-# nsspeeds-entriesshows the number of entries in the NS speeds map
-# nsset-invalidations number of times an nsset was dropped because it no 
longer worked
-# nxdomain-answerscounts the number of times it answered NXDOMAIN since 
starting
-# outgoing-timeouts   counts the number of timeouts on outgoing UDP queries 
since starting
-# over-capacity-drops Questions dropped because over maximum concurrent query 
limit (since 3.2)
-# packetcache-bytes   Size of the packet cache in bytes (since 3.3.1)
-# packetcache-entries Size of packet cache (since 3.2)
-# packetcache-hitsPacket cache hits (since 3.2)
-# packetcache-misses  Packet cache misses (since 3.2)
-# qa-latency  shows the current latency average, in microseconds
-# questions   counts all End-user initiated queries with the RD bit set
-# resource-limits counts number of queries that could not be performed 
because of resource limits
-# server-parse-errors counts number of server replied packets that could not 
be parsed
-# servfail-answerscounts the number of times it answered SERVFAIL since 
starting
-# spoof-prevents  number of times PowerDNS considered itself spoofed, and 
dropped the data
-# sys-msecnumber of CPU milliseconds spent in 'system' mode
-# tcp-client-overflow number of times an IP address was denied TCP access 
because it already had too many connections
-# tcp-outqueries  counts the number of outgoing TCP queries since starting
-# tcp-questions   counts all incoming TCP queries (since starting)
-# throttled-out   counts the number of throttled outgoing UDP queries 
since starting
-# throttle-entriesshows the number of entries in the throttle map
-# unauthorized-tcpnumber of TCP questions denied because of allow-from 
restrictions
-# unauthorized-udpnumber of UDP questions denied because of allow-from 
restrictions
-# unexpected-packets  number of answers from remote servers that were 
unexpected (might point to spoofing)
-# uptime  number of seconds process has been running (since 3.1.5)
-# user-msec   number of CPU milliseconds spent in 'user' mode
-
-import subprocess, time, os, pwd, re
-
-# set this to the user as which ganglia runs
-GANGLIA_USER = 'nobody'
-# set the location where this script will store its state file
-STATEDIR = '/var/lib/ganglia/'
-STATEFILE = 'pdns_gmetric.state'
-
-COUNTMETRICS = ['answ

[MediaWiki-commits] [Gerrit] mediawiki...RegexBlock[master]: Separate hooks into their own files

2017-10-06 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382928 )

Change subject: Separate hooks into their own files
..

Separate hooks into their own files

Change-Id: If174570d8937f34f2512d1da368554dc6557d3c2
---
M RegexBlockCore.php
A RegexBlockHooks.php
M extension.json
3 files changed, 83 insertions(+), 84 deletions(-)


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

diff --git a/RegexBlockCore.php b/RegexBlockCore.php
index 238e5bc..cf735c9 100644
--- a/RegexBlockCore.php
+++ b/RegexBlockCore.php
@@ -19,44 +19,6 @@
 class RegexBlock {
 
/**
-* Prepare data by getting blockers
-*
-* @param User $current_user Current user
-* @return bool
-*/
-   public static function check( $current_user ) {
-   global $wgRequest;
-
-   if ( $current_user->isAllowed( 'regexblock-exempt' ) ) {
-   // Users with superhuman powers (staff) should not be 
blocked in any case
-   return true;
-   }
-
-   // sanitizeIP() check is needed for IPv6 -- upon saving a 
RegexBlock,
-   // IPv6 IPs like ::1 (localhost) are expanded to 
0:0:0:0:0:0:0:1, but
-   // $wgRequest->getIP() contains just "::1" so the checks fail 
and
-   // blocked IPv6 IPs would still be able to edit
-   $ip_to_check = IP::sanitizeIP( $wgRequest->getIP() );
-
-   /* First check cache */
-   $blocked = self::isBlockedCheck( $current_user, $ip_to_check );
-   if ( $blocked ) {
-   return true;
-   }
-
-   $blockers_array = self::getBlockers();
-   $block_data = self::getBlockData( $current_user, 
$blockers_array );
-
-   /* check user for each blocker */
-   foreach ( $blockers_array as $blocker ) {
-   $blocker_block_data = isset( $block_data[$blocker] ) ? 
$block_data[$blocker] : null;
-   self::blocked( $blocker, $blocker_block_data, 
$current_user, $ip_to_check );
-   }
-
-   return true;
-   }
-
-   /**
 * Get a database object
 *
 * @param int Either DB_REPLICA (for reads) or DB_MASTER (for writes)
@@ -604,39 +566,4 @@
self::getBlockData( $wgUser, $blockers_array, $readMaster );
}
 
-   /**
-* Add a link to Special:RegexBlock on Special:Contributions/USERNAME
-* pages if the user has 'regexblock' permission
-*
-* @param int $id
-* @param Title $nt
-* @param array $links Other existing contributions links
-* @return bool
-*/
-   public static function loadContribsLink( $id, $nt, &$links ) {
-   global $wgUser;
-   if ( $wgUser->isAllowed( 'regexblock' ) ) {
-   $links[] = Linker::linkKnown(
-   SpecialPage::getTitleFor( 'RegexBlock' ),
-   wfMessage( 'regexblock-link' )->escaped(),
-   array(),
-   array( 'wpTarget' => $nt->getText() )
-   );
-   }
-   return true;
-   }
-
-   /**
-* Creates the necessary database tables when the user runs
-* maintenance/update.php.
-*
-* @param DatabaseUpdater $updater
-* @return bool
-*/
-   public static function onLoadExtensionSchemaUpdates( $updater ) {
-   $file = __DIR__ . '/regexblock_schema.sql';
-   $updater->addExtensionUpdate( array( 'addTable', 'blockedby', 
$file, true ) );
-   $updater->addExtensionUpdate( array( 'addTable', 
'stats_blockedby', $file, true ) );
-   return true;
-   }
 }
\ No newline at end of file
diff --git a/RegexBlockHooks.php b/RegexBlockHooks.php
new file mode 100644
index 000..87effba
--- /dev/null
+++ b/RegexBlockHooks.php
@@ -0,0 +1,77 @@
+isAllowed( 'regexblock-exempt' ) ) {
+   // Users with superhuman powers (staff) should not be 
blocked in any case
+   return true;
+   }
+
+   // sanitizeIP() check is needed for IPv6 -- upon saving a 
RegexBlock,
+   // IPv6 IPs like ::1 (localhost) are expanded to 
0:0:0:0:0:0:0:1, but
+   // $wgRequest->getIP() contains just "::1" so the checks fail 
and
+   // blocked IPv6 IPs would still be able to edit
+   $ip_to_check = IP::sanitizeIP( $wgRequest->getIP() );
+
+   /* First check cache */
+   $blocked = RegexBlock::isBlockedCheck( $current_user, 
$ip_to_check );
+   if ( $blocked ) {
+   return true;
+   }
+
+  

[MediaWiki-commits] [Gerrit] operations/puppet[production]: elasticsearch/logstash: drop ganglia monitoring

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382927 )

Change subject: elasticsearch/logstash: drop ganglia monitoring
..

elasticsearch/logstash: drop ganglia monitoring

Bug: T177225
Change-Id: I7c59c9da1b36c23045b8dafe7d72ffc6ceb983bb
---
D modules/elasticsearch/files/ganglia/elasticsearch.pyconf
D modules/elasticsearch/files/ganglia/elasticsearch_monitoring.py
D modules/elasticsearch/manifests/ganglia.pp
M modules/role/manifests/logstash/elasticsearch.pp
4 files changed, 0 insertions(+), 644 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/382927/1

diff --git a/modules/elasticsearch/files/ganglia/elasticsearch.pyconf 
b/modules/elasticsearch/files/ganglia/elasticsearch.pyconf
deleted file mode 100644
index 7e99924..000
--- a/modules/elasticsearch/files/ganglia/elasticsearch.pyconf
+++ /dev/null
@@ -1,24 +0,0 @@
-modules {
-  module {
-name = "elasticsearch_monitoring"
-language = "python"
-
-param metric_group {
-  value = "elasticsearch"
-}
-
-param host {
-value = "http://localhost:9200/";
-}
-  }
-}
-
-collection_group {
-  collect_every = 10
-  time_threshold = 10
-
-  metric {
-name_match = "es_(.+)"
-  }
-}
-
diff --git a/modules/elasticsearch/files/ganglia/elasticsearch_monitoring.py 
b/modules/elasticsearch/files/ganglia/elasticsearch_monitoring.py
deleted file mode 100644
index 88bf6ac..000
--- a/modules/elasticsearch/files/ganglia/elasticsearch_monitoring.py
+++ /dev/null
@@ -1,600 +0,0 @@
-#! /usr/bin/python
-
-"""
-Elasticsearch ganglia monitoring originally from
-https://github.com/ganglia/gmond_python_modules/tree/master/elasticsearch
-and heavily hacked.
-"""
-
-try:
-import simplejson as json
-assert json  # silence pyflakes
-except ImportError:
-import json
-
-import socket
-import threading
-import time
-import urllib2
-from Queue import Queue
-from functools import partial
-
-URLOPEN_TIMEOUT = 4
-
-
-# Used to merge stat descriptions
-def merge(skel, stat):
-d = skel.copy()
-d.update(stat)
-return d
-
-
-# Maximum time to server stale stats
-LAST_FETCH_THRESHOLD = 600
-
-# Stat types
-GAUGE = {
-'slope': 'both',
-}
-BYTES_GAUGE = merge(GAUGE, {
-'units': 'bytes'
-})
-
-COUNTER = {
-'slope': 'positive',
-}
-TIME = merge(COUNTER, {
-'units': 'ms/sec',
-})
-BYTES = merge(COUNTER, {
-'units': 'bytes/sec',
-})
-
-
-# Stats to be collected
-main_stats = dict()
-# CACHE
-main_stats['es_filter_cache_size'] = merge(BYTES_GAUGE, {
-'path': 'indices.filter_cache.memory_size_in_bytes',
-'description': 'Filter Cache Size'
-})
-main_stats['es_filter_cache_evictions'] = merge(COUNTER, {
-'path': 'indices.filter_cache.evictions',
-'description': 'Filter Cache Evictions/sec',
-})
-main_stats['es_id_cache_size'] = merge(BYTES_GAUGE, {
-'path': 'indices.id_cache.memory_size_in_bytes',
-'description': 'Id Cache Size',
-})
-main_stats['es_fielddata_cache_size'] = merge(BYTES_GAUGE, {
-'path': 'indices.fielddata.memory_size_in_bytes',
-'description': 'Field Data Cache Size'
-})
-main_stats['es_fielddata_cache_evictions'] = merge(COUNTER, {
-'path': 'indices.fielddata.evictions',
-'units': 'evictions/sec',
-'description': 'Field Data Cache Evictions/sec',
-})
-
-# DOCS
-main_stats['es_docs_count'] = merge(GAUGE, {
-'path': 'indices.docs.count',
-'units': 'docs',
-'description': 'Documents',
-})
-main_stats['es_docs_deleted'] = merge(GAUGE, {
-'path': 'indices.docs.deleted',
-'units': 'docs',
-'description': 'Deleted Documents',
-})
-
-# FLUSH
-main_stats['es_flushes'] = merge(COUNTER, {
-'path': 'indices.flush.total',
-'units': 'flushes',
-'description': 'Flushes/sec',
-})
-main_stats['es_flush_time'] = merge(TIME, {
-'path': 'indices.flush.total_time_in_millis',
-'description': 'Flush Time/sec'
-})
-
-# GET
-main_stats['es_gets'] = merge(COUNTER, {
-'path': 'indices.get.total',
-'units': 'gets/sec',
-'description': 'Gets/sec',
-})
-main_stats['es_get_time'] = merge(TIME, {
-'path': 'indices.get.time_in_millis',
-'description': 'Get Time/sec'
-})
-main_stats['es_gets_exists'] = merge(COUNTER, {
-'path': 'indices.get.exists_total',
-'units': 'get/sec',
-'description': 'Get (exists)/sec',
-})
-main_stats['es_get_exists_time'] = merge(TIME, {
-'path': 'indices.get.exists_time_in_millis',
-'description': 'Get (exists) Time/sec'
-})
-main_stats['es_gets_missing'] = merge(COUNTER, {
-'path': 'indices.get.missing_total',
-'units': 'get/sec',
-'description': 'Gets (missing)/sec',
-})
-main_stats['es_get_missing_time'] = merge(TIME, {
-'path': 'indices.get.missing_time_in_millis',
-'description': 'Gets (missing) Time/sec'
-})
-
-# INDEXING
-main_stats['es_deletes'] = merge(COUNTER, {
-'path': 'indices.indexing.delete_total',
-'

[MediaWiki-commits] [Gerrit] operations/puppet[production]: standard: actually drop 'has_ganglia' param entirely

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382926 )

Change subject: standard: actually drop 'has_ganglia' param entirely
..

standard: actually drop 'has_ganglia' param entirely

Bug: T177225
Change-Id: I5c57620b998e2b262f13c97274a1ccb2b74c67f7
---
M hieradata/labs.yaml
M modules/standard/manifests/init.pp
2 files changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/26/382926/1

diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index fed4f4a..06e628c 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -1,7 +1,6 @@
 # General variables that once would have been in realm.pp
 realm: labs
 datacenters: [eqiad]
-standard::has_ganglia: false
 has_nrpe: false
 discovery::app_routes:
   mediawiki: "%{::site}"
diff --git a/modules/standard/manifests/init.pp 
b/modules/standard/manifests/init.pp
index 5bcd948..1e47393 100644
--- a/modules/standard/manifests/init.pp
+++ b/modules/standard/manifests/init.pp
@@ -4,7 +4,6 @@
 class standard(
 $has_default_mail_relay = true,
 $has_admin = true,
-$has_ganglia = true,
 ) {
 include ::profile::base
 include ::standard::ntp
@@ -23,8 +22,6 @@
 
 include ::standard::diamond
 include ::standard::prometheus
-
-include ::ganglia::monitor::decommission
 
 # Some instances have their own exim definition that
 # will conflict with this

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Get rid of $IP in Command

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

Change subject: Get rid of $IP in Command
..

Get rid of $IP in Command

Change-Id: Iccfe1b79963462f9cad80ff327ccd574ee1122c5
---
M includes/shell/Command.php
R includes/shell/limit.sh
2 files changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/includes/shell/Command.php b/includes/shell/Command.php
index fd8f6a0..cefe573 100644
--- a/includes/shell/Command.php
+++ b/includes/shell/Command.php
@@ -199,8 +199,6 @@
 * @throws ShellDisabledError
 */
public function execute() {
-   global $IP;
-
$this->everExecuted = true;
 
$profileMethod = $this->method ?: wfGetCaller();
@@ -235,7 +233,7 @@
$filesize = intval( $this->limits['filesize'] );
 
if ( $time > 0 || $mem > 0 || $filesize > 0 || 
$wallTime > 0 ) {
-   $cmd = '/bin/bash ' . escapeshellarg( 
"$IP/includes/limit.sh" ) . ' ' .
+   $cmd = '/bin/bash ' . escapeshellarg( __DIR__ . 
'/limit.sh' ) . ' ' .
   escapeshellarg( $cmd ) . ' ' .
   escapeshellarg(
   "MW_INCLUDE_STDERR=" . ( 
$this->useStderr ? '1' : '' ) . ';' .
diff --git a/includes/limit.sh b/includes/shell/limit.sh
similarity index 100%
rename from includes/limit.sh
rename to includes/shell/limit.sh

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: standard: decom ganglia plugin everywhere by default

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382924 )

Change subject: standard: decom ganglia plugin everywhere by default
..

standard: decom ganglia plugin everywhere by default

Bug: T177225
Change-Id: Idcafe53ffde5e3000f68789532c633820b1ffb1b
---
M modules/standard/manifests/init.pp
1 file changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/modules/standard/manifests/init.pp 
b/modules/standard/manifests/init.pp
index 17fcbe6..5bcd948 100644
--- a/modules/standard/manifests/init.pp
+++ b/modules/standard/manifests/init.pp
@@ -24,11 +24,7 @@
 include ::standard::diamond
 include ::standard::prometheus
 
-if $has_ganglia {
-include ::ganglia
-} else {
-include ::ganglia::monitor::decommission
-}
+include ::ganglia::monitor::decommission
 
 # Some instances have their own exim definition that
 # will conflict with this

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: statsd: remove ganglia backend support

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382923 )

Change subject: statsd: remove ganglia backend support
..

statsd: remove ganglia backend support

Bug: T177225
Change-Id: I6fad8663e6048a2c761b59f19be07ad65f426e44
---
D modules/statsd/files/backends/ganglia.js
M modules/statsd/manifests/init.pp
2 files changed, 0 insertions(+), 346 deletions(-)


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

diff --git a/modules/statsd/files/backends/ganglia.js 
b/modules/statsd/files/backends/ganglia.js
deleted file mode 100644
index e06dfd7..000
--- a/modules/statsd/files/backends/ganglia.js
+++ /dev/null
@@ -1,341 +0,0 @@
-/**
- * Ganglia backend for StatsD
- * Author: Ori Livneh
- * Copyright (c) 2013 Wikimedia Foundation 
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Ganglia-specific settings (for /etc/statsd/localConfig.js):
- *
- * {
- *   "gangliaHost": "localhost",// Hostname of Ganglia server
- *   "gangliaPort": 8649,   // UDP port of Ganglia server
- *   "gangliaMulticast": false, // Use multicast?
- *   "gangliaSpoofHost": "slave",   // Associate metrics w/this hostname
- *   "gangliaGroup": "statsd",  // Default metric group name
- *   "gangliaFilters": [],  // Array of module paths (see below)
- *   "sendMetadataInterval": 6, // Same as send_metadata_interval
- * }
- *
- * Metric filters
- *
- * If you want to choose which metrics get sent to Ganglia, you may set
- * the "gangliaFilters" configuration to an array of module paths.
- * Each module should export a "filter" function which takes a metric
- * object. The function may modify the metric object or return false to
- * exclude it from Ganglia reporting. For example:
- *
- *   exports.filter = function ( metric ) {
- * // Exclude counters from Ganglia reporting.
- * return /count/.test( metric.name ) ? false : metric;
- *   };
- *
- */
-
-function Xdr( bufSize ) {
-this.b = new Buffer( bufSize );
-this.b.fill( 0 );
-this.ptr = 0;
-}
-
-Xdr.prototype.pack = function ( type, value ) {
-switch ( type ) {
-case 'int':
-this.b.writeInt32BE( value, this.ptr );
-this.ptr += 4;
-break;
-case 'string':
-this.pack( 'int', value.length );
-this.b.write( value, this.ptr );
-this.ptr += ( ( Buffer.byteLength( value ) + 3 ) & ~0x03 );
-break;
-case 'boolean':
-this.pack( 'int', value ? 1 : 0 );
-break;
-}
-};
-
-Xdr.prototype.getBytes = function () {
-return this.b.slice( 0, this.ptr );
-};
-
-Xdr.meta = function ( metric ) {
-var xdr = new Xdr( 1024 );
-
-xdr.pack( 'int', 128 );
-xdr.pack( 'string', metric.hostname );
-xdr.pack( 'string', metric.name );
-xdr.pack( 'boolean', metric.spoof );
-xdr.pack( 'string', metric.type );
-xdr.pack( 'string', metric.name );
-xdr.pack( 'string', metric.units );
-xdr.pack( 'int', metric.slope );
-xdr.pack( 'int', metric.tmax );
-xdr.pack( 'int', metric.dmax );
-xdr.pack( 'int', 1 );
-xdr.pack( 'string', 'GROUP' );
-xdr.pack( 'string', metric.group );
-return xdr.getBytes();
-};
-
-Xdr.data = function ( metric ) {
-var xdr = new Xdr( 512 );
-
-xdr.pack( 'int', 133 );
-xdr.pack( 'string', metric.hostname );
-xdr.pack( 'string', metric.name );
-xdr.pack( 'boolean', metric.spoof );
-xdr.pack( 'string', '%s' );
-xdr.pack( 'string', metric.value.toString() );
-return xdr.getBytes();
-};
-
-function logSocketError( err, bytes ) {
-if ( err ) console.log( err );
-}
-
-function add( a, b ) {
-return a + b;
-}
-
-function sub( a, b ) {
-return a - b;
-}
-
-function summarize( ar ) {
-var n = ar.length,
-mid = Math.floor( n / 2 );
-
-if ( !n ) return false;
-
-ar.sort( sub );
-retu

[MediaWiki-commits] [Gerrit] operations/puppet[production]: memcached: remove ganglia monitoring

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382922 )

Change subject: memcached: remove ganglia monitoring
..

memcached: remove ganglia monitoring

Bug: T177225
Change-Id: I46403f6307e4c5a1b49bb66b417ee21cc4435ea5
---
D modules/memcached/files/ganglia/gmond_memcached.py
D modules/memcached/files/ganglia/gmond_memcached.pyconf
D modules/memcached/manifests/ganglia.pp
M modules/memcached/manifests/init.pp
D modules/memcached/manifests/monitoring.pp
5 files changed, 0 insertions(+), 537 deletions(-)


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

diff --git a/modules/memcached/files/ganglia/gmond_memcached.py 
b/modules/memcached/files/ganglia/gmond_memcached.py
deleted file mode 100644
index c85110d..000
--- a/modules/memcached/files/ganglia/gmond_memcached.py
+++ /dev/null
@@ -1,373 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import sys
-import traceback
-import os
-import threading
-import time
-import socket
-import select
-
-descriptors = list()
-Desc_Skel = {}
-_Worker_Thread = None
-_Lock = threading.Lock()  # synchronization lock
-Debug = False
-
-
-def dprint(f, *v):
-if Debug:
-print >>sys.stderr, "DEBUG: "+f % v
-
-
-def floatable(str):
-try:
-float(str)
-return True
-except:
-return False
-
-
-class UpdateMetricThread(threading.Thread):
-
-def __init__(self, params):
-threading.Thread.__init__(self)
-self.running = False
-self.shuttingdown = False
-self.refresh_rate = 15
-if "refresh_rate" in params:
-self.refresh_rate = int(params["refresh_rate"])
-self.metric = {}
-self.last_metric = {}
-self.timeout = 2
-
-self.host = "localhost"
-self.port = 11211
-if "host" in params:
-self.host = params["host"]
-if "port" in params:
-self.port = int(params["port"])
-self.type = params["type"]
-self.mp = params["metrix_prefix"]
-
-def shutdown(self):
-self.shuttingdown = True
-if not self.running:
-return
-self.join()
-
-def run(self):
-self.running = True
-
-while not self.shuttingdown:
-_Lock.acquire()
-self.update_metric()
-_Lock.release()
-time.sleep(self.refresh_rate)
-
-self.running = False
-
-def update_metric(self):
-sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-msg = ""
-self.last_metric = self.metric.copy()
-try:
-dprint("connect %s:%d", self.host, self.port)
-sock.connect((self.host, self.port))
-sock.send("stats\r\n")
-
-while True:
-rfd, wfd, xfd = select.select([sock], [], [], self.timeout)
-if not rfd:
-print >>sys.stderr, "ERROR: select timeout"
-break
-
-for fd in rfd:
-if fd == sock:
-data = fd.recv(8192)
-msg += data
-
-if msg.find("END"):
-break
-
-sock.close()
-except socket.error, e:
-print >>sys.stderr, "ERROR: %s" % e
-
-for m in msg.split("\r\n"):
-d = m.split(" ")
-if len(d) == 3 and d[0] == "STAT" and floatable(d[2]):
-self.metric[self.mp+"_"+d[1]] = float(d[2])
-
-def metric_of(self, name):
-val = 0
-mp = name.split("_")[0]
-name_tail = name.rsplit("_", 1)
-if (name_tail[1] == "rate" and
-name_tail[0] in self.metric):
-_Lock.acquire()
-name = name_tail[0]
-if name in self.last_metric:
-num = self.metric[name]-self.last_metric[name]
-period = self.metric[mp+"_time"]-self.last_metric[mp+"_time"]
-try:
-val = num/period
-except ZeroDivisionError:
-val = 0
-_Lock.release()
-elif (name_tail[1] == "ratio" and
-"hits" in name_tail[0] and
-name_tail[0] in self.metric and
-name_tail[0].replace("hits", "misses") in self.metric):
-_Lock.acquire()
-hits_name = name_tail[0]
-misses_name = hits_name.replace("hits", "misses")
-if (hits_name in self.last_metric and
-misses_name in self.last_metric):
-hits = self.metric[hits_name]-self.last_metric[hits_name]
-misses = self.metric[misses_name]-self.last_metric[misses_name]
-try:
-val = hits/(hits+misses)
-except ZeroDivisionError:
-val = 0
-_Lock.release()
-elif name in self.me

[MediaWiki-commits] [Gerrit] operations/puppet[production]: zookeeper: remove jmxtrans for sending data to ganglia

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382921 )

Change subject: zookeeper: remove jmxtrans for sending data to ganglia
..

zookeeper: remove jmxtrans for sending data to ganglia

Should this be removed now that Ganglia will be removed
entirely? Is there more to it than just these lines though?

Bug: T177225
Change-Id: Ibc45e67c32b66af117a11b6559a29fdbf011739c
---
M modules/profile/manifests/zookeeper/server.pp
1 file changed, 0 insertions(+), 5 deletions(-)


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

diff --git a/modules/profile/manifests/zookeeper/server.pp 
b/modules/profile/manifests/zookeeper/server.pp
index 550682b..df58c5a 100644
--- a/modules/profile/manifests/zookeeper/server.pp
+++ b/modules/profile/manifests/zookeeper/server.pp
@@ -39,11 +39,6 @@
 }
 
 $group_prefix = "zookeeper.cluster.${cluster_name}."
-# Use jmxtrans for sending metrics to ganglia
-class { 'zookeeper::jmxtrans':
-group_prefix => $group_prefix,
-statsd   => $statsd_host,
-}
 
 if $is_critical {
 # Alert if Zookeeper Server is not running.

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: cumin: drop ganglia::web role alias

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382920 )

Change subject: cumin: drop ganglia::web role alias
..

cumin: drop ganglia::web role alias

Bug: T177225
Change-Id: Idceb2586b95fe3818ed040a9c92e4600ad785183
---
M modules/profile/templates/cumin/aliases.yaml.erb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/382920/1

diff --git a/modules/profile/templates/cumin/aliases.yaml.erb 
b/modules/profile/templates/cumin/aliases.yaml.erb
index 7d6ae11..b40c14d 100644
--- a/modules/profile/templates/cumin/aliases.yaml.erb
+++ b/modules/profile/templates/cumin/aliases.yaml.erb
@@ -183,7 +183,7 @@
 
 # Miscellaneous groups
 misc-analytics: P{R:class = role::statistics::web or R:class = 
role::piwik::server} or A:eventlogging
-misc-apache: P{R:class = role::microsites::peopleweb or R:class = 
grafana::production or R:class = role::requesttracker_server or R:class = 
role::releases or R:class = role::otrs or R:class = role::ganglia::web} or 
A:planet
+misc-apache: P{R:class = role::microsites::peopleweb or R:class = 
grafana::production or R:class = role::requesttracker_server or R:class = 
role::releases or R:class = role::otrs} or A:planet
 misc-devel: P{R:class = role::webperf or R:class = role::ve or R:class = 
role::archiva} or A:debugproxy or A:mwlog
 misc-nonprod: P{R:class = role::spare::system or R:class = role::test or 
R:class = role::security::tools or R:class = role::pybaltest}
 misc-ops: A:installserver or A:cumin or A:url-downloader or A:icinga or 
P{R:class = role::logging::kafkatee::webrequest::ops or R:class = role::builder 
or R:class = role::syslog::centralserver or R:class = role::pmacct or R:class = 
role::backup::offsite or R:class = role::backup} or A:netmon

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Introduce ShellCommandFactory

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

Change subject: Introduce ShellCommandFactory
..

Introduce ShellCommandFactory

Change-Id: Id875e68ea1fa72b44a463f977ab52270fe1e7088
---
M autoload.php
M includes/MediaWikiServices.php
M includes/ServiceWiring.php
A includes/shell/CommandFactory.php
M includes/shell/Shell.php
M tests/phpunit/includes/MediaWikiServicesTest.php
6 files changed, 100 insertions(+), 13 deletions(-)


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

diff --git a/autoload.php b/autoload.php
index 0a2ecf0..0c58993 100644
--- a/autoload.php
+++ b/autoload.php
@@ -931,6 +931,7 @@
'MediaWiki\\Session\\UserInfo' => __DIR__ . 
'/includes/session/UserInfo.php',
'MediaWiki\\ShellDisabledError' => __DIR__ . 
'/includes/exception/ShellDisabledError.php',
'MediaWiki\\Shell\\Command' => __DIR__ . '/includes/shell/Command.php',
+   'MediaWiki\\Shell\\CommandFactory' => __DIR__ . 
'/includes/shell/CommandFactory.php',
'MediaWiki\\Shell\\Result' => __DIR__ . '/includes/shell/Result.php',
'MediaWiki\\Shell\\Shell' => __DIR__ . '/includes/shell/Shell.php',
'MediaWiki\\Site\\MediaWikiPageNameNormalizer' => __DIR__ . 
'/includes/site/MediaWikiPageNameNormalizer.php',
diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php
index 84fc959..0d010b4 100644
--- a/includes/MediaWikiServices.php
+++ b/includes/MediaWikiServices.php
@@ -10,6 +10,7 @@
 use GlobalVarConfig;
 use Hooks;
 use IBufferingStatsdDataFactory;
+use MediaWiki\Shell\CommandFactory;
 use Wikimedia\Rdbms\LBFactory;
 use LinkCache;
 use Wikimedia\Rdbms\LoadBalancer;
@@ -681,6 +682,14 @@
return $this->getService( 'ReadOnlyMode' );
}
 
+   /**
+* @since 1.30
+* @return CommandFactory
+*/
+   public function getShellCommandFactory() {
+   return $this->getService( 'ShellCommandFactory' );
+   }
+

///
// NOTE: When adding a service getter here, don't forget to add a test
// case for it in MediaWikiServicesTest::provideGetters() and in
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index d048007..75ce8ec 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -41,6 +41,7 @@
 use MediaWiki\Linker\LinkRendererFactory;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Shell\CommandFactory;
 
 return [
'DBLoadBalancerFactory' => function ( MediaWikiServices $services ) {
@@ -428,6 +429,23 @@
);
},
 
+   'ShellCommandFactory' => function ( MediaWikiServices $services ) {
+   $config = $services->getMainConfig();
+
+   $limits = [
+   'time' => $config->get( 'MaxShellTime' ),
+   'walltime' => $config->get( 'MaxShellWallClockTime' ),
+   'memory' => $config->get( 'MaxShellMemory' ),
+   'filesize' => $config->get( 'MaxShellFileSize' ),
+   ];
+   $cgroup = $config->get( 'ShellCgroup' );
+
+   $factory = new CommandFactory( $limits, $cgroup );
+   $factory->setLogger( LoggerFactory::getInstance( 'exec' ) );
+
+   return $factory;
+   },
+

///
// NOTE: When adding a service here, don't forget to add a getter 
function
// in the MediaWikiServices class. The convenience getter should just 
call
diff --git a/includes/shell/CommandFactory.php 
b/includes/shell/CommandFactory.php
new file mode 100644
index 000..ecd8ac3
--- /dev/null
+++ b/includes/shell/CommandFactory.php
@@ -0,0 +1,66 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+namespace MediaWiki\Shell;
+
+use Psr\Log\LoggerAwareTrait;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+
+/**
+ * Factory facilitating dependency injection for Command
+ *
+ * @since 1.30
+ */
+class CommandFactory {
+   use LoggerAwareTrait;
+
+   /** @var array */
+   private $limits;
+
+   /** @var string|bool */
+   private $cgroup;
+
+   /**
+* Constructor
+*
+* @param array $limits
+* @param string|bool $cgroup
+*/
+   public function __construct( array $limits, $cgroup ) {
+   $this->limits = $limits;
+   $this->cgroup = $cgroup;
+   $this->setLogger( new NullLogger() );
+   }
+
+   /**
+* Instantiates a new Command
+*
+* @return Command
+*/
+   public function create() {
+   $command = new Command();
+   $command->setLogger( $this->logger );
+
+   return $com

[MediaWiki-commits] [Gerrit] operations/puppet[production]: authdns: remove ganglia support

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382918 )

Change subject: authdns: remove ganglia support
..

authdns: remove ganglia support

Bug: T177225
Change-Id: I52709b218ea8309c8114b4109787536427a1bb4f
---
D modules/authdns/files/ganglia/ganglia_gdnsd.py
D modules/authdns/files/ganglia/gdnsd.pyconf
D modules/authdns/manifests/ganglia.pp
M modules/role/manifests/authdns/server.pp
4 files changed, 0 insertions(+), 342 deletions(-)


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

diff --git a/modules/authdns/files/ganglia/ganglia_gdnsd.py 
b/modules/authdns/files/ganglia/ganglia_gdnsd.py
deleted file mode 100644
index 03f4809..000
--- a/modules/authdns/files/ganglia/ganglia_gdnsd.py
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# Copyright (c) 2013 Faidon Liambotis
-# Copyright (c) 2013 Wikimedia Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-"""Gmond module for gdnsd statistics
-
-:copyright: (c) 2013 Faidon Liambotis and Wikimedia Foundation Inc.
-:author: Faidon Liambotis
-:license: GPLv2+
-"""
-
-import urllib2
-import json
-import time
-
-
-CONF = {
-'stats_url': 'http://127.0.0.1:3506/json',
-'prefix': 'gdnsd',
-'groups': 'gdnsd',
-}
-DESCRIPTIONS = {
-'stats_v6': 'DNS queries over IPv6',
-'stats_badvers': 'DNS BADVERS responses',
-'stats_formerr': 'DNS FORMERR responses',
-'stats_noerror': 'DNS NOERROR responses',
-'stats_notimp': 'DNS NOTIMP responses',
-'stats_nxdomain': 'DNS NXDOMAIN responses',
-'stats_refused': 'DNS REFUSED responses',
-'stats_dropped': 'DNS dropped packets',
-'stats_edns': 'DNS EDNS queries',
-'stats_edns_clientsub': 'DNS queries with EDNS Client Subnet',
-'udp_reqs': 'DNS UDP requests',
-'tcp_reqs': 'DNS TCP requests',
-'udp_edns_big': 'DNS UDP EDNS big',
-'udp_tc': 'DNS UDP TC-bit',
-'udp_edns_tc': 'DNS UDP EDNS TC-bit',
-'udp_sendfail': 'DNS UDP sendfail',
-'udp_recvfail': 'DNS UDP recvfail',
-'tcp_sendfail': 'DNS TCP sendfail',
-'tcp_recvfail': 'DNS TCP recvfail',
-}
-CACHE = {
-'time': 0,
-'data': {},
-}
-
-
-def build_desc(skel, prop):
-"""Build a description dict from a template.
-
-:param skel: template dict
-:param prop: substitution dict
-:returns: New dict
-"""
-new = skel.copy()
-for key, value in prop.iteritems():
-new[key] = value
-return new
-
-
-def fetch_metrics(url=CONF['stats_url']):
-"""Fetches & decodes metrics from gdnsd.
-
-:param url: URL for gdnsd's json output
-:returns: decoded dict
-"""
-metrics = {}
-try:
-response = urllib2.urlopen(url)
-data = response.read()
-response.close()
-metrics = json.loads(data)
-except Exception:  # pylint: disable-msg=W0703
-# Could be URLError, HTTPError, HTTPException or ValueError (from json)
-# doesn't matter why, as Ganglia won't propagate a message.
-# pass, i.e. just return {}.
-pass
-
-# remove the services section, as we're not interested in it
-metrics.pop('services', None)
-
-return metrics
-
-
-def fetch_metrics_cached(url=CONF['stats_url']):
-"""Fetches, decodes and caches metrics from gdnsd.
-Fetches at most once a second, otherwise serving from the cache.
-Tries to fetch twice, if the first attempt failed.
-Serves stale data up to 15s old if both attempts failed.
-
-:param url: URL for gdnsd's json output
-:returns: decoded dict
-"""
-# fetch at most once a second; especially useful considering that
-# the callback gets called for every single metric independently
-if time.time() - CACHE['time'] < 1 and CACHE['data']:
-return CACHE['data']
-
-# try three times, as its very error-prone
-# (yes, this is horrible)
-metrics = None
-for _ in range(3):
-metrics = fetch_metrics(url)
-if metrics:
-break
-
-if metrics:
-CACHE['time'] = time.time()
-CACHE['data'] = metrics
-else:
-# failed, return cached data up to 15s to avoid dives/spikes
-if time.time() - CACHE['time'] <= 15:
-metrics = CACHE['data']
-
-return metrics
-
-
-def metric_handler(name):
-"""Callback to return the current value for a metric.
-
-:param name: metric name
-:returns: metric value
-"""
-raw

[MediaWiki-commits] [Gerrit] operations/puppet[production]: openstack: remove ganglia disk stats

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382917 )

Change subject: openstack: remove ganglia disk stats
..

openstack: remove ganglia disk stats

Bug: T177225
Change-Id: I7f4961981502e38a1a62ea920863cf6ea2bdd35d
---
M modules/profile/manifests/openstack/base/nova/compute/service.pp
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/17/382917/1

diff --git a/modules/profile/manifests/openstack/base/nova/compute/service.pp 
b/modules/profile/manifests/openstack/base/nova/compute/service.pp
index 1629111..749cb02 100644
--- a/modules/profile/manifests/openstack/base/nova/compute/service.pp
+++ b/modules/profile/manifests/openstack/base/nova/compute/service.pp
@@ -10,7 +10,6 @@
 ) {
 
 require_package('conntrack')
-ganglia::plugin::python {'diskstat': }
 
 if $::fqdn =~ /^labvirt100[0-9].eqiad.wmnet/ {
 openstack2::nova::compute::partition{ '/dev/sdb':}

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: exim4/multiple roles: remove Ganglia exim stats

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382916 )

Change subject: exim4/multiple roles: remove Ganglia exim stats
..

exim4/multiple roles: remove Ganglia exim stats

Bug: T177225
Change-Id: Icb434fedb9d32e742a3ac2116f328f97d7e9dfec
---
D modules/exim4/files/ganglia/exim-to-gmetric
D modules/exim4/manifests/ganglia.pp
M modules/otrs/manifests/mail.pp
M modules/profile/manifests/lists.pp
M modules/role/manifests/mail/mx.pp
M modules/role/manifests/phabricator_server.pp
6 files changed, 0 insertions(+), 270 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/16/382916/1

diff --git a/modules/exim4/files/ganglia/exim-to-gmetric 
b/modules/exim4/files/ganglia/exim-to-gmetric
deleted file mode 100644
index e32276e..000
--- a/modules/exim4/files/ganglia/exim-to-gmetric
+++ /dev/null
@@ -1,246 +0,0 @@
-#! /usr/bin/perl
-#
-# Exim stats grabber for NET-SNMP
-#
-# Based on a script by Matthew Newton Copyright (c) University of Leicester,
-# 2005
-#
-# Slightly modified for Timico (http://timico.net) by Ian P. Christian.
-#
-# Signficantly modified into a gmetric collector for WMF internal use by Jeff
-# Green 12/2011
-#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 51
-# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-use strict;
-use Sys::Syslog;
-use Fcntl ':flock';
-
-my $conf = {
-   'statefile' => '/tmp/eximstats.state',
-   'mainlog' => '/var/log/exim4/mainlog',
-   'mainlogold' => '/var/log/exim4/mainlog.1',
-   'lockfile' => '/tmp/eximstats.lock',
-   'ident' => $0,
-   'interval' => 60,
-};
-
-my $metric = {
-   'message_in' => {
-   'name' => 'exim messages in',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-   'message_out' => {
-   'name' => 'exim messages out',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-   'delivery_deferred' => {
-   'name' => 'exim deferred delivery',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-   'delivery_failed' => {
-   'name' => 'exim failed delivery',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-   'delivery_suppressed' => {
-   'name' => 'exim suppressed delivery',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-   'queued_messages' => {
-   'name' => 'exim queued messages',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-   'queued_messages_bounce' => {
-   'name' => 'exim queued bounce messages',
-   'type' => 'uint32',
-   'units' => 'messages',
-   'value' => 0,
-   'gmax' => $conf->{'interval'} * 1.5,
-   },
-};
-
-# lock to prevent collisions
-my $error = setlockfile('set');
-failboat("one: $error") if ($error);
-
-# read state file and figure out where to start reading logs
-my $state => {
-   'seek' => 0,
-   'inode' => inode_number($conf->{'mainlog'}),
-};
-if (-r $conf->{'statefile'}) {
-   open STATE, "< $conf->{'statefile'}";
-   while () {
-   if (/^(inode|seek)=(\d+)$/) {
-   $state->{$1} = $2;
-   }
-   }
-   close STATE;
-}
-
-# read the previous mainlog if we can't seek to the appropriate spot in the 
current log
-open LOG, "< $conf->{'mainlog'}" or failboat("cannot open exim log file 
$conf->{'mainlog'}: $!");
-my $cantseek = 1 unless (seek(LOG, $state->{'seek'}, 0));
-close LOG;
-if ($state->{'inode'} != inode_number($conf->{'mainlog'}) or $cantseek or 
$state->{'inode'} == inode_number($conf->{'mainlogold'})) {
-   rea

[MediaWiki-commits] [Gerrit] operations/puppet[production]: hhvm: remove ganglia monitoring

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382915 )

Change subject: hhvm: remove ganglia monitoring
..

hhvm: remove ganglia monitoring

Bug: T177225
Change-Id: I4df1fab26fe661affe274640782c050d6b96b310
---
D modules/hhvm/files/monitoring/hhvm_health.py
D modules/hhvm/files/monitoring/hhvm_health.pyconf
D modules/hhvm/files/monitoring/hhvm_mem.py
D modules/hhvm/files/monitoring/hhvm_mem.pyconf
M modules/hhvm/manifests/monitoring.pp
5 files changed, 1 insertion(+), 378 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/15/382915/1

diff --git a/modules/hhvm/files/monitoring/hhvm_health.py 
b/modules/hhvm/files/monitoring/hhvm_health.py
deleted file mode 100644
index 763dfcd..000
--- a/modules/hhvm/files/monitoring/hhvm_health.py
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""
-  Ganglia metric-gathering module for HHVM health stats
-
-"""
-import json
-import logging
-import re
-import sys
-import time
-import urllib2
-
-
-logging.basicConfig(level=logging.INFO, stream=sys.stderr)
-
-
-def flatten(mapping, prefix=''):
-flat = {}
-for k, v in mapping.items():
-k = prefix + re.sub('\W', '', k.replace(' ', '_'))
-flat.update(flatten(v, k + '.') if isinstance(v, dict) else {k: v})
-return flat
-
-
-class HealthStats(object):
-def __init__(self, url, expiry=5):
-self.url = url
-self.expiry = expiry
-self.data = {}
-self.update()
-
-def update(self):
-try:
-req = urllib2.urlopen(self.url)
-res = flatten(json.load(req), 'HHVM.')
-self.data.update(res)
-self.last_fetched = time.time()
-except (AttributeError, EnvironmentError, ValueError):
-logging.exception('Failed to update stats:')
-
-def expired(self):
-return time.time() - self.last_fetched > self.expiry
-
-def get(self, stat):
-if self.expired():
-self.update()
-return self.data[stat]
-
-
-def guess_unit(metric):
-if 'size' in metric or 'capac' in metric or 'byte' in metric:
-return 'bytes'
-return 'count'
-
-
-def metric_init(params):
-url = params.get('url', 'http://localhost:9002/check-health')
-stats = HealthStats(url)
-return [{
-'name': str(key),
-'value_type': 'uint',
-'format': '%u',
-'units': guess_unit(key),
-'slope': 'both',
-'groups': 'HHVM',
-'call_back': stats.get,
-} for key in stats.data]
-
-
-def metric_cleanup():
-pass
-
-
-def self_test():
-params = dict(arg.split('=') for arg in sys.argv[1:])
-metrics = metric_init(params)
-while 1:
-for metric in metrics:
-name = metric['name']
-call_back = metric['call_back']
-logging.info('%s: %s', name, call_back(name))
-time.sleep(5)
-
-
-if __name__ == '__main__':
-self_test()
diff --git a/modules/hhvm/files/monitoring/hhvm_health.pyconf 
b/modules/hhvm/files/monitoring/hhvm_health.pyconf
deleted file mode 100644
index 6c898a3..000
--- a/modules/hhvm/files/monitoring/hhvm_health.pyconf
+++ /dev/null
@@ -1,96 +0,0 @@
-# Ganglia metric module for HHVM health statistics.
-
-modules {
-module {
-name = "hhvm_health"
-language = "python"
-}
-}
-
-collection_group {
-collect_every  = 20
-time_threshold = 60
-
-metric {
-name= "HHVM.targetcache"
-title   = "Target Cache"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.tcprofsize"
-title   = "Translation Cache - Prof Size"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.units"
-title   = "Units"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.tcfrozensize"
-title   = "Translation Cache - Frozen Size"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.hhbcroarenacapac"
-title   = "HHBC RO Arena Capacity"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.rds"
-title   = "RDS"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.tchotsize"
-title   = "Translation Cache - Hot Size"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.funcs"
-title   = "Funcs"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.queued"
-title   = "Queued"
-value_threshold = 1.0
-}
-
-
-metric {
-name= "HHVM.tcsize"
-title   = "Translation Cache - Size"
-value_threshold = 1.0
-}
-
-
-m

[MediaWiki-commits] [Gerrit] operations/puppet[production]: bacula: remove ganglia backup sets

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382914 )

Change subject: bacula: remove ganglia backup sets
..

bacula: remove ganglia backup sets

Bug: T177225
Change-Id: I16713191f096de94facf762e686e014a1b5a56cc
---
M modules/profile/manifests/backup/director.pp
M modules/role/manifests/ganglia/web.pp
2 files changed, 0 insertions(+), 9 deletions(-)


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

diff --git a/modules/profile/manifests/backup/director.pp 
b/modules/profile/manifests/backup/director.pp
index c034fe1..9f8c5cd 100644
--- a/modules/profile/manifests/backup/director.pp
+++ b/modules/profile/manifests/backup/director.pp
@@ -142,12 +142,6 @@
 bacula::director::fileset { 'var-lib-carbon-whisper':
 includes => [ '/var/lib/carbon/whisper' ]
 }
-bacula::director::fileset { 'var-lib-ganglia':
-includes => [ '/var/lib/ganglia' ]
-}
-bacula::director::fileset { 'srv-ganglia':
-includes => [ '/srv/ganglia' ]
-}
 bacula::director::fileset { 'bugzilla-static':
 includes => [ '/srv/org/wikimedia/static-bugzilla' ]
 }
diff --git a/modules/role/manifests/ganglia/web.pp 
b/modules/role/manifests/ganglia/web.pp
index 76db02e..86440db 100644
--- a/modules/role/manifests/ganglia/web.pp
+++ b/modules/role/manifests/ganglia/web.pp
@@ -93,9 +93,6 @@
 description   => 'HTTP',
 check_command => 'check_http',
 }
-include ::profile::backup::host
-backup::set { 'var-lib-ganglia': }
-backup::set { 'srv-ganglia': }
 
 Class['ganglia::gmetad::rrdcached'] -> Class['::ganglia::gmetad']
 Class['ganglia::gmetad'] -> Class['::ganglia::web']

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: udp2log: remove ganglia monitoring

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382913 )

Change subject: udp2log: remove ganglia monitoring
..

udp2log: remove ganglia monitoring

Bug: T177225
Change-Id: I47bc09db8d15cf7024e44a0b673d2668321ca8f9
---
D modules/udp2log/files/PacketLossLogtailer.py
D modules/udp2log/files/rolematcher.py
M modules/udp2log/manifests/monitoring.pp
3 files changed, 0 insertions(+), 460 deletions(-)


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

diff --git a/modules/udp2log/files/PacketLossLogtailer.py 
b/modules/udp2log/files/PacketLossLogtailer.py
deleted file mode 100644
index f843902..000
--- a/modules/udp2log/files/PacketLossLogtailer.py
+++ /dev/null
@@ -1,226 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# This plugin for logtailer will crunch WMF packet loss logs and return:
-# * average percent loss per server role
-# * ninetieth percentile loss per server role
-# It will throw out
-# * packet loss numbers greater than 98%
-# * large margins of error
-# * margins of error are greater than percent packet loss
-# Note that this plugin depends on a certain apache log format, documented in
-# __init__.
-
-import time
-import threading
-import re
-
-# local dependencies
-from ganglia_logtailer_helper import GangliaMetricObject
-from ganglia_logtailer_helper import LogtailerParsingException
-from ganglia_logtailer_helper import LogtailerStateException
-import rolematcher
-
-
-class PacketLossLogtailer(object):
-# only used in daemon mode
-period = 30
-
-def __init__(self):
-'''This function should initialize any data structures or variables
-needed for the internal state of the line parser.'''
-self.last_update_time = time.time()
-self.day_in_seconds = 24 * 60 * 60
-self.reset_state()
-self.lock = threading.RLock()
-
-# a list of rolematchers which are simple object to determine the role
-# of a particular server this list is obtained from crawling
-# config-master.wikimedia.org/pybal and parse the available
-# configurations
-self.matchers = rolematcher.init()
-# this is what will match the packet loss lines
-# packet loss format :
-# %[%Y-%m-%dT%H:%M:%S]t %server lost: (%percentloss ± %margin)
-# [2011-10-26T21:20:25] sq86.wikimedia.org lost: (3.61446 ± 19.67462)%
-# match keys: date, server, percentloss, margin
-regex = '^\[(?P[^]]+)\] (?P[^ ]+) '
-regex += 'lost: \((?P[^ ]+) \+\/- (?P[^)]+)\)%'
-self.reg = re.compile(regex)
-# assume we're in daemon mode unless set_check_duration gets called
-self.dur_override = False
-
-# example function for parse line
-# takes one argument (text) line to be parsed
-# returns nothing
-def parse_line(self, line):
-'''This function should digest the contents of one line at a time,
-updating the internal state variables.'''
-self.lock.acquire()
-try:
-regMatch = self.reg.match(line)
-if regMatch:
-linebits = regMatch.groupdict()
-self.num_hits += 1
-# capture data
-percentloss = float(linebits['percentloss'])
-margin = float(linebits['margin'])
-role = self.determine_role(linebits['server'])
-# store for 90th % and average calculations
-# on ssl servers, sequence numbers are out of order.
-# T79967
-if((margin <= 20) and (percentloss <= 98)):
-self.percentloss_dict.setdefault(role, [])
-self.percentloss_dict[role].append(percentloss)
-# keep behavior of PacketLossLogtailer consistent with
-# previous version and have one overall metric that
-# can be used for sending notifications, for now keep
-# filtering out HTTPS/IP6 traffic as the packetloss numbers
-# are inaccurate.
-if role != 'https':
-self.percentloss_dict.setdefault('all_roles', [])
-self.percentloss_dict['all_roles'].append(percentloss)
-else:
-raise LogtailerParsingException("regmatch failed to match")
-
-except Exception, e:
-self.lock.release()
-raise LogtailerParsingException(
-"regmatch or contents failed with %s" % e)
-self.lock.release()
-
-def update_rolematchers(self):
-if (time.time() - self.last_update_time) > self.day_in_seconds:
-self.matchers = rolematcher.init()
-self.last_update_time = time.time()
-if self.matchers == []:
-#  downloading the roles did not go well apparently
-#  fall back to 

[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: Remove dependency on deprecated JSON polyfill module

2017-10-06 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382912 )

Change subject: Remove dependency on deprecated JSON polyfill module
..

Remove dependency on deprecated JSON polyfill module

The 'json' module has been deprecated since 1.29,
and no longer loads anything. see:
 - https://phabricator.wikimedia.org/T141344
 - https://gerrit.wikimedia.org/r/#/c/322617/

Change-Id: I1b81b3586c1a874534682dfb543b3522627c7c6e
---
M extension.json
1 file changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/extension.json b/extension.json
index 4ed275a..636a126 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "Article Feedback",
-   "version": "5.2.5",
+   "version": "5.3.0",
"author": [
"Greg Chiasson",
"Reha Sterbin",
@@ -273,7 +273,6 @@
"dependencies": [
"jquery.appear",
"jquery.tipsy",
-   "json",
"jquery.localize",
"jquery.ui.button",
"jquery.cookie",
@@ -422,7 +421,6 @@
"mediawiki.util",
"jquery.tipsy",
"jquery.localize",
-   "json",
"jquery.ui.button"
]
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b81b3586c1a874534682dfb543b3522627c7c6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: SamanthaNguyen 

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


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Remove compatibility with pre-1.27 MediaWiki

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

Change subject: Remove compatibility with pre-1.27 MediaWiki
..

Remove compatibility with pre-1.27 MediaWiki

Change-Id: I3f7fd7b11d5f710ae4e940b7001aa6948cf3
---
M extension.json
M includes/Hooks.php
2 files changed, 3 insertions(+), 42 deletions(-)


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

diff --git a/extension.json b/extension.json
index 90920e8..9673522 100644
--- a/extension.json
+++ b/extension.json
@@ -9,6 +9,7 @@
"license-name": "MIT",
"type": "other",
"requires": {
+   "MediaWiki": ">= 1.27.0",
"extensions": {
"Echo": "*"
}
@@ -37,14 +38,8 @@
"EchoGetBundleRules": [
"LoginNotify\\Hooks::onEchoGetBundleRules"
],
-   "LoginAuthenticateAudit": [
-   "LoginNotify\\Hooks::onLoginAuthenticateAudit"
-   ],
"AuthManagerLoginAuthenticateAudit": [

"LoginNotify\\Hooks::onAuthManagerLoginAuthenticateAudit"
-   ],
-   "AddNewAccount": [
-   "LoginNotify\\Hooks::onAddNewAccount"
],
"UserLoadOptions": [
"LoginNotify\\Hooks::onUserLoadOptions"
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 7fe5b72..059523d 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -10,7 +10,6 @@
 
 use EchoAttributeManager;
 use EchoEvent;
-use LoginForm;
 use MediaWiki\Auth\AuthenticationResponse;
 use User;
 
@@ -101,24 +100,7 @@
}
 
/**
-* Old hook for pre 1.27 or wikis with auth manager disabled.
-*
-* @todo Doesn't catch CAPTCHA or throttle failures
-*
-* @param User $user User in question.
-* @param string $pass The password (parameter not used).
-* @param int $retval A LoginForm constant (e.g. LoginForm::SUCCESS).
-*/
-   public static function onLoginAuthenticateAudit( User $user, $pass, 
$retval ) {
-   if ( $retval === LoginForm::WRONG_PASS ) {
-   self::doFailedLogin( $user );
-   } elseif ( $retval === LoginForm::SUCCESS ) {
-   self::doSuccessfulLogin( $user );
-   }
-   }
-
-   /**
-* Hook for login auditing post 1.27
+* Hook for login auditing
 *
 * @param AuthenticationResponse $ret Is login successful?
 * @param User|null $user User object on successful auth
@@ -169,23 +151,7 @@
}
 
/**
-* Deprecated since v1.27
-*
-* Set a cookie saying this is a known computer when creating an 
account.
-*
-* @todo This still sets cookies if user creates an account while 
logged in as someone else.
-* @param User $user The user that has been created.
-* @param bool $byMail Account created by email
-*/
-   public static function onAddNewAccount( User $user, $byMail ) {
-   if ( !$byMail ) {
-   $loginNotify = new LoginNotify();
-   $loginNotify->setCurrentAddressAsKnown( $user );
-   }
-   }
-
-   /**
-* Hook for new account creation since v1.27
+* Hook handler for new account creation.
 *
 * Called immediately after a local user has been created and saved to 
the database
 *

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

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

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Use --prefer-dist with composer in docker images

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

Change subject: Use --prefer-dist with composer in docker images
..


Use --prefer-dist with composer in docker images

This ensures that we download cacheable zip files.

Change-Id: I4f857a0cfafd8785b8b119b68a03d69141db2437
---
M dockerfiles/composer-package/run.sh
M dockerfiles/composer-test/run.sh
M dockerfiles/mediawiki-phpcs/run.sh
M jjb/mediawiki.yaml
M jjb/php.yaml
5 files changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/dockerfiles/composer-package/run.sh 
b/dockerfiles/composer-package/run.sh
index c7d165e..af0c227 100644
--- a/dockerfiles/composer-package/run.sh
+++ b/dockerfiles/composer-package/run.sh
@@ -5,5 +5,5 @@
 cd /src
 
 composer --ansi validate
-composer install --no-progress
+composer install --no-progress --prefer-dist
 composer test
diff --git a/dockerfiles/composer-test/run.sh b/dockerfiles/composer-test/run.sh
index cc5962e..29ca82f 100644
--- a/dockerfiles/composer-test/run.sh
+++ b/dockerfiles/composer-test/run.sh
@@ -10,5 +10,5 @@
 git submodule --quiet update --init --recursive
 
 composer --ansi validate --no-check-publish
-composer install --no-progress
+composer install --no-progress --prefer-dist
 composer test
diff --git a/dockerfiles/mediawiki-phpcs/run.sh 
b/dockerfiles/mediawiki-phpcs/run.sh
index 60808be..6c24ff6 100644
--- a/dockerfiles/mediawiki-phpcs/run.sh
+++ b/dockerfiles/mediawiki-phpcs/run.sh
@@ -6,5 +6,5 @@
 git fetch --quiet --depth 1 "${ZUUL_URL}/${ZUUL_PROJECT}" "$ZUUL_REF"
 git checkout --quiet FETCH_HEAD
 
-composer install --no-progress
+composer install --no-progress --prefer-dist
 ./vendor/bin/phpcs -p -s --report-full 
"--report-checkstyle=/log/checkstyle.xml"
diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index 259d6db..c262506 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -404,7 +404,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/mediawiki-phpcs:v2017.10.05.05.29'
+image: 'wmfreleng/mediawiki-phpcs:v2017.10.07.01.12'
 logdir: '/log'
 publishers:
  - checkstyle:
diff --git a/jjb/php.yaml b/jjb/php.yaml
index 296a248..1f46f85 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -141,7 +141,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-cache-src:
-image: 'wmfreleng/composer-package:v2017.10.06.23.41'
+image: 'wmfreleng/composer-package:v2017.10.07.01.12'
 logdir: '/log'
 
 - job:
@@ -158,7 +158,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/composer-test:v2017.10.05.05.29'
+image: 'wmfreleng/composer-test:v2017.10.07.01.12'
 logdir: '/log'
 
 # Couple jobs with a {name} prefix

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f857a0cfafd8785b8b119b68a03d69141db2437
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Use --prefer-dist with composer in docker images

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

Change subject: Use --prefer-dist with composer in docker images
..

Use --prefer-dist with composer in docker images

This ensures that we download cacheable zip files.

Change-Id: I4f857a0cfafd8785b8b119b68a03d69141db2437
---
M dockerfiles/composer-package/run.sh
M dockerfiles/composer-test/run.sh
M dockerfiles/mediawiki-phpcs/run.sh
M jjb/mediawiki.yaml
M jjb/php.yaml
5 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/10/382910/1

diff --git a/dockerfiles/composer-package/run.sh 
b/dockerfiles/composer-package/run.sh
index c7d165e..af0c227 100644
--- a/dockerfiles/composer-package/run.sh
+++ b/dockerfiles/composer-package/run.sh
@@ -5,5 +5,5 @@
 cd /src
 
 composer --ansi validate
-composer install --no-progress
+composer install --no-progress --prefer-dist
 composer test
diff --git a/dockerfiles/composer-test/run.sh b/dockerfiles/composer-test/run.sh
index cc5962e..29ca82f 100644
--- a/dockerfiles/composer-test/run.sh
+++ b/dockerfiles/composer-test/run.sh
@@ -10,5 +10,5 @@
 git submodule --quiet update --init --recursive
 
 composer --ansi validate --no-check-publish
-composer install --no-progress
+composer install --no-progress --prefer-dist
 composer test
diff --git a/dockerfiles/mediawiki-phpcs/run.sh 
b/dockerfiles/mediawiki-phpcs/run.sh
index 60808be..6c24ff6 100644
--- a/dockerfiles/mediawiki-phpcs/run.sh
+++ b/dockerfiles/mediawiki-phpcs/run.sh
@@ -6,5 +6,5 @@
 git fetch --quiet --depth 1 "${ZUUL_URL}/${ZUUL_PROJECT}" "$ZUUL_REF"
 git checkout --quiet FETCH_HEAD
 
-composer install --no-progress
+composer install --no-progress --prefer-dist
 ./vendor/bin/phpcs -p -s --report-full 
"--report-checkstyle=/log/checkstyle.xml"
diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index 259d6db..c262506 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -404,7 +404,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/mediawiki-phpcs:v2017.10.05.05.29'
+image: 'wmfreleng/mediawiki-phpcs:v2017.10.07.01.12'
 logdir: '/log'
 publishers:
  - checkstyle:
diff --git a/jjb/php.yaml b/jjb/php.yaml
index 296a248..1f46f85 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -141,7 +141,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-cache-src:
-image: 'wmfreleng/composer-package:v2017.10.06.23.41'
+image: 'wmfreleng/composer-package:v2017.10.07.01.12'
 logdir: '/log'
 
 - job:
@@ -158,7 +158,7 @@
  - docker-log-dir
  - docker-cache-dir
  - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/composer-test:v2017.10.05.05.29'
+image: 'wmfreleng/composer-test:v2017.10.07.01.12'
 logdir: '/log'
 
 # Couple jobs with a {name} prefix

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: apache: remove ganglia monitoring

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382909 )

Change subject: apache: remove ganglia monitoring
..

apache: remove ganglia monitoring

Bug: T177225
Change-Id: Ibf8731818e9496ddb464370ef326a328eba7412e
---
D modules/apache/files/apache-status
D modules/apache/files/apache_status.py
M modules/apache/manifests/monitoring.pp
3 files changed, 0 insertions(+), 466 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/09/382909/1

diff --git a/modules/apache/files/apache-status 
b/modules/apache/files/apache-status
deleted file mode 100755
index 3d6e87a..000
--- a/modules/apache/files/apache-status
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-WHITE="$(/usr/bin/tput setaf 7; /usr/bin/tput bold)"
-RESET="$(/usr/bin/tput sgr0)"
-file="/tmp/apache_status.$(/bin/hostname).$(/bin/date +%s).txt"
-/usr/bin/links -dump http://127.0.0.1/server-status -width 80 | tee "$file"
-printf "\nOutput saved to ${WHITE}${file}${RESET}.\n"
diff --git a/modules/apache/files/apache_status.py 
b/modules/apache/files/apache_status.py
deleted file mode 100755
index 15c0f2b..000
--- a/modules/apache/files/apache_status.py
+++ /dev/null
@@ -1,439 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import os
-import time
-import urllib2
-import traceback
-import re
-import copy
-
-# global to store state for "total accesses"
-METRICS = {
-'time': 0,
-'data': {}
-}
-
-LAST_METRICS = copy.deepcopy(METRICS)
-METRICS_CACHE_MAX = 5
-
-# Metric prefix
-NAME_PREFIX = "ap_"
-SSL_NAME_PREFIX = "apssl_"
-
-SERVER_STATUS_URL = ""
-
-descriptors = list()
-Desc_Skel = {}
-Scoreboard = {
-NAME_PREFIX + 'waiting': {
-'key': '_',
-'desc': 'Waiting for Connection',
-},
-NAME_PREFIX + 'starting': {
-'key': 'S',
-'desc': 'Starting up',
-},
-NAME_PREFIX + 'reading_request': {
-'key': 'R',
-'desc': 'Reading Request',
-},
-NAME_PREFIX + 'sending_reply': {
-'key': 'W',
-'desc': 'Sending Reply',
-},
-NAME_PREFIX + 'keepalive': {
-'key': 'K',
-'desc': 'Keepalive (read)',
-},
-NAME_PREFIX + 'dns_lookup': {
-'key': 'D',
-'desc': 'DNS Lookup',
-},
-NAME_PREFIX + 'closing': {
-'key': 'C',
-'desc': 'Closing connection',
-},
-NAME_PREFIX + 'logging': {
-'key': 'L',
-'desc': 'Logging',
-},
-NAME_PREFIX + 'gracefully_fin': {
-'key': 'G',
-'desc': 'Gracefully finishing',
-},
-NAME_PREFIX + 'idle': {
-'key': 'I',
-'desc': 'Idle cleanup of worker',
-},
-NAME_PREFIX + 'open_slot': {
-'key': '.',
-'desc': 'Open slot with no current process',
-},
-}
-Scoreboard_bykey = dict([(v["key"], k) for (k, v) in Scoreboard.iteritems()])
-
-SSL_REGEX = re.compile(
-'^(cache type:) (.*)()(?P[0-9]+)( bytes, current sessio'
-'ns: )(?P[0-9]+)(subcaches: )(?P[0-9]+)(, indexes per subcache: )(?P[0-'
-'9]+)()(.*)(index usage: )(?P[0-9]+)(%, ca'
-'che usage: )(?P[0-9]+)(%total sessions stored sin'
-'ce starting: )(?P[0-9]+)(total sessions expir'
-'ed since starting: )(?P[0-9]+)(total \(pre-e'
-'xpiry\) sessions scrolled out of the cache: )(?P[0-9]+)(total retrieves since starting: )(?P[0-9]+)( hit, )(?P[0-9]+)( misstotal'
-' removes since starting: )(?P[0-9]+)( hit, )(?P[0-9]+)'
-)
-
-Metric_Map = {
-'Uptime': NAME_PREFIX + "uptime",
-'IdleWorkers': NAME_PREFIX + "idle_workers",
-'BusyWorkers': NAME_PREFIX + "busy_workers",
-'Total kBytes': NAME_PREFIX + "bytes",
-'CPULoad': NAME_PREFIX + "cpuload",
-"Total Accesses": NAME_PREFIX + "rps"
-}
-
-
-def get_metrics():
-
-global METRICS, LAST_METRICS, SERVER_STATUS_URL, COLLECT_SSL
-
-if (time.time() - METRICS['time']) > METRICS_CACHE_MAX:
-
-metrics = dict([(k, 0) for k in Scoreboard.keys()])
-
-# This is the short server-status. Lacks SSL metrics
-try:
-req = urllib2.Request(SERVER_STATUS_URL + "?auto")
-
-# Download the status file
-res = urllib2.urlopen(req)
-
-for line in res:
-split_line = line.rstrip().split(": ")
-long_metric_name = split_line[0]
-if long_metric_name == "Scoreboard":
-for sck in split_line[1]:
-metrics[Scoreboard_bykey[sck]] += 1
-else:
-if long_metric_name in Metric_Map:
-metric_name = Metric_Map[long_metric_name]
-else:
-metric_name = long_metric_name
-metrics[metric_name] = split_line[1]
-
-except urllib2.URLError:
-traceback.print_exc()
-
-# If we are collecting SSL metrics we'll do
-if COLLECT_SSL:
-
-try:
-  

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

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

Change subject: Update VE core submodule to master (4e29d197d)
..

Update VE core submodule to master (4e29d197d)

New changes:
b64a2a6db Replace abandoned colors wo WikimediaUI palette ones
4e29d197d Align `border-radius` to WikimediaUI Base values

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


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

diff --git a/lib/ve b/lib/ve
index 0c062b9..4e29d19 16
--- a/lib/ve
+++ b/lib/ve
@@ -1 +1 @@
-Subproject commit 0c062b9b272c40d74fe86c7c63ed6977d0743e84
+Subproject commit 4e29d197dc149a562068b112506fa7bd0cbc4c21

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ocg: remove all ganglia support

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382907 )

Change subject: ocg: remove all ganglia support
..

ocg: remove all ganglia support

Bug: T177225
Change-Id: Iea7e8f9870ac00d96bd7bce8c3791a7a764720b9
---
D hieradata/common/ocg/ganglia.yaml
D modules/ocg/files/ganglia/ocg.py
D modules/ocg/manifests/ganglia.pp
D modules/ocg/templates/ganglia/ocg.pyconf.erb
M modules/role/manifests/ocg.pp
5 files changed, 0 insertions(+), 278 deletions(-)


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

diff --git a/hieradata/common/ocg/ganglia.yaml 
b/hieradata/common/ocg/ganglia.yaml
deleted file mode 100644
index 961f7d2..000
--- a/hieradata/common/ocg/ganglia.yaml
+++ /dev/null
@@ -1 +0,0 @@
-ocg::ganglia::data_filesystem: "/srv"
diff --git a/modules/ocg/files/ganglia/ocg.py b/modules/ocg/files/ganglia/ocg.py
deleted file mode 100755
index 8bdff1c..000
--- a/modules/ocg/files/ganglia/ocg.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (c) 2014 Jeff Green 
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the 'Software'), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-#
-import argparse
-import logging
-import logging.handlers
-import os
-import re
-import requests
-import time
-
-_url = 'http://localhost:8000/?command=health'
-_timeout = 15
-_time_max = 60
-_tmp_fs = '/mnt/tmpfs'
-_data_fs = '/srv'
-_descriptions = {}
-_logger = None
-_report_cache = {}
-_last_ocg_health_time = 0
-
-
-def setup_logging():
-'''set up _logger as syslog handler'''
-global _logger
-_logger = logging.getLogger('GlobalLogger')
-_logger.setLevel(logging.INFO)
-syslog_handler = logging.handlers.SysLogHandler(address='/dev/log')
-syslog_handler.setLevel(logging.INFO)
-syslog_handler.setFormatter(
-logging.Formatter('ganglia-ocg[%(process)d]: %(message)s'))
-_logger.addHandler(syslog_handler)
-
-
-def set_cache(data=None):
-global _report_cache
-if data is None:
-_logger.debug('clearing cache')
-_report_cache = {
-'ocg_job_status_queue': 0,
-'ocg_job_queue': 0,
-'ocg_health_check_response_time': _timeout,
-}
-else:
-_logger.debug('populating cache')
-_report_cache = {
-'ocg_job_status_queue': data[u'StatusObjects'][u'length'],
-'ocg_job_queue': data[u'JobQueue'][u'length'],
-'ocg_health_check_response_time': data[u'requestTime'],
-}
-
-
-def poll_ocg_server():
-'''make an http request to OCG server and parse JSON response data
-:returns: dict containing the parsed JSON data
-'''
-# cache OCG health report in a global, to avoid rapid-fire GETs
-global _last_ocg_health_time, _report_cache
-if time.time() - _last_ocg_health_time > 45:
-_last_ocg_health_time = time.time()
-set_cache()
-try:
-_logger.info(_url)
-r = requests.get(_url, timeout=_timeout)
-except requests.exceptions.RequestException as e:
-_logger.error(e)
-else:
-if r.status_code != 200:
-_logger.error(r.status_code)
-else:
-try:
-data = r.json()
-except Exception as e:
-_logger.error(e)
-else:
-set_cache(data)
-else:
-_logger.debug('using cache')
-return _report_cache
-
-
-def check_utilization(path):
-'''check filesystem utilization
-:param path: filesystem path
-:returns: filesystem utilization as a percentage
-'''
-if os.path.ismount(path):
-stat = os.statvfs(path)
-blocks_allocated = float(stat.f_blocks - stat.f_bfree)
-percent_allocated = blocks_allocated / stat.f_blocks * 100
-utilization = int(round(percent_allocated))
-else:
-informative_message = 'not a mounted filesyst

[MediaWiki-commits] [Gerrit] operations/puppet[production]: postgresql: remove all ganglia support

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382906 )

Change subject: postgresql: remove all ganglia support
..

postgresql: remove all ganglia support

Bug: T177225
Change-Id: Icb5bf587185a7527a6a8bbe0f888bf24b9ee3013
---
D modules/postgresql/files/ganglia/postgresql.py
D modules/postgresql/manifests/ganglia.pp
D modules/postgresql/spec/classes/postgresql_ganglia.rb
D modules/postgresql/templates/ganglia/postgresql.pyconf.erb
D modules/postgresql/tests/ganglia.pp
M modules/role/manifests/postgres/master.pp
M modules/role/manifests/postgres/slave.pp
7 files changed, 0 insertions(+), 510 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/06/382906/1

diff --git a/modules/postgresql/files/ganglia/postgresql.py 
b/modules/postgresql/files/ganglia/postgresql.py
deleted file mode 100644
index e879ce1..000
--- a/modules/postgresql/files/ganglia/postgresql.py
+++ /dev/null
@@ -1,394 +0,0 @@
-#!/bin/env python
-
-import os
-import threading
-import time
-import psycopg2
-
-descriptors = list()
-_Worker_Thread = None
-_Lock = threading.Lock()  # synchronization lock
-metric_results = {}
-
-
-def metric_of(name):
-global metric_results
-return metric_results.get(name, 0)
-
-
-# These are the defaults set for the metric attributes
-Desc_Skel = {
-"name": "N/A",
-"call_back": metric_of,
-"time_max": 60,
-"value_type": "uint",
-"units": "N/A",
-"slope": "both",  # zero|positive|negative|both
-"format": "%d",
-"description": "N/A",
-"groups": "PostgreSQL",
-}
-
-# Create your queries here. Keys whose names match those defined in the default
-# set are overridden. Any additional key-value pairs (i.e. query) will not be
-# added to the Ganglia metric definition but can be useful for data purposes.
-metric_defs = {
-"pg_backends_waiting": {
-"description": "Number of postgres backends that are waiting",
-"units": "backends",
-"query": "SELECT count(*) AS backends_waiting FROM " +
- "pg_stat_activity WHERE waiting = 't';"
-},
-"pg_database_size": {
-"description": "Total size of all databases in bytes",
-"value_type": "double",
-"format": "%.0f",
-"units": "bytes",
-"query": "SELECT sum(pg_database_size(d.oid)) AS " +
- "size_database FROM pg_database d ORDER BY 1 DESC;"
-},
-"pg_idx_blks_read": {
-"description": "Total index blocks read",
-"slope": "positive",
-"units": "blocks",
-"query": "SELECT sum(idx_blks_read) AS idx_blks_read " +
- "FROM pg_statio_all_indexes;"
-},
-"pg_idx_blks_hit": {
-"description": "Total index blocks hit",
-"slope": "positive",
-"units": "blocks",
-"query": "SELECT sum(idx_blks_hit) AS idx_blks_hit " +
- "FROM pg_statio_all_indexes;"
-},
-"pg_locks": {
-"description": "Number of locks held",
-"units": "locks",
-"query": "SELECT count(*) FROM pg_locks;"
-},
-"pg_query_time_idle_in_txn": {
-"description": 'Age of longest _idle in transaction_ transaction',
-"units": "seconds",
-"query": "SELECT COALESCE(max(COALESCE(ROUND(EXTRACT(epoch " +
- "FROM now()-query_start)),0)),0) AS " +
- "query_time_idle_in_txn FROM pg_stat_activity " +
- "WHERE current_query = '% in transaction';"
-},
-"pg_max_idle_txn_time": {
-"description": "Age of longest idle transaction",
-"units": "seconds",
-"query": "SELECT COALESCE(max(COALESCE(ROUND(EXTRACT(epoch " +
- "FROM now()-query_start)),0)),0) as query_time_max FROM " +
- "pg_stat_activity WHERE current_query <> '';"
-},
-"pg_txn_time_max": {
-"description": "Age of longest transaction",
-"units": "seconds",
-"query": "SELECT max(COALESCE(ROUND(EXTRACT(epoch " +
- "FROM now()-xact_start)),0)) as txn_time_max " +
- "FROM pg_stat_activity WHERE xact_start IS NOT NULL;"
-},
-"pg_connections": {
-"description": "Number of connections",
-"units": "connctions",
-"query": "SELECT sum(numbackends) FROM pg_stat_database;"
-},
-"pg_wal_files": {
-"description": "number of wal files in pg_xlog directory",
-"units": "# wal files",
-"query": "SELECT count(*) AS wal_files FROM " +
- "pg_ls_dir('pg_xlog') WHERE pg_ls_dir ~ E'^[0-9A-F]{24}$';"
-},
-"pg_xact_commit": {
-"description": "Transactions committed",
-"slope": "positive",
-"units": "transactions",
-"query": "SELECT sum(xact_commit) as xact_commit FROM " +
- "pg_stat_database;",
-},
-"pg_xact_rollback": {
-"description": "Transactio

[MediaWiki-commits] [Gerrit] integration/config[master]: Move git cloning out of composer-package image

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

Change subject: Move git cloning out of composer-package image
..


Move git cloning out of composer-package image

Use the jenkins git plugin to clone the repository into $WORKSPACE/src
and then mount that as a volume into the container.

Change-Id: I7c8f2b69073765cd55fb364bf6938675b7d97187
---
M dockerfiles/composer-package/example-run.sh
M dockerfiles/composer-package/run.sh
M jjb/macro-docker.yaml
M jjb/php.yaml
4 files changed, 30 insertions(+), 14 deletions(-)

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



diff --git a/dockerfiles/composer-package/example-run.sh 
b/dockerfiles/composer-package/example-run.sh
index 80fd8a1..0eea69b 100644
--- a/dockerfiles/composer-package/example-run.sh
+++ b/dockerfiles/composer-package/example-run.sh
@@ -1,11 +1,17 @@
 #!/bin/bash
 
-install --mode 777 --directory log
+mkdir -m 777 -p log
+rm -rf src
+mkdir -m 777 -p src
+cd src
+git init
+git fetch --quiet --depth 1 "https://gerrit.wikimedia.org/r/utfnormal"; 
"refs/changes/57/375857/1"
+git checkout FETCH_HEAD
+cd ..
+
+mkdir -p log
 docker run \
 --rm --tty \
---env ZUUL_URL=https://gerrit.wikimedia.org/r \
---env ZUUL_PROJECT=utfnormal \
---env ZUUL_COMMIT=668604441afd899efb073ce4c6b5545341ef6582 \
---env ZUUL_REF=refs/changes/57/375857/1 \
 --volume /$(pwd)/log://var/lib/jenkins/log \
+--volume /$(pwd)/src://src \
  wmfreleng/composer-package:latest
diff --git a/dockerfiles/composer-package/run.sh 
b/dockerfiles/composer-package/run.sh
index 9cc954a..c7d165e 100644
--- a/dockerfiles/composer-package/run.sh
+++ b/dockerfiles/composer-package/run.sh
@@ -4,11 +4,6 @@
 
 cd /src
 
-git init
-git fetch --quiet --depth 1 "${ZUUL_URL}/${ZUUL_PROJECT}" "$ZUUL_REF"
-git checkout FETCH_HEAD
-git submodule --quiet update --init --recursive
-
 composer --ansi validate
 composer install --no-progress
 composer test
diff --git a/jjb/macro-docker.yaml b/jjb/macro-docker.yaml
index 3b273a0..7bd1c09 100644
--- a/jjb/macro-docker.yaml
+++ b/jjb/macro-docker.yaml
@@ -69,7 +69,7 @@
 --volume "$(pwd)"/log:{logdir} \
 {image}
 
-# Run a docker image with .env and a log and src directory
+# Run a docker image with .env and a log and cache directory
 - builder:
 name: docker-run-with-log-and-workspace-cache
 builders:
@@ -82,3 +82,18 @@
 --volume "$(pwd)"/log:{logdir} \
 --volume "$(pwd)"/cache:/cache \
 {image}
+
+# Run a docker image with cache, log, and src directories
+- builder:
+name: docker-run-with-log-cache-src
+builders:
+ - shell: |
+#!/bin/bash -eu
+set -x
+chmod 777 src
+docker run \
+--rm --tty \
+--volume "$(pwd)"/log:{logdir} \
+--volume "$(pwd)"/cache:/cache \
+--volume "$(pwd)"/src:/src \
+{image}
diff --git a/jjb/php.yaml b/jjb/php.yaml
index 918025c..296a248 100644
--- a/jjb/php.yaml
+++ b/jjb/php.yaml
@@ -130,6 +130,7 @@
 - job:
 name: 'composer-package-php70-docker'
 node: DebianJessieDocker
+defaults: use-remote-zuul-shallow-clone-to-src
 concurrent: true
 properties:
  - build-discarder:
@@ -137,11 +138,10 @@
 triggers:
  - zuul
 builders:
- - docker-zuul-env
  - docker-log-dir
  - docker-cache-dir
- - docker-run-with-log-and-workspace-cache:
-image: 'wmfreleng/composer-package:v2017.10.05.05.29'
+ - docker-run-with-log-cache-src:
+image: 'wmfreleng/composer-package:v2017.10.06.23.41'
 logdir: '/log'
 
 - job:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7c8f2b69073765cd55fb364bf6938675b7d97187
Gerrit-PatchSet: 4
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: osm: remove all ganglia support

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382905 )

Change subject: osm: remove all ganglia support
..

osm: remove all ganglia support

Bug: T177225
Change-Id: I950dfc6962e6b97837772cbe759b0b7e2b02498f
---
D modules/osm/files/ganglia/osm.py
D modules/osm/manifests/ganglia.pp
D modules/osm/templates/ganglia/osm.pyconf.erb
M modules/role/manifests/osm/master.pp
M modules/role/manifests/osm/slave.pp
5 files changed, 0 insertions(+), 224 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/05/382905/1

diff --git a/modules/osm/files/ganglia/osm.py b/modules/osm/files/ganglia/osm.py
deleted file mode 100644
index 655cdfd..000
--- a/modules/osm/files/ganglia/osm.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/bin/env python
-
-import os
-import threading
-import time
-
-descriptors = list()
-_Worker_Thread = None
-_Lock = threading.Lock()  # synchronization lock
-metric_results = {}
-
-
-def metric_of(name):
-global metric_results
-return metric_results.get(name, 0)
-
-
-# These are the defaults set for the metric attributes
-Desc_Skel = {
-"name": "N/A",
-"call_back": metric_of,
-"time_max": 60,
-"value_type": "uint",
-"units": "N/A",
-"slope": "both",  # zero|positive|negative|both
-"format": "%d",
-"description": "N/A",
-"groups": "OpenStreetMap",
-}
-
-
-# Create your queries here. Keys whose names match those defined in the default
-# set are overridden. Any additional key-value pairs (i.e. query) will not be
-# added to the Ganglia metric definition but can be useful for data purposes.
-def get_planet_osm_lag(obj):
-import datetime
-try:
-with open(obj.state_path, "r") as f:
-for line in f.readlines():
-if line.startswith("timestamp="):
-t = datetime.datetime.strptime(
-line.strip().split('=')[1], "%Y-%m-%dT%H\:%M\:%SZ")
-r = datetime.datetime.now() - t
-return r.seconds
-except IOError as e:
-print_exception("Could not open file", e)
-raise
-
-
-metric_defs = {
-"osm_sync_lag": {
-"description": "Number of seconds behind planet.osm",
-"units": "seconds",
-"query": get_planet_osm_lag,
-},
-}
-
-
-def print_exception(custom_msg, exception):
-error_msg = custom_msg or "An error has occurred"
-print "%s %s" % (error_msg, exception),
-
-
-class UpdateMetricThread(threading.Thread):
-def __init__(self, params):
-threading.Thread.__init__(self)
-self.running = False
-self.shuttingdown = False
-self.refresh_rate = 30
-self.state_path = "/srv/osmosis/state.txt"
-
-param_list = ["state_path", "refresh_rate"]
-for attr in param_list:
-if attr in params:
-setattr(self, attr, params[attr])
-
-def shutdown(self):
-self.shuttingdown = True
-if not self.running:
-return
-self.join()
-
-def run(self):
-self.running = True
-
-while not self.shuttingdown:
-_Lock.acquire()
-try:
-self.update_metric()
-except Exception as e:
-print_exception("Unable to update metrics", e)
-_Lock.release()
-time.sleep(int(self.refresh_rate))
-
-self.running = False
-
-def update_metric(self):
-global metric_results
-
-converter = {
-'float': float,
-'uint': int
-}
-
-for metric_name, metric_attrs in metric_defs.iteritems():
-data = metric_attrs["query"](self)
-convert_fn = converter.get(
-metric_defs[metric_name].get("value_type"), int)
-metric_results[metric_name] = convert_fn(data)
-
-
-def metric_init(params):
-global descriptors, Desc_Skel, _Worker_Thread
-
-_Worker_Thread = UpdateMetricThread(params)
-_Worker_Thread.start()
-
-for metric_desc in metric_defs:
-descriptors.append(
-create_desc(metric_desc, Desc_Skel, metric_defs[metric_desc]))
-
-return descriptors
-
-
-def create_desc(metric_name, skel, prop):
-return dict(
-skel.items() +
-[('name', metric_name)] +
-[(k, v) for k, v in prop.items() if k in skel]
-)
-
-
-def metric_cleanup():
-_Worker_Thread.shutdown()
-
-
-if __name__ == '__main__':
-import argparse
-
-parser = argparse.ArgumentParser(
-description='Debug the Ganglia OSM module.')
-parser.add_argument(
-'--state_path', type=str, default='/srv/osmosis/state.txt',
-help='The path where state.txt resides. (default: %(default)s).')
-parser.add_argument(
-'--refresh_rate', type=int, default=10,
-help='The interval, in seconds, between query executions ' +
- 'metric coll

[MediaWiki-commits] [Gerrit] operations/puppet[production]: site: decom ganglia-web host, rm aggregators, rm phab include

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382904 )

Change subject: site: decom ganglia-web host, rm aggregators, rm phab include
..

site: decom ganglia-web host, rm aggregators, rm phab include

- Let uranium, the ganglia-web host use role::spare to decom it
- Remove ganglia aggregators from install/bastion hosts
- Remove ganglia class include from Phabricator

Bug: T177225
Change-Id: I24bbd8dbe6b05d3a439df2efe8bb07e0946561ef
---
M manifests/site.pp
1 file changed, 2 insertions(+), 12 deletions(-)


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

diff --git a/manifests/site.pp b/manifests/site.pp
index 47df907..214b319 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -125,7 +125,6 @@
 prometheus::ops)
 
 interface::add_ip6_mapped { 'main': }
-class { '::ganglia::monitor::aggregator': sites =>  'esams', }
 }
 
 # Bastion in California
@@ -136,10 +135,6 @@
 prometheus::ops)
 
 interface::add_ip6_mapped { 'main': }
-
-class { '::ganglia::monitor::aggregator':
-sites =>  'ulsfo',
-}
 }
 
 node 'bohrium.eqiad.wmnet' {
@@ -1188,16 +1183,11 @@
 aptrepo::wikimedia)
 
 interface::add_ip6_mapped { 'main': }
-
-class { '::ganglia::monitor::aggregator':
-sites => $::site,
-}
 }
 
 # Phabricator
 node /^(phab1001\.eqiad|phab2001\.codfw)\.wmnet$/ {
 role(phabricator_server)
-include ::ganglia
 interface::add_ip6_mapped { 'main': }
 }
 
@@ -2338,9 +2328,9 @@
 interface::add_ip6_mapped { 'main': }
 }
 
-# Ganglia Web UI
+# ex-Ganglia Web UI - to be decomed
 node 'uranium.wikimedia.org' {
-role(ganglia::web)
+role(spare)
 interface::add_ip6_mapped { 'main': }
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Replace validation colors with WikimediaUI palette ones

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

Change subject: Replace validation colors with WikimediaUI palette ones
..


Replace validation colors with WikimediaUI palette ones

Replacing validation colors with WikimediaUI palette ones.
They don't seem to be used in normal SD views, amending just in case.

Change-Id: I7417ab79cd214945ffe0e84034897c4848085689
---
M modules/styles/mediawiki.ui/forms.less
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/styles/mediawiki.ui/forms.less 
b/modules/styles/mediawiki.ui/forms.less
index 9370af8..a8623db 100644
--- a/modules/styles/mediawiki.ui/forms.less
+++ b/modules/styles/mediawiki.ui/forms.less
@@ -140,7 +140,7 @@
}
}
~ .mw-ui-validation-icon {
-   background: #00b08a;
+   background: #00af89;
background: rgba( 0, 176, 138, 0.85 );
}
~ .mw-ui-validation-icon:before {
@@ -184,7 +184,7 @@
}
}
~ .mw-ui-validation-icon {
-   background: #d31300;
+   background: #d33;
background: rgba( 211, 19, 0, 0.85 );
}
~ .mw-ui-validation-icon:before {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7417ab79cd214945ffe0e84034897c4848085689
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use PHP 7 "\u{NNNN}" Unicode codepoint escapes in string lit...

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

Change subject: Use PHP 7 "\u{}" Unicode codepoint escapes in string 
literals
..

Use PHP 7 "\u{}" Unicode codepoint escapes in string literals

In cases where we're operating on text data (and not binary data),
use e.g. "\u{00A0}" to refer directly to the Unicode Character
'NO-BREAK SPACE' instead of "\xc2\xa0" to specify the bytes C2h A0h
(which correspond to the UTF-8 encoding of that character). This
makes it easier to look up those mysterious sequences, as not all
are as recognizable as the no-break space.

This is not enforced by PHP, but I think we should write those in
uppercase and zero-padded to at least four characters, like the
Unicode standard does.

Note that not all "\xNN" escapes can be automatically replaced:
* We can't use Unicode escapes for binary data that is not UTF-8
  (e.g. in code converting from legacy encodings or testing the
  handling of invalid UTF-8 byte sequences).
* '\xNN' escapes in regular expressions in single-quoted strings
  are actually handled by PCRE and have to be handled carefully
  (those regexps should probably be changed to use the /u modifier).
* "\xNN" referring to ASCII characters ("\x80" and lower) should
  probably be left as-in.

The replacements in this commit were done semi-manually by piping
the existing "\xNN" escapes through the following terrible Ruby
script I devised:

  chars = eval('"' + ARGV[0] + '"').force_encoding('utf-8')
  puts chars.split('').map{|char|
'\\u{' + char.ord.to_s(16).upcase.rjust(4, '0') + '}'
  }.join('')

Change-Id: Idc3dee3a7fb5ebfaef395754d8859b18f1f8769a
---
M includes/cache/MessageCache.php
M includes/collation/CollationFa.php
M includes/collation/IcuCollation.php
M includes/installer/Installer.php
M includes/json/FormatJson.php
M includes/specials/formfields/Licenses.php
M includes/tidy/RemexCompatFormatter.php
M languages/Language.php
M languages/data/Names.php
M languages/messages/MessagesAf.php
M languages/messages/MessagesBe.php
M languages/messages/MessagesBe_tarask.php
M languages/messages/MessagesBg.php
M languages/messages/MessagesBr.php
M languages/messages/MessagesCs.php
M languages/messages/MessagesEo.php
M languages/messages/MessagesEs.php
M languages/messages/MessagesEt.php
M languages/messages/MessagesFi.php
M languages/messages/MessagesFr.php
M languages/messages/MessagesFrp.php
M languages/messages/MessagesFur.php
M languages/messages/MessagesHu.php
M languages/messages/MessagesHy.php
M languages/messages/MessagesIa.php
M languages/messages/MessagesIt.php
M languages/messages/MessagesKaa.php
M languages/messages/MessagesKk_cyrl.php
M languages/messages/MessagesKk_latn.php
M languages/messages/MessagesKsh.php
M languages/messages/MessagesLa.php
M languages/messages/MessagesLbe.php
M languages/messages/MessagesLn.php
M languages/messages/MessagesLt.php
M languages/messages/MessagesLv.php
M languages/messages/MessagesNb.php
M languages/messages/MessagesNn.php
M languages/messages/MessagesOc.php
M languages/messages/MessagesPl.php
M languages/messages/MessagesPt.php
M languages/messages/MessagesPt_br.php
M languages/messages/MessagesRu.php
M languages/messages/MessagesSe.php
M languages/messages/MessagesSk.php
M languages/messages/MessagesSv.php
M languages/messages/MessagesUdm.php
M languages/messages/MessagesUk.php
M languages/messages/MessagesUz.php
M languages/messages/MessagesWa.php
M maintenance/language/languages.inc
M tests/phpunit/includes/collation/CollationFaTest.php
M tests/phpunit/includes/collation/CustomUppercaseCollationTest.php
M tests/phpunit/languages/LanguageTest.php
53 files changed, 141 insertions(+), 141 deletions(-)


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

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 244da33..c4843337 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -856,9 +856,9 @@
],
[
' ',
-   "\xc2\xa0",
-   "\xc2\xa0",
-   "\xc2\xad"
+   "\u{00A0}",
+   "\u{00A0}",
+   "\u{00AD}"
],
$message
);
diff --git a/includes/collation/CollationFa.php 
b/includes/collation/CollationFa.php
index 7410886..723a4d1 100644
--- a/includes/collation/CollationFa.php
+++ b/includes/collation/CollationFa.php
@@ -33,13 +33,13 @@
// Really hacky - replace with stuff from other blocks.
private $override = [
// U+0627 ARABIC LETTER ALEF => U+0623 ARABIC LETTER ALEF WITH 
H

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use PHP 7 '<=>' operator in 'sort()' callbacks

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

Change subject: Use PHP 7 '<=>' operator in 'sort()' callbacks
..

Use PHP 7 '<=>' operator in 'sort()' callbacks

`$a <=> $b` returns `-1` if `$a` is lesser, `1` if `$b` is lesser,
and `0` if they are equal.

It also enables the neat idiom `$a[x] <=> $b[x] ?: $a[y] <=> $b[y]`
to sort arrays of objects first by 'x', and by 'y' if they are equal.

* Replace a common pattern like `return $a < $b ? -1 : 1` with the
  new operator (and similar patterns with the variables, the numbers
  or the comparison inverted). Some of the uses were previously not
  correctly handling the variables being equal; this is now
  automatically fixed.
* Also replace `return $a - $b`, which is equivalent to `return
  $a <=> $b` if both variables are integers (but not correct if they
  are floats) but less intuitive.
* (Do not replace `return strcmp( $a, $b )`, it is also equivalent
  when both variables are strings, but it's equally intuitive, and
  also there's a lot of it and I'd like to keep this patch small.)
* Also replace `return $a > $b`, which presumably sort of works most
  of the time (returns `1` if `$b` is lesser, and `0` if they are
  equal or `$a` is lesser) but is erroneous.

Change-Id: I19a3d2fc8fcdb208c10330bd7a42c4e05d7f5cf3
---
M includes/GlobalFunctions.php
M includes/MagicWord.php
M includes/OutputPage.php
M includes/Title.php
M includes/auth/AuthManager.php
M includes/changes/ChangesListFilterGroup.php
M includes/libs/Timing.php
M includes/libs/XhprofData.php
M includes/libs/virtualrest/VirtualRESTServiceClient.php
M includes/page/ImagePage.php
M includes/parser/Parser.php
M includes/profiler/ProfilerSectionOnly.php
M includes/profiler/ProfilerXhprof.php
M includes/profiler/output/ProfilerOutputText.php
M includes/session/SessionInfo.php
M includes/specialpage/AuthManagerSpecialPage.php
M includes/specialpage/ChangesListSpecialPage.php
M includes/specials/SpecialVersion.php
M maintenance/findDeprecated.php
M maintenance/namespaceDupes.php
M profileinfo.php
M tests/phpunit/MediaWikiTestCase.php
22 files changed, 37 insertions(+), 74 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/382901/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 484dfe8..713ab5e 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -191,7 +191,7 @@
if ( is_string( $a ) && is_string( $b ) ) {
return strcmp( $a, $b );
} elseif ( count( $a ) !== count( $b ) ) {
-   return count( $a ) < count( $b ) ? -1 : 1;
+   return count( $a ) <=> count( $b );
} else {
reset( $a );
reset( $b );
diff --git a/includes/MagicWord.php b/includes/MagicWord.php
index 93c8a71..17a4a0f 100644
--- a/includes/MagicWord.php
+++ b/includes/MagicWord.php
@@ -395,13 +395,7 @@
public function compareStringLength( $s1, $s2 ) {
$l1 = strlen( $s1 );
$l2 = strlen( $s2 );
-   if ( $l1 < $l2 ) {
-   return 1;
-   } elseif ( $l1 > $l2 ) {
-   return -1;
-   } else {
-   return 0;
-   }
+   return $l2 <=> $l1; // descending
}
 
/**
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 5d9006a..3dc40f7 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -4036,12 +4036,8 @@
uksort( $logosPerDppx, function ( $a , $b ) {
$a = floatval( $a );
$b = floatval( $b );
-
-   if ( $a == $b ) {
-   return 0;
-   }
// Sort from smallest to largest (e.g. 1x, 1.5x, 2x)
-   return ( $a < $b ) ? -1 : 1;
+   return $a <=> $b;
} );
 
foreach ( $logosPerDppx as $dppx => $src ) {
diff --git a/includes/Title.php b/includes/Title.php
index 3da6ab9..66cff10 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -792,11 +792,8 @@
 * @return int Result of string comparison, or namespace comparison
 */
public static function compare( LinkTarget $a, LinkTarget $b ) {
-   if ( $a->getNamespace() == $b->getNamespace() ) {
-   return strcmp( $a->getText(), $b->getText() );
-   } else {
-   return $a->getNamespace() - $b->getNamespace();
-   }
+   return $a->getNamespace() <=> $b->getNamespace()
+   ?: strcmp( $a->getText(), $b->getText() );
}
 
/**
diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php
index 9407c42..62c996e 100644
--- a/includes/auth

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use PHP 5.6 '**' operator instead of 'pow()' function

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

Change subject: Use PHP 5.6 '**' operator instead of 'pow()' function
..

Use PHP 5.6 '**' operator instead of 'pow()' function

Change-Id: Ieb22e1dbfcffaa4e7b3dcfabbcc999e5dd59a4bf
---
M includes/diff/DiffEngine.php
M includes/libs/IP.php
M includes/libs/filebackend/FileBackendStore.php
M includes/media/FormatMetadata.php
M includes/media/GIFMetadataExtractor.php
M includes/utils/UIDGenerator.php
M includes/utils/ZipDirectoryReader.php
M maintenance/generateSitemap.php
M maintenance/storage/storageTypeStats.php
M tests/phpunit/includes/api/RandomImageGenerator.php
M tests/phpunit/languages/LanguageTest.php
11 files changed, 27 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/382900/1

diff --git a/includes/diff/DiffEngine.php b/includes/diff/DiffEngine.php
index 53378e5..eb47aeb 100644
--- a/includes/diff/DiffEngine.php
+++ b/includes/diff/DiffEngine.php
@@ -348,7 +348,7 @@
$this->maxDifferences = ceil( ( $this->m + $this->n ) / 
2.0 );
if ( $this->m * $this->n > $this->tooLong ) {
// limit complexity to D^POW_LIMIT for long 
sequences
-   $this->maxDifferences = floor( pow( 
$this->maxDifferences, $this->powLimit - 1.0 ) );
+   $this->maxDifferences = floor( 
$this->maxDifferences ** ( $this->powLimit - 1.0 ) );
wfDebug( "Limiting max number of differences to 
$this->maxDifferences\n" );
}
 
diff --git a/includes/libs/IP.php b/includes/libs/IP.php
index 1c48f49..c500e10 100644
--- a/includes/libs/IP.php
+++ b/includes/libs/IP.php
@@ -425,7 +425,7 @@
$ip = self::sanitizeIP( $ip );
$n = ip2long( $ip );
if ( $n < 0 ) {
-   $n += pow( 2, 32 );
+   $n += 2 ** 32;
# On 32-bit platforms (and on Windows), 2^32 
does not fit into an int,
# so $n becomes a float. We convert it to 
string instead.
if ( is_float( $n ) ) {
@@ -487,7 +487,7 @@
}
# Convert to unsigned
if ( $network < 0 ) {
-   $network += pow( 2, 32 );
+   $network += 2 ** 32;
}
} else {
$network = false;
@@ -523,7 +523,7 @@
$start = $end = false;
} else {
$start = sprintf( '%08X', $network );
-   $end = sprintf( '%08X', $network + pow( 2, ( 32 
- $bits ) ) - 1 );
+   $end = sprintf( '%08X', $network + 2 ** ( 32 - 
$bits ) - 1 );
}
// Explicit range
} elseif ( strpos( $range, '-' ) !== false ) {
diff --git a/includes/libs/filebackend/FileBackendStore.php 
b/includes/libs/filebackend/FileBackendStore.php
index b8eec3f..d27ee6f 100644
--- a/includes/libs/filebackend/FileBackendStore.php
+++ b/includes/libs/filebackend/FileBackendStore.php
@@ -1560,7 +1560,7 @@
$shards = [];
list( $digits, $base ) = $this->getContainerHashLevels( 
$container );
if ( $digits > 0 ) {
-   $numShards = pow( $base, $digits );
+   $numShards = $base ** $digits;
for ( $index = 0; $index < $numShards; $index++ ) {
$shards[] = '.' . Wikimedia\base_convert( 
$index, 10, $base, $digits );
}
diff --git a/includes/media/FormatMetadata.php 
b/includes/media/FormatMetadata.php
index 6661965..9543082 100644
--- a/includes/media/FormatMetadata.php
+++ b/includes/media/FormatMetadata.php
@@ -782,7 +782,7 @@
}
}
if ( is_numeric( $val ) ) {
-   $fNumber = pow( 2, $val 
/ 2 );
+   $fNumber = 2 ** ( $val 
/ 2 );
if ( $fNumber !== false 
) {
$val = 
$this->msg( 'exif-maxaperturevalue-value',

$this->formatNum( $val ),
diff --git a/includes/media/GIFMetadataExtractor.php 
b/includes/media/GIFMetadataExtractor.php
index ac5fc81..aa4c11e 100644
--- a/includes/media/GIFMetadata

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use PHP 5.6 constant expressions for some bitfield constants

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

Change subject: Use PHP 5.6 constant expressions for some bitfield constants
..

Use PHP 5.6 constant expressions for some bitfield constants

I searched the entire codebase for 'const' and looked for things
that looked suspiciously like manually calculated bitfield unions.
As of PHP 5.6, we can have them calculated automatically when
defining constants.

Change-Id: I7d971d1a63f8916db2f8f6c053c7dd0a13add92d
---
M includes/Revision.php
M includes/api/ApiResult.php
M includes/dao/IDBAccessObject.php
M includes/logging/LogPage.php
M includes/page/WikiPage.php
M includes/parser/Preprocessor.php
M tests/phpunit/suites/ParserTestTopLevelSuite.php
7 files changed, 12 insertions(+), 10 deletions(-)


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

diff --git a/includes/Revision.php b/includes/Revision.php
index bcfbe63..3071ade 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -91,8 +91,9 @@
const DELETED_COMMENT = 2;
const DELETED_USER = 4;
const DELETED_RESTRICTED = 8;
-   const SUPPRESSED_USER = 12; // convenience
-   const SUPPRESSED_ALL = 15; // convenience
+   const SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED; 
// convenience
+   const SUPPRESSED_ALL = self::DELETED_TEXT | self::DELETED_COMMENT | 
self::DELETED_USER |
+   self::DELETED_RESTRICTED; // convenience
 
// Audience options for accessors
const FOR_PUBLIC = 1;
diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php
index 468d878..1afacaf 100644
--- a/includes/api/ApiResult.php
+++ b/includes/api/ApiResult.php
@@ -61,7 +61,7 @@
 * probably wrong.
 * @since 1.25
 */
-   const NO_VALIDATE = 12;
+   const NO_VALIDATE = self::NO_SIZE_CHECK | 8;
 
/**
 * Key for the 'indexed tag name' metadata item. Value is string.
diff --git a/includes/dao/IDBAccessObject.php b/includes/dao/IDBAccessObject.php
index e18a090..a555c55 100644
--- a/includes/dao/IDBAccessObject.php
+++ b/includes/dao/IDBAccessObject.php
@@ -59,9 +59,9 @@
/** @var int Read from the master/quorum */
const READ_LATEST = 1;
/* @var int Read from the master/quorum and lock out other writers */
-   const READ_LOCKING = 3; // READ_LATEST (1) and "LOCK IN SHARE MODE" (2)
+   const READ_LOCKING = self::READ_LATEST | 2; // READ_LATEST (1) and 
"LOCK IN SHARE MODE" (2)
/** @var int Read from the master/quorum and lock out other writers and 
locking readers */
-   const READ_EXCLUSIVE = 7; // READ_LOCKING (3) and "FOR UPDATE" (4)
+   const READ_EXCLUSIVE = self::READ_LOCKING | 4; // READ_LOCKING (3) and 
"FOR UPDATE" (4)
 
/** @var int Read from a replica DB or without a quorum, using the 
master/quorum on miss */
const READ_LATEST_IMMUTABLE = 8;
diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php
index e421209..1b47178 100644
--- a/includes/logging/LogPage.php
+++ b/includes/logging/LogPage.php
@@ -35,8 +35,8 @@
const DELETED_RESTRICTED = 8;
 
// Convenience fields
-   const SUPPRESSED_USER = 12;
-   const SUPPRESSED_ACTION = 9;
+   const SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED;
+   const SUPPRESSED_ACTION = self::DELETED_ACTION | 
self::DELETED_RESTRICTED;
 
/** @var bool */
public $updateRecentChanges;
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index d0a04c0..fb899c1 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -92,7 +92,7 @@
const PURGE_CDN_CACHE = 1;
const PURGE_CLUSTER_PCACHE = 2;
const PURGE_GLOBAL_PCACHE = 4;
-   const PURGE_ALL = 7;
+   const PURGE_ALL = self::PURGE_CDN_CACHE | self::PURGE_CLUSTER_PCACHE | 
self::PURGE_GLOBAL_PCACHE;
 
/**
 * Constructor and clear the article
diff --git a/includes/parser/Preprocessor.php b/includes/parser/Preprocessor.php
index 49e961a..b6084d8 100644
--- a/includes/parser/Preprocessor.php
+++ b/includes/parser/Preprocessor.php
@@ -171,7 +171,8 @@
const RECOVER_COMMENTS = 16;
const NO_TAGS = 32;
 
-   const RECOVER_ORIG = 59; // = 1|2|8|16|32 no constant expression 
support in PHP yet
+   const RECOVER_ORIG = self::NO_ARGS | self::NO_TEMPLATES | 
self::NO_IGNORE |
+   self::RECOVER_COMMENTS | self::NO_TAGS;
 
/** This constant exists when $indexOffset is supported in newChild() */
const SUPPORTS_INDEX_OFFSET = 1;
diff --git a/tests/phpunit/suites/ParserTestTopLevelSuite.php 
b/tests/phpunit/suites/ParserTestTopLevelSuite.php
index 07b18f5..fe38a98 100644
--- a/tests/phpunit/suites/ParserTestTopLevelSuite.php
+++ b/tests/phpunit/suites/ParserTestTopLevelSuite.php
@@ -29,7 +29,7 @@
   

[MediaWiki-commits] [Gerrit] oojs/ui[master]: WikimediaUI theme: Reduce FieldLayout `margin-top` slightly

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

Change subject: WikimediaUI theme: Reduce FieldLayout `margin-top` slightly
..


WikimediaUI theme: Reduce FieldLayout `margin-top` slightly

Bug: T177675
Change-Id: I6463bb204cd89fd12a39c4f3c571be0ffc37
---
M src/themes/wikimediaui/layouts.less
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/themes/wikimediaui/layouts.less 
b/src/themes/wikimediaui/layouts.less
index 98b5864..ad0c0fa 100644
--- a/src/themes/wikimediaui/layouts.less
+++ b/src/themes/wikimediaui/layouts.less
@@ -40,11 +40,11 @@
 
 .theme-oo-ui-fieldLayout () {
// At base `font-size: 12.8px` we just relatively follow M101 design 
guideline here
-   margin-top: 1.640625em; // `1.5em` in the guideline, we go for 
`21px`/`1.640625em`
+   margin-top: 1.25em; // `1.5em` in the guideline, we go for 
`1.25em`≈`16px`
 
&.oo-ui-labelElement,
&.oo-ui-fieldLayout-align-inline {
-   margin-top: 1.171875em; // `1.25em` in the guideline, we go for 
`15px`/`1.171875em`
+   margin-top: 0.9375em; // `1.25em` in the guideline, we go for 
`0.9375em`≈`12px`
}
 
&,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6463bb204cd89fd12a39c4f3c571be0ffc37
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Prtksxna 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: installer: Reuse $db->makeList() rather than reinventing the...

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

Change subject: installer: Reuse $db->makeList() rather than reinventing the 
wheel
..


installer: Reuse $db->makeList() rather than reinventing the wheel

Change-Id: Ib1f896e5bed17bc240fe585fd6d5f753995a12e1
---
M includes/installer/MysqlUpdater.php
1 file changed, 5 insertions(+), 17 deletions(-)

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



diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index bcc2705..466ad0f 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -21,6 +21,7 @@
  * @ingroup Deployment
  */
 use Wikimedia\Rdbms\MySQLField;
+use Wikimedia\Rdbms\IDatabase;
 use MediaWiki\MediaWikiServices;
 
 /**
@@ -530,25 +531,12 @@
) );
}
$sql = "SELECT cur_title, cur_namespace, cur_id, 
cur_timestamp FROM $cur WHERE ";
-   $firstCond = true;
+   $dupeTitles = [];
foreach ( $duplicate as $ns => $titles ) {
-   if ( $firstCond ) {
-   $firstCond = false;
-   } else {
-   $sql .= ' OR ';
-   }
-   $sql .= "( cur_namespace = {$ns} AND cur_title 
in (";
-   $first = true;
-   foreach ( $titles as $t ) {
-   if ( $first ) {
-   $sql .= $this->db->addQuotes( 
$t );
-   $first = false;
-   } else {
-   $sql .= ', ' . 
$this->db->addQuotes( $t );
-   }
-   }
-   $sql .= ") ) \n";
+   $dupeTitles[] = "( cur_namespace = {$ns} AND 
cur_title in ("
+   . $this->db->makeList( $titles ) . ") ) 
\n";
}
+   $sql .= $this->db->makeList( $dupeTitles, 
IDatabase::LIST_OR );
# By sorting descending, the most recent entry will be 
the first in the list.
# All following entries will be deleted by the next 
while-loop.
$sql .= 'ORDER BY cur_namespace, cur_title, 
cur_timestamp DESC';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1f896e5bed17bc240fe585fd6d5f753995a12e1
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Suppress error in MediaWiki\Shell\Command

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

Change subject: Suppress error in MediaWiki\Shell\Command
..

Suppress error in MediaWiki\Shell\Command

Command uses a certain error message to detect and ignore
EINTR in stream_select, and uses trigger_error to clear
the message from get_last_error (clear_last_error is PHP7 only).
This works rather poorly with a system config that does not catch
or ignore most errors; specifically it breaks database tests
on Vagrant with the warnings_as_errors role on.

Use a workaround from 
http://php.net/manual/en/function.error-get-last.php#113518
to suppress the error.

Change-Id: I9c8f922bc0a8f5ee6b8e7501b3cce4f98ecb
---
M includes/shell/Command.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/98/382898/1

diff --git a/includes/shell/Command.php b/includes/shell/Command.php
index fd8f6a0..cf73d21 100644
--- a/includes/shell/Command.php
+++ b/includes/shell/Command.php
@@ -316,11 +316,16 @@
$readyPipes = $pipes;
 
// Clear last error
+   set_error_handler( function () {}, 0 );
// @codingStandardsIgnoreStart 
Generic.PHP.NoSilencedErrors.Discouraged
@trigger_error( '' );
+   // @codingStandardsIgnoreEnd
+   restore_error_handler();
+
+   // @codingStandardsIgnoreStart 
Generic.PHP.NoSilencedErrors.Discouraged
$numReadyPipes = @stream_select( $readyPipes, 
$emptyArray, $emptyArray, $timeout );
+   // @codingStandardsIgnoreEnd
if ( $numReadyPipes === false ) {
-   // @codingStandardsIgnoreEnd
$error = error_get_last();
if ( strncmp( $error['message'], $eintrMessage, 
strlen( $eintrMessage ) ) == 0 ) {
continue;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c8f922bc0a8f5ee6b8e7501b3cce4f98ecb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] RCFilters: Share one color picker popup between all hi...

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

Change subject: [WIP] RCFilters: Share one color picker popup between all 
highlight dropdowns
..

[WIP] RCFilters: Share one color picker popup between all highlight dropdowns

Change-Id: I84dabce988f4c99835f503bb8c8eb492f7fbfde1
---
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemHighlightButton.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuOptionWidget.js
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.HighlightColorPickerWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ItemMenuOptionWidget.js
M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js
5 files changed, 58 insertions(+), 26 deletions(-)


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

diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemHighlightButton.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemHighlightButton.js
index c840d7c..27ee038 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemHighlightButton.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemHighlightButton.js
@@ -7,34 +7,25 @@
 * @constructor
 * @param {mw.rcfilters.Controller} controller RCFilters controller
 * @param {mw.rcfilters.dm.FilterItem} model Filter item model
+* @param {mw.rcfilters.ui.MenuSelectWidget} menu Parent menu
 * @param {Object} [config] Configuration object
 */
-   mw.rcfilters.ui.FilterItemHighlightButton = function 
MwRcfiltersUiFilterItemHighlightButton( controller, model, config ) {
+   mw.rcfilters.ui.FilterItemHighlightButton = function 
MwRcfiltersUiFilterItemHighlightButton( controller, model, menu, config ) {
config = config || {};
-
-   this.colorPickerWidget = new 
mw.rcfilters.ui.HighlightColorPickerWidget( controller, model );
 
// Parent
mw.rcfilters.ui.FilterItemHighlightButton.parent.call( this, 
$.extend( true, {}, config, {
icon: 'highlight',
-   indicator: 'down',
-   popup: {
-   anchor: false,
-   padded: true,
-   align: 'backwards',
-   horizontalPosition: 'end',
-   $floatableContainer: this.$element,
-   width: 290,
-   $content: this.colorPickerWidget.$element
-   }
+   indicator: 'down'
} ) );
 
this.controller = controller;
this.model = model;
+   this.popup = menu.highlightPopup;
+   this.colorPicker = menu.highlightColorPicker;
 
// Event
this.model.connect( this, { update: 'updateUiBasedOnModel' } );
-   this.colorPickerWidget.connect( this, { chooseColor: 
'onChooseColor' } );
// This lives inside a MenuOptionWidget, which intercepts 
mousedown
// to select the item. We want to prevent that when we click 
the highlight
// button
@@ -59,6 +50,18 @@
 
/* Methods */
 
+   mw.rcfilters.ui.FilterItemHighlightButton.prototype.onAction = function 
() {
+   // Attach the shared popup to this button
+   this.popup.setFloatableContainer( this.$element );
+   // TODO add setAutoCloseIgnore to PopupWidget upstream
+   this.popup.$autoCloseIgnore = this.$element;
+   this.colorPicker.setItem( this.model );
+   this.colorPicker.connect( this, { chooseColor: 'onChooseColor' 
} );
+
+   // Parent method
+   
mw.rcfilters.ui.FilterItemHighlightButton.parent.prototype.onAction.call( this 
);
+   };
+
/**
 * Respond to item model update event
 */
@@ -81,6 +84,9 @@
};
 
mw.rcfilters.ui.FilterItemHighlightButton.prototype.onChooseColor = 
function () {
+   // Close the popup and disconnect it from this button
this.popup.toggle( false );
+   this.popup.disconnect( this );
+   this.popup.$autoCloseIgnore = undefined;
};
 }( mediaWiki, jQuery ) );
diff --git 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuOptionWidget.js
 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuOptionWidget.js
index 5198c69..66af6ee 100644
--- 
a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuOptionWidget.js
+++ 
b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuOptionWidget.js
@@ -7,16 +7,17 @@
 * @constructor
 * @param {mw.rcfilters.Controller}

[MediaWiki-commits] [Gerrit] operations/dns[master]: add mobile domain for electcom.wikimedia

2017-10-06 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382896 )

Change subject: add mobile domain for electcom.wikimedia
..


add mobile domain for electcom.wikimedia

Bug: T174370
Change-Id: I6d5f08ee7b2e62a6e40c55c5c9b57aac8a8948c6
---
M templates/wikimedia.org
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 65cea30..1df29ba 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -347,6 +347,7 @@
 dk.m600 IN DYNA geoip!text-addrs
 ec.m600 IN DYNA geoip!text-addrs
 ee.m600 IN DYNA geoip!text-addrs
+electcom.m  600 IN DYNA geoip!text-addrs
 et.m600 IN DYNA geoip!text-addrs
 incubator.m 600 IN DYNA geoip!text-addrs
 fdc.m   600 IN DYNA geoip!text-addrs

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d5f08ee7b2e62a6e40c55c5c9b57aac8a8948c6
Gerrit-PatchSet: 2
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: HTMLForm: Rename file to `ooui.styles.less` and use LESS not...

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

Change subject: HTMLForm: Rename file to `ooui.styles.less` and use LESS 
notation
..


HTMLForm: Rename file to `ooui.styles.less` and use LESS notation

Turning ooui.styles into a LESS files and take advantage of LESS
notation. This is in preparation for mangling whitespace of
OOUI Special:Pages forms.

Bug: T177668
Change-Id: Icd955358dbbf50712d8a66a0325aa14c8e7963d2
---
M resources/Resources.php
D resources/src/mediawiki/htmlform/ooui.styles.css
A resources/src/mediawiki/htmlform/ooui.styles.less
3 files changed, 50 insertions(+), 48 deletions(-)

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



diff --git a/resources/Resources.php b/resources/Resources.php
index b31926b..6d59d5c 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1110,7 +1110,7 @@
'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.htmlform.ooui.styles' => [
-   'styles' => 'resources/src/mediawiki/htmlform/ooui.styles.css',
+   'styles' => 'resources/src/mediawiki/htmlform/ooui.styles.less',
'targets' => [ 'desktop', 'mobile' ],
],
'mediawiki.icon' => [
diff --git a/resources/src/mediawiki/htmlform/ooui.styles.css 
b/resources/src/mediawiki/htmlform/ooui.styles.css
deleted file mode 100644
index dbf2b6b..000
--- a/resources/src/mediawiki/htmlform/ooui.styles.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/* OOUIHTMLForm styles */
-
-.mw-htmlform-ooui .mw-htmlform-field-HTMLCheckMatrix {
-   width: 100%;
-}
-
-.mw-htmlform-ooui .mw-htmlform-matrix {
-   border-spacing: 0;
-}
-
-.mw-htmlform-ooui .mw-htmlform-matrix td {
-   padding: 0.35em 0.7em;
-   -webkit-transition: background-color 250ms;
-   -moz-transition: background-color 250ms;
-   transition: background-color 250ms;
-}
-
-.mw-htmlform-ooui .mw-htmlform-matrix tbody tr:nth-child( even ) td {
-   background-color: #f8f9fa;
-}
-
-.mw-htmlform-ooui .mw-htmlform-matrix tbody tr:not( :first-child ):hover td {
-   background-color: #eaecf0;
-}
-
-.mw-htmlform-ooui .mw-htmlform-matrix tbody tr:first-child td {
-   background-color: #fff;
-}
-
-.mw-htmlform-ooui .mw-htmlform-matrix td.first {
-   margin-right: 5%;
-   width: 39%;
-}
-
-/* Flatlist styling for PHP widgets... */
-.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline,
-/* ...and for JS widgets */
-.mw-htmlform-flatlist .oo-ui-radioOptionWidget,
-.mw-htmlform-flatlist .oo-ui-checkboxMultioptionWidget {
-   display: inline-block;
-   margin-right: 1em;
-}
-
-.mw-htmlform-ooui .htmlform-tip,
-.mw-htmlform-ooui .mw-htmlform-submit-buttons {
-   margin-top: 1em;
-}
diff --git a/resources/src/mediawiki/htmlform/ooui.styles.less 
b/resources/src/mediawiki/htmlform/ooui.styles.less
new file mode 100644
index 000..43acb3a
--- /dev/null
+++ b/resources/src/mediawiki/htmlform/ooui.styles.less
@@ -0,0 +1,49 @@
+/* OOUIHTMLForm styles */
+
+.mw-htmlform-ooui {
+   .mw-htmlform-field-HTMLCheckMatrix {
+   width: 100%;
+   }
+
+   .mw-htmlform-matrix {
+   border-spacing: 0;
+
+   td {
+   padding: 0.35em 0.7em;
+   -webkit-transition: background-color 250ms;
+   -moz-transition: background-color 250ms;
+   transition: background-color 250ms;
+   }
+
+   tbody tr:nth-child( even ) td {
+   background-color: #f8f9fa;
+   }
+
+   tbody tr:not( :first-child ):hover td {
+   background-color: #eaecf0;
+   }
+
+   tbody tr:first-child td {
+   background-color: #fff;
+   }
+
+   td.first {
+   margin-right: 5%;
+   width: 39%;
+   }
+   }
+}
+
+/* Flatlist styling for PHP widgets... */
+.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline,
+/* ...and for JS widgets */
+.mw-htmlform-flatlist .oo-ui-radioOptionWidget,
+.mw-htmlform-flatlist .oo-ui-checkboxMultioptionWidget {
+   display: inline-block;
+   margin-right: 1em;
+}
+
+.mw-htmlform-ooui .htmlform-tip,
+.mw-htmlform-ooui .mw-htmlform-submit-buttons {
+   margin-top: 1em;
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd955358dbbf50712d8a66a0325aa14c8e7963d2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Prtksxna 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commi

[MediaWiki-commits] [Gerrit] operations/dns[master]: add mobile domain for electomwikimedia

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382896 )

Change subject: add mobile domain for electomwikimedia
..

add mobile domain for electomwikimedia

Bug: T174370
Change-Id: I6d5f08ee7b2e62a6e40c55c5c9b57aac8a8948c6
---
M templates/wikimedia.org
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/96/382896/1

diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 65cea30..1df29ba 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -347,6 +347,7 @@
 dk.m600 IN DYNA geoip!text-addrs
 ec.m600 IN DYNA geoip!text-addrs
 ee.m600 IN DYNA geoip!text-addrs
+electcom.m  600 IN DYNA geoip!text-addrs
 et.m600 IN DYNA geoip!text-addrs
 incubator.m 600 IN DYNA geoip!text-addrs
 fdc.m   600 IN DYNA geoip!text-addrs

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d5f08ee7b2e62a6e40c55c5c9b57aac8a8948c6
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Dzahn 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikiba.se: Fix docroot to /srv/se/wikiba/output

2017-10-06 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382894 )

Change subject: wikiba.se: Fix docroot to /srv/se/wikiba/output
..


wikiba.se: Fix docroot to /srv/se/wikiba/output

It seems the correct path is /srv/se/wikiba/output and not just
/srv/se/wikiba/

Change-Id: I68210e80d8f7fe67e746bbb46e64208b43cf02bc
---
M modules/profile/templates/wikibase/apache-wikibase.erb
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/profile/templates/wikibase/apache-wikibase.erb 
b/modules/profile/templates/wikibase/apache-wikibase.erb
index 5b92fc8..142a980 100644
--- a/modules/profile/templates/wikibase/apache-wikibase.erb
+++ b/modules/profile/templates/wikibase/apache-wikibase.erb
@@ -1,7 +1,7 @@
 
 ServerName <%= @server_name %>
 ServerAdmin <%= @server_admin %>
-DocumentRoot /srv/se/wikiba/
+DocumentRoot /srv/se/wikiba/output
 
 ServerSignature On
 
@@ -14,7 +14,7 @@
 AllowOverride None
 
 
-
+
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Require all granted

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I68210e80d8f7fe67e746bbb46e64208b43cf02bc
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Avoid notices on large articles

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

Change subject: Avoid notices on large articles
..


Avoid notices on large articles

Articles which have more than 500 contributors or 500 images (the
maximum number allowed) will lead to this field not being
set for other pages

The limit is for contributors/images across all articles, not
for each individual article

Change-Id: I24728a0156490fadff8d39ce87d564584576a5cc
---
M includes/DataProvider.php
1 file changed, 17 insertions(+), 4 deletions(-)

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



diff --git a/includes/DataProvider.php b/includes/DataProvider.php
index 7e5cd5c..235e68f 100644
--- a/includes/DataProvider.php
+++ b/includes/DataProvider.php
@@ -63,6 +63,7 @@
if ( isset( $item['revision'] ) ) {
$url .= '/' . $item['revision'];
}
+
return [
'method' => 'GET',
'url' => $url,
@@ -153,20 +154,30 @@
'action' => 'query',
'prop' => 'contributors|images',
'redirects' => 1,
+   // Note that the imlimit and pclimit applies to all 
titles so this will result in
+   // an incomplete list of contributors
+   'imlimit' => 'max',
'pclimit' => 'max', // 500; more titles than that will 
probably blow up Electron anyway
'titles' => implode( '|', $dbkeys ),
];
$images = [];
+   $metadata['contributors'] = [];
do {
$data = $this->makeActionApiRequest( $params );
$continue = isset( $data['continue'] ) ? 
$data['continue'] : [];
$params = $continue + $params;
foreach ( $data['query']['pages'] as $page ) {
-   foreach ( $page['contributors'] as $key => 
$contrib ) {
-   
$metadata['contributors'][$contrib['name']] = $contrib['userid'];
+   // Contributors will not be defined if pclimit 
is hit one of the other pages
+   if ( isset( $page['contributors'] ) ) {
+   foreach ( $page['contributors'] as $key 
=> $contrib ) {
+   
$metadata['contributors'][$contrib['name']] = $contrib['userid'];
+   }
}
-   foreach ( $page['images'] as $image ) {
-   $images[] = $image['title'];
+   // Imagess will not be defined if imlimit is 
hit one of the other pages
+   if ( isset( $page['images'] ) ) {
+   foreach ( $page['images'] as $image ) {
+   $images[] = $image['title'];
+   }
}
}
} while ( $continue );
@@ -213,6 +224,8 @@
}
}
} while ( $continue );
+   } else {
+   $metadata['images'][$page['title']] = [];
}
 
// get sections & modules

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I24728a0156490fadff8d39ce87d564584576a5cc
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: C. Scott Ananian 
Gerrit-Reviewer: Pmiazga 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Equivset[master]: Improving README.md

2017-10-06 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382895 )

Change subject: Improving README.md
..

Improving README.md

Adding installation instructions, fixing syntax error in usage
example, improving usage examples.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/Equivset 
refs/changes/95/382895/1

diff --git a/README.md b/README.md
index c2ab69f..91e74fd 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,18 @@
 # Equivset
 A mapping of "equivalent" characters to prevent spoofing.
 
+### Installation
+Using composer:
+Add the following to the composer.json file for your project:
+```
+{
+  "require": {
+ "wikimedia/equivset": "dev-master"
+  }
+}
+```
+And then run 'composer update'.
+
 ## Usage
 ```php
 use Wikimedia\Equivset\Equivset;
@@ -8,12 +20,13 @@
 $equivset = new Equivset();
 
 // Normalize a string
-echo $equivset->normalize( 0 ); // O
+echo $equivset->normalize( 'sp00f' ); // SPOOF
 
 // Get a single character.
-if ( $equivset->has( 'a' ) ) {
-   $char = equivset->get( 'a' );
+if ( $equivset->has( 'ɑ' ) ) {
+   $char = $equivset->get( 'ɑ' );
 }
+echo $char; // A
 
 // Loop over entire set.
 foreach ( $equivset as $char => $equiv ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ef0c19aef63636b1a4df50fe4ed62839bb33987
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/Equivset
Gerrit-Branch: master
Gerrit-Owner: Kaldari 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikiba.se: Fix docroot to /srv/se/wikiba/output

2017-10-06 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382894 )

Change subject: wikiba.se: Fix docroot to /srv/se/wikiba/output
..

wikiba.se: Fix docroot to /srv/se/wikiba/output

It seems the correct path is /srv/se/wikiba/output and not just /srv/se/wikiba/

Change-Id: I68210e80d8f7fe67e746bbb46e64208b43cf02bc
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68210e80d8f7fe67e746bbb46e64208b43cf02bc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Hygiene: Render functions should contain no logic

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

Change subject: Hygiene: Render functions should contain no logic
..


Hygiene: Render functions should contain no logic

Add the getBookTemplateData method which will be
responsible for creating the data needed for rendering.

Update method signatures so that they are only passed
what they need to render.

Add a comment to explain the additional processing in
renderImageInfos which is not clear at first glance.

Further simplification will happen in follow up patches

Change-Id: Iec31d60df0dd3d42402e781b5b1e356bc7e88800
---
M includes/BookRenderer.php
1 file changed, 177 insertions(+), 103 deletions(-)

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



diff --git a/includes/BookRenderer.php b/includes/BookRenderer.php
index 0bc4bfc..e79cd7a 100644
--- a/includes/BookRenderer.php
+++ b/includes/BookRenderer.php
@@ -26,23 +26,24 @@
 
/**
 * Generate the concatenated page.
-* @param array[] $collection Collection, as returned by 
CollectionSession::getCollection().
+* @param array[] $collection as returned by
+*   CollectionSession::getCollection().
 * @param string[] $pages Map of prefixed DB key => Parsoid HTML.
 * @param array[] &$metadata Map of prefixed DB key => metadata, as 
returned by fetchMetadata().
 *   Section data will be updated to account for heading level and id 
changes.
 *   Also, an outline will be added (see renderCoverAndToc() for 
format).
-* @return string HTML of the rendered book (without body/head).
+* @param boolean $hasChapters whether the book has articles
+* @param integer $articleCount number of articles in the book
+* @return array with keys html representing the data needed to render 
the book
 */
-   public function renderBook( $collection, $pages, &$metadata ) {
-   $hasChapters = (bool)array_filter( $collection['items'], 
function ( $item ) {
-   return $item['type'] === 'chapter';
-   } );
-   $articleCount = count( array_filter( $collection['items'], 
function ( $item ) {
-   return $item['type'] === 'article';
-   } ) );
-
-   $final = '';
+   private function getBookTemplateData(
+   $collection, $pages, $metadata, $hasChapters, $articleCount
+   ) {
$headingCounter = new HeadingCounter();
+   $bookBodyHtml = '';
+   $items = $collection['items'];
+   $tocHeadingCounter = new HeadingCounter();
+   $outline = [];
 
// First we need to render the articles as we can't know the 
TOC anchors for sure
// until we have resolved id conflicts.
@@ -52,15 +53,22 @@
$munger = new RemexCollectionMunger( $serializer, [
'topHeadingLevel' => $hasChapters ? 3 : 2,
] );
-   foreach ( $collection['items'] as $item ) {
+   foreach ( $items as $item ) {
+   $titleText = $item['title'];
+   $title = Title::newFromText( $titleText );
if ( $item['type'] === 'chapter' ) {
-   $final .= Html::element( 'h1', [
-   'id' => 'mw-book-chapter-' . 
Sanitizer::escapeIdForAttribute( $item['title'] ),
+   $outline[] = $this->getBookChapterData( $title, 
$tocHeadingCounter );
+   $bookBodyHtml .= Html::element( 'h1', [
+   'id' => 'mw-book-chapter-' . 
Sanitizer::escapeIdForAttribute( $titleText ),
'class' => 'mw-book-chapter',
'data-mw-sectionnumber' => 
$headingCounter->incrementAndGet( -2 ),
-   ], $item['title'] ) . "\n";
+   ], $titleText ) . "\n";
} elseif ( $item['type'] === 'article' ) {
-   $title = Title::newFromText( $item['title'] );
+   $outline = array_merge( $outline,
+   $this->getArticleChaptersData( $title, 
$tocHeadingCounter,
+   $metadata['displaytitle'], 
$metadata['sections'], $articleCount )
+   );
+
$dbkey = $title->getPrefixedDBkey();
$html = $this->getBodyContents( $pages[$dbkey] 
);
 
@@ -73,7 +81,8 @@
$mungerOptions['sectionNumberPrefix'] = 
$headingAttribs['data-mw-sectionnumber']
   

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Add license info

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

Change subject: Add license info
..


Add license info

Concatenated HTML has the license section now.

Change-Id: I759c3492d3bdaba67917db9ffe6685b9a5c32293
---
M i18n/en.json
M i18n/qqq.json
M includes/BookRenderer.php
M includes/DataProvider.php
M resources/ext.collection.offline/offline.less
A templates/license.mustache
6 files changed, 52 insertions(+), 4 deletions(-)

Approvals:
  Pmiazga: Looks good to me, approved
  Niedzielski: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Zoranzoki21: Looks good to me, but someone else must approve



diff --git a/i18n/en.json b/i18n/en.json
index 6e4ccf1..4d0e64b 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -193,6 +193,7 @@
"coll-images-source": "Source",
"coll-images-license": "License",
"coll-images-original-artist": "Original artist",
+   "coll-license-title": "Content License",
"coll-rendererror-title": "Could not generate the book",
"coll-rendererror-no-session": "Book definition not found in session. 
It might have been discarded due to inactivity.",
"coll-rendererror-pdf": "PDF rendering failed: $1",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 368fbec..d24ab09 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -220,6 +220,7 @@
"coll-images-source": "Label for the source of each image in the images 
section",
"coll-images-license": "Label for the license of each image in the 
images section",
"coll-images-original-artist": "Label for the original artist of each 
image in the images section",
+   "coll-license-title": "Text shown on top of PDF license section",
"coll-rendererror-title": "Error page title for book rendering errors.",
"coll-rendererror-no-session": "Error shown when trying to render a 
book but there is no collection stored in the session.",
"coll-rendererror-pdf": "Error shown when the Electron request to 
render the book into PDF failed. Parameters:\n* $1 - error message",
diff --git a/includes/BookRenderer.php b/includes/BookRenderer.php
index ed399b1..0bc4bfc 100644
--- a/includes/BookRenderer.php
+++ b/includes/BookRenderer.php
@@ -97,9 +97,10 @@
}
 
$final = $this->renderCoverAndToc( $collection, $metadata )
-. $final
-. $this->renderContributors( $metadata, 
$headingCounter->incrementAndGetTopLevel() )
-. $this->renderImageInfos( $metadata, 
$headingCounter->incrementAndGetTopLevel() );
+   . $final
+   . $this->renderContributors( $metadata, 
$headingCounter->incrementAndGetTopLevel() )
+   . $this->renderImageInfos( $metadata, 
$headingCounter->incrementAndGetTopLevel() )
+   . $this->renderLicense( $metadata, 
$headingCounter->incrementAndGetTopLevel() );
return $final;
}
 
@@ -182,6 +183,15 @@
'number' => 
$headingCounter->incrementAndGetTopLevel(),
];
}
+   if ( $metadata['license'] ) {
+   $outline[] = [
+   'text' => wfMessage( 'coll-license-title' 
)->text(),
+   'type' => 'license',
+   'level' => $metadataLevel,
+   'anchor' => 'mw-book-license',
+   'number' => 
$headingCounter->incrementAndGetTopLevel(),
+   ];
+   }
$metadata['outline'] = $outline;
 
return $this->templateParser->processTemplate( 'toc', 
$this->fixTemplateData( [
@@ -240,6 +250,23 @@
}
 
/**
+* Generate HTML for the content license of the book
+* @param array[] $metadata Map of prefixed DB key => metadata, as 
returned by fetchMetadata().
+* @param string $sectionNumber The section number for the images 
section, if any.
+* @return string HTML to append to the book.
+*/
+   private function renderLicense( $metadata, $sectionNumber = null ) {
+   if ( !$metadata['license'] ) {
+   return '';
+   }
+   return $this->templateParser->processTemplate( 'license', [
+   'sectionNumber' => $sectionNumber,
+   'license' => $metadata['license'],
+   'headingMsg' => wfMessage( 'coll-license-title' 
)->text()
+   ] );
+   }
+
+   /**
 * Get the part inside the  from an HTML file.
 * Not very robust (a  tag in a comment or CDATA section could 
confuse it) but the
 *  section has no user-controlled part so using it with Par

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Add images section

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

Change subject: Add images section
..


Add images section

Concatenated book HTML now has the images section.

Bug: T175856
Change-Id: I7ef0444c474a904a2610c3960ac8524bacad67dd
---
M i18n/en.json
M i18n/qqq.json
M includes/BookRenderer.php
M includes/DataProvider.php
M resources/ext.collection.offline/offline.less
A templates/images.mustache
6 files changed, 115 insertions(+), 8 deletions(-)

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

Objections:
  Niedzielski: There's a problem with this change, please improve



diff --git a/i18n/en.json b/i18n/en.json
index 0627409..6e4ccf1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -189,6 +189,10 @@
"coll-notice-download-pdf-text": "While the Book Creator PDF rendering 
is being replaced, you can try 'Download as PDF' from the sidebar tools 
for individual articles.",
"coll-toc-title": "Table of Contents",
"coll-contributors-title": "Contributors",
+   "coll-images-title": "Images",
+   "coll-images-source": "Source",
+   "coll-images-license": "License",
+   "coll-images-original-artist": "Original artist",
"coll-rendererror-title": "Could not generate the book",
"coll-rendererror-no-session": "Book definition not found in session. 
It might have been discarded due to inactivity.",
"coll-rendererror-pdf": "PDF rendering failed: $1",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ee5a7a4..368fbec 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -216,6 +216,10 @@
"coll-notice-download-pdf-text": "Text describing how to download 
article as PDF while Book Creator PDF feature is unavailable",
"coll-toc-title": "Text shown on top of PDF table of contents",
"coll-contributors-title": "Text shown on top of PDF contributors 
section",
+   "coll-images-title": "Text shown on top of PDF images section",
+   "coll-images-source": "Label for the source of each image in the images 
section",
+   "coll-images-license": "Label for the license of each image in the 
images section",
+   "coll-images-original-artist": "Label for the original artist of each 
image in the images section",
"coll-rendererror-title": "Error page title for book rendering errors.",
"coll-rendererror-no-session": "Error shown when trying to render a 
book but there is no collection stored in the session.",
"coll-rendererror-pdf": "Error shown when the Electron request to 
render the book into PDF failed. Parameters:\n* $1 - error message",
diff --git a/includes/BookRenderer.php b/includes/BookRenderer.php
index 1825ca7..ed399b1 100644
--- a/includes/BookRenderer.php
+++ b/includes/BookRenderer.php
@@ -98,7 +98,8 @@
 
$final = $this->renderCoverAndToc( $collection, $metadata )
 . $final
-. $this->renderContributors( $metadata, 
$headingCounter->incrementAndGetTopLevel() );
+. $this->renderContributors( $metadata, 
$headingCounter->incrementAndGetTopLevel() )
+. $this->renderImageInfos( $metadata, 
$headingCounter->incrementAndGetTopLevel() );
return $final;
}
 
@@ -159,19 +160,28 @@
}
 
if ( $hasChapters ) {
-   $contributorsLevel = -2;
+   $metadataLevel = -2;
} elseif ( $articleCount > 1 ) {
-   $contributorsLevel = -1;
+   $metadataLevel = -1;
} else {
-   $contributorsLevel = 0;
+   $metadataLevel = 0;
}
$outline[] = [
'text' => wfMessage( 'coll-contributors-title' 
)->text(),
'type' => 'contributors',
-   'level' => $contributorsLevel,
+   'level' => $metadataLevel,
'anchor' => 'mw-book-contributors',
'number' => $headingCounter->incrementAndGetTopLevel(),
];
+   if ( $metadata['images'] ) {
+   $outline[] = [
+   'text' => wfMessage( 'coll-images-title' 
)->text(),
+   'type' => 'images',
+   'level' => $metadataLevel,
+   'anchor' => 'mw-book-images',
+   'number' => 
$headingCounter->incrementAndGetTopLevel(),
+   ];
+   }
$metadata['outline'] = $outline;
 
return $this->templateParser->processTemplate( 'toc', 
$this->fixTemplateData( [
@@ -203,6 +213,33 @@
}
 
/**
+* Generate HTML fo

[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikiba.se: Remove colon from VirtualHost

2017-10-06 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382893 )

Change subject: wikiba.se: Remove colon from VirtualHost
..


wikiba.se: Remove colon from VirtualHost

it's invalid syntax.

Also correct the path by changing /srv/es/wikiba to /srv/se/wikiba.

Change-Id: I0c2b9dbc9b6fc3b7f710b772aa3cad7318e4b589
---
M modules/profile/manifests/microsites/wikibase.pp
M modules/profile/templates/wikibase/apache-wikibase.erb
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/modules/profile/manifests/microsites/wikibase.pp 
b/modules/profile/manifests/microsites/wikibase.pp
index d6c3c04..380aa6e 100644
--- a/modules/profile/manifests/microsites/wikibase.pp
+++ b/modules/profile/manifests/microsites/wikibase.pp
@@ -18,12 +18,12 @@
 content => template('profile/wikibase/apache-wikibase.erb'),
 }
 
-ensure_resource('file', '/srv/es', {'ensure' => 'directory' })
-ensure_resource('file', '/srv/es/wikiba', {'ensure' => 'directory' })
+ensure_resource('file', '/srv/se', {'ensure' => 'directory' })
+ensure_resource('file', '/srv/se/wikiba', {'ensure' => 'directory' })
 
 git::clone { 'wikibase/wikiba.se-deploy':
 ensure=> 'latest',
-directory => '/srv/es/wikiba',
+directory => '/srv/se/wikiba',
 branch=> 'master',
 }
 
diff --git a/modules/profile/templates/wikibase/apache-wikibase.erb 
b/modules/profile/templates/wikibase/apache-wikibase.erb
index 293df40..5b92fc8 100644
--- a/modules/profile/templates/wikibase/apache-wikibase.erb
+++ b/modules/profile/templates/wikibase/apache-wikibase.erb
@@ -1,4 +1,4 @@
-
+
 ServerName <%= @server_name %>
 ServerAdmin <%= @server_admin %>
 DocumentRoot /srv/se/wikiba/

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c2b9dbc9b6fc3b7f710b772aa3cad7318e4b589
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: installer: Add comments to purgeCache()

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

Change subject: installer: Add comments to purgeCache()
..


installer: Add comments to purgeCache()

Change-Id: I791f220b49e3e1c7d6df9ccab7d70ff8a0031ef1
---
M includes/installer/DatabaseUpdater.php
1 file changed, 11 insertions(+), 3 deletions(-)

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



diff --git a/includes/installer/DatabaseUpdater.php 
b/includes/installer/DatabaseUpdater.php
index 752bc54..a317822 100644
--- a/includes/installer/DatabaseUpdater.php
+++ b/includes/installer/DatabaseUpdater.php
@@ -988,19 +988,27 @@
}
 
/**
-* Purge the objectcache table
+* Purge various database caches
 */
public function purgeCache() {
global $wgLocalisationCacheConf;
-   # We can't guarantee that the user will be able to use TRUNCATE,
-   # but we know that DELETE is available to us
+   // We can't guarantee that the user will be able to use 
TRUNCATE,
+   // but we know that DELETE is available to us
$this->output( "Purging caches..." );
+
+   // ObjectCache
$this->db->delete( 'objectcache', '*', __METHOD__ );
+
+   // LocalisationCache
if ( $wgLocalisationCacheConf['manualRecache'] ) {
$this->rebuildLocalisationCache();
}
+
+   // ResourceLoader: Message cache
$blobStore = new MessageBlobStore();
$blobStore->clear();
+
+   // ResourceLoader: File-dependency cache
$this->db->delete( 'module_deps', '*', __METHOD__ );
$this->output( "done.\n" );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I791f220b49e3e1c7d6df9ccab7d70ff8a0031ef1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikiba.se: Remove colon from VirtualHost

2017-10-06 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382893 )

Change subject: wikiba.se: Remove colon from VirtualHost
..

wikiba.se: Remove colon from VirtualHost

it's invalid syntax.

Change-Id: I0c2b9dbc9b6fc3b7f710b772aa3cad7318e4b589
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/93/382893/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikiba.se: Add missing variables to wikibase.pp profile

2017-10-06 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382891 )

Change subject: wikiba.se: Add missing variables to wikibase.pp profile
..


wikiba.se: Add missing variables to wikibase.pp profile

Adds missing $server_name and $server_admin hiera calls.

Change-Id: I5587585b8f80f09bb2d7914c9f5951c0181bcad8
---
M modules/profile/manifests/microsites/wikibase.pp
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/modules/profile/manifests/microsites/wikibase.pp 
b/modules/profile/manifests/microsites/wikibase.pp
index ab4014b..d6c3c04 100644
--- a/modules/profile/manifests/microsites/wikibase.pp
+++ b/modules/profile/manifests/microsites/wikibase.pp
@@ -1,5 +1,8 @@
 # https://wikiba.se (T99531)
-class profile::microsites::wikibase {
+class profile::microsites::wikibase(
+  $server_name = hiera('profile::wikibase::server_name'),
+  $server_admin = hiera('profile::wikibase::server_admin'),
+) {
 
 class { '::base::firewall': }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5587585b8f80f09bb2d7914c9f5951c0181bcad8
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikibase: set Labs Hiera values in repo

2017-10-06 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/382892 )

Change subject: wikibase: set Labs Hiera values in repo
..


wikibase: set Labs Hiera values in repo

Set values for server name and server admin name in Labs
in the repo and not on the wiki page.

Change-Id: Id5c80b5c6bf423068a60934d9295dc7c38ab5235
---
A hieradata/labs/wikidata-dev/host/wikibase-stretch.yaml
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/labs/wikidata-dev/host/wikibase-stretch.yaml 
b/hieradata/labs/wikidata-dev/host/wikibase-stretch.yaml
new file mode 100644
index 000..1e5d75f
--- /dev/null
+++ b/hieradata/labs/wikidata-dev/host/wikibase-stretch.yaml
@@ -0,0 +1,2 @@
+profile:wikibase::server_name: 'wikibase.wmflabs.org'
+profile:wikibase::server_admin: 
'ladsgroup@wikibase-stretch.wikidata-dev.eqiad.wmflabs'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id5c80b5c6bf423068a60934d9295dc7c38ab5235
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Equivset[master]: Renaming README to README.md (needed by GitHub)

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

Change subject: Renaming README to README.md (needed by GitHub)
..


Renaming README to README.md (needed by GitHub)

Change-Id: I3779dcf3e938baa0f06572ade1e4c75becddfdb3
---
R README.md
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/README b/README.md
similarity index 100%
rename from README
rename to README.md

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3779dcf3e938baa0f06572ade1e4c75becddfdb3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/libs/Equivset
Gerrit-Branch: master
Gerrit-Owner: Kaldari 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikiba.se: Fix class

2017-10-06 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382891 )

Change subject: wikiba.se: Fix class
..

wikiba.se: Fix class

Change-Id: I5587585b8f80f09bb2d7914c9f5951c0181bcad8
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/91/382891/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5587585b8f80f09bb2d7914c9f5951c0181bcad8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Improve some parameter docs

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

Change subject: Improve some parameter docs
..


Improve some parameter docs

Change-Id: Ibac10a20243a4eedd826485d56eddd5234da6fec
---
M includes/AFComputedVariable.php
M includes/AbuseFilter.class.php
M includes/AbuseFilter.hooks.php
M includes/AbuseFilterVariableHolder.php
M includes/Views/AbuseFilterView.php
M includes/Views/AbuseFilterViewEdit.php
M includes/Views/AbuseFilterViewExamine.php
M includes/Views/AbuseFilterViewHistory.php
M includes/Views/AbuseFilterViewRevert.php
M includes/api/ApiAbuseFilterCheckMatch.php
M includes/api/ApiAbuseFilterCheckSyntax.php
M includes/api/ApiAbuseFilterEvalExpression.php
M includes/api/ApiAbuseFilterUnblockAutopromote.php
M includes/api/ApiQueryAbuseFilters.php
M includes/api/ApiQueryAbuseLog.php
M includes/parser/AFPData.php
M includes/parser/AbuseFilterCachingParser.php
M includes/parser/AbuseFilterParser.php
M includes/special/SpecialAbuseLog.php
M phpcs.xml
20 files changed, 180 insertions(+), 179 deletions(-)

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



diff --git a/includes/AFComputedVariable.php b/includes/AFComputedVariable.php
index 45d635b..c8f3351 100644
--- a/includes/AFComputedVariable.php
+++ b/includes/AFComputedVariable.php
@@ -6,8 +6,8 @@
public static $articleCache = [];
 
/**
-* @param $method
-* @param $parameters
+* @param string $method
+* @param array $parameters
 */
function __construct( $method, $parameters ) {
$this->mMethod = $method;
@@ -47,7 +47,7 @@
 * in case a user name is given as argument. Nowadays user objects are 
passed
 * directly but many old log entries rely on this.
 *
-* @param $user string|User
+* @param string|User $user
 * @return User
 */
static function getUserObject( $user ) {
@@ -86,8 +86,8 @@
}
 
/**
-* @param $namespace
-* @param $title Title
+* @param int $namespace
+* @param Title $title
 * @return Article
 */
static function articleFromTitle( $namespace, $title ) {
@@ -134,7 +134,7 @@
}
 
/**
-* @param $vars AbuseFilterVariableHolder
+* @param AbuseFilterVariableHolder $vars
 * @return AFPData|array|int|mixed|null|string
 * @throws MWException
 * @throws AFPException
diff --git a/includes/AbuseFilter.class.php b/includes/AbuseFilter.class.php
index 776cdc4..552a351 100644
--- a/includes/AbuseFilter.class.php
+++ b/includes/AbuseFilter.class.php
@@ -380,7 +380,7 @@
}
 
/**
-* @param $filter
+* @param string $filter
 * @return mixed
 */
public static function checkSyntax( $filter ) {
@@ -393,7 +393,7 @@
}
 
/**
-* @param $expr
+* @param string $expr
 * @param array $vars
 * @return string
 */
@@ -1293,7 +1293,7 @@
 * Retrieve a var dump from External Storage or the text table
 * Some of this code is stolen from Revision::loadText et al
 *
-* @param $stored_dump
+* @param string $stored_dump
 *
 * @return object|AbuseFilterVariableHolder|bool
 */
@@ -1592,8 +1592,8 @@
}
 
/**
-* @param $throttleId
-* @param $types
+* @param string $throttleId
+* @param array $types
 * @param Title $title
 * @param string $rateCount
 * @param string $ratePeriod
@@ -1670,7 +1670,7 @@
}
 
/**
-* @param $throttleId
+* @param string $throttleId
 * @param string $type
 * @param Title $title
 * @param bool $global
@@ -2530,10 +2530,10 @@
return $text;
}
 
-   /*
+   /**
 * Get the history ID of the first change to a given filter
 *
-* @param int $filterId Filter id
+* @param int $filterID Filter id
 * @return int
 */
public static function getFirstFilterChange( $filterID ) {
diff --git a/includes/AbuseFilter.hooks.php b/includes/AbuseFilter.hooks.php
index 6e14e26..8c5de14 100644
--- a/includes/AbuseFilter.hooks.php
+++ b/includes/AbuseFilter.hooks.php
@@ -211,16 +211,16 @@
}
 
/**
-* @param Article|WikiPage $article
-* @param User $user
+* @param Article|WikiPage &$article
+* @param User &$user
 * @param string $content Content
 * @param string $summary
 * @param bool $minoredit
 * @param bool $watchthis
 * @param string $sectionanchor
-* @param int $flags
+* @param int &$flags
 * @param Revision $revision
-* @param Status $status
+* @param Status &$status
 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikibase: set Labs Hiera values in repo

2017-10-06 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382892 )

Change subject: wikibase: set Labs Hiera values in repo
..

wikibase: set Labs Hiera values in repo

Set values for server name and server admin name in Labs
in the repo and not on the wiki page.

Change-Id: Id5c80b5c6bf423068a60934d9295dc7c38ab5235
---
A hieradata/labs/wikidata-dev/host/wikidata-stretch.yaml
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/hieradata/labs/wikidata-dev/host/wikidata-stretch.yaml 
b/hieradata/labs/wikidata-dev/host/wikidata-stretch.yaml
new file mode 100644
index 000..1e5d75f
--- /dev/null
+++ b/hieradata/labs/wikidata-dev/host/wikidata-stretch.yaml
@@ -0,0 +1,2 @@
+profile:wikibase::server_name: 'wikibase.wmflabs.org'
+profile:wikibase::server_admin: 
'ladsgroup@wikibase-stretch.wikidata-dev.eqiad.wmflabs'

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: docs/uidesign/monospace.html: Add textareas to the demo

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

Change subject: docs/uidesign/monospace.html: Add textareas to the demo
..


docs/uidesign/monospace.html: Add textareas to the demo

It seems that textareas have their own font-size set in Chrome (but not
Firefox and other browsers), making them unaffected by this behavior.

Change-Id: I811245ea26b4d90ad252fe8f6d2e096e27cb9073
---
M docs/uidesign/monospace.html
1 file changed, 104 insertions(+), 2 deletions(-)

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

Objections:
  VolkerE: There's a problem with this change, please improve



diff --git a/docs/uidesign/monospace.html b/docs/uidesign/monospace.html
index f2b988e2..cdaf580 100644
--- a/docs/uidesign/monospace.html
+++ b/docs/uidesign/monospace.html
@@ -2,15 +2,24 @@
 
 

-   pre {
+   pre,
+   textarea {
border: 1px dashed #AAA;
background-color: #E0E0E0;
color: #00;
-   margin: 1em 10%;
padding: 0.5em;
+   height: 1em;
+   width: 90%;
}
blockquote {
font-style: italic;
+   }
+   table {
+   width: 100%;
+   table-layout: fixed;
+   }
+   td {
+   padding: 0.5em;
}

 
@@ -33,45 +42,138 @@
 monospace and use 0.8 x 16px = 13px instead.
 
 
+Additionally, it seems that textareas have their own font-size set in Chrome
+(but not Firefox and other browsers), making them unaffected by this behavior.
+
+
 Below are various rendering:
 
 
+
+
+
+
+