[MediaWiki-commits] [Gerrit] integration/config[master]: Install xdebug for composer-package image
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
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
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...
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
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...
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
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
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?
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?
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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
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...
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
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
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
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
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...
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
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...
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
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...
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
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
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
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
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
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
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
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
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
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()
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
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
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
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)
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
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
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
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
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: + + + ++
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Clarify operator precedence
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/382885 ) Change subject: resourceloader: Clarify operator precedence .. resourceloader: Clarify operator precedence Change-Id: I478db046a1cc162c6767003ce45c9b56270f3372 --- M includes/resourceloader/ResourceLoaderImageModule.php M tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index 8b54959..71a0fa2 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -249,7 +249,7 @@ $fileDescriptor = is_string( $options ) ? $options : $options['file']; $allowedVariants = array_merge( - is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : [], + ( is_array( $options ) && isset( $options['variants'] ) ) ? $options['variants'] : [], $this->getGlobalVariants( $context ) ); if ( isset( $this->variants[$skin] ) ) { diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php index aea2776..838d2c0 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php @@ -15,8 +15,8 @@ protected function getTestImage( $name ) { $options = ResourceLoaderImageModuleTest::$commonImageData[$name]; $fileDescriptor = is_string( $options ) ? $options : $options['file']; - $allowedVariants = is_array( $options ) && - isset( $options['variants'] ) ? $options['variants'] : []; + $allowedVariants = ( is_array( $options ) && isset( $options['variants'] ) ) ? + $options['variants'] : []; $variants = array_fill_keys( $allowedVariants, [ 'color' => 'red' ] ); return new ResourceLoaderImageTestable( $name, -- To view, visit https://gerrit.wikimedia.org/r/382885 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I478db046a1cc162c6767003ce45c9b56270f3372 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński Gerrit-Reviewer: Krinkle 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] oojs/ui[master]: WikimediaUI theme: Reduce FieldLayout `margin-top` slightly
VolkerE has uploaded a new change for review. ( 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(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/90/382890/1 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: newchange Gerrit-Change-Id: I6463bb204cd89fd12a39c4f3c571be0ffc37 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: VolkerE ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FundraisingTranslateWorkflow[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382889 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I1a1c6191dcc7c6027f95a6d02667bd9ea3bcb7ea --- M FundraisingMessageGroup.php M phpcs.xml 2 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FundraisingTranslateWorkflow refs/changes/89/382889/1 diff --git a/FundraisingMessageGroup.php b/FundraisingMessageGroup.php index ebd2003..e354df4 100644 --- a/FundraisingMessageGroup.php +++ b/FundraisingMessageGroup.php @@ -19,7 +19,9 @@ * * Wrap translation groups we want to mutate. * -* @param array $list +* @param array &$groups +* @param array &$deps +* @param array &$autoload * @return bool */ public static function onTranslatePostInitGroups( &$groups, &$deps, &$autoload ) { @@ -43,6 +45,7 @@ /** * Modify workflow permissions +* @return MessageGroupStates */ public function getMessageGroupStates() { global $wgFundraisingTranslateWorkflowPublishRight; @@ -60,6 +63,9 @@ /** * Delegate everything else to the pseudo-parent object +* @param string $method +* @param array $args +* @return mixed */ public function __call( $method, $args ) { return call_user_func_array( [ $this->group, $method ], $args ); diff --git a/phpcs.xml b/phpcs.xml index 39107c9..489037d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -3,13 +3,8 @@ - - - . - vendor - node_modules -- To view, visit https://gerrit.wikimedia.org/r/382889 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a1c6191dcc7c6027f95a6d02667bd9ea3bcb7ea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FundraisingTranslateWorkflow Gerrit-Branch: master Gerrit-Owner: Umherirrender ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Equivset[master]: Renaming README to README.md (needed by GitHub)
Kaldari has uploaded a new change for review. ( 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(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/libs/Equivset refs/changes/88/382888/1 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: newchange Gerrit-Change-Id: I3779dcf3e938baa0f06572ade1e4c75becddfdb3 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] mediawiki/core[master]: [WIP] Implement structured footer content
Krinkle has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382887 ) Change subject: [WIP] Implement structured footer content .. [WIP] Implement structured footer content This the footer link logic structured and contained. Previously, the only way to insert content into the footer is to - 1) expose the content as HTML. (Unstructured) - 2) in its own SkinTemplate data key. (Chance of collision) - 3) and adding that key to a list in another data key. - 4) by using the SkinTemplateOutputPageBeforeExec hook. This changes the logic by: * Encouraging structured data instead of raw HTML. * Avoiding name collisions due to the HTML no longer being stored in an array that is shared with many other purposes and extensions. * Discouraging non-skin extensions from needing to use SkinTemplate data keys (e.g. 'footerlinks') as a public API. * Discouraging use of SkinTemplateOutputPageBeforeExec hook. * Removeing one of few cases where SkinTemplate data is considered mutable instead of read-only after being set. The modification point is now where the data is defined, *before* it is "set" as SkinTemplate data. Bug: T60137 Change-Id: If20e2c65ad6dccc6accf06fd1c7421a41c70c44e --- M includes/skins/BaseTemplate.php M includes/skins/SkinTemplate.php 2 files changed, 158 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/87/382887/1 diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php index 8d5ce10..d921338 100644 --- a/includes/skins/BaseTemplate.php +++ b/includes/skins/BaseTemplate.php @@ -573,40 +573,91 @@ } /** -* Returns an array of footerlinks trimmed down to only those footer links that -* are valid. +* Returns an array of data keys containing footer HTML content. +* * If you pass "flat" as an option then the returned array will be a flat array -* of footer icons instead of a key/value array of footerlinks arrays broken -* up into categories. -* @param string $option -* @return array|mixed +* of data keys instead of grouped by footer area. +* +* @param string|null $option [optional] +* @return array */ - function getFooterLinks( $option = null ) { - $footerlinks = $this->get( 'footerlinks' ); + public function getFooterLinks( $option = null ) { + $content = $this->get( 'footercontent' ); - // Reduce footer links down to only those which are being used - $validFooterLinks = []; - foreach ( $footerlinks as $category => $links ) { - $validFooterLinks[$category] = []; - foreach ( $links as $link ) { - if ( isset( $this->data[$link] ) && $this->data[$link] ) { - $validFooterLinks[$category][] = $link; + $keysByArea = []; + foreach ( $content['areas'] as $areaName => $itemNames ) { + $areaKeys = []; + foreach ( $itemNames as $itemName ) { + $item = $content['items'][$itemName]; + switch ( $item['type'] ) { + case 'html-data': + if ( isset( $this->data[$itemName] ) && $this->data[$itemName] ) { + $areaKeys[] = $itemName; + } + break; + default: + throw new sException( "Unknown footer content type: {$item['type']}" ); } } - if ( count( $validFooterLinks[$category] ) <= 0 ) { - unset( $validFooterLinks[$category] ); + if ( $areaKeys ) { + $keysByArea[$areaName] = $areaKeys; } } if ( $option == 'flat' ) { - // fold footerlinks into a single array using a bit of trickery - $validFooterLinks = call_user_func_array( + // Fold areas into a single list using a bit of trickery + return call_user_func_array( 'array_merge', - array_values( $validFooterLinks ) + array_values( $keysByArea ) ); } - return $validFooterLinks; + return $keysByArea; + } + + /** +* Returns an array of footer HTML content. +* +* If you pass "flat" as an option the
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382886 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I7e54530641437d8715bd977330a40470e2932928 --- M includes/Projection/EPSG3857.php M includes/SimpleStyleParser.php M includes/SpecialMap.php M includes/Tag/TagHandler.php M phpcs.xml 5 files changed, 13 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/86/382886/1 diff --git a/includes/Projection/EPSG3857.php b/includes/Projection/EPSG3857.php index 06495b8..0b053bd 100644 --- a/includes/Projection/EPSG3857.php +++ b/includes/Projection/EPSG3857.php @@ -41,8 +41,8 @@ /** * (Point, Number[, Boolean]) -> LatLon * -* @param $point -* @param $zoom +* @param array $point +* @param float $zoom * @return array */ public static function pointToLatLon( $point, $zoom ) { diff --git a/includes/SimpleStyleParser.php b/includes/SimpleStyleParser.php index 74d357e..91be720 100644 --- a/includes/SimpleStyleParser.php +++ b/includes/SimpleStyleParser.php @@ -67,7 +67,7 @@ /** * Validate and sanitize a parsed GeoJSON data object * -* @param array|object $data +* @param array|object &$data * @return Status */ public function parseObject( &$data ) { @@ -84,7 +84,7 @@ /** * Normalize an object * -* @param stdClass[] $data +* @param stdClass[] &$data * @return Status */ public function normalizeAndSanitize( &$data ) { @@ -94,8 +94,8 @@ } /** -* @param stdClass[] $values -* @param stdClass $counters counter-name -> integer +* @param stdClass[] &$values +* @param stdClass &$counters counter-name -> integer * @return bool|array [ marker, marker properties ] */ public static function doCountersRecursive( array &$values, &$counters ) { @@ -166,7 +166,7 @@ * Does not attempt to be smart, just recurses through everything that can be dangerous even * if not a valid GeoJSON. * -* @param object|array $json +* @param object|array &$json */ protected function sanitize( &$json ) { if ( is_array( $json ) ) { @@ -192,7 +192,7 @@ /** * Normalizes JSON * -* @param array $json +* @param array &$json * @return Status */ protected function normalize( array &$json ) { @@ -274,7 +274,7 @@ * * HACK: this function supports JsonConfig-style localization that doesn't pass validation * -* @param object $properties +* @param object &$properties */ private function sanitizeProperties( &$properties ) { foreach ( self::$parsedProps as $prop ) { diff --git a/includes/SpecialMap.php b/includes/SpecialMap.php index f8d644b..3d8ef55 100644 --- a/includes/SpecialMap.php +++ b/includes/SpecialMap.php @@ -64,7 +64,7 @@ /** * Parses subpage parameter to this special page into zoom / lat /lon * -* @param $par +* @param string $par * @return array|bool */ public static function parseSubpage( $par ) { diff --git a/includes/Tag/TagHandler.php b/includes/Tag/TagHandler.php index 909012c..e466bb8 100644 --- a/includes/Tag/TagHandler.php +++ b/includes/Tag/TagHandler.php @@ -87,7 +87,7 @@ /** * Entry point for all tags * -* @param $input +* @param string $input * @param array $args * @param Parser $parser * @param PPFrame $frame @@ -134,7 +134,7 @@ /** * Parses and sanitizes GeoJSON+simplestyle contained inside of tags * -* @param $input +* @param string $input * @param Parser $parser * @param PPFrame $frame */ @@ -207,7 +207,7 @@ } /** -* @param $name +* @param string $name * @param bool $default * @return float|string */ diff --git a/phpcs.xml b/phpcs.xml index 213e0ac..d473d2b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,9 +2,6 @@ - - - @@ -14,6 +11,4 @@ . - vendor - node_modules -- To view, visit https://gerrit.wikimedia.org/r/382886 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e54530641437d8715bd977330a40470e2932928 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: Umherirrender ___
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Clarify operator precedence
Bartosz Dziewoński has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382885 ) Change subject: Clarify operator precedence .. Clarify operator precedence Change-Id: I478db046a1cc162c6767003ce45c9b56270f3372 --- M includes/resourceloader/ResourceLoaderImageModule.php M tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/85/382885/1 diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index 8b54959..71a0fa2 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -249,7 +249,7 @@ $fileDescriptor = is_string( $options ) ? $options : $options['file']; $allowedVariants = array_merge( - is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : [], + ( is_array( $options ) && isset( $options['variants'] ) ) ? $options['variants'] : [], $this->getGlobalVariants( $context ) ); if ( isset( $this->variants[$skin] ) ) { diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php index aea2776..838d2c0 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderImageTest.php @@ -15,8 +15,8 @@ protected function getTestImage( $name ) { $options = ResourceLoaderImageModuleTest::$commonImageData[$name]; $fileDescriptor = is_string( $options ) ? $options : $options['file']; - $allowedVariants = is_array( $options ) && - isset( $options['variants'] ) ? $options['variants'] : []; + $allowedVariants = ( is_array( $options ) && isset( $options['variants'] ) ) ? + $options['variants'] : []; $variants = array_fill_keys( $allowedVariants, [ 'color' => 'red' ] ); return new ResourceLoaderImageTestable( $name, -- To view, visit https://gerrit.wikimedia.org/r/382885 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I478db046a1cc162c6767003ce45c9b56270f3372 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Avoid clashes with MediaWiki:Common.css for hlist rules
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/382882 ) Change subject: Avoid clashes with MediaWiki:Common.css for hlist rules .. Avoid clashes with MediaWiki:Common.css for hlist rules Impacts footer and main menu Bug: T173507 Change-Id: Ie519550c0657c2314ecccaca1d65ecf99d0a3f5f --- M resources/skins.minerva.mainMenu.styles/mainmenu.less M skinStyles/mediawiki.hlist/minerva.less 2 files changed, 8 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Jdlrobson: Looks good to me, approved diff --git a/resources/skins.minerva.mainMenu.styles/mainmenu.less b/resources/skins.minerva.mainMenu.styles/mainmenu.less index 8b2780b..75ec233 100644 --- a/resources/skins.minerva.mainMenu.styles/mainmenu.less +++ b/resources/skins.minerva.mainMenu.styles/mainmenu.less @@ -110,6 +110,11 @@ margin: 0; font-size: 0.75em; // equals `12px` at base `font-size: 16px` + // T173507 + &:after { + content: none; + } + a { color: @colorProgressive; padding: 0.7em 12px; diff --git a/skinStyles/mediawiki.hlist/minerva.less b/skinStyles/mediawiki.hlist/minerva.less index 80e646a..d6a0f06 100644 --- a/skinStyles/mediawiki.hlist/minerva.less +++ b/skinStyles/mediawiki.hlist/minerva.less @@ -28,13 +28,14 @@ .hlist-separated { li:after { - content: '•'; + // Make sure we override any site styles + content: '•' !important; padding-left: 8px; color: @linkColor; font-size: 16px; line-height: 1; } :last-child:after { - content: ''; + content: none !important; } } -- To view, visit https://gerrit.wikimedia.org/r/382882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie519550c0657c2314ecccaca1d65ecf99d0a3f5f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/skins/MinervaNeue Gerrit-Branch: master Gerrit-Owner: Jdlrobson Gerrit-Reviewer: Jdlrobson 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] operations/puppet[production]: wikibase: fix git clone destination
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382884 ) Change subject: wikibase: fix git clone destination .. wikibase: fix git clone destination It's not wikibase.se, it's wikiba.se. This joke name just makes it so confusing, this isn't Sweden :) Change-Id: I8b767c8da169c6de748c7d8ed08e6a865c2db243 --- M modules/profile/manifests/microsites/wikibase.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/84/382884/1 diff --git a/modules/profile/manifests/microsites/wikibase.pp b/modules/profile/manifests/microsites/wikibase.pp index 8d764b2..ab4014b 100644 --- a/modules/profile/manifests/microsites/wikibase.pp +++ b/modules/profile/manifests/microsites/wikibase.pp @@ -18,7 +18,7 @@ ensure_resource('file', '/srv/es', {'ensure' => 'directory' }) ensure_resource('file', '/srv/es/wikiba', {'ensure' => 'directory' }) -git::clone { 'wikibase/wikibase.se-deploy': +git::clone { 'wikibase/wikiba.se-deploy': ensure=> 'latest', directory => '/srv/es/wikiba', branch=> 'master', -- To view, visit https://gerrit.wikimedia.org/r/382884 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b767c8da169c6de748c7d8ed08e6a865c2db243 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]: wikibase: fix git clone destination
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/382884 ) Change subject: wikibase: fix git clone destination .. wikibase: fix git clone destination It's not wikibase.se, it's wikiba.se. This joke name just makes it so confusing, this isn't Sweden :) Change-Id: I8b767c8da169c6de748c7d8ed08e6a865c2db243 --- M modules/profile/manifests/microsites/wikibase.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Paladox: Looks good to me, but someone else must approve 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 8d764b2..ab4014b 100644 --- a/modules/profile/manifests/microsites/wikibase.pp +++ b/modules/profile/manifests/microsites/wikibase.pp @@ -18,7 +18,7 @@ ensure_resource('file', '/srv/es', {'ensure' => 'directory' }) ensure_resource('file', '/srv/es/wikiba', {'ensure' => 'directory' }) -git::clone { 'wikibase/wikibase.se-deploy': +git::clone { 'wikibase/wikiba.se-deploy': ensure=> 'latest', directory => '/srv/es/wikiba', branch=> 'master', -- To view, visit https://gerrit.wikimedia.org/r/382884 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b767c8da169c6de748c7d8ed08e6a865c2db243 Gerrit-PatchSet: 1 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] wikimedia...rainbow[develop]: Count the number of user session tokens by volume for mobile...
Bearloga has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/381508 ) Change subject: Count the number of user session tokens by volume for mobile web search .. Count the number of user session tokens by volume for mobile web search Bug: T176811 Change-Id: I9ce01d5c6ffcce6ddb6e4fe35281d41c39f9f9d6 --- M modules/mobile_web/events.R M tab_documentation/mobile_events.md M ui.R M utils.R 4 files changed, 45 insertions(+), 13 deletions(-) Approvals: Bearloga: Verified; Looks good to me, approved diff --git a/modules/mobile_web/events.R b/modules/mobile_web/events.R index 6f326c6..3e0125a 100644 --- a/modules/mobile_web/events.R +++ b/modules/mobile_web/events.R @@ -1,6 +1,15 @@ +output$mobile_event_user_session <- renderValueBox( + valueBox( +value = mobile_session_mean["Total user sessions"], +subtitle = "User sessions per day*", +icon = icon("search"), +color = "green" + ) +) + output$mobile_event_searches <- renderValueBox( valueBox( -value = mobile_dygraph_means["search sessions"], +value = mobile_dygraph_means["search start"], subtitle = "Search sessions per day*", icon = icon("search"), color = "green" @@ -30,5 +39,13 @@ polloi::smoother(smooth_level = polloi::smooth_switch(input$smoothing_global, input$smoothing_mobile_event)) %>% polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Mobile search events, by day") %>% dyRangeSelector %>% -dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom") +dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom") %>% +dyEvent(as.Date("2017-03-29"), "H (new header)", labelLoc = "bottom") +}) + +output$mobile_session_plot <- renderDygraph({ + mobile_session %>% +polloi::smoother(smooth_level = polloi::smooth_switch(input$smoothing_global, input$smoothing_mobile_event)) %>% +polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Mobile user sessions, by volume") %>% +dyRangeSelector }) diff --git a/tab_documentation/mobile_events.md b/tab_documentation/mobile_events.md index e6859b9..c8a029a 100644 --- a/tab_documentation/mobile_events.md +++ b/tab_documentation/mobile_events.md @@ -1,13 +1,15 @@ -Mobile search +Mobile web search === -User actions that we track around search on the mobile website generally fall into three categories: +User actions that we track around prefix search on the mobile website generally fall into three categories: -1. The start of a user's search session; -2. The presentation of the user with a results page, and; -3. A user clicking through to an article in the results page. +1. **search start (aka search session)**: An API request is being made to retrieve search results whenever the user types enough characters to perform a search (3 or more). A search session is identified by searchSessionToken. For example, if a user types "Bara", then a new search session is started; if they then type "ck" (Barack), then a new search session is started; +2. **Result pages opened**: The API request has finished and the results have been rendered; +3. **clickthroughs**: A user clicking through to an article in the results page. -These three things are tracked via the [EventLogging 'MobileWebSearch' schema](https://meta.wikimedia.org/wiki/Schema:MobileWebSearch), and stored to a database. The results are then aggregated and anonymised, and presented on this page. For performance/privacy reasons we randomly sample what we store, so the actual numbers are a vast understatement of how many user actions our servers receive - what's more interesting is how they change over time. In the case of Mobile Web search, this sampling rate is *going* to be **0.1%**: it's currently turned off entirely but should be enabled soon. +When a user opens the search overlay, a **user session** start. We use a random generated userSessionToken to identify this search funnel. A user session can have multiple search sessions. We split user sessions into “low volume”, "medium volume" and “high-volume” sessions. A “high-volume” session is a user session whose search sessions are equal to or greater than the 90th percentile for the whole population on any particular day. A “low-volume” session is a user session whose search sessions are equal to or less than the 5th percentile. The rest are categorized as "medium-volume". + +We use the [EventLogging 'MobileWebSearch' schema](https://meta.wikimedia.org/wiki/Schema:MobileWebSearch) to track these activities, and stored to a database. Currently the schema tracks prefix search only. The results are then aggregated and anonymised, and presented on this page. For performance/privacy reasons we randomly sample what we store, so the actual numbers are a vast understatement of how many user actions our servers receive - what's more interesting is how they change ove
[MediaWiki-commits] [Gerrit] mediawiki...Josa[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382883 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I26b5337b0e021edabfd6f930bc9a2715e8072e41 --- M Josa.class.php M phpcs.xml 2 files changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Josa refs/changes/83/382883/1 diff --git a/Josa.class.php b/Josa.class.php index cad196a..7004381 100644 --- a/Josa.class.php +++ b/Josa.class.php @@ -36,7 +36,7 @@ ]; /** -* @param Parser $parser +* @param Parser &$parser * @return bool */ public static function onParserFirstCallInit( Parser &$parser ) { @@ -88,7 +88,7 @@ return ( $param === 'josaonly' || $param === '조사만' ); } - /* + /** * @param string $type Type of the last letter in the word (see Josa::$josaMap's keys) * @param string $str Word to determine the josa * @return string Josa diff --git a/phpcs.xml b/phpcs.xml index d6d864f..53b90b0 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,15 +2,10 @@ - - - . - - vendor - node_modules + -- To view, visit https://gerrit.wikimedia.org/r/382883 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I26b5337b0e021edabfd6f930bc9a2715e8072e41 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Josa Gerrit-Branch: master Gerrit-Owner: Umherirrender ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Avoid clashes with MediaWiki:Common.css for hlist rules
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382882 ) Change subject: Avoid clashes with MediaWiki:Common.css for hlist rules .. Avoid clashes with MediaWiki:Common.css for hlist rules Impacts footer and main menu Bug: T173507 Change-Id: Ie519550c0657c2314ecccaca1d65ecf99d0a3f5f --- M resources/skins.minerva.mainMenu.styles/mainmenu.less M skinStyles/mediawiki.hlist/minerva.less A skinStyles/mobilefrontend.js/Overlay.less A skinStyles/mobilefrontend.js/images/error.svg A skinStyles/mobilefrontend.js/toast.less 5 files changed, 175 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue refs/changes/82/382882/1 diff --git a/resources/skins.minerva.mainMenu.styles/mainmenu.less b/resources/skins.minerva.mainMenu.styles/mainmenu.less index 8b2780b..75ec233 100644 --- a/resources/skins.minerva.mainMenu.styles/mainmenu.less +++ b/resources/skins.minerva.mainMenu.styles/mainmenu.less @@ -110,6 +110,11 @@ margin: 0; font-size: 0.75em; // equals `12px` at base `font-size: 16px` + // T173507 + &:after { + content: none; + } + a { color: @colorProgressive; padding: 0.7em 12px; diff --git a/skinStyles/mediawiki.hlist/minerva.less b/skinStyles/mediawiki.hlist/minerva.less index 80e646a..d6a0f06 100644 --- a/skinStyles/mediawiki.hlist/minerva.less +++ b/skinStyles/mediawiki.hlist/minerva.less @@ -28,13 +28,14 @@ .hlist-separated { li:after { - content: '•'; + // Make sure we override any site styles + content: '•' !important; padding-left: 8px; color: @linkColor; font-size: 16px; line-height: 1; } :last-child:after { - content: ''; + content: none !important; } } diff --git a/skinStyles/mobilefrontend.js/Overlay.less b/skinStyles/mobilefrontend.js/Overlay.less new file mode 100644 index 000..5f3c641 --- /dev/null +++ b/skinStyles/mobilefrontend.js/Overlay.less @@ -0,0 +1,33 @@ +@import 'minerva.variables'; +@import 'minerva.mixins'; + +.overlay { + padding-top: @headerHeight; + + .license { + .secondary-text(); + } + + .header-action { + a, + button { + height: @headerHeight; + } + } + + .slider-button { + top: @headerHeight; + } + + > ul, button { + width: @headerHeight; + } +} + +@media all and ( min-width: @wgMFDeviceWidthDesktop ) { + .overlay-header { + // Make sure the close button and secondary button icon images are aligned + // with the content. + max-width: @contentMaxWidthTablet + ( 2 * @iconGutterWidth ); + } +} diff --git a/skinStyles/mobilefrontend.js/images/error.svg b/skinStyles/mobilefrontend.js/images/error.svg new file mode 100644 index 000..c9bc517 --- /dev/null +++ b/skinStyles/mobilefrontend.js/images/error.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg"; viewBox="0 0 24 24"> \ No newline at end of file diff --git a/skinStyles/mobilefrontend.js/toast.less b/skinStyles/mobilefrontend.js/toast.less new file mode 100644 index 000..01d8985 --- /dev/null +++ b/skinStyles/mobilefrontend.js/toast.less @@ -0,0 +1,133 @@ +@import 'minerva.variables'; +@import 'minerva.mixins'; + +// Toast notifications +// +// Styleguide 3. + +.drawer { + background-color: @colorGray15; + // needed for Android 4.x + position: absolute; + // needed for MSIE 9 (Windows Phone 7) + width: 100%; +} + +// Basic toast notification +// +// Toast must have visible class to be shown +// +// Markup: +// +// Notification for user. +// +// +// Styleguide 3.1. +.mw-notification, +.toast, +.drawer { + .box-sizing( border-box ); + position: fixed; + bottom: 0; + left: 0; + right: 0; + box-shadow: 0 -1px 8px 0 rgba( 0, 0, 0, 0.35 ); + word-wrap: break-word; + // needs to be higher than for overlays to show on top of overlays + z-index: @z-indexOverOverlay; + // don't use visibility: hidden in old browsers that don't support animations + display: none; + + &.visible, &.mw-notification-visible { + display: block; + } +} + +.mw-notification, +.toast { + font-size: 0.9em; + padding: 0.9em 1em; + background-color: @toastNotificationColor; + color: #fff; + margin: 0 10% 20px; + width: 80%; + text-align: center; + border-rad
[MediaWiki-commits] [Gerrit] mediawiki...Interwiki[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382881 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: Ie25794af8b60c7d5b75ca0441d3368248a042c99 --- M Interwiki_body.php M phpcs.xml 2 files changed, 3 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Interwiki refs/changes/81/382881/1 diff --git a/Interwiki_body.php b/Interwiki_body.php index da7051f..f055205 100644 --- a/Interwiki_body.php +++ b/Interwiki_body.php @@ -33,7 +33,7 @@ /** * Show the special page * -* @param $par Mixed: parameter passed to the page or null +* @param string|null $par parameter passed to the page or null */ public function execute( $par ) { $this->setHeaders(); @@ -77,7 +77,7 @@ /** * Returns boolean whether the user can modify the data. -* @param $out OutputPage|bool If $wgOut object given, it adds the respective error message. +* @param OutputPage|bool $out If $wgOut object given, it adds the respective error message. * @throws PermissionsError|ReadOnlyError * @return bool */ @@ -105,7 +105,7 @@ } /** -* @param $action string +* @param string $action The action of the form */ protected function showForm( $action ) { $request = $this->getRequest(); diff --git a/phpcs.xml b/phpcs.xml index d620fc5..3cb24ee 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,9 +1,6 @@ - - - @@ -13,5 +10,4 @@ . - vendor -- To view, visit https://gerrit.wikimedia.org/r/382881 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie25794af8b60c7d5b75ca0441d3368248a042c99 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Interwiki Gerrit-Branch: master Gerrit-Owner: Umherirrender ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Avoid notices on large articles
Jdlrobson has uploaded a new change for review. ( 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, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/80/382880/1 diff --git a/includes/DataProvider.php b/includes/DataProvider.php index 7e5cd5c..d283763 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,6 +154,9 @@ '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 ), ]; @@ -162,11 +166,17 @@ $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 ); -- To view, visit https://gerrit.wikimedia.org/r/382880 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24728a0156490fadff8d39ce87d564584576a5cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: Jdlrobson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Insider[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382879 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I875992087cd7a364d3ba2df3e98d370eb13f9271 --- M Insider.class.php M phpcs.xml 2 files changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Insider refs/changes/79/382879/1 diff --git a/Insider.class.php b/Insider.class.php index 99e699c..be42f35 100644 --- a/Insider.class.php +++ b/Insider.class.php @@ -21,7 +21,7 @@ class Insider { /** -* @param Parser $parser +* @param Parser &$parser * @return bool */ public static function onParserFirstCallInit( Parser &$parser ) { @@ -29,6 +29,10 @@ return true; } + /** +* @param Parser $parser +* @return string +*/ public static function onFuncInsider( Parser $parser ) { $args = func_get_args(); array_shift( $args ); @@ -45,6 +49,11 @@ return ''; } + /** +* @param OutputPage &$out +* @param ParserOutput $parserOutput +* @return true +*/ public static function onOutputPageParserOutput( OutputPage &$out, ParserOutput $parserOutput ) { $related = $parserOutput->getExtensionData( 'Insider' ); @@ -86,7 +95,7 @@ * Write out HTML-code. * * @param Skin $skin -* @param array $bar +* @param array &$bar * @return bool */ public static function onSidebarBeforeOutput( $skin, &$bar ) { diff --git a/phpcs.xml b/phpcs.xml index 2b6c00a..90e8108 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,14 +2,9 @@ - - - . - - vendor - node_modules + -- To view, visit https://gerrit.wikimedia.org/r/382879 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I875992087cd7a364d3ba2df3e98d370eb13f9271 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Insider Gerrit-Branch: master Gerrit-Owner: Umherirrender ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: simplify assert.closeTo and assert.contains
BearND has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382875 ) Change subject: Hygiene: simplify assert.closeTo and assert.contains .. Hygiene: simplify assert.closeTo and assert.contains This is to make failure output a bit nicer and more useful when assertions fail by showing the actual result. Change-Id: I64bb8e6839f343e8718234a542b5fc74a0718114 --- M test/utils/assert.js 1 file changed, 4 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/75/382875/1 diff --git a/test/utils/assert.js b/test/utils/assert.js index ec10cee..fcdd736 100644 --- a/test/utils/assert.js +++ b/test/utils/assert.js @@ -115,24 +115,14 @@ * @param {?string} message */ function closeTo(result, expected, delta, message) { -try { -assert.ok(_.isNumber(result) && Math.abs(result - expected) <= delta, message); -} catch (e) { -console.log(`Result is ${result}; expected ${expected} ± ${delta}`); -throw e; -} +assert.ok(_.isNumber(result) && Math.abs(result - expected) <= delta, +message || `Result is ${result}; expected ${expected} ± ${delta}`); } function contains(result, sub, message) { -try { -assert.ok(result.indexOf(sub) > -1, message); -} catch (e) { -console.log(`Substring:\n${sub}`); -console.log(`Not in result:\n${result}`); -throw e; -} - +assert.ok(result.indexOf(sub) > -1, +message || `'${sub}' not in:\n${result}`); } -- To view, visit https://gerrit.wikimedia.org/r/382875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64bb8e6839f343e8718234a542b5fc74a0718114 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: BearND ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Fix Portuguese news selector
BearND has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382877 ) Change subject: Fix Portuguese news selector .. Fix Portuguese news selector The old version of the CSS selector for ptwiki news stories resulted in too many news result (around 133 as of yesterday). Now it should only pick from the top news table. We had not noticed earlier since he had not updated the fixtures. A subsequent commit will do so. Change-Id: I165ec6056c10673a297ed407e427cc1697f1efc4 --- M etc/feed/news-sites.js 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/77/382877/1 diff --git a/etc/feed/news-sites.js b/etc/feed/news-sites.js index 4bbe83e..7e6f627 100644 --- a/etc/feed/news-sites.js +++ b/etc/feed/news-sites.js @@ -62,7 +62,8 @@ ko: new NewsSite('틀:새로_들어온_소식', 'body > ul > li', TOPIC_SELECTOR_BOLD_LINK), no: new NewsSite('Mal:Aktuelt', 'ul > li', TOPIC_SELECTOR_BOLD_LINK), pl: new NewsSite('Szablon:Aktualności', 'ul:last-of-type > li', TOPIC_SELECTOR_BOLD_LINK), -pt: new NewsSite('Portal:Eventos_atuais', 'div > ul > li', TOPIC_SELECTOR_BOLD_LINK), +pt: new NewsSite('Portal:Eventos_atuais', 'table:nth-child(3) ul > li', +TOPIC_SELECTOR_BOLD_LINK), ru: new NewsSite('Шаблон:Актуальные_события', 'body > ul > li', TOPIC_SELECTOR_BOLD_LINK), sco: new NewsSite('Template:In_the_news', 'ul[id^=mw] li', TOPIC_SELECTOR_BOLD_LINK), // see en sv: new NewsSite('Portal:Huvudsida/Aktuella händelser', 'body > ul > li', -- To view, visit https://gerrit.wikimedia.org/r/382877 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I165ec6056c10673a297ed407e427cc1697f1efc4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: BearND ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: simplify assertions in onthisday test
BearND has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382876 ) Change subject: Hygiene: simplify assertions in onthisday test .. Hygiene: simplify assertions in onthisday test This is to make failure output a bit nicer and more useful when assertions fail by showing the actual result. Change-Id: I6d974c59997e0efe318fdee62541b9af9d348736 --- M test/features/onthisday/on-this-day.js 1 file changed, 31 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/76/382876/1 diff --git a/test/features/onthisday/on-this-day.js b/test/features/onthisday/on-this-day.js index f68585a..ec7e036 100644 --- a/test/features/onthisday/on-this-day.js +++ b/test/features/onthisday/on-this-day.js @@ -289,7 +289,7 @@ return preq.get(january30uriForEndpointName(endpointName, lang)); } function verifyNonZeroEndpointResults(response, endpointName) { -assert.equal(response.status, 200); +assert.deepEqual(response.status, 200); assert.ok(response.body[endpointName].length > 0, `${endpointName} should have fetched some results`); } @@ -331,8 +331,8 @@ }); it('eventsForYearListElements returns a WMFEvent for only year list elements', () => { -assert.ok( - onThisDay.testing.eventsForYearListElements(MOCK_EVENT_LIST_ELEMENTS, 'en').length === 4, +assert.deepEqual( + onThisDay.testing.eventsForYearListElements(MOCK_EVENT_LIST_ELEMENTS, 'en').length, 4, 'Should return WMFEvent for each of 4 year list elements' ); }); @@ -383,10 +383,10 @@ assert.ok('4 CE – Bla bla'.match(regex)[2] === undefined); assert.ok('4CE – Bla bla'.match(regex)[2] === undefined); assert.ok('4 AD – Bla bla'.match(regex)[2] === undefined); -assert.ok('1 BC – Bla bla'.match(regex)[2] === 'BC'); -assert.ok('1BC – Bla bla'.match(regex)[2] === 'BC'); -assert.ok('1bce – Bla bla'.match(regex)[2] === 'bce'); -assert.ok('1 bce – Bla bla'.match(regex)[2] === 'bce'); +assert.deepEqual('1 BC – Bla bla'.match(regex)[2], 'BC'); +assert.deepEqual('1BC – Bla bla'.match(regex)[2], 'BC'); +assert.deepEqual('1bce – Bla bla'.match(regex)[2], 'bce'); +assert.deepEqual('1 bce – Bla bla'.match(regex)[2], 'bce'); assert.ok('AD 1 – Bla bla'.match(regex)[2] === undefined); }); @@ -411,10 +411,10 @@ const sortedEvents = onThisDay.testing.eventsForYearListElements(MOCK_EVENT_LIST_ELEMENTS, 'en') .sort(onThisDay.testing.reverseChronologicalWMFEventComparator); -assert.ok(sortedEvents[0].year === 1948); -assert.ok(sortedEvents[1].year === 1946); -assert.ok(sortedEvents[2].year === -58); -assert.ok(sortedEvents[3].year === -516); +assert.deepEqual(sortedEvents[0].year, 1948); +assert.deepEqual(sortedEvents[1].year, 1946); +assert.deepEqual(sortedEvents[2].year, -58); +assert.deepEqual(sortedEvents[3].year, -516); }); it('Hydration should replace each \'title\' key with \'$merge\' key', () => { @@ -443,25 +443,25 @@ } // Confirm expected number of pages exist post-hydration -assert.ok(events[0].pages.length === 1); -assert.ok(events[1].pages.length === 4); -assert.ok(events[2].pages.length === 2); -assert.ok(events[3].pages.length === 1); -assert.ok(events[4].pages.length === 5); +assert.deepEqual(events[0].pages.length, 1); +assert.deepEqual(events[1].pages.length, 4); +assert.deepEqual(events[2].pages.length, 2); +assert.deepEqual(events[3].pages.length, 1); +assert.deepEqual(events[4].pages.length, 5); }); it('listElementsByHeadingID extracts expected number of births from DE fixture', () => { // https://de.wikipedia.org/api/rest_v1/page/html/1._Dezember const document = documentFromFixtureFile('de.1._Dezember.html'); const listElements = onThisDay.testing.listElementsByHeadingID(document, ['Geboren'], 'de'); -assert.ok(listElements.length === 180); +assert.deepEqual(listElements.length, 180); }); it('listElementsByHeadingID extracts expected number of births from EN fixture', () => { // https://en.wikipedia.org/api/rest_v1/page/html/December_1 const document = documentFromFixtureFile('en.December_1.html'); const listElements = onThisDay.testing.listElementsByHeadingID(document, ['Births'], 'en'); -assert.ok(listElements.length === 208); +assert.deepEqual(listElements.length, 208); }); it('listElementsByHeadingID extracts expected number of births from AR fixture', () => { @@ -469,7 +469,7 @@ const document = documentFromFixtureFile('ar.January_1.html')
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: Update test fixtures
BearND has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382878 ) Change subject: Hygiene: Update test fixtures .. Hygiene: Update test fixtures This is for news, onthisday, and a general test page. This ia a followup of the comment in https://gerrit.wikimedia.org/r/#/c/382035/1//COMMIT_MSG@9. The updated content is based on an undeployed Parsoid version: https://gerrit.wikimedia.org/r/#/c/370227/12 to make sure MCS is ready for this. Using const uri = `http://localhost:8000/${lang}.wikipedia.org/v3/page/pagebundle/${encodeURIComponent(NEWS_SITES[lang].title)}`; Note: pagebundle instead of html in the path. And used rsp.body.html.body instead of rsp.body when writing. Change-Id: Ib50b702a37acf6cb481d5ffa731e48e6e8490303 --- M test/features/news/news-sites.js M test/features/onthisday/fixtures/ar.January_1.html M test/features/onthisday/fixtures/de.1._Dezember.html M test/features/onthisday/fixtures/en.December_1.html M test/features/onthisday/fixtures/sv.Augusti_25.html M test/features/onthisday/on-this-day.js A test/fixtures/news-site-da-2017-10-04.htm A test/fixtures/news-site-de-2017-10-04.htm A test/fixtures/news-site-el-2017-10-04.htm A test/fixtures/news-site-en-2017-10-04.htm A test/fixtures/news-site-es-2017-10-04.htm A test/fixtures/news-site-fi-2017-10-04.htm A test/fixtures/news-site-fr-2017-10-04.htm A test/fixtures/news-site-he-2017-10-04.htm A test/fixtures/news-site-ko-2017-10-04.htm A test/fixtures/news-site-no-2017-10-04.htm A test/fixtures/news-site-pl-2017-10-04.htm A test/fixtures/news-site-pt-2017-10-04.htm A test/fixtures/news-site-ru-2017-10-04.htm A test/fixtures/news-site-sco-2017-10-04.htm A test/fixtures/news-site-sv-2017-10-04.htm A test/fixtures/news-site-vi-2017-10-04.htm M test/fixtures/update-news-sites M test/lib/bill-clinton.html M test/lib/parseProperty/parse-infobox-test.js 25 files changed, 4,363 insertions(+), 3,013 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/78/382878/1 -- To view, visit https://gerrit.wikimedia.org/r/382878 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib50b702a37acf6cb481d5ffa731e48e6e8490303 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: BearND ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ImageMap[master]: Improve some parameter docs
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382874 ) Change subject: Improve some parameter docs .. Improve some parameter docs Change-Id: I622365d0850d6bd73547c262c61241aa583a120e --- M ImageMap_body.php M phpcs.xml 2 files changed, 8 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ImageMap refs/changes/74/382874/1 diff --git a/ImageMap_body.php b/ImageMap_body.php index 7eca3d4..2ea3768 100644 --- a/ImageMap_body.php +++ b/ImageMap_body.php @@ -28,16 +28,16 @@ const NONE = 4; /** -* @param Parser $parser +* @param Parser &$parser */ public static function onParserFirstCallInit( Parser &$parser ) { $parser->setHook( 'imagemap', [ 'ImageMap', 'render' ] ); } /** -* @param $input -* @param $params -* @param $parser Parser +* @param string $input +* @param array $params +* @param Parser $parser * @return string HTML (Image map, or error message) */ public static function render( $input, $params, $parser ) { @@ -376,8 +376,8 @@ } /** -* @param $count int -* @param $lineNum int|string +* @param int $count +* @param int|string $lineNum * @return array|string String with error (HTML), or array of coordinates */ static function tokenizeCoords( $count, $lineNum ) { @@ -396,8 +396,8 @@ } /** -* @param $name string -* @param $line string|int|bool +* @param string $name +* @param string|int|bool $line * @return string HTML */ static function error( $name, $line = false ) { diff --git a/phpcs.xml b/phpcs.xml index 8e267bf..dfec23f 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,9 +2,6 @@ - - - . -- To view, visit https://gerrit.wikimedia.org/r/382874 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I622365d0850d6bd73547c262c61241aa583a120e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ImageMap Gerrit-Branch: master Gerrit-Owner: Umherirrender ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: bump copyright years
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382872 ) Change subject: bump copyright years .. bump copyright years Change-Id: I88e5c9c35f9aa2686f001cbd283935448564e8b0 --- M src/main.c M src/purger.c M src/receiver.c M src/stats.c M src/strq.c 5 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/72/382872/1 diff --git a/src/main.c b/src/main.c index 440991e..e7c55db 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,4 @@ -/* Copyright © 2013 Brandon L Black +/* Copyright © 2013-2017 Brandon L Black * * This file is part of vhtcpd. * diff --git a/src/purger.c b/src/purger.c index bdfff82..b95fe08 100644 --- a/src/purger.c +++ b/src/purger.c @@ -1,4 +1,4 @@ -/* Copyright © 2013 Brandon L Black +/* Copyright © 2013-2017 Brandon L Black * * This file is part of vhtcpd. * diff --git a/src/receiver.c b/src/receiver.c index 8570da0..5d0a7d6 100644 --- a/src/receiver.c +++ b/src/receiver.c @@ -1,4 +1,4 @@ -/* Copyright © 2013 Brandon L Black +/* Copyright © 2013-2017 Brandon L Black * * This file is part of vhtcpd. * diff --git a/src/stats.c b/src/stats.c index 59c8ede..30d84cd 100644 --- a/src/stats.c +++ b/src/stats.c @@ -1,4 +1,4 @@ -/* Copyright © 2013 Brandon L Black +/* Copyright © 2013-2017 Brandon L Black * * This file is part of vhtcpd. * diff --git a/src/strq.c b/src/strq.c index b29bece..d4ef191 100644 --- a/src/strq.c +++ b/src/strq.c @@ -1,4 +1,4 @@ -/* Copyright © 2013 Brandon L Black +/* Copyright © 2013-2017 Brandon L Black * * This file is part of vhtcpd. * -- To view, visit https://gerrit.wikimedia.org/r/382872 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88e5c9c35f9aa2686f001cbd283935448564e8b0 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: http-parser usage updates
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382871 ) Change subject: http-parser usage updates .. http-parser usage updates Update the http_parser_settings fields for 2.7.1, and pay attention to http_errno and log (and skip sent metric) on cases where the response status code is >= 400. Change-Id: I6d2ff4ce2944480ded27bcb9622288b9f9c82461 --- M src/purger.c 1 file changed, 20 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/71/382871/1 diff --git a/src/purger.c b/src/purger.c index 612ba94..bdfff82 100644 --- a/src/purger.c +++ b/src/purger.c @@ -174,7 +174,7 @@ pr->cb_called = true; pr->need_to_close = !http_should_keep_alive(p); -pr->status_ok = true; // XXX actually set this... +pr->status_ok = p->status_code < 400; return 0; } @@ -182,12 +182,14 @@ http_parser_settings psettings = { .on_message_begin = NULL, .on_url = NULL, -.on_status_complete = NULL, +.on_status = NULL, .on_header_field = NULL, .on_header_value = NULL, .on_headers_complete = NULL, .on_body = NULL, -.on_message_complete = msg_complete_cb +.on_message_complete = msg_complete_cb, +.on_chunk_header = NULL, +.on_chunk_complete = NULL }; #ifdef NDEBUG @@ -555,20 +557,28 @@ s->parser->data = ≺ int hpe_parsed = http_parser_execute(s->parser, &psettings, &s->inbuf[s->inbuf_parsed], recvrv); s->inbuf_parsed += hpe_parsed; -if(hpe_parsed != recvrv) { // not parseable, could be more trailing garbage, close it all down -dmn_log_err("TCP conn to %s: response unparseable, dropping request", dmn_logf_anysin(&s->daddr)); +if(s->parser->http_errno != HPE_OK || hpe_parsed != recvrv) { // not parseable, could be more trailing garbage, close it all down +dmn_log_err("TCP conn to %s: response unparseable (parser error %s), dropping request", dmn_logf_anysin(&s->daddr), http_errno_description(s->parser->http_errno)); close_from_read_cb(s, true); return; } else if(pr.cb_called) { // parsed a full response -// XXX pr.status_ok will just be for stats? dmn_log_debug("purger: %s/%s -> purger_read_cb silent result: successful response parsed", dmn_logf_anysin(&s->daddr), state_strs[s->state]); -// copy to next purger + inc counters + reset i/o progress -if(s->next_purger) -purger_enqueue(s->next_purger, s->outbuf, s->outbuf_bytes); +// local counter on reqs-per-conn s->fd_reqs++; -stats.purgers[s->idx].inpkts_sent++; + +// Only forward to next purger and mark sent in stats if status was reasonable +if(pr.status_ok) { +if(s->next_purger) +purger_enqueue(s->next_purger, s->outbuf, s->outbuf_bytes); +stats.purgers[s->idx].inpkts_sent++; +} +else { +dmn_log_warn("PURGE response code was was >= 400"); +} + +// reset i/o s->outbuf_bytes = s->outbuf_written = s->inbuf_parsed = 0; // no matter which path, current timer needs to go -- To view, visit https://gerrit.wikimedia.org/r/382871 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d2ff4ce2944480ded27bcb9622288b9f9c82461 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: Bump http-parser upstream src to 2.7.1
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382870 ) Change subject: Bump http-parser upstream src to 2.7.1 .. Bump http-parser upstream src to 2.7.1 Change-Id: Ic3aa6718415daf2c19d1f97eb3ca9ce1e6e83ab9 --- M src/http-parser 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/70/382870/1 diff --git a/src/http-parser b/src/http-parser index 8081938..feae95a 16 --- a/src/http-parser +++ b/src/http-parser @@ -1 +1 @@ -Subproject commit 80819384450b5511a3d1c424dd92a5843c891364 +Subproject commit feae95a3a69f111bc1897b9048d9acbc290992f9 -- To view, visit https://gerrit.wikimedia.org/r/382870 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3aa6718415daf2c19d1f97eb3ca9ce1e6e83ab9 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: split per-purger stats
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382869 ) Change subject: split per-purger stats .. split per-purger stats Now that we have several queues (one for each purger), we have to split out our queue-related stats to be one-per-purger as well. This will break stats compatibility for our monitoring stuff! Things to note in the new output: * A dropoff from inpkts_dequeued to inpkts_sent meants a communications failure with the cache receiving PURGEs (of the type we weren't willing to retry). * The inpkts_enqueued of the first purger should match the global inpkts_sane. The inpkts_enqueued of subsequent purgers should match the previous purger's inpkts_sent (it doesn't forward requests that failed communications with its own cache in a way that looked bad enough to drop the URL rather than retry it). Old file output: start:12345678 uptime:30 inpkts_recvd:50 inpkts_sane:50 inpkts_enqueued:50 inpkts_dequeued:50 queue_overflows:0 queue_size:0 queue_max_size:1 New file output: start:12345678 uptime:30 inpkts_recvd:50 inpkts_sane:50 purgers:2 Purger0: inpkts_enqueued:50 inpkts_dequeued:50 inpkts_sent:42 queue_overflows:0 queue_size:0 queue_max_size:1 Purger1: inpkts_enqueued:42 inpkts_dequeued:42 inpkts_sent:21 queue_overflows:0 queue_size:0 queue_max_size:1 Change-Id: I1fff8e72ffb7b0c82ef177ee4c08cc140f0b2a12 --- M src/main.c M src/purger.c M src/purger.h M src/stats.c M src/stats.h M src/strq.c M src/strq.h M src/test_strq.c 8 files changed, 87 insertions(+), 51 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/69/382869/1 diff --git a/src/main.c b/src/main.c index 6506725..440991e 100644 --- a/src/main.c +++ b/src/main.c @@ -397,7 +397,7 @@ ev_set_timeout_collect_interval(loop, 0.1); // stats has a timeout callback for reporting -stats_init(loop, cfg->statsfile); +stats_init(loop, cfg->statsfile, cfg->num_purgers); // set up an array of purger objects, and initialize them in reverse // order so we can set up the purger->purger queueing chain @@ -406,7 +406,7 @@ purger_t* next_purger = NULL; unsigned i = cfg->num_purgers - 1; do { -purgers[i] = purger_new(loop, &cfg->purger_addrs[i], next_purger, cfg->max_queue_mb, cfg->io_timeout, cfg->idle_timeout); +purgers[i] = purger_new(loop, &cfg->purger_addrs[i], next_purger, i, cfg->max_queue_mb, cfg->io_timeout, cfg->idle_timeout); next_purger = purgers[i]; } while(i--); } diff --git a/src/purger.c b/src/purger.c index 60a2bf1..612ba94 100644 --- a/src/purger.c +++ b/src/purger.c @@ -138,6 +138,7 @@ struct purger { purger_state_t state; int fd; +unsigned idx; unsigned outbuf_bytes; // total size of current buffered message unsigned outbuf_written; // bytes of the message sent so far... unsigned inbuf_size; // dynamic resize of inbuf @@ -567,7 +568,7 @@ if(s->next_purger) purger_enqueue(s->next_purger, s->outbuf, s->outbuf_bytes); s->fd_reqs++; -stats.inpkts_sent++; +stats.purgers[s->idx].inpkts_sent++; s->outbuf_bytes = s->outbuf_written = s->inbuf_parsed = 0; // no matter which path, current timer needs to go @@ -651,14 +652,15 @@ } } -purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, purger_t* next_purger, unsigned max_mb, unsigned io_timeout, unsigned idle_timeout) { +purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, purger_t* next_purger, unsigned idx, unsigned max_mb, unsigned io_timeout, unsigned idle_timeout) { purger_t* s = calloc(1, sizeof(purger_t)); +s->idx = idx; s->fd = -1; s->inbuf_size = INBUF_INITSIZE; s->outbuf = malloc(OUTBUF_SIZE); s->inbuf = malloc(s->inbuf_size); s->parser = malloc(sizeof(http_parser)); -s->queue = strq_new(loop, max_mb); +s->queue = strq_new(loop, idx, max_mb); s->next_purger = next_purger; s->loop = loop; s->io_timeout = io_timeout; @@ -691,7 +693,7 @@ purger_assert_sanity(s); strq_enqueue(s->queue, req, req_len); -stats.inpkts_enqueued++; +stats.purgers[s->idx].inpkts_enqueued++; // enqueue can happen in any state, but actions differ: switch(s->state) { diff --git a/src/purger.h b/src/purger.h index 9966187..934503b 100644 --- a/src/purger.h +++ b/src/purger.h @@ -13,7 +13,7 @@ typedef struct purger purger_t; // Sender does not own the loop, the caller does. -purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, purger_t* next_purger, unsigned max_mb, unsigned io_timeout, unsigned idle_timeout); +purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, purger_t* next_purger, unsigned idx, unsigned max_mb, unsigned io_timeout, unsigned idle_timeout);
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: Move the strq object completely inside the purger
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382866 ) Change subject: Move the strq object completely inside the purger .. Move the strq object completely inside the purger There's no need to pass and utilize strq+purger in parallel from everywhere. Logically at this point, one purger "owns" its own strq, so hide it within as an implementation detail of the purger. Change-Id: I714d093ad4c88f405faf9850d369151431a6517d --- M src/main.c M src/purger.c M src/purger.h M src/receiver.c M src/receiver.h 5 files changed, 15 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/66/382866/1 diff --git a/src/main.c b/src/main.c index b874757..b048811 100644 --- a/src/main.c +++ b/src/main.c @@ -27,7 +27,6 @@ #include #include "purger.h" #include "receiver.h" -#include "strq.h" #include "stats.h" #include "libdmn/dmn.h" #include "config.h" @@ -400,20 +399,16 @@ // stats has a timeout callback for reporting stats_init(loop, cfg->statsfile); -// set up one string queue -strq_t* queue = strq_new(loop, cfg->max_queue_mb); - // set up an array of purger objects purgers = malloc(cfg->num_purgers * sizeof(purger_t*)); for(unsigned i = 0; i < cfg->num_purgers; i++) -purgers[i] = purger_new(loop, &cfg->purger_addrs[i], queue, cfg->purge_full_url, cfg->io_timeout, cfg->idle_timeout); +purgers[i] = purger_new(loop, &cfg->purger_addrs[i], cfg->max_queue_mb, cfg->purge_full_url, cfg->io_timeout, cfg->idle_timeout); // set up the singular receiver, with purger[0] as the dequeur receiver_t* receiver = receiver_new( loop, cfg->matcher, cfg->matcher_extra, -queue, purgers[0], cfg->lsock ); @@ -429,7 +424,6 @@ receiver_destroy(receiver); for(unsigned i = 0; i < cfg->num_purgers; i++) purger_destroy(purgers[i]); -strq_destroy(queue); ev_loop_destroy(loop); cfg_destroy(cfg); diff --git a/src/purger.c b/src/purger.c index 7080b70..8266fde 100644 --- a/src/purger.c +++ b/src/purger.c @@ -32,6 +32,7 @@ #include #include +#include "stats.h" #include "strq.h" #include "libdmn/dmn.h" #include "http-parser/http_parser.h" @@ -705,7 +706,7 @@ } } -purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, strq_t* queue, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout) { +purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, unsigned max_mb, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout) { purger_t* s = calloc(1, sizeof(purger_t)); s->fd = -1; s->purge_full_url = purge_full_url; @@ -713,7 +714,7 @@ s->outbuf = malloc(OUTBUF_SIZE); s->inbuf = malloc(s->inbuf_size); s->parser = malloc(sizeof(http_parser)); -s->queue = queue; +s->queue = strq_new(loop, max_mb); s->loop = loop; s->io_timeout = io_timeout; s->idle_timeout = idle_timeout; @@ -739,14 +740,13 @@ return s; } -void purger_ping(purger_t* s) { -dmn_assert(s); +void purger_enqueue(purger_t* s, const char* url, const unsigned url_len) { +dmn_assert(s); dmn_assert(url); dmn_assert(url_len); dmn_log_debug("purger: %s/%s -> hit purger_ping()", dmn_logf_anysin(&s->daddr), state_strs[s->state]); purger_assert_sanity(s); -// ping is called immediately after an enqueue, thus dequeue -// always has an item to fetch -dmn_assert(!strq_is_empty(s->queue)); +strq_enqueue(s->queue, url, url_len); +stats.inpkts_enqueued++; // enqueue can happen in any state, but actions differ: switch(s->state) { @@ -790,5 +790,6 @@ free(s->inbuf); free(s->outbuf); free(s->parser); +strq_destroy(s->queue); free(s); } diff --git a/src/purger.h b/src/purger.h index 1a6c411..6f27c23 100644 --- a/src/purger.h +++ b/src/purger.h @@ -3,15 +3,14 @@ #define VHTCPD_PURGER_H #include -#include "strq.h" #include "libdmn/dmn.h" struct purger; typedef struct purger purger_t; // Sender does not own the loop, the caller does. -purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, strq_t* strq, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout); -void purger_ping(purger_t* s); +purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, unsigned max_mb, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout); +void purger_enqueue(purger_t* s, const char* url, const unsigned url_len); void purger_destroy(purger_t* s); #endif // VHTCPD_PURGER_H diff --git a/src/receiver.c b/src/receiver.c index 0272252..8d6b33f 100644 --- a/src/receiver.c +++ b/src/receiver.c @@ -65,7 +65,6 @@ char* inbuf; struct ev_loop* loop; ev_io* read_watcher; -strq_t* queue; purger_t* purger; const pcre* matcher; c
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: Release 0.0.12
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382873 ) Change subject: Release 0.0.12 .. Release 0.0.12 Change-Id: I2057590575dd91283ab579b5142988e76ca01bb1 --- M NEWS M configure.ac 2 files changed, 32 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/73/382873/1 diff --git a/NEWS b/NEWS index 28127d1..72f2e8f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,34 @@ +0.0.12 - 2017-10-06 + * The hardcoded limit for PURGEs sent over a single outbound connection +before we recycle it has increased from 10K to 100K (the 15-minute limit +for the same remains) + * Serialized multi-queue: earlier versions had a single multi-headed queue of +requests, with all purge destinations pulling from this queue as fast as +they could in parallel. With this release, each purger gets its own +separate single-headed request queue, and requests must move *serially* +through completion at one purger before being handed to the input queue of +the next, like a bucket brigade. This ensures when two connected caches are +part of a layered setup, the first cache listed on the commandline always +wins a purging race. This could in theory also multiply the queue memory +usage, but in common practice we'd expect only the first queue to backlog +significantly under input spikes, and the rest to remain rather short. + * The memory size of queue objects has grown as well - they're now stored in +the form of their eventual outbound raw HTTP PURGE request, rather than just +as the URL (basically, the parsing of URLs and generation of HTTP PURGE text +has moved upstream of the queueing). + * In past releases, while there were no purge-failure events that were +completely silent to both metrics and logging, there were several that +either affected metrics but emitted no log message, or emitted log messages +but affected no metrics. Now all possible purging failure paths both affect +a metric *and* emit log information. + * Stats output (file+syslog) has changed substantially. Several +of the previously-global metrics are now per-purger (per-queue), and a new +stat inpkts_sent has been added. When there's a difference between +inpkts_dequeued and inpkts_sent, it indicates some kind of communication +failure on the purger side (to the caches). + * Embedded http-parser from joyent upgraded from 2.1 to 2.7.1 + * Better checking of PURGE response parsing/errors + 0.0.11 - 2016-01-22 wrapped complex assert funcs in NDEBUG checks to make sure they don't affect NDEBUG builds diff --git a/configure.ac b/configure.ac index 4062ca0..db96064 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.68]) -AC_INIT([vhtcpd],[0.0.11],[bbl...@wikimedia.org],[vhtcpd],[https://gerrit.wikimedia.org/r/gitweb?p=operations/software/varnish/vhtcpd.git]) +AC_INIT([vhtcpd],[0.0.12],[bbl...@wikimedia.org],[vhtcpd],[https://gerrit.wikimedia.org/r/gitweb?p=operations/software/varnish/vhtcpd.git]) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR([acaux]) AM_INIT_AUTOMAKE([1.11.3 dist-xz no-dist-gzip foreign tar-ustar -Wall]) -- To view, visit https://gerrit.wikimedia.org/r/382873 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2057590575dd91283ab579b5142988e76ca01bb1 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: assertion/warning nits
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382862 ) Change subject: assertion/warning nits .. assertion/warning nits 1) do not check nonnull-flagged args Compilers have gotten smarter/better, the nonnull flag alone suffices, and doing these redundant checks raises warnings. 2) Hack around unused argc+argc in test_strq via logging... 3) Add some missing state asserts to close_from_read_cb() Change-Id: I343ae97a06dfa497b7be781e6ce4a822b031fe6b --- M src/libdmn/dmn_daemon.c M src/libdmn/dmn_secure.c M src/purger.c M src/test_strq.c 4 files changed, 5 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/62/382862/1 diff --git a/src/libdmn/dmn_daemon.c b/src/libdmn/dmn_daemon.c index 458db55..44cbafc 100644 --- a/src/libdmn/dmn_daemon.c +++ b/src/libdmn/dmn_daemon.c @@ -151,8 +151,6 @@ } void dmn_daemonize(const char* pidfile, const bool restart) { -dmn_assert(pidfile); - // This pipe is used to communicate daemonization success // (which must happen two forks later because fcntl() does // not fork-inherit) back to the top-level parent for @@ -232,11 +230,9 @@ dmn_log_close_alt_stderr(); } -pid_t dmn_status(const char* pidfile) { dmn_assert(pidfile); return check_pidfile(pidfile); } +pid_t dmn_status(const char* pidfile) { return check_pidfile(pidfile); } pid_t dmn_stop(const char* pidfile) { -dmn_assert(pidfile); - const pid_t pid = check_pidfile(pidfile); if(!pid) { dmn_log_info("Did not find a running daemon to stop!"); @@ -268,8 +264,6 @@ } int dmn_signal(const char* pidfile, int sig) { -dmn_assert(pidfile); - int rv = 1; // error const pid_t pid = check_pidfile(pidfile); if(!pid) { diff --git a/src/libdmn/dmn_secure.c b/src/libdmn/dmn_secure.c index 22c0bc5..b6f29b5 100644 --- a/src/libdmn/dmn_secure.c +++ b/src/libdmn/dmn_secure.c @@ -41,8 +41,6 @@ static bool is_secured = false; void dmn_secure_setup(const char* username, const char* chroot_path) { -dmn_assert(username); - // This isn't really a security thing, we'd fail somewhere else along the line anyways, // it's just a handy error bailout to point out developer bugs in using these interfaces. if(geteuid()) diff --git a/src/purger.c b/src/purger.c index 796eb84..c7d26be 100644 --- a/src/purger.c +++ b/src/purger.c @@ -518,6 +518,9 @@ // based on presence of another queued request, otherwise reconnect to // re-send the current request. static void close_from_read_cb(purger_t* s, const bool clear_current) { +dmn_assert(s); +dmn_assert(s->state == PST_CONN_IDLE || s->state == PST_SENDWAIT || s->state == PST_RECVWAIT); + purger_closefd(s); ev_timer_stop(s->loop, s->timeout_watcher); ev_io_stop(s->loop, s->read_watcher); diff --git a/src/test_strq.c b/src/test_strq.c index 468ce70..a0909a9 100644 --- a/src/test_strq.c +++ b/src/test_strq.c @@ -16,6 +16,7 @@ int main(int argc, char* argv[]) { dmn_init_log("test_strq", true); +dmn_log_info("%s", argv[argc - 1]); struct ev_loop* loop = ev_loop_new(0); strq_t* q = strq_new(loop, 2, 3); -- To view, visit https://gerrit.wikimedia.org/r/382862 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I343ae97a06dfa497b7be781e6ce4a822b031fe6b Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: Remove multi-head support from strq
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382865 ) Change subject: Remove multi-head support from strq .. Remove multi-head support from strq The multi-head idea was efficient for multiple parallel dequeuers, but at this point we're more concerned about layer races. Switching the strq code back to single-head is a first step towards serializing the multiple purgers (varnishes) so that the first must complete a purge before it's handed to the next (and future queue delays as well). This leaves the codebase temporarily-disfunctional in that only the first purger now gets any requests. To be fixed in the followups as the refactor continues. Change-Id: Id30875ecec7fdef09f12402f2dba2fea64410538 --- M src/main.c M src/purger.c M src/purger.h M src/receiver.c M src/receiver.h M src/strq.c M src/strq.h M src/test_strq.c 8 files changed, 63 insertions(+), 194 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/65/382865/1 diff --git a/src/main.c b/src/main.c index 803edc4..b874757 100644 --- a/src/main.c +++ b/src/main.c @@ -400,22 +400,21 @@ // stats has a timeout callback for reporting stats_init(loop, cfg->statsfile); -// set up the string queue -strq_t* queue = strq_new(loop, cfg->max_queue_mb, cfg->num_purgers); +// set up one string queue +strq_t* queue = strq_new(loop, cfg->max_queue_mb); // set up an array of purger objects purgers = malloc(cfg->num_purgers * sizeof(purger_t*)); for(unsigned i = 0; i < cfg->num_purgers; i++) -purgers[i] = purger_new(loop, &cfg->purger_addrs[i], queue, i, cfg->purge_full_url, cfg->io_timeout, cfg->idle_timeout); +purgers[i] = purger_new(loop, &cfg->purger_addrs[i], queue, cfg->purge_full_url, cfg->io_timeout, cfg->idle_timeout); -// set up the singular receiver +// set up the singular receiver, with purger[0] as the dequeur receiver_t* receiver = receiver_new( loop, cfg->matcher, cfg->matcher_extra, queue, -purgers, -cfg->num_purgers, +purgers[0], cfg->lsock ); diff --git a/src/purger.c b/src/purger.c index d48f894..7080b70 100644 --- a/src/purger.c +++ b/src/purger.c @@ -140,7 +140,6 @@ struct purger { purger_state_t state; bool purge_full_url; -unsigned vhead; // queue vhead index int fd; unsigned outbuf_bytes; // total size of current buffered message unsigned outbuf_written; // bytes of the message sent so far... @@ -339,7 +338,7 @@ unsigned url_len; const char* url; -while((url = strq_dequeue(s->queue, &url_len, s->vhead))) { +while((url = strq_dequeue(s->queue, &url_len))) { if(!encode_to_outbuf(s, url, url_len)) return false; } @@ -706,7 +705,7 @@ } } -purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, strq_t* queue, unsigned vhead, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout) { +purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, strq_t* queue, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout) { purger_t* s = calloc(1, sizeof(purger_t)); s->fd = -1; s->purge_full_url = purge_full_url; @@ -715,7 +714,6 @@ s->inbuf = malloc(s->inbuf_size); s->parser = malloc(sizeof(http_parser)); s->queue = queue; -s->vhead = vhead; s->loop = loop; s->io_timeout = io_timeout; s->idle_timeout = idle_timeout; @@ -748,7 +746,7 @@ // ping is called immediately after an enqueue, thus dequeue // always has an item to fetch -dmn_assert(!strq_is_empty(s->queue, s->vhead)); +dmn_assert(!strq_is_empty(s->queue)); // enqueue can happen in any state, but actions differ: switch(s->state) { diff --git a/src/purger.h b/src/purger.h index 0bf3f49..1a6c411 100644 --- a/src/purger.h +++ b/src/purger.h @@ -10,7 +10,7 @@ typedef struct purger purger_t; // Sender does not own the loop, the caller does. -purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, strq_t* strq, unsigned vhead, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout); +purger_t* purger_new(struct ev_loop* loop, const dmn_anysin_t* daddr, strq_t* strq, bool purge_full_url, unsigned io_timeout, unsigned idle_timeout); void purger_ping(purger_t* s); void purger_destroy(purger_t* s); diff --git a/src/receiver.c b/src/receiver.c index d062e49..0272252 100644 --- a/src/receiver.c +++ b/src/receiver.c @@ -62,12 +62,11 @@ struct receiver { int fd; -unsigned num_purgers; char* inbuf; struct ev_loop* loop; ev_io* read_watcher; strq_t* queue; -purger_t** purgers; +purger_t* purger; const pcre* matcher; const pcre_extra* matcher_extra; }; @@ -189,13 +188,12 @@ dmn_log_debug("receiver
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: raise PERSIST_REQS to 100K
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382863 ) Change subject: raise PERSIST_REQS to 100K .. raise PERSIST_REQS to 100K The 10K value made sense back in 2013, but at modern purge rates it's probably too low. Even with recent fixups and reductions, we can expect typical averages rates on the text cluster around 1K/sec. Probably should be a runtime parameter, but this is an easier fixup for now. Change-Id: I423eb51e8f83a6d58ad195e6d46847675f21106d --- M src/purger.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/63/382863/1 diff --git a/src/purger.c b/src/purger.c index c7d26be..1814fc8 100644 --- a/src/purger.c +++ b/src/purger.c @@ -55,10 +55,10 @@ // Limits on time/purges per purging socket. It seems that Varnish imposes no // limit here other than inter-purge idle time, so it's a good idea that we -// close() occasionally to avoid pushing corner-case bug buttons. At 10K +// close() occasionally to avoid pushing corner-case bug buttons. At 100K // reqs or 15 minutes, we're still getting the vast majority of the benefit, // so this is basically a free safety valve. -#define PERSIST_REQS 1U +#define PERSIST_REQS 10U #define PERSIST_TIME 900.0 // These are the 6 possible states of the purger object. -- To view, visit https://gerrit.wikimedia.org/r/382863 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I423eb51e8f83a6d58ad195e6d46847675f21106d Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...vhtcpd[master]: Move all URL parsing and HTTP req generation to receiver
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382867 ) Change subject: Move all URL parsing and HTTP req generation to receiver .. Move all URL parsing and HTTP req generation to receiver Before: * Receiver parsed URL to check http parsing sanity at least to the host level and to apply host-level regex filtering, and initial parsefail here would show up as a loss at the inpkts_sane metric (w/ log outputs) * Receiver also had other inpkts_sane failure-points (detectable in stats) with no logged output to help debug them, during the more-basic parsing of HTCP format. * Purgers (x2) re-parsed URL for full host+path sanity from scratch (duplicating some of the earlier work), and could fail this with log output but no metrics record that can be differentiated. * Purgers (x2) used the parsed URL to encode output HTTP message locally. After: * Receiver now does all URL parsing once, and all possible failure points have unique log messages and show up as loss of inpkts_sane metric. * Receiver encodes the HTTP output, and puts *this* (rather than the raw unparsed URL) into the queue. * Purger pulls fully-formed outbound HTTP reqs from queue, has no failure points here before sending to Varnish Fixes: * no more metrics-silent input-side errors * no more log-silent input-side errors Tradeoffs: * Queue memory size is larger per-request * More memcpy traffic in general * HTTP parsing de-duplication of CPU work Change-Id: I3a8e25ed0187ac82a78440bd0b051b28646a906a --- M src/main.c M src/purger.c M src/purger.h M src/receiver.c M src/receiver.h 5 files changed, 105 insertions(+), 97 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/67/382867/1 diff --git a/src/main.c b/src/main.c index b048811..f1b0a83 100644 --- a/src/main.c +++ b/src/main.c @@ -402,7 +402,7 @@ // set up an array of purger objects purgers = malloc(cfg->num_purgers * sizeof(purger_t*)); for(unsigned i = 0; i < cfg->num_purgers; i++) -purgers[i] = purger_new(loop, &cfg->purger_addrs[i], cfg->max_queue_mb, cfg->purge_full_url, cfg->io_timeout, cfg->idle_timeout); +purgers[i] = purger_new(loop, &cfg->purger_addrs[i], cfg->max_queue_mb, cfg->io_timeout, cfg->idle_timeout); // set up the singular receiver, with purger[0] as the dequeur receiver_t* receiver = receiver_new( @@ -410,7 +410,8 @@ cfg->matcher, cfg->matcher_extra, purgers[0], -cfg->lsock +cfg->lsock, +cfg->purge_full_url ); // Finish daemonization (release initial process and stderr) diff --git a/src/purger.c b/src/purger.c index 8266fde..4e8f0b5 100644 --- a/src/purger.c +++ b/src/purger.c @@ -42,9 +42,6 @@ // of keep-alive, apparently varnish closes after every // response to a PURGE, currently. -// this buffer holds a fully-formed HTTP request to purge a single URL. -#define OUTBUF_SIZE 4096U - // this buffer holds the complete HTTP response we get, and can grow at runtime #define INBUF_INITSIZE 4096U @@ -140,7 +137,6 @@ struct purger { purger_state_t state; -bool purge_full_url; int fd; unsigned outbuf_bytes; // total size of current buffered message unsigned outbuf_written; // bytes of the message sent so far... @@ -273,75 +269,21 @@ #endif -// The fixed parts of the request string. -// The two holes are for the URL and the hostname. -static const char out_prefix[] = "PURGE "; -static const unsigned out_prefix_len = sizeof(out_prefix) - 1; -static const char out_middle[] = " HTTP/1.1\r\nHost: "; -static const unsigned out_middle_len = sizeof(out_middle) - 1; -static const char out_suffix[] = "\r\nUser-Agent: vhtcpd\r\n\r\n"; -static const unsigned out_suffix_len = sizeof(out_suffix) - 1; - -// bits for url parser object with at least host + path defined -static const unsigned uf_hostpath = (1 << UF_HOST) | (1 << UF_PATH); - -// true retval => reject for parse failure -static bool encode_to_outbuf(purger_t* s, const char* url, unsigned url_len) { -dmn_assert(s); dmn_assert(url); dmn_assert(url_len); +// rv: false -> placed something in outbuf +// true -> queue empty, nothing placed in outbuf +static bool dequeue_to_outbuf(purger_t* s) { +dmn_assert(s); +dmn_assert(s->outbuf); dmn_assert(!s->outbuf_bytes); // no other packet currently buffered dmn_assert(!s->outbuf_written); // no other packet currently buffered -bool rv = true; - -struct http_parser_url up; -memset(&up, 0, sizeof(struct http_parser_url)); -if(http_parser_parse_url(url, url_len, 0, &up) || ((up.field_set & uf_hostpath) != uf_hostpath)) { -dmn_log_warn("Rejecting enqueued URL, cannot parse host + path: %s", url); -} -else { -const char* path_etc; -unsigned path_etc_len; -if(s->purge_full_url) { -
[MediaWiki-commits] [Gerrit] operations/puppet[production]: wikibase: fix document root path
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/382860 ) Change subject: wikibase: fix document root path .. wikibase: fix document root path It's not /srv/org if it's not an .org domain :p Change-Id: Id60e2665e83bcc6596560aaf79369109d5e33685 --- M modules/profile/manifests/microsites/wikibase.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Paladox: Looks good to me, but someone else must approve 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 05f1dad..8d764b2 100644 --- a/modules/profile/manifests/microsites/wikibase.pp +++ b/modules/profile/manifests/microsites/wikibase.pp @@ -20,7 +20,7 @@ git::clone { 'wikibase/wikibase.se-deploy': ensure=> 'latest', -directory => '/srv/org/wikibase', +directory => '/srv/es/wikiba', branch=> 'master', } -- To view, visit https://gerrit.wikimedia.org/r/382860 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id60e2665e83bcc6596560aaf79369109d5e33685 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn Gerrit-Reviewer: Dzahn 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...vhtcpd[master]: Add inpkts_sent metric
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382864 ) Change subject: Add inpkts_sent metric .. Add inpkts_sent metric Failures at the very end are not notable in metrics, if e.g. communication with varnish fails in a way that causes us to drop the purge request on the floor (instead of reconnect->retry). They did cause syslog entries, just not metrics. Now we'll see it as a difference between inpkts_dequeued and inpkts_sent. Change-Id: Icbd63e165577bde8be47c923689afb83ce0f1377 --- M src/purger.c M src/stats.c M src/stats.h 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/varnish/vhtcpd refs/changes/64/382864/1 diff --git a/src/purger.c b/src/purger.c index 1814fc8..d48f894 100644 --- a/src/purger.c +++ b/src/purger.c @@ -623,6 +623,7 @@ // reset i/o progress + inc connection reqs s->outbuf_bytes = s->outbuf_written = s->inbuf_parsed = 0; s->fd_reqs++; +stats.inpkts_sent++; // no matter which path, current timer needs to go ev_timer_stop(s->loop, s->timeout_watcher); diff --git a/src/stats.c b/src/stats.c index f30ad63..e922b56 100644 --- a/src/stats.c +++ b/src/stats.c @@ -44,6 +44,7 @@ " inpkts_sane: %" PRIu64 " inpkts_enqueued: %" PRIu64 " inpkts_dequeued: %" PRIu64 + " inpkts_sent: %" PRIu64 " queue_overflows: %" PRIu64 " queue_size: %" PRIu64 " queue_max_size: %" PRIu64, @@ -53,6 +54,7 @@ stats.inpkts_sane, stats.inpkts_enqueued, stats.inpkts_dequeued, + stats.inpkts_sent, stats.queue_overflows, stats.queue_size, stats.queue_max_size @@ -72,6 +74,7 @@ " inpkts_sane:%" PRIu64 " inpkts_enqueued:%" PRIu64 " inpkts_dequeued:%" PRIu64 + " inpkts_sent:%" PRIu64 " queue_overflows:%" PRIu64 " queue_size:%" PRIu64 " queue_max_size:%" PRIu64 @@ -82,6 +85,7 @@ stats.inpkts_sane, stats.inpkts_enqueued, stats.inpkts_dequeued, + stats.inpkts_sent, stats.queue_overflows, stats.queue_size, stats.queue_max_size diff --git a/src/stats.h b/src/stats.h index 108b299..28970ec 100644 --- a/src/stats.h +++ b/src/stats.h @@ -10,6 +10,7 @@ uint64_t inpkts_sane; uint64_t inpkts_enqueued; uint64_t inpkts_dequeued; +uint64_t inpkts_sent; uint64_t queue_overflows; uint64_t queue_size; uint64_t queue_max_size; -- To view, visit https://gerrit.wikimedia.org/r/382864 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbd63e165577bde8be47c923689afb83ce0f1377 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/varnish/vhtcpd Gerrit-Branch: master Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits