[MediaWiki-commits] [Gerrit] Don't list transcodes that were never initiated as failures. - change (mediawiki...TimedMediaHandler)
jenkins-bot has submitted this change and it was merged. Change subject: Don't list transcodes that were never initiated as failures. .. Don't list transcodes that were never initiated as failures. Because we added a new transcode profile in I413a72be, almost every single video/audio file is now listed on Special:TimedMediaHandler as queued, because they were never initiated (relates to issue T104061), and because the queued query was unspecific. This makes the list less useful. I introduced a new state 'missing' and narrowed 'queued', to stuff that was actually added to the jobqueue. Also recalculate totals, making sure failed, missing and currently being transcoded are not part of the transcode total. Bug: T132616 Bug: T112932 Change-Id: I9d96419b55c77924168ba14f2fe3a5ab3cac0698 --- M SpecialTimedMediaHandler.php M i18n/en.json M i18n/qqq.json 3 files changed, 12 insertions(+), 5 deletions(-) Approvals: Brion VIBBER: Looks good to me, approved jenkins-bot: Verified diff --git a/SpecialTimedMediaHandler.php b/SpecialTimedMediaHandler.php index 65fb0a5..31954ab 100644 --- a/SpecialTimedMediaHandler.php +++ b/SpecialTimedMediaHandler.php @@ -12,8 +12,9 @@ // @codingStandardsIgnoreStart private $transcodeStates = array( 'active' => 'transcode_time_startwork IS NOT NULL AND transcode_time_success IS NULL AND transcode_time_error IS NULL', - 'failed' => 'transcode_error != "" AND transcode_time_success IS NULL', - 'queued' => 'transcode_time_startwork IS NULL AND transcode_time_success IS NULL AND transcode_time_error IS NULL', + 'failed' => 'transcode_time_startwork IS NOT NULL AND transcode_time_error IS NOT NULL', + 'queued' => 'transcode_time_addjob IS NOT NULL AND transcode_time_startwork IS NULL', + 'missing' => 'transcode_time_addjob IS NULL', ); // @codingStandardsIgnoreEnd private $formats = array( @@ -62,7 +63,7 @@ $states = $this->getStates(); $this->renderState( $out, 'transcodes', $states, false ); foreach ( $this->transcodeStates as $state => $condition ) { - $this->renderState( $out, $state, $states ); + $this->renderState( $out, $state, $states, $state !== 'missing' ); } } @@ -78,7 +79,8 @@ if ( $states[ $state ][ 'total' ] ) { // Give grep a chance to find the usages: // timedmedia-derivative-state-transcodes, timedmedia-derivative-state-active, - // timedmedia-derivative-state-queued, timedmedia-derivative-state-failed + // timedmedia-derivative-state-queued, timedmedia-derivative-state-failed, + // timedmedia-derivative-state-missing $out->addHTML( "" . $this->msg( @@ -227,6 +229,9 @@ $key = $row->transcode_key; $states[ 'transcodes' ][ $key ] = $row->count; $states[ 'transcodes' ][ $key ] -= $states[ 'queued' ][ $key ]; + $states[ 'transcodes' ][ $key ] -= $states[ 'missing' ][ $key ]; + $states[ 'transcodes' ][ $key ] -= $states[ 'active' ][ $key ]; + $states[ 'transcodes' ][ $key ] -= $states[ 'failed' ][ $key ]; $states[ 'transcodes' ][ 'total' ] += $states[ 'transcodes' ][ $key ]; } $wgMemc->add( $memcKey, $states, 60 ); diff --git a/i18n/en.json b/i18n/en.json index 6d72719..70ec2bd 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -151,6 +151,7 @@ "timedmedia-derivative-state-active": "{{PLURAL:$1|$1 running transcode|$1 running transcodes}}", "timedmedia-derivative-state-queued": "{{PLURAL:$1|$1 queued transcode|$1 queued transcodes}}", "timedmedia-derivative-state-failed": "{{PLURAL:$1|$1 failed transcode|$1 failed transcodes}}", + "timedmedia-derivative-state-missing": "{{PLURAL:$1|$1 uninitialized transcode|$1 uninitialized transcodes}}", "timedmedia-no-derivatives": "No transcoding required.", "timedmedia-file": "File", "timedmedia-audios": "{{PLURAL:$1|$1 audio file|$1 audio files}}", diff --git a/i18n/qqq.json b/i18n/qqq.json index bf00ab3..01f7187 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -166,9 +166,10 @@ "timedmedia-ogg-videos": "Number of Ogg videos on [[Special:TimedMediaHandler]]. Parameters:\n* $1 - number of videos\n{{Related|Timedmedia-format-type}}", "timedmedia-webm-videos": "Number of WebM videos on [[Special:TimedMediaHandler]]. Parameters:\n* $1 - number of
[MediaWiki-commits] [Gerrit] Remove no longer needed GroupElement::$targetPropertyName - change (oojs/ui)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/284633 Change subject: Remove no longer needed GroupElement::$targetPropertyName .. Remove no longer needed GroupElement::$targetPropertyName Follows-up 84edd70dc. Change-Id: Ie500ca170cc50221697828dee38538a5edc4924e --- M php/mixins/GroupElement.php 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/33/284633/1 diff --git a/php/mixins/GroupElement.php b/php/mixins/GroupElement.php index e4300fd..4c43d90 100644 --- a/php/mixins/GroupElement.php +++ b/php/mixins/GroupElement.php @@ -20,8 +20,6 @@ */ protected $group; - public static $targetPropertyName = 'group'; - /** * @param array $config Configuration options */ -- To view, visit https://gerrit.wikimedia.org/r/284633 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie500ca170cc50221697828dee38538a5edc4924e Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui 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] Add namespace translation for Indonesian (id) - change (mediawiki...Flow)
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/284632 Change subject: Add namespace translation for Indonesian (id) .. Add namespace translation for Indonesian (id) Bug: T133254 Change-Id: I9d171825619e64b20aa034f0898c551dc8cddf6f --- M Flow.namespaces.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/32/284632/1 diff --git a/Flow.namespaces.php b/Flow.namespaces.php index 4c70dbb..829eb00 100644 --- a/Flow.namespaces.php +++ b/Flow.namespaces.php @@ -88,6 +88,11 @@ NS_TOPIC => 'Téma', ); +/** Indonesian */ +$namespaceNames['id'] = array( + NS_TOPIC => 'Topik', +); + /** Italian */ $namespaceNames['it'] = array( NS_TOPIC => 'Argomento', -- To view, visit https://gerrit.wikimedia.org/r/284632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d171825619e64b20aa034f0898c551dc8cddf6f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused wfGetDB() in SiteStats::jobs - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused wfGetDB() in SiteStats::jobs .. Remove unused wfGetDB() in SiteStats::jobs Change-Id: Id818a71a75e4d4cb8397df5b1ff3dfdd3b155ea7 --- M includes/SiteStats.php 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/SiteStats.php b/includes/SiteStats.php index acd5262..4908419 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -202,7 +202,6 @@ */ static function jobs() { if ( !isset( self::$jobs ) ) { - $dbr = wfGetDB( DB_SLAVE ); self::$jobs = array_sum( JobQueueGroup::singleton()->getQueueSizes() ); /** * Zero rows still do single row read for row that doesn't exist, -- To view, visit https://gerrit.wikimedia.org/r/284214 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id818a71a75e4d4cb8397df5b1ff3dfdd3b155ea7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: AddshoreGerrit-Reviewer: Legoktm Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add property filtering - change (mediawiki...TemplateStyles)
jenkins-bot has submitted this change and it was merged. Change subject: Add property filtering .. Add property filtering Properties listed in $wgTemplateStylesPropertyBlacklist, or those that contain function-like values not listed in $wgTemplateStylesFunctionWhitelist cause the containing declaration to be omitted from rendering entirely. Additionally, rule selectors are unconditionally prepended with '#mw-content-text' so that they cannot be applied to UI elements outside the actual page content. Change-Id: Id3d7dff465363d0163e4a5a1f31e770b4b0a67e2 --- M CSSParser.php M CSSRenderer.php M TemplateStyles.hooks.php M extension.json R tests/phpunit/CSSParseRenderTest.php 5 files changed, 124 insertions(+), 47 deletions(-) Approvals: BryanDavis: Looks good to me, approved Brion VIBBER: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/CSSParser.php b/CSSParser.php index 67abfc2..889d0cd 100644 --- a/CSSParser.php +++ b/CSSParser.php @@ -30,24 +30,24 @@ (?# Sequences of whitespace ) | \/\* (?: [^*]+ | \*[^\/] )* \*\/ [ \n\t]* (?# Comments and any trailing whitespace ) - | " (?: [^"\n]+ | \. )* ["\n] + | " (?: [^"\n]+ | . )* ["\n] (?# Double-quoted string literals (to newline when unclosed ) - | \' (?: [^\'\n]+ | \. )* [\'\n] - (#? Single-quoted string literals (to newline when unclosed ) + | \' (?: [^\'\n]+ | . )* [\'\n] + (?# Single-quoted string literals (to newline when unclosed ) | [+-]? (?: [0-9]* \. )? [0-9]+ (?: [_a-z][_a-z0-9-]* | % )? - (#? Numerical literals - including optional trailing units or percent sign ) + (?# Numerical literals - including optional trailing units or percent sign ) | @? -? (?: [_a-z] | [0-9a-f]{1,6} [ \n\t]? ) (?: [_a-z0-9-]+ | [0-9a-f]{1,6} [ \n\t]? | [^\0-\177] )* (?: [ \n\t]* \( )? - (#? Identifiers - including leading `@` for at-rule blocks ) - (#? Trailing open captures are captured to match functional values ) + (?# Identifiers - including leading `@` for at-rule blocks ) + (?# Trailing open captures are captured to match functional values ) | \# (?: [_a-z0-9-]+ | [0-9a-f]{1,6} [ \n\t]? | [^\0-\177] )* - (#? So-called hatch literals ) + (?# So-called hatch literals ) | u\+ [0-9a-f]{1,6} (?: - [0-9a-f]{1,6} )? - (#? Unicode range literals ) + (?# Unicode range literals ) | u\+ [0-9a-f?]{1,6} - (#? Unicode mask literals ) + (?# Unicode mask literals ) | .) - (#? Any unmatched token is reduced to single characters ) + (?# Any unmatched token is reduced to single characters ) /xis', $css, $match ); $space = false; @@ -69,8 +69,13 @@ // prevents trying to obfuscate ASCII in identifiers to prevent matches. $t = preg_replace_callback( '/([0-9a-f]{1,6})[ \n\t]?/', function( $match ) { - return html_entity_decode( '
[MediaWiki-commits] [Gerrit] Add reason to deletion log entries - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Add reason to deletion log entries .. Add reason to deletion log entries Bug: T110499 Change-Id: Id4b1355291bfd5f31a449de645e69a42dc42e098 --- M tag/SpecialPageTranslationDeletePage.php M tag/TranslateDeleteJob.php 2 files changed, 21 insertions(+), 5 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/tag/SpecialPageTranslationDeletePage.php b/tag/SpecialPageTranslationDeletePage.php index 98d49a4..713393d 100644 --- a/tag/SpecialPageTranslationDeletePage.php +++ b/tag/SpecialPageTranslationDeletePage.php @@ -349,7 +349,8 @@ $old, $base, !$this->singleLanguage(), - $user + $user, + $this->reason ); } @@ -359,7 +360,8 @@ $old, $base, !$this->singleLanguage(), - $user + $user, + $this->reason ); } @@ -374,7 +376,8 @@ $old, $base, !$this->singleLanguage(), - $user + $user, + $this->reason ); } } diff --git a/tag/TranslateDeleteJob.php b/tag/TranslateDeleteJob.php index b62dfe1..0c78e7f 100644 --- a/tag/TranslateDeleteJob.php +++ b/tag/TranslateDeleteJob.php @@ -19,9 +19,10 @@ * @param $base * @param $full * @param $performer +* @param $reason * @return TranslateDeleteJob */ - public static function newJob( Title $target, $base, $full, /*User*/$performer ) { + public static function newJob( Title $target, $base, $full, /*User*/$performer, $reason ) { $job = new self( $target ); $job->setUser( FuzzyBot::getUser() ); $job->setFull( $full ); @@ -29,6 +30,7 @@ $msg = $job->getFull() ? 'pt-deletepage-full-logreason' : 'pt-deletepage-lang-logreason'; $job->setSummary( wfMessage( $msg, $base )->inContentLanguage()->text() ); $job->setPerformer( $performer ); + $job->setReason( $reason ); return $job; } @@ -50,12 +52,13 @@ $summary = $this->getSummary(); $base = $this->getBase(); $doer = User::newFromName( $this->getPerformer() ); + $reason = $this->getReason(); PageTranslationHooks::$allowTargetEdit = true; $error = ''; $wikipage = new WikiPage( $title ); - $ok = $wikipage->doDeleteArticle( $summary, false, 0, true, $error, $user ); + $ok = $wikipage->doDeleteArticle( "{$summary}: $reason", false, 0, true, $error, $user ); if ( !$ok ) { $params = array( 'target' => $base, @@ -65,6 +68,7 @@ $type = $this->getFull() ? 'deletefnok' : 'deletelnok'; $entry = new ManualLogEntry( 'pagetranslation', $type ); $entry->setPerformer( $doer ); + $entry->setComment( $reason ); $entry->setTarget( $title ); $entry->setParameters( $params ); $logid = $entry->insert(); @@ -82,6 +86,7 @@ $type = $this->getFull() ? 'deletefok' : 'deletelok'; $entry = new ManualLogEntry( 'pagetranslation', $type ); $entry->setPerformer( $doer ); + $entry->setComment( $reason ); $entry->setTarget( Title::newFromText( $base ) ); $logid = $entry->insert(); $entry->publish( $logid ); @@ -105,6 +110,14 @@ return $this->params['summary']; } + public function setReason( $reason ) { + $this->params['reason'] = $reason; + } + + public function getReason() { + return $this->params['reason']; + } + public function setFull( $full ) { $this->params['full'] = $full; } -- To view, visit https://gerrit.wikimedia.org/r/282395 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id4b1355291bfd5f31a449de645e69a42dc42e098
[MediaWiki-commits] [Gerrit] General cleanup of CSSRenderer - change (mediawiki...TemplateStyles)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/284629 Change subject: General cleanup of CSSRenderer .. General cleanup of CSSRenderer * Add phpdoc comments * Rename some variables to be a bit more clear for new readers * Break up render() to make things more readable and reduce cyclomatic complexity Change-Id: Iceeb1f6eb09b61efe6b81f359d28741f54fe88ad --- M CSSRenderer.php M tests/phpunit/CSSParseRenderTest.php 2 files changed, 104 insertions(+), 47 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateStyles refs/changes/29/284629/1 diff --git a/CSSRenderer.php b/CSSRenderer.php index 70d2631..40d7614 100644 --- a/CSSRenderer.php +++ b/CSSRenderer.php @@ -1,6 +1,4 @@ bymedia = []; + $this->byMedia = []; } /** * Adds (and merge) a parsed CSS tree to the render list. * * @param array $rules The parsed tree as created by CSSParser::rules() -* @param string $media Forcibly specified @media block selector. Normally unspecified -* and defaults to the empty string. +* @param string $media Forcibly specified @media block selector. */ function add( $rules, $media = '' ) { - if ( !array_key_exists( $media, $this->bymedia ) ) { - $this->bymedia[$media] = []; + if ( !array_key_exists( $media, $this->byMedia ) ) { + $this->byMedia[$media] = []; } - foreach ( $rules as $at ) { - switch ( strtolower( $at['name'] ) ) { + foreach ( $rules as $rule ) { + switch ( strtolower( $rule['name'] ) ) { case '@media': if ( $media == '' ) { - $this->add( $at['rules'], "@media ".$at['text'] ); + $this->add( + $rule['rules'], "@media {$rule['text']}" + ); } break; case '': - $this->bymedia[$media] = array_merge( $this->bymedia[$media], $at['rules'] ); + $this->byMedia[$media] = array_merge( + $this->byMedia[$media], $rule['rules'] + ); break; } } } /** -* Renders the collected CSS trees into a string suitable for inclusion +* Render the collected CSS trees into a string suitable for inclusion * in a
[MediaWiki-commits] [Gerrit] General cleanup of CSSParser - change (mediawiki...TemplateStyles)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/284628 Change subject: General cleanup of CSSParser .. General cleanup of CSSParser * Add phpdoc comments * Update method signatures to reduce duplication * Rename some variables to be a bit more clear for new readers * Try to keep lines <80 chars (my own personal peeve I know) * Use === instead of == * Fix a few other small code style issues Change-Id: I52594fd34646af53fc91ec470fcf1d0be9c2b156 --- M CSSParser.php 1 file changed, 169 insertions(+), 96 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateStyles refs/changes/28/284628/1 diff --git a/CSSParser.php b/CSSParser.php index 889d0cd..2e7bcb9 100644 --- a/CSSParser.php +++ b/CSSParser.php @@ -12,7 +12,9 @@ */ class CSSParser { + /** @var array $tokens */ private $tokens; + /** @var int $index */ private $index; /** @@ -25,6 +27,7 @@ * @param string $css */ function __construct( $css ) { + $this->index = 0; preg_match_all( '/( [ \n\t]+ (?# Sequences of whitespace ) @@ -46,51 +49,65 @@ (?# Unicode range literals ) | u\+ [0-9a-f?]{1,6} (?# Unicode mask literals ) - | .) + | . (?# Any unmatched token is reduced to single characters ) - /xis', $css, $match ); + )/xis', $css, $match ); - $space = false; - foreach ( $match[0] as $t ) { - if ( preg_match( '/^(?:[ \n\t]|\/\*)/', $t ) ) { - + $inWhitespaceRun = false; + foreach ( $match[0] as $token ) { + if ( preg_match( '/^(?: [ \n\t] | \/\* )/x', $token ) ) { // Fold any sequence of whitespace to a single space token - - if ( !$space ) { - $space = true; + if ( !$inWhitespaceRun ) { + $inWhitespaceRun = true; $this->tokens[] = ' '; continue; } } else { + // Decode any hexadecimal escape character into its + // corresponding UTF-8 sequence - output is UTF-8 so the + // escaping is unnecessary and this prevents trying to + // obfuscate ASCII in identifiers to prevent matches. + $token = preg_replace_callback( + '/([0-9a-f]{1,6})[ \n\t]?/', + function( $match ) { + return html_entity_decode( + '
[MediaWiki-commits] [Gerrit] Correct typo in variable naming - change (mediawiki...TimedMediaHandler)
jenkins-bot has submitted this change and it was merged. Change subject: Correct typo in variable naming .. Correct typo in variable naming Change-Id: I316e13c4af52c6090dd3e006fd6263e8c1dd1093 --- M WebVideoTranscode/WebVideoTranscode.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Paladox: Looks good to me, but someone else must approve Brion VIBBER: Looks good to me, approved jenkins-bot: Verified diff --git a/WebVideoTranscode/WebVideoTranscode.php b/WebVideoTranscode/WebVideoTranscode.php index 9c460f0..00b5eaf 100644 --- a/WebVideoTranscode/WebVideoTranscode.php +++ b/WebVideoTranscode/WebVideoTranscode.php @@ -815,11 +815,11 @@ // Populate the per transcode state cache foreach ( $res as $row ) { // strip the out the "transcode_" from keys - $trascodeState = array(); + $transcodeState = array(); foreach ( $row as $k => $v ) { - $trascodeState[ str_replace( 'transcode_', '', $k ) ] = $v; + $transcodeState[ str_replace( 'transcode_', '', $k ) ] = $v; } - self::$transcodeState[ $fileName ][ $row->transcode_key ] = $trascodeState; + self::$transcodeState[ $fileName ][ $row->transcode_key ] = $transcodeState; if ( $row->transcode_time_startwork != null && $row->transcode_time_startwork < $over && $row->transcode_time_success == null -- To view, visit https://gerrit.wikimedia.org/r/284268 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I316e13c4af52c6090dd3e006fd6263e8c1dd1093 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJGerrit-Reviewer: Brion VIBBER 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] DRY up validate_personal - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284627 Change subject: DRY up validate_personal .. DRY up validate_personal It's got way nicer behavior than validate_form. Start grooming it for use with mustache forms to get them off popup alerts. Bug: T107363 Change-Id: I944246c74eb90b00cf59b0ddbfd2018d2d2b0de2 --- M modules/validate_input.js 1 file changed, 48 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/27/284627/1 diff --git a/modules/validate_input.js b/modules/validate_input.js index ae282e6..1a6e700 100644 --- a/modules/validate_input.js +++ b/modules/validate_input.js @@ -101,17 +101,31 @@ var value, stateField, selectedState, countryField, $emailAdd, invalid, apos, dotpos, domain, errorsPresent = false, currField = '', - i = 0, + i, fields = [ 'fname', 'lname', 'street', 'city', 'zip', 'emailAdd' ], - msgFields = [ 'fnameMsg', 'lnameMsg', 'streetMsg', 'cityMsg', 'zipMsg', 'emailAddMsg' ], + errorTemplate = mediaWiki.msg( 'donate_interface-error-msg' ), numFields = fields.length, invalids = [ '..', '/', '\\', ',', '<', '>' ]; + function clearError( field ) { + $( '#' + field ).removeClass( 'errorHighlight' ); + $( '#' + field + 'Msg' ) + .removeClass( 'errorMsg' ) + .addClass( 'errorMsgHide' ); + } + + function setError( field, message ) { + errorsPresent = true; + $( '#' + field ).addClass( 'errorHighlight' ); + $( '#' + field + 'Msg' ) + .removeClass( 'errorMsgHide' ) + .addClass( 'errorMsg' ) + .text( message ); + } + for ( i = 0; i < numFields; i++ ) { if ( $( '#' + fields[ i ] ).length > 0 ) { // Make sure field exists - $( '#' + msgFields[ i ] ).removeClass( 'errorMsg' ); - $( '#' + msgFields[ i ] ).addClass( 'errorMsgHide' ); - $( '#' + fields[ i ] ).removeClass( 'errorHighlight' ); + clearError( fields[ i ] ); // See if the field is empty or equal to the placeholder value = document.getElementById( fields[ i ] ).value; if ( @@ -122,11 +136,10 @@ ) ) { currField = mediaWiki.msg( 'donate_interface-error-msg-' + fields[ i ] ); - errorsPresent = true; - $( '#' + fields[ i ] ).addClass( 'errorHighlight' ); - $( '#' + msgFields[ i ] ).removeClass( 'errorMsgHide' ); - $( '#' + msgFields[ i ] ).addClass( 'errorMsg' ); - $( '#' + msgFields[ i ] ).text( mediaWiki.msg( 'donate_interface-error-msg' ).replace( '$1', currField ) ); + setError( + fields[ i ], + errorTemplate.replace( '$1', currField ) + ); } } } @@ -135,42 +148,34 @@ if ( stateField && stateField.type === 'select-one' ) { // state is a dropdown select selectedState = stateField.options[ stateField.selectedIndex ].value; if ( selectedState === 'YY' || !$.trim( selectedState ) ) { - errorsPresent = true; - $( '#state' ).addClass( 'errorHighlight' ); - $( '#stateMsg' ).removeClass( 'errorMsgHide' ); - $( '#stateMsg' ).addClass( 'errorMsg' ); - $( '#stateMsg' ).text( mediaWiki.msg( 'donate_interface-error-msg' ).replace( '$1', mediaWiki.msg( 'donate_interface-state-province' ) ) ); + setError( + 'state', + errorTemplate.replace( '$1', mediaWiki.msg( 'donate_interface-state-province' ) ) + ); } else { - $( '#state' ).removeClass( 'errorHighlight' ); - $( '#stateMsg' ).removeClass( 'errorMsg' ); - $( '#stateMsg' ).addClass( 'errorMsgHide' ); + clearError( 'state' ); } } + // FIXME: wouldn't $( '#country' ).val() work for both types? countryField = document.getElementById( 'country' ); if ( countryField && countryField.type === 'select-one' ) { // country is a dropdown select if ( !$.trim(
[MediaWiki-commits] [Gerrit] Add null values when query returns no results - change (analytics/reportupdater)
Nuria has submitted this change and it was merged. Change subject: Add null values when query returns no results .. Add null values when query returns no results Before, when the query or script returned no results (just header), RU didn't update the report file for that time period, leaving a blank in the report. This was on purpose and intended to give another opportunity for the data to be backfilled when ready. But in practice, when a query does not return any results at first, it usually does not return any results in subsequent retrials. So, the corresponding slot in the report file remains empty forever, and the query is run every time RU is executed, using unnecessary resources. This change makes RU output a line with null values, when a query or script returns no results. Thus, avoiding unnecessary recomputations. If the data for a query is not ready at the time RU triggers by default, the lag option should be used to delay the execution by a given number of seconds. Bug: T117537 Change-Id: Ic1790aed5df60075b617d5900ad9a80085e0 --- M reportupdater/executor.py M test/executor_test.py 2 files changed, 120 insertions(+), 107 deletions(-) Approvals: Nuria: Verified; Looks good to me, approved diff --git a/reportupdater/executor.py b/reportupdater/executor.py index c44d0aa..95db060 100644 --- a/reportupdater/executor.py +++ b/reportupdater/executor.py @@ -10,6 +10,7 @@ import subprocess import csv import os +from copy import copy from datetime import datetime, date from selector import Selector from collections import defaultdict @@ -51,7 +52,8 @@ if report.db_key not in self.connections: self.connections[report.db_key] = self.create_connection(report.db_key) connection = self.connections[report.db_key] -report.results = self.execute_sql(sql_query, connection, report.is_funnel) +header, data = self.execute_sql(sql_query, connection) +report.results = self.normalize_results(report, header, data) return True except Exception, e: message = ('Report "{report_key}" could not be executed ' @@ -115,32 +117,17 @@ raise RuntimeError('MySQLdb can not connect to database (' + str(e) + ').') -def execute_sql(self, sql_query, connection, is_funnel=False): +def execute_sql(self, sql_query, connection): cursor = connection.cursor() try: cursor.execute(sql_query) -rows = cursor.fetchall() +data = cursor.fetchall() header = [field[0] for field in cursor.description] except Exception, e: raise RuntimeError('MySQLdb can not execute query (' + str(e) + ').') finally: cursor.close() -if is_funnel: -data = defaultdict(list) -else: -data = {} -for row in rows: -sql_date = row[0] -if not isinstance(sql_date, date): -raise ValueError('Query results do not have date values in first column.') -# normalize to datetime -row = list(row) # make row item assignable -row[0] = datetime(sql_date.year, sql_date.month, sql_date.day, 0, 0, 0, 0) -if is_funnel: -data[row[0]].append(row) -else: -data[row[0]] = row -return {'header': header, 'data': data} +return header, data def execute_script_report(self, report): @@ -157,33 +144,52 @@ # it will be the absolute path to itself # NOTE: wouldn't this be available to the script anyway? parameters.append(os.path.dirname(report.script)) -# execute the script, store its output in a pipe try: +# Execute the script, parse the results and normalize them. process = subprocess.Popen(parameters, stdout=subprocess.PIPE) -except OSError, e: +tsv_reader = csv.reader(process.stdout, delimiter='\t') +report.results = self.normalize_results(report, None, tsv_reader) +except Exception, e: message = ('Report "{report_key}" could not be executed ' 'because of error: {error}') logging.error(message.format(report_key=report.key, error=str(e))) return False -# parse the results into the report object -header = None -if report.is_funnel: -data = defaultdict(list) -else: -data = {} -tsv_reader = csv.reader(process.stdout, delimiter='\t') -for row in tsv_reader: -if header is None: # first row -header = row -else: # other rows -try: -row[0] = datetime.strptime(row[0], DATE_FORMAT) -except ValueError: -logging.error('Query
[MediaWiki-commits] [Gerrit] WIP pass errors in to getForm() - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284626 Change subject: WIP pass errors in to getForm() .. WIP pass errors in to getForm() Might be cool to pass all the adapter data into getForm so the rendering classes don't need to ask the adapter anything. Change-Id: Ie30559d8249dd17fc9c1af8fbe9898533ccc54ac --- M gateway_common/GatewayPage.php M gateway_forms/Form.php M gateway_forms/Mustache.php M gateway_forms/RapidHtml.php M tests/MustacheFormTest.php 5 files changed, 52 insertions(+), 48 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/26/284626/1 diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index 8461312..a604399 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -153,15 +153,19 @@ /** * Build and display form to user +* @param array|null $errors from validation or from payment result */ - public function displayForm() { + public function displayForm( $errors = null ) { + if ( $errors === null ) { + $errors = $this->adapter->getAllErrors(); + } $output = $this->getOutput(); $form_class = $this->getFormClass(); // TODO: use interface. static ctor. if ( $form_class && class_exists( $form_class ) ){ $form_obj = new $form_class( $this->adapter ); - $form = $form_obj->getForm(); + $form = $form_obj->getForm( $errors ); $output->addModules( $form_obj->getResources() ); $output->addHTML( $form ); } else { @@ -288,10 +292,10 @@ if ( $this->isProcessImmediate() ) { // Check form for errors // FIXME: Should this be rolled into adapter.doPayment? - $form_errors = $this->validateForm(); + $hasErrors = $this->validateForm(); // If there were errors, redisplay form, otherwise proceed to next step - if ( $form_errors ) { + if ( $hasErrors ) { $this->displayForm(); } else { // Attempt to process the payment, and render the response. @@ -303,8 +307,7 @@ } } else { //token mismatch $error['general']['token-mismatch'] = $this->msg( 'donate_interface-token-mismatch' ); - $this->adapter->addManualError( $error ); - $this->displayForm(); + $this->displayForm( $error ); } } @@ -449,9 +452,9 @@ ) ); $this->displayForm(); } elseif ( $errors = $result->getErrors() ) { - // FIXME: Creepy. Currently, the form inspects adapter errors. Use - // the stuff encapsulated in PaymentResult instead. - foreach ( $this->adapter->getTransactionResponse()->getErrors() as $code => $transactionError ) { + // Mash the transaction errors into a form-friendly array + $formErrors = array(); + foreach ( $result->getErrors() as $code => $transactionError ) { $message = $transactionError['message']; $error = array(); if ( !empty( $transactionError['context'] ) ) { @@ -462,9 +465,9 @@ else { $error['general'][ $code ] = $message; } - $this->adapter->addManualError( $error ); + $formErrors[] = $error; } - $this->displayForm(); + $this->displayForm( $formErrors ); } else { // Success. $thankYouPage = ResultPages::getThankYouPage( $this->adapter ); diff --git a/gateway_forms/Form.php b/gateway_forms/Form.php index 2c3a8d8..59b32b6 100644 --- a/gateway_forms/Form.php +++ b/gateway_forms/Form.php @@ -1,11 +1,6 @@ gateway = $gateway; $this->scriptPath = $this->gateway->getContext()->getConfig()->get( 'ScriptPath' ); $this->logger = DonationLoggerFactory::getLogger( $gateway ); - $gateway_errors = $this->gateway->getAllErrors(); - - // @codeCoverageIgnoreStart - if (
[MediaWiki-commits] [Gerrit] Add change tag for delivery to wikitext pages - change (mediawiki...MassMessage)
Wctaiwan has uploaded a new change for review. https://gerrit.wikimedia.org/r/284624 Change subject: Add change tag for delivery to wikitext pages .. Add change tag for delivery to wikitext pages Note that this does not cover LiquidThreads or Flow talk pages. Change-Id: I0074b45e40779979c86b47a3b626710228db078f --- M MassMessage.hooks.php M extension.json M i18n/en.json M i18n/qqq.json M includes/job/MassMessageJob.php 5 files changed, 30 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage refs/changes/24/284624/1 diff --git a/MassMessage.hooks.php b/MassMessage.hooks.php index 71bb204..bf482dc 100644 --- a/MassMessage.hooks.php +++ b/MassMessage.hooks.php @@ -245,4 +245,14 @@ } return true; } + + /** +* Register the change tag for MassMessage delivery +* @param array &$tags +* @return bool +*/ + public static function onRegisterTags( &$tags ) { + $tags[] = 'massmessage-delivery'; + return true; + } } diff --git a/extension.json b/extension.json index 1b4456f..3b947f9 100644 --- a/extension.json +++ b/extension.json @@ -72,6 +72,12 @@ ], "BeforePageDisplay": [ "MassMessageHooks::onBeforePageDisplay" + ], + "ListDefinedTags": [ + "MassMessageHooks::onRegisterTags" + ], + "ChangeTagsListActive": [ + "MassMessageHooks::onRegisterTags" ] }, "ContentHandlers": { diff --git a/i18n/en.json b/i18n/en.json index 83b2406..902f97b 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -123,5 +123,7 @@ "apihelp-massmessage-example-1": "Send a message to the list at [[Signpost Spamlist]] with the subject \"New Signpost\", and message body of \"Please read it\"", "apihelp-query+mmsites-description": "Serve autocomplete requests for the site field in MassMessage.", "apihelp-query+mmsites-param-term": "The prefix to search for.", - "apihelp-query+mmsites-example-1": "Autocomplete \"en\"" + "apihelp-query+mmsites-example-1": "Autocomplete \"en\"", + "tag-massmessage-delivery": "MassMessage delivery", + "tag-massmessage-delivery-description": "Message delivery using [[:mw:Extension:MassMessage|Extension:MassMessage]]" } diff --git a/i18n/qqq.json b/i18n/qqq.json index fb01efa..4c52951 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -129,5 +129,7 @@ "apihelp-massmessage-example-1": "{{doc-apihelp-example|massmessage}}", "apihelp-query+mmsites-description": "{{doc-apihelp-description|query+mmsites}}", "apihelp-query+mmsites-param-term": "Label of an input area. Connected site names will be returned if they match the provided prefix (e.g. entering \"meta\" may return \"metawiki\").\n\n{{doc-apihelp-param|query+mmsites|term}}", - "apihelp-query+mmsites-example-1": "{{doc-apihelp-example|query+mmsites}}" + "apihelp-query+mmsites-example-1": "{{doc-apihelp-example|query+mmsites}}", + "tag-massmessage-delivery": "Change tag for MassMessage delivery edits", + "tag-massmessage-delivery-description": "Description for MassMessage delivery change tag" } diff --git a/includes/job/MassMessageJob.php b/includes/job/MassMessageJob.php index 655beef..a6bc565 100644 --- a/includes/job/MassMessageJob.php +++ b/includes/job/MassMessageJob.php @@ -308,6 +308,14 @@ } } + // Apply change tag for wikitext talk page edits + if ( $params['action'] === 'edit' ) { + $revId = $api->getResult()->getResultData()['edit']['newrevid']; + DeferredUpdates::addCallableUpdate( function() use ( $revId ) { + ChangeTags::addTags( 'massmessage-delivery', null, $revId, null ); + } ); + } + // Cleanup all the stuff we polluted $context->setUser( $oldCUser ); $context->setRequest( $oldCRequest ); -- To view, visit https://gerrit.wikimedia.org/r/284624 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0074b45e40779979c86b47a3b626710228db078f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassMessage Gerrit-Branch: master Gerrit-Owner: Wctaiwan___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bundle dependencies in an "uber-jar" - change (mediawiki...html5depurate)
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/284625 Change subject: Bundle dependencies in an "uber-jar" .. Bundle dependencies in an "uber-jar" There was no Debian package for Grizzly, and doing our own would have been a significant amount of work, since it uses a lot of dependencies that we don't directly need. Change-Id: Iddbb6ca15745cacd7088173861a3b1ed0c4c5d89 --- M README.md M pom.xml 2 files changed, 49 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/html5depurate refs/changes/25/284625/1 diff --git a/README.md b/README.md index 9f14719..e2200ab 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,15 @@ * maven2 * jsvc -Compile with `mvn compile`. Then `mvn dependency:build-classpath` will display -a classpath suitable for testing. Then the daemon can be started with something -like: +Compile and generate a .jar file by running `mvn package`. + +We use the "shade" plugin to bundle all dependencies. So to run it, you only +need the generated .jar file in the class path. To start the server as a +daemon, use something like: ``` /usr/bin/jsvc \ - -cp "$classpath":target/classes \ + -cp $(pwd)/target/html5depurate-1.0-SNAPSHOT.jar \ -pidfile /tmp/html5depurate.pid \ -errfile /tmp/html5depurate.err \ -outfile /tmp/html5depurate.out \ @@ -53,8 +55,10 @@ - A SysV init script wrapping jsvc should be fairly simple. - Very strong security guarantees are possible by using a security.policy file. - - Most Maven dependencies are packaged already, with the exception of the -validator.nu parser itself, which needs to be bundled. + - There is no package for grizzly, so we will have to bundle it for now. +Using Maven Central during build, instead of creating about 9 new Debian +source packages, is not allowed in Debian upstream, but WMF can distribute +the resulting file. * Collect warnings/errors and provide a JSON serialized return format exposed at /info. diff --git a/pom.xml b/pom.xml index e726baa..05e6a80 100644 --- a/pom.xml +++ b/pom.xml @@ -7,36 +7,69 @@ 1.0-SNAPSHOT html5depurate http://maven.apache.org + + + +org.apache.maven.plugins +maven-shade-plugin +2.4.3 + + + + +package + + shade + + + + + + nu.validator htmlparser - 1.4.1 + ${htmlparser.version} commons-daemon commons-daemon - 1.0.15 + ${commons-daemon.version} commons-cli commons-cli - 1.3.1 + ${commons-cli.version} org.glassfish.grizzly grizzly-framework - 2.3.22 + ${grizzly.version} org.glassfish.grizzly grizzly-http-server - 2.3.22 + ${grizzly.version} org.glassfish.grizzly grizzly-http-server-multipart - 2.3.22 + ${grizzly.version} + + +1.4.1 +1.0.15 +1.3.1 +2.3.22 + -- To view, visit https://gerrit.wikimedia.org/r/284625 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddbb6ca15745cacd7088173861a3b1ed0c4c5d89 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/html5depurate Gerrit-Branch: master Gerrit-Owner: Tim Starling___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use png image from restbase in mathml mode - change (mediawiki...MathSearch)
jenkins-bot has submitted this change and it was merged. Change subject: Use png image from restbase in mathml mode .. Use png image from restbase in mathml mode Change-Id: Iffb2a03c3aa8ed220307ef58ba13f1a38a284c5e --- M MathObject.php 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Physikerwelt: Looks good to me, approved jenkins-bot: Verified diff --git a/MathObject.php b/MathObject.php index 9db623f..8df32a8 100644 --- a/MathObject.php +++ b/MathObject.php @@ -421,6 +421,10 @@ } public function getPng() { + if ( $this->mode == 'mathml' ){ + $pngUrl = preg_replace( '#/svg/#', '/png/', $this->getRbi()->getFullSvgUrl() ); + return file_get_contents( $pngUrl ); + } $texvc = MathTexvc::newFromMd5( $this->getMd5() ); $texvc->readFromDatabase(); return $texvc->getPng(); -- To view, visit https://gerrit.wikimedia.org/r/284619 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iffb2a03c3aa8ed220307ef58ba13f1a38a284c5e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MathSearch Gerrit-Branch: master Gerrit-Owner: PhysikerweltGerrit-Reviewer: Dyiop Gerrit-Reviewer: Hcohl Gerrit-Reviewer: Physikerwelt Gerrit-Reviewer: Whyameri Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow single-parameter WmfFramework::messageExists - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284621 Change subject: Allow single-parameter WmfFramework::messageExists .. Allow single-parameter WmfFramework::messageExists Assume the current request language if not specified. Bug: T133253 Change-Id: I0d48f618577714e18c2ff624b9711361aedbccb9 --- M gateway_common/WmfFramework.mediawiki.php 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/21/284621/1 diff --git a/gateway_common/WmfFramework.mediawiki.php b/gateway_common/WmfFramework.mediawiki.php index 1ece1bb..c3a20ab 100644 --- a/gateway_common/WmfFramework.mediawiki.php +++ b/gateway_common/WmfFramework.mediawiki.php @@ -56,12 +56,15 @@ /** * wmfMessageExists returns true if a translatable message has been defined * for the string and language that have been passed in, false if none is -* present. +* present. If no language is passed in, defaults to self::getLanguageCode() * @param string $msg_key The message string to look up. -* @param string $language A valid mediawiki language code. +* @param string $language A valid mediawiki language code, or null. * @return boolean - true if message exists, otherwise false. */ - public static function messageExists( $msg_key, $language ) { + public static function messageExists( $msg_key, $language = null ) { + if ( $language === null ) { + $language = self::getLanguageCode(); + } return Language::getMessageFor( $msg_key, $language ) !== null; } -- To view, visit https://gerrit.wikimedia.org/r/284621 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d48f618577714e18c2ff624b9711361aedbccb9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change message key of Canada province prompt - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284620 Change subject: Change message key of Canada province prompt .. Change message key of Canada province prompt Use 'donate_interface-donor-state-ca' for consistency with other country-specific overrides. Bug: T133253 Change-Id: Iea1afc1ae7eb5a322837b8784b27abc810242441 --- M gateway_common/i18n/interface/ast.json M gateway_common/i18n/interface/ba.json M gateway_common/i18n/interface/bn.json M gateway_common/i18n/interface/ce.json M gateway_common/i18n/interface/cs.json M gateway_common/i18n/interface/cy.json M gateway_common/i18n/interface/de.json M gateway_common/i18n/interface/diq.json M gateway_common/i18n/interface/en.json M gateway_common/i18n/interface/es.json M gateway_common/i18n/interface/eu.json M gateway_common/i18n/interface/fa.json M gateway_common/i18n/interface/fr.json M gateway_common/i18n/interface/fy.json M gateway_common/i18n/interface/gl.json M gateway_common/i18n/interface/he.json M gateway_common/i18n/interface/ia.json M gateway_common/i18n/interface/it.json M gateway_common/i18n/interface/ka.json M gateway_common/i18n/interface/kk-cyrl.json M gateway_common/i18n/interface/ksh.json M gateway_common/i18n/interface/lb.json M gateway_common/i18n/interface/mk.json M gateway_common/i18n/interface/nl.json M gateway_common/i18n/interface/ps.json M gateway_common/i18n/interface/pt-br.json M gateway_common/i18n/interface/qqq.json M gateway_common/i18n/interface/roa-tara.json M gateway_common/i18n/interface/ru.json M gateway_common/i18n/interface/sv.json M gateway_common/i18n/interface/uk.json M gateway_common/i18n/interface/vi.json M gateway_common/i18n/interface/zh-hans.json M globalcollect_gateway/forms/html/_personal-information/CA.html M worldpay_gateway/forms/html/_personal-information/CA.html 35 files changed, 38 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/20/284620/1 diff --git a/gateway_common/i18n/interface/ast.json b/gateway_common/i18n/interface/ast.json index 214097a..26fb4e6 100644 --- a/gateway_common/i18n/interface/ast.json +++ b/gateway_common/i18n/interface/ast.json @@ -135,7 +135,7 @@ "donate_interface-donor-county": "Conceyu, condáu", "donate_interface-donor-island": "Islla", "donate_interface-donor-state": "Estáu, comunidá autónoma", - "donate_interface-donor-province": "Provincia", + "donate_interface-donor-state-ca": "Provincia", "donate_interface-donor-zip": "Códigu postal", "donate_interface-donor-postal": "Códigu postal", "donate_interface-donor-country": "País/Rexón", diff --git a/gateway_common/i18n/interface/ba.json b/gateway_common/i18n/interface/ba.json index d6536f3..20e0b15 100644 --- a/gateway_common/i18n/interface/ba.json +++ b/gateway_common/i18n/interface/ba.json @@ -146,7 +146,7 @@ "donate_interface-donor-county": "Округ", "donate_interface-donor-island": "Утрау", "donate_interface-donor-state": "Штат:", - "donate_interface-donor-province": "Провинция", + "donate_interface-donor-state-ca": "Провинция", "donate_interface-donor-zip": "Индекс", "donate_interface-donor-postal": "Почта индексы:", "donate_interface-donor-country": "Ил / регион:", diff --git a/gateway_common/i18n/interface/bn.json b/gateway_common/i18n/interface/bn.json index 48f3791..6d40a6a 100644 --- a/gateway_common/i18n/interface/bn.json +++ b/gateway_common/i18n/interface/bn.json @@ -124,7 +124,7 @@ "donate_interface-donor-county": "দেশ", "donate_interface-donor-island": "দ্বীপ", "donate_interface-donor-state": "রাষ্ট্র", - "donate_interface-donor-province": "প্রদেশ", + "donate_interface-donor-state-ca": "প্রদেশ", "donate_interface-donor-zip": "জিপ", "donate_interface-donor-postal": "পোস্টাল কোড", "donate_interface-donor-country": "দেশ/অঞ্চল", diff --git a/gateway_common/i18n/interface/ce.json b/gateway_common/i18n/interface/ce.json index 3d29e02..be6b521 100644 --- a/gateway_common/i18n/interface/ce.json +++ b/gateway_common/i18n/interface/ce.json @@ -16,7 +16,7 @@ "donate_interface-rt-button": "ГӀоде банкехула «$1»", "donate_interface-ewallet-button": "ГӀоде $1 чухула", "donate_interface-amount-legend": "ГӀоьна ахча", - "donate_interface-donor-province": "Провинци", + "donate_interface-donor-state-ca": "Провинци", "donate_interface-error-msg-amount": "гӀоьна ахча", "donate_interface-error-msg-genaricrequired": "ХӀара юззар тӀехь ду.", "donate_interface-error-msg-country-calc": "ГӀалат - тха хӀинца а йиш яц хьан гӀо тӀелаца.", diff --git a/gateway_common/i18n/interface/cs.json b/gateway_common/i18n/interface/cs.json index fa400fe..43b4083 100644 --- a/gateway_common/i18n/interface/cs.json +++
[MediaWiki-commits] [Gerrit] Persist state/province selection, localize prompt - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284623 Change subject: Persist state/province selection, localize prompt .. Persist state/province selection, localize prompt Also move state dropdown template into existing but empty file. Bug: T133253 Change-Id: I3139495149f09c35cc8acd10c0eb3df507b888b3 --- M gateway_forms/Mustache.php M gateway_forms/includes/Subdivisions.php M gateway_forms/mustache/personal_info.html.mustache M gateway_forms/mustache/state_dropdown.html.mustache 4 files changed, 29 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/23/284623/1 diff --git a/gateway_forms/Mustache.php b/gateway_forms/Mustache.php index d3855e8..700bf55 100644 --- a/gateway_forms/Mustache.php +++ b/gateway_forms/Mustache.php @@ -134,20 +134,30 @@ $data['address_css_class'] = 'halfwidth'; // Does this country require a subdivision input? - $state_list = Subdivisions::getByCountry( $data['country'] ); - if ( $state_list ) { - $data['address_css_class'] = 'thirdwidth'; - $data['state_required'] = true; - $data['state_options'] = array(); - foreach ( $state_list as $abbr => $name ) { - $data['state_options'][] = array( 'abbr' => $abbr, 'name' => $name ); - } - } - + $this->setStateOptions( $data ); } } } + protected function setStateOptions( &$data ) { + $state_list = Subdivisions::getByCountry( $data['country'] ); + if ( $state_list ) { + $data['address_css_class'] = 'thirdwidth'; + $data['state_required'] = true; + $data['state_options'] = array(); + + foreach ( $state_list as $abbr => $name ) { + $selected = isset( $data['state'] ) + && $data['state'] === $abbr; + + $data['state_options'][] = array( + 'abbr' => $abbr, + 'name' => $name, + 'is_selected' => $selected, + ); + } + } + } protected function addCurrencyData( &$data ) { $supportedCurrencies = $this->gateway->getCurrencies(); if ( count( $supportedCurrencies ) === 1 ) { diff --git a/gateway_forms/includes/Subdivisions.php b/gateway_forms/includes/Subdivisions.php index 49751dd..3cee062 100644 --- a/gateway_forms/includes/Subdivisions.php +++ b/gateway_forms/includes/Subdivisions.php @@ -27,7 +27,6 @@ private static $list = array( 'AU' => array( - 'YY' => 'Select a State/Territory', 'ACI' => 'Ashmore and Cartier Islands', 'AAT' => 'Australian Antarctic Territory', 'ACT' => 'Australian Capital Territory', @@ -46,7 +45,6 @@ 'WA' => 'Western Australia', ), 'CA' => array( - 'YY' => 'Select a Province', 'AB' => 'Alberta', 'BC' => 'British Columbia', 'MB' => 'Manitoba', @@ -62,7 +60,6 @@ 'YT' => 'Yukon', ), 'US' => array( - 'YY' => 'Select a State', 'AK' => 'Alaska', 'AL' => 'Alabama', 'AR' => 'Arkansas', diff --git a/gateway_forms/mustache/personal_info.html.mustache b/gateway_forms/mustache/personal_info.html.mustache index bde7d5d..1b08117 100644 --- a/gateway_forms/mustache/personal_info.html.mustache +++ b/gateway_forms/mustache/personal_info.html.mustache @@ -16,13 +16,7 @@ {{# city_required }} {{/ city_required }} -{{# state_required }} - - {{# state_options }} - {{ name }} - {{/ state_options }} - -{{/ state_required }} +{{> state_dropdown }}{{! only renders if required }} {{# postal_code_required }} {{/
[MediaWiki-commits] [Gerrit] Localize subdivisions - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284622 Change subject: Localize subdivisions .. Localize subdivisions We only have Canadian provinces localized for now. Bug: T133253 Change-Id: I2dcbfcb350fde842a6d307a432d59c7efac1d504 --- M gateway_forms/includes/Subdivisions.php 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/22/284622/1 diff --git a/gateway_forms/includes/Subdivisions.php b/gateway_forms/includes/Subdivisions.php index 59460a9..49751dd 100644 --- a/gateway_forms/includes/Subdivisions.php +++ b/gateway_forms/includes/Subdivisions.php @@ -4,11 +4,27 @@ public static function getByCountry ( $country ) { if ( isset( self::$list[$country] ) ) { - return self::$list[$country]; + $divisions = self::$list[$country]; + + // Localize subdivisions where possible + if ( isset( self::$keyBase[$country] ) ) { + foreach ( $divisions as $abbr => $name ) { + $key = self::$keyBase[$country] . $abbr; + if ( WmfFramework::messageExists( $key ) ) { + $divisions[$abbr] = WmfFramework::formatMessage( $key ); + } + } + } + return $divisions; } return false; } + private static $keyBase = array( + 'CA' => 'donate_interface-province-dropdown-', + 'US' => 'donate_interface-state-dropdown-', + ); + private static $list = array( 'AU' => array( 'YY' => 'Select a State/Territory', -- To view, visit https://gerrit.wikimedia.org/r/284622 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dcbfcb350fde842a6d307a432d59c7efac1d504 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use png image from restbase in mathml mode - change (mediawiki...MathSearch)
Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/284619 Change subject: Use png image from restbase in mathml mode .. Use png image from restbase in mathml mode Change-Id: Iffb2a03c3aa8ed220307ef58ba13f1a38a284c5e --- M MathObject.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch refs/changes/19/284619/1 diff --git a/MathObject.php b/MathObject.php index 9db623f..8df32a8 100644 --- a/MathObject.php +++ b/MathObject.php @@ -421,6 +421,10 @@ } public function getPng() { + if ( $this->mode == 'mathml' ){ + $pngUrl = preg_replace( '#/svg/#', '/png/', $this->getRbi()->getFullSvgUrl() ); + return file_get_contents( $pngUrl ); + } $texvc = MathTexvc::newFromMd5( $this->getMd5() ); $texvc->readFromDatabase(); return $texvc->getPng(); -- To view, visit https://gerrit.wikimedia.org/r/284619 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iffb2a03c3aa8ed220307ef58ba13f1a38a284c5e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MathSearch Gerrit-Branch: master Gerrit-Owner: Physikerwelt___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Typo fix at the warning for the inactive deployment server - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: Typo fix at the warning for the inactive deployment server .. Typo fix at the warning for the inactive deployment server Changing "canges" to "changes" at the warning for the inactive deployment-server, PS2: Also changing "if will probably work" to "it will probaly work. Change-Id: Id8153a5f7e4720a2cbe6a3bd9d5f67116bd20268 --- M modules/role/files/deployment/inactive.motd 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/role/files/deployment/inactive.motd b/modules/role/files/deployment/inactive.motd index 72c8b76..7c544dc 100755 --- a/modules/role/files/deployment/inactive.motd +++ b/modules/role/files/deployment/inactive.motd @@ -16,8 +16,8 @@ While it is perfectly working, this is not the active deployment server. -If you want to deploy software, you should /not/ do it from here; if +If you want to deploy software, you should /not/ do it from here; it will probably work, but the next deployer could lose track of any of -your canges. Connect to 'deployment.eqiad.wmnet' instead, it will +your changes. Connect to 'deployment.eqiad.wmnet' instead, it will route you to the correct server. MOTD -- To view, visit https://gerrit.wikimedia.org/r/284605 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8153a5f7e4720a2cbe6a3bd9d5f67116bd20268 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Luke081515Gerrit-Reviewer: Alexandros Kosiaris Gerrit-Reviewer: BryanDavis Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Rush Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Skip Cucumber features or scenarios tagged with `@skip` tag - change (mediawiki/selenium)
jenkins-bot has submitted this change and it was merged. Change subject: Skip Cucumber features or scenarios tagged with `@skip` tag .. Skip Cucumber features or scenarios tagged with `@skip` tag Bug: T128190 Change-Id: I268052a0a26194d0a92e9f0034ffd0611da0584a --- M lib/mediawiki_selenium/rake_task.rb 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/mediawiki_selenium/rake_task.rb b/lib/mediawiki_selenium/rake_task.rb index 6c30705..db15992 100644 --- a/lib/mediawiki_selenium/rake_task.rb +++ b/lib/mediawiki_selenium/rake_task.rb @@ -18,6 +18,7 @@ options += ' --backtrace --verbose --color --format pretty'\ " --format Cucumber::Formatter::Sauce --out '#{workspace}/log/junit'"\ + ' --tags ~@skip'\ " --tags @#{site}" end -- To view, visit https://gerrit.wikimedia.org/r/282370 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I268052a0a26194d0a92e9f0034ffd0611da0584a Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: ZfilipinGerrit-Reviewer: Dduvall Gerrit-Reviewer: Hashar Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Zfilipin Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Print stacktrace when MWMultiVersion dies - change (mediawiki/vagrant)
jenkins-bot has submitted this change and it was merged. Change subject: Print stacktrace when MWMultiVersion dies .. Print stacktrace when MWMultiVersion dies Give people a chance to figure out what is wrong with MWMultiVersion by printing a stack trace when exiting. Change-Id: I5fb2f34e21606e60acf76a3bcec76876e4830a43 --- M puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb b/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb index 4b97941..86a2766 100644 --- a/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb +++ b/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb @@ -200,6 +200,7 @@ header( 'HTTP/1.1 500 Internal server error' ); } echo $msg; + debug_print_backtrace(); trigger_error( $msg, E_USER_ERROR ); exit( 1 ); // sanity } -- To view, visit https://gerrit.wikimedia.org/r/284617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fb2f34e21606e60acf76a3bcec76876e4830a43 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: BryanDavisGerrit-Reviewer: BryanDavis Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Experimental lint and phpunit for the SmashPig repo - change (integration/config)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/284618 Change subject: Experimental lint and phpunit for the SmashPig repo .. Experimental lint and phpunit for the SmashPig repo Change-Id: I02fe75da3690155ac60f19abcf1426a9fac86311 --- M zuul/layout.yaml 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/18/284618/1 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 0ab2f6e..d29a44d 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -2188,7 +2188,9 @@ gate-and-submit: - composer-php53 experimental: - - tox-jessie + - php53lint + - composer-php53 + - phpunit - name: wikimedia/iegreview template: -- To view, visit https://gerrit.wikimedia.org/r/284618 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02fe75da3690155ac60f19abcf1426a9fac86311 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Print stacktrace when MWMultiVersion dies - change (mediawiki/vagrant)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/284617 Change subject: Print stacktrace when MWMultiVersion dies .. Print stacktrace when MWMultiVersion dies Give people a chance to figure out what is wrong with MWMultiVersion by printing a stack trace when exiting. Change-Id: I5fb2f34e21606e60acf76a3bcec76876e4830a43 --- M puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/17/284617/1 diff --git a/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb b/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb index 4b97941..86a2766 100644 --- a/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb +++ b/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb @@ -200,6 +200,7 @@ header( 'HTTP/1.1 500 Internal server error' ); } echo $msg; + debug_print_backtrace(); trigger_error( $msg, E_USER_ERROR ); exit( 1 ); // sanity } -- To view, visit https://gerrit.wikimedia.org/r/284617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fb2f34e21606e60acf76a3bcec76876e4830a43 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update VE core submodule to master (bf91965) - change (mediawiki...VisualEditor)
Jforrester has uploaded a new change for review. https://gerrit.wikimedia.org/r/284616 Change subject: Update VE core submodule to master (bf91965) .. Update VE core submodule to master (bf91965) New changes: 443bb73 Restore OOUI PNGs for IE9 7970a6e Remove feature check for classList 8a40565 Fix getNodeClientRectFromRange to work better with nails 6657dc8 Update OOjs UI to v0.16.6 436b74a Fix pasting in IE<=10 53ca31f Fix node drop in IE9 01e0256 Remove comment about testing 'beforepaste', not required f7f5d71 Debounce selection change events to avoid nested model changes Change-Id: Idf3bbaa066ed857e392b91b99afa222e6f168ed5 --- M .jsduck/eg-iframe.html M lib/ve 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/16/284616/1 diff --git a/.jsduck/eg-iframe.html b/.jsduck/eg-iframe.html index bc6045e..7217532 100644 --- a/.jsduck/eg-iframe.html +++ b/.jsduck/eg-iframe.html @@ -123,9 +123,6 @@ - - - @@ -135,6 +132,9 @@ + + + diff --git a/lib/ve b/lib/ve index d6c6a85..bf91965 16 --- a/lib/ve +++ b/lib/ve -Subproject commit d6c6a850a5720a587758faec3efcb8d4c4a0f88f +Subproject commit bf91965ec1d9eebce6875361a5482361f0afb42d -- To view, visit https://gerrit.wikimedia.org/r/284616 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf3bbaa066ed857e392b91b99afa222e6f168ed5 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] Validate config paths when loading cached values - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/284614 Change subject: Validate config paths when loading cached values .. Validate config paths when loading cached values Change-Id: I4823c8054a3b24e00c54fd36065f5e17d21074f9 --- M Core/Configuration.php 1 file changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/14/284614/1 diff --git a/Core/Configuration.php b/Core/Configuration.php index 5a90727..0c06644 100644 --- a/Core/Configuration.php +++ b/Core/Configuration.php @@ -123,12 +123,16 @@ $cacheObj = apc_fetch( "smashpig-settings-{$view}-time", $success ); if ( $success ) { - $defaultCacheTime = $cacheObj[ 'default-time' ]; - $overrideCacheTime = $cacheObj[ 'override-time' ]; + $defaultCacheTime = $cacheObj['default-time']; + $overrideCacheTime = $cacheObj['override-time']; + $cacheDefaultPath = $cacheObj['default-path']; + $cacheOverridePath = $cacheObj['override-path']; - if ( ( $defaultFileTime == $defaultCacheTime ) && ( $overrideFileTime == $overrideCacheTime ) ) { + if ( ( $defaultFileTime == $defaultCacheTime ) && ( $overrideFileTime == $overrideCacheTime ) + && ( $cacheDefaultPath == $defaultFile ) && ( $cacheOverridePath == $overrideFile ) + ) { // The cached values are valid - $this->options = $cacheObj[ 'values' ]; + $this->options = $cacheObj['values']; return true; } } @@ -152,6 +156,8 @@ array( 'default-time' => $defaultFileTime, 'override-time' => $overrideFileTime, +'default-path' => $defaultFile, +'override-path' => $overrideFile, 'values'=> $this->options, ) ); -- To view, visit https://gerrit.wikimedia.org/r/284614 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4823c8054a3b24e00c54fd36065f5e17d21074f9 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Cheat encapsulation to allow us to reset the configuration c... - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/284615 Change subject: Cheat encapsulation to allow us to reset the configuration context .. Cheat encapsulation to allow us to reset the configuration context Change-Id: I3acebc2577009a828f89492dd8e11ddbc4742d38 --- M Tests/BaseSmashPigUnitTestCase.php 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/15/284615/1 diff --git a/Tests/BaseSmashPigUnitTestCase.php b/Tests/BaseSmashPigUnitTestCase.php index 4e10f21..3dea54c 100644 --- a/Tests/BaseSmashPigUnitTestCase.php +++ b/Tests/BaseSmashPigUnitTestCase.php @@ -24,6 +24,13 @@ $group, true ); + + // FIXME: gross. + $contextJailbreak = new \ReflectionClass( 'SmashPig\Core\Context' ); + $instanceProperty = $contextJailbreak->getProperty( 'instance' ); + $instanceProperty->setAccessible( true ); + $instanceProperty->setValue( null ); + Context::init( $config ); } -- To view, visit https://gerrit.wikimedia.org/r/284615 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3acebc2577009a828f89492dd8e11ddbc4742d38 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix an issue where latest post wasn't considered as potentia... - change (mediawiki...Flow)
jenkins-bot has submitted this change and it was merged. Change subject: Fix an issue where latest post wasn't considered as potentially topmost .. Fix an issue where latest post wasn't considered as potentially topmost Bug: T126264 Change-Id: I43d24cdc3a00053c971f2734b23cbbc3bb5240c6 --- M includes/Notifications/PostReplyPresentationModel.php 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Notifications/PostReplyPresentationModel.php b/includes/Notifications/PostReplyPresentationModel.php index 4d160ad..042d6d8 100644 --- a/includes/Notifications/PostReplyPresentationModel.php +++ b/includes/Notifications/PostReplyPresentationModel.php @@ -26,7 +26,9 @@ $notificationController = Container::get( 'controller.notification' ); $firstChronologicallyEvent = end( $bundledEvents ); $firstChronologicallyPostId = $firstChronologicallyEvent->getExtraParam( 'post-id' ); - $topmostPostID = $notificationController->getTopmostPostId( $bundledEvents ); + + $bundledEventsIncludingThis = array_merge( array( $this->event ), $bundledEvents ); + $topmostPostID = $notificationController->getTopmostPostId( $bundledEventsIncludingThis ); } else { $event = $this->event; -- To view, visit https://gerrit.wikimedia.org/r/284611 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43d24cdc3a00053c971f2734b23cbbc3bb5240c6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: MattflaschenGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added #wikimedia-interactive - change (labs...wikibugs2)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/284613 Change subject: Added #wikimedia-interactive .. Added #wikimedia-interactive Change-Id: I7bf0d62716e6067a7134326fb929246a570998cb --- M channels.yaml 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/13/284613/1 diff --git a/channels.yaml b/channels.yaml index 209c6d1..61d24e6 100644 --- a/channels.yaml +++ b/channels.yaml @@ -141,6 +141,16 @@ - Apex - Vector +"#wikimedia-interactive": +- Graph +- Graphoid +- Kartographer +- Maps +- Map-Styles +- Kartotherian +- Tilerator +- Discovery-Maps-Sprint + "#wikimedia-perf": - Performance-Team - MediaWiki-ResourceLoader -- To view, visit https://gerrit.wikimedia.org/r/284613 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bf0d62716e6067a7134326fb929246a570998cb Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Yurik___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Straighten out test namespaces; reusable config setup - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/284612 Change subject: Straighten out test namespaces; reusable config setup .. Straighten out test namespaces; reusable config setup Change-Id: I2028415797acde1e1ac3bae7c2c526df998665d4 --- M PaymentProviders/Adyen/Tests/phpunit/AuditTest.php M PaymentProviders/Amazon/Tests/phpunit/ApiTest.php M PaymentProviders/Amazon/Tests/phpunit/AuditTest.php M PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php M PaymentProviders/AstroPay/Tests/phpunit/AuditTest.php M PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php M PaymentProviders/Worldpay/Tests/phpunit/AuditTest.php M Tests/BaseSmashPigUnitTestCase.php M Tests/MessageTest.php M phpunit.xml 10 files changed, 53 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/12/284612/1 diff --git a/PaymentProviders/Adyen/Tests/phpunit/AuditTest.php b/PaymentProviders/Adyen/Tests/phpunit/AuditTest.php index f94d4d5..62a301e 100644 --- a/PaymentProviders/Adyen/Tests/phpunit/AuditTest.php +++ b/PaymentProviders/Adyen/Tests/phpunit/AuditTest.php @@ -1,11 +1,13 @@ -initConfig( null, 'amazon' ); } /** diff --git a/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php b/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php index 84c23f0..7e227e7 100644 --- a/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php +++ b/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php @@ -1,6 +1,9 @@ paymentSuccess = $this->loadJson( __DIR__ . "/../Data/paid.json" ); diff --git a/PaymentProviders/Worldpay/Tests/phpunit/AuditTest.php b/PaymentProviders/Worldpay/Tests/phpunit/AuditTest.php index a3b5cce..fbbf2b1 100644 --- a/PaymentProviders/Worldpay/Tests/phpunit/AuditTest.php +++ b/PaymentProviders/Worldpay/Tests/phpunit/AuditTest.php @@ -1,13 +1,15 @@ - - -Tests/MessageTest.php - + +Tests + PaymentProviders/Adyen/Tests/phpunit -- To view, visit https://gerrit.wikimedia.org/r/284612 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2028415797acde1e1ac3bae7c2c526df998665d4 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix an issue where latest post wasn't considered as potentia... - change (mediawiki...Flow)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/284611 Change subject: Fix an issue where latest post wasn't considered as potentially topmost .. Fix an issue where latest post wasn't considered as potentially topmost Bug: T126264 Change-Id: I43d24cdc3a00053c971f2734b23cbbc3bb5240c6 --- M includes/Notifications/PostReplyPresentationModel.php 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/11/284611/1 diff --git a/includes/Notifications/PostReplyPresentationModel.php b/includes/Notifications/PostReplyPresentationModel.php index 4d160ad..042d6d8 100644 --- a/includes/Notifications/PostReplyPresentationModel.php +++ b/includes/Notifications/PostReplyPresentationModel.php @@ -26,7 +26,9 @@ $notificationController = Container::get( 'controller.notification' ); $firstChronologicallyEvent = end( $bundledEvents ); $firstChronologicallyPostId = $firstChronologicallyEvent->getExtraParam( 'post-id' ); - $topmostPostID = $notificationController->getTopmostPostId( $bundledEvents ); + + $bundledEventsIncludingThis = array_merge( array( $this->event ), $bundledEvents ); + $topmostPostID = $notificationController->getTopmostPostId( $bundledEventsIncludingThis ); } else { $event = $this->event; -- To view, visit https://gerrit.wikimedia.org/r/284611 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43d24cdc3a00053c971f2734b23cbbc3bb5240c6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix optional table joins and unmarshalling - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/284610 Change subject: Fix optional table joins and unmarshalling .. Fix optional table joins and unmarshalling Several of the new table joins expect the rows of the right hand table to be optional. This requires a _left_ join, not just a join. Additionally, Cursors returned from join queries always have these columns but they may be empty. Instead of checking for the presence of a column name to determine whether the joined part exists or not, check that a field with a nonnull constraint is nonnull. Change-Id: I3da94a9953f880e03cac4b3ab40f9c8c73b21110 --- M app/src/main/java/org/wikipedia/database/contract/ReadingListPageContract.java M app/src/main/java/org/wikipedia/database/contract/UserOptionContract.java M app/src/main/java/org/wikipedia/page/PageTitle.java M app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageHttpRow.java M app/src/main/java/org/wikipedia/readinglist/page/database/disk/ReadingListPageDiskRow.java M app/src/main/java/org/wikipedia/useroption/database/UserOptionRow.java 6 files changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/10/284610/1 diff --git a/app/src/main/java/org/wikipedia/database/contract/ReadingListPageContract.java b/app/src/main/java/org/wikipedia/database/contract/ReadingListPageContract.java index fece015..b3bc3e5 100644 --- a/app/src/main/java/org/wikipedia/database/contract/ReadingListPageContract.java +++ b/app/src/main/java/org/wikipedia/database/contract/ReadingListPageContract.java @@ -140,7 +140,7 @@ } public static final class HttpWithPage implements Page { -public static final String TABLES = ":httpTbl join :tbl on (:tbl.keyCol = :httpTbl.keyCol)" +public static final String TABLES = ":httpTbl left join :tbl on (:tbl.keyCol = :httpTbl.keyCol)" .replaceAll(":tbl.keyCol", KEY.qualifiedName()) .replaceAll(":httpTbl.keyCol", HttpCol.KEY.qualifiedName()) .replaceAll(":httpTbl", TABLE_HTTP) @@ -165,7 +165,7 @@ } public static final class DiskWithPage implements Page { -public static final String TABLES = ":diskTbl join :tbl on (:tbl.keyCol = :diskTbl.keyCol)" +public static final String TABLES = ":diskTbl left join :tbl on (:tbl.keyCol = :diskTbl.keyCol)" .replaceAll(":tbl.keyCol", KEY.qualifiedName()) .replaceAll(":diskTbl.keyCol", DiskCol.KEY.qualifiedName()) .replaceAll(":diskTbl", TABLE_DISK) diff --git a/app/src/main/java/org/wikipedia/database/contract/UserOptionContract.java b/app/src/main/java/org/wikipedia/database/contract/UserOptionContract.java index 6c275e6..97b5100 100644 --- a/app/src/main/java/org/wikipedia/database/contract/UserOptionContract.java +++ b/app/src/main/java/org/wikipedia/database/contract/UserOptionContract.java @@ -73,7 +73,7 @@ } interface HttpWithOption extends Option { -String TABLES = ":httpTbl join :tbl on (:tbl.keyCol = :httpTbl.keyCol)" +String TABLES = ":httpTbl left join :tbl on (:tbl.keyCol = :httpTbl.keyCol)" .replaceAll(":tbl.keyCol", KEY.qualifiedName()) .replaceAll(":httpTbl.keyCol", HttpCol.KEY.qualifiedName()) .replaceAll(":httpTbl", TABLE_HTTP) @@ -90,4 +90,4 @@ String[] PROJECTION = DbUtil.qualifiedNames(ID, KEY, VAL, HTTP_KEY, HTTP_STATUS, HTTP_TIMESTAMP, HTTP_TRANSACTION_ID); } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/wikipedia/page/PageTitle.java b/app/src/main/java/org/wikipedia/page/PageTitle.java index 74f8fc1..9b7e871 100644 --- a/app/src/main/java/org/wikipedia/page/PageTitle.java +++ b/app/src/main/java/org/wikipedia/page/PageTitle.java @@ -47,6 +47,7 @@ * * [[Utilisateur:Deskana]] on frwiki will have a namespace of "Utilisateur", even if you got * to the page by going to [[User:Deskana]] and having MediaWiki automatically redirect you. */ +// TODO: use Namespace. Clients shouldn't have to bear this knowledge to access a String. @Nullable private final String namespace; private final String text; private final String fragment; diff --git a/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageHttpRow.java b/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageHttpRow.java index 8cf5479..fd438a3 100644 --- a/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageHttpRow.java +++ b/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageHttpRow.java @@ -12,7 +12,7 @@ public class ReadingListPageHttpRow extends HttpRow { public static ReadingListPageHttpRow fromCursor(@NonNull Cursor cursor) { HttpRow httpRow =
[MediaWiki-commits] [Gerrit] Hygiene: use base class to reference statics - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/284606 Change subject: Hygiene: use base class to reference statics .. Hygiene: use base class to reference statics It is more consistent to reference the statics where they are declared instead of from a subclass. No functional changes intended. Change-Id: I3fbb7c9e3c282a2c944de22489eee3e27b4f7108 --- M app/src/main/java/org/wikipedia/database/Database.java 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/06/284606/1 diff --git a/app/src/main/java/org/wikipedia/database/Database.java b/app/src/main/java/org/wikipedia/database/Database.java index a3cf5ec..61c9a65 100644 --- a/app/src/main/java/org/wikipedia/database/Database.java +++ b/app/src/main/java/org/wikipedia/database/Database.java @@ -8,7 +8,7 @@ import org.wikipedia.editing.summaries.EditSummary; import org.wikipedia.history.HistoryEntry; import org.wikipedia.pageimages.PageImage; -import org.wikipedia.readinglist.page.ReadingListPage; +import org.wikipedia.readinglist.page.ReadingListPageRow; import org.wikipedia.savedpages.SavedPage; import org.wikipedia.search.RecentSearch; import org.wikipedia.useroption.database.UserOptionRow; @@ -30,9 +30,9 @@ UserOptionRow.HTTP_DATABASE_TABLE, UserOptionRow.DATABASE_TABLE, -ReadingListPage.DISK_DATABASE_TABLE, -ReadingListPage.HTTP_DATABASE_TABLE, -ReadingListPage.DATABASE_TABLE +ReadingListPageRow.DISK_DATABASE_TABLE, +ReadingListPageRow.HTTP_DATABASE_TABLE, +ReadingListPageRow.DATABASE_TABLE }; public Database(Context context) { -- To view, visit https://gerrit.wikimedia.org/r/284606 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fbb7c9e3c282a2c944de22489eee3e27b4f7108 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Reading List list content provider - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/284609 Change subject: Add Reading List list content provider .. Add Reading List list content provider Change-Id: I856e49528dd4285d698bd23e87906762cd6324d7 --- M app/src/main/java/org/wikipedia/database/AppContentProviderEndpoint.java M app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java M app/src/main/java/org/wikipedia/database/contract/ReadingListPageContract.java 3 files changed, 70 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/09/284609/1 diff --git a/app/src/main/java/org/wikipedia/database/AppContentProviderEndpoint.java b/app/src/main/java/org/wikipedia/database/AppContentProviderEndpoint.java index 7220bdf..45ba28e 100644 --- a/app/src/main/java/org/wikipedia/database/AppContentProviderEndpoint.java +++ b/app/src/main/java/org/wikipedia/database/AppContentProviderEndpoint.java @@ -10,6 +10,7 @@ import org.wikipedia.database.contract.EditHistoryContract; import org.wikipedia.database.contract.PageHistoryContract; import org.wikipedia.database.contract.PageImageHistoryContract; +import org.wikipedia.database.contract.ReadingListContract; import org.wikipedia.database.contract.ReadingListPageContract; import org.wikipedia.database.contract.SavedPageContract; import org.wikipedia.database.contract.SearchHistoryContract; @@ -55,7 +56,12 @@ ReadingListPageContract.DiskWithPage.PROJECTION), READING_LIST_PAGE_WITH_DISK(405, ReadingListPageContract.PageWithDisk.PATH, ReadingListPageContract.PageWithDisk.TABLES, -ReadingListPageContract.PageWithDisk.PROJECTION); +ReadingListPageContract.PageWithDisk.PROJECTION), +READING_LIST(406, ReadingListContract.List.PATH, ReadingListContract.List.TABLES, +ReadingListContract.List.PROJECTION), +READING_LIST_WITH_PAGES_AND_DISK(407, ReadingListContract.ListWithPagesAndDisk.PATH, +ReadingListContract.ListWithPagesAndDisk.TABLES, +ReadingListContract.ListWithPagesAndDisk.PROJECTION); private static final EnumCodeMap CODE_TO_ENUM = new EnumCodeMap<>(AppContentProviderEndpoint.class); private static final UriMatcher URI_TO_CODE = newUriToCode(); @@ -120,4 +126,4 @@ } return matcher; } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java b/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java index f69252d..f2141fe 100644 --- a/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java +++ b/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java @@ -3,9 +3,16 @@ import android.net.Uri; import org.wikipedia.database.DbUtil; +import org.wikipedia.database.column.CodeEnumColumn; +import org.wikipedia.database.column.CsvColumn; import org.wikipedia.database.column.IdColumn; +import org.wikipedia.database.column.IntColumn; import org.wikipedia.database.column.LongColumn; +import org.wikipedia.database.column.NamespaceColumn; import org.wikipedia.database.column.StrColumn; +import org.wikipedia.readinglist.page.database.disk.DiskStatus; + +import java.util.Set; @SuppressWarnings("checkstyle:interfaceistype") public interface ReadingListContract { @@ -20,10 +27,62 @@ StrColumn DESCRIPTION = new StrColumn(TABLE, "readingListDescription", "text"); String[] SELECTION = DbUtil.qualifiedNames(KEY); +String[] ALL = DbUtil.qualifiedNames(ID, KEY, TITLE, MTIME, ATIME, DESCRIPTION); } interface List extends Col { +String TABLES = TABLE; String PATH = ReadingListPageContract.Disk.PATH + "/list"; Uri URI = Uri.withAppendedPath(AppContentProviderContract.AUTHORITY_BASE, PATH); +String[] PROJECTION = null; + +String ORDER_KEY = KEY.qualifiedName(); +String ORDER_MRU = ":atimeCol desc".replaceAll(":atimeCol", ATIME.qualifiedName()); } -} \ No newline at end of file + +final class ListWithPagesAndDisk implements List { +public static final String PATH = List.PATH + "/with_page"; +public static final Uri URI = Uri.withAppendedPath(AppContentProviderContract.AUTHORITY_BASE, PATH); + +public static final StrColumn PAGE_KEY = ReadingListPageContract.PageCol.KEY; +public static final CsvColumnPAGE_LIST_KEYS = ReadingListPageContract.PageCol.LIST_KEYS; +public static final StrColumn PAGE_LANG = ReadingListPageContract.PageCol.LANG; +public static final NamespaceColumn PAGE_NAMESPACE = ReadingListPageContract.PageCol.NAMESPACE; +public static final StrColumn PAGE_TITLE = ReadingListPageContract.PageCol.TITLE; +public static final IntColumn PAGE_DISK_PAGE_REV =
[MediaWiki-commits] [Gerrit] Add Reading List list table - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/284608 Change subject: Add Reading List list table .. Add Reading List list table Bug: T127707 Change-Id: I72be73e67f703f78667f1cad10799c64bcf7aef8 --- M app/src/main/java/org/wikipedia/WikipediaApp.java M app/src/main/java/org/wikipedia/database/Database.java A app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java A app/src/main/java/org/wikipedia/readinglist/database/ReadingListRow.java A app/src/main/java/org/wikipedia/readinglist/database/ReadingListTable.java M app/src/main/java/org/wikipedia/readinglist/page/ReadingListPage.java M app/src/main/java/org/wikipedia/readinglist/page/ReadingListPageRow.java A app/src/main/java/org/wikipedia/util/ValidateUtil.java 8 files changed, 223 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/08/284608/1 diff --git a/app/src/main/java/org/wikipedia/WikipediaApp.java b/app/src/main/java/org/wikipedia/WikipediaApp.java index 32a6c8c..a7a0549 100644 --- a/app/src/main/java/org/wikipedia/WikipediaApp.java +++ b/app/src/main/java/org/wikipedia/WikipediaApp.java @@ -33,6 +33,7 @@ import org.wikipedia.onboarding.PrefsOnboardingStateMachine; import org.wikipedia.page.PageCache; import org.wikipedia.pageimages.PageImage; +import org.wikipedia.readinglist.database.ReadingListRow; import org.wikipedia.readinglist.page.ReadingListPageRow; import org.wikipedia.readinglist.page.database.ReadingListPageHttpRow; import org.wikipedia.readinglist.page.database.disk.ReadingListPageDiskRow; @@ -338,6 +339,8 @@ client = new DatabaseClient<>(this, ReadingListPageRow.HTTP_DATABASE_TABLE); } else if (cls.equals(ReadingListPageDiskRow.class)) { client = new DatabaseClient<>(this, ReadingListPageRow.DISK_DATABASE_TABLE); +} else if (cls.equals(ReadingListRow.class)) { +client = new DatabaseClient<>(this, ReadingListRow.DATABASE_TABLE); } else { throw new RuntimeException("No persister found for class " + cls.getCanonicalName()); } diff --git a/app/src/main/java/org/wikipedia/database/Database.java b/app/src/main/java/org/wikipedia/database/Database.java index 61c9a65..b2eb693 100644 --- a/app/src/main/java/org/wikipedia/database/Database.java +++ b/app/src/main/java/org/wikipedia/database/Database.java @@ -8,6 +8,7 @@ import org.wikipedia.editing.summaries.EditSummary; import org.wikipedia.history.HistoryEntry; import org.wikipedia.pageimages.PageImage; +import org.wikipedia.readinglist.database.ReadingListRow; import org.wikipedia.readinglist.page.ReadingListPageRow; import org.wikipedia.savedpages.SavedPage; import org.wikipedia.search.RecentSearch; @@ -16,7 +17,7 @@ public class Database extends SQLiteOpenHelper { private static final String DATABASE_NAME = "wikipedia.db"; -private static final int DATABASE_VERSION = 12; +private static final int DATABASE_VERSION = 13; private final DatabaseTable[] databaseTables = { HistoryEntry.DATABASE_TABLE, @@ -32,7 +33,9 @@ ReadingListPageRow.DISK_DATABASE_TABLE, ReadingListPageRow.HTTP_DATABASE_TABLE, -ReadingListPageRow.DATABASE_TABLE +ReadingListPageRow.DATABASE_TABLE, + +ReadingListRow.DATABASE_TABLE }; public Database(Context context) { diff --git a/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java b/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java new file mode 100644 index 000..f69252d --- /dev/null +++ b/app/src/main/java/org/wikipedia/database/contract/ReadingListContract.java @@ -0,0 +1,29 @@ +package org.wikipedia.database.contract; + +import android.net.Uri; + +import org.wikipedia.database.DbUtil; +import org.wikipedia.database.column.IdColumn; +import org.wikipedia.database.column.LongColumn; +import org.wikipedia.database.column.StrColumn; + +@SuppressWarnings("checkstyle:interfaceistype") +public interface ReadingListContract { +String TABLE = "readinglist"; + +interface Col { +IdColumn ID = new IdColumn(TABLE); +StrColumn KEY = new StrColumn(TABLE, "readingListKey", "text not null unique"); +StrColumn TITLE = new StrColumn(TABLE, "readingListTitle", "text not null"); +LongColumn MTIME = new LongColumn(TABLE, "readingListMtime", "integer not null"); +LongColumn ATIME = new LongColumn(TABLE, "readingListAtime", "integer not null"); +StrColumn DESCRIPTION = new StrColumn(TABLE, "readingListDescription", "text"); + +String[] SELECTION = DbUtil.qualifiedNames(KEY); +} + +interface List extends Col { +String PATH = ReadingListPageContract.Disk.PATH + "/list"; +Uri URI =
[MediaWiki-commits] [Gerrit] Add debug logging to ContentProvider queries - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/284607 Change subject: Add debug logging to ContentProvider queries .. Add debug logging to ContentProvider queries Defaults to disabled. Change-Id: Ibaacbbc7c024a45e991a6f004b8f312ea1d9ff00 --- M app/src/main/java/org/wikipedia/database/AppContentProvider.java 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/07/284607/1 diff --git a/app/src/main/java/org/wikipedia/database/AppContentProvider.java b/app/src/main/java/org/wikipedia/database/AppContentProvider.java index 21d3a2c..240441d 100644 --- a/app/src/main/java/org/wikipedia/database/AppContentProvider.java +++ b/app/src/main/java/org/wikipedia/database/AppContentProvider.java @@ -11,8 +11,13 @@ import android.support.annotation.Nullable; import org.wikipedia.WikipediaApp; +import org.wikipedia.util.log.L; + +import java.util.Arrays; public class AppContentProvider extends ContentProvider { +private static final boolean LOG = false; + @Override public boolean onCreate() { @SuppressWarnings("UnnecessaryLocalVariable") final boolean loaded = true; return loaded; @@ -30,10 +35,21 @@ SQLiteDatabase db = readableDatabase(); final String groupBy = null; final String having = null; + +if (LOG) { +L.d("selectionArgs=" + Arrays.toString(selectionArgs)); +String sql = builder.buildQuery(projection, "(" + selection + ")", groupBy, having, +sortOrder, null); +L.d("sql=" + sql); +} + Cursor cursor = builder.query(db, projection == null ? endpoint.projection() : projection, selection, selectionArgs, groupBy, having, sortOrder); if (cursor != null) { +if (LOG) { +L.d("count=" + cursor.getCount() + " columnNames=" + Arrays.toString(cursor.getColumnNames())); +} cursor.setNotificationUri(getContentResolver(), uri); } return cursor; @@ -99,4 +115,4 @@ private SQLiteDatabase writableDatabase() { return WikipediaApp.getInstance().getDatabase().getWritableDatabase(); } -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/284607 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibaacbbc7c024a45e991a6f004b8f312ea1d9ff00 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Typo fix at the warning for the inactive deployment server - change (operations/puppet)
Luke081515 has uploaded a new change for review. https://gerrit.wikimedia.org/r/284605 Change subject: Typo fix at the warning for the inactive deployment server .. Typo fix at the warning for the inactive deployment server Changing "canges" to "changes" at the warning for the inactive deployment-server, Change-Id: Id8153a5f7e4720a2cbe6a3bd9d5f67116bd20268 --- M modules/role/files/deployment/inactive.motd 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/05/284605/1 diff --git a/modules/role/files/deployment/inactive.motd b/modules/role/files/deployment/inactive.motd index 72c8b76..7d51e9c 100755 --- a/modules/role/files/deployment/inactive.motd +++ b/modules/role/files/deployment/inactive.motd @@ -18,6 +18,6 @@ If you want to deploy software, you should /not/ do it from here; if will probably work, but the next deployer could lose track of any of -your canges. Connect to 'deployment.eqiad.wmnet' instead, it will +your changes. Connect to 'deployment.eqiad.wmnet' instead, it will route you to the correct server. MOTD -- To view, visit https://gerrit.wikimedia.org/r/284605 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8153a5f7e4720a2cbe6a3bd9d5f67116bd20268 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Luke081515___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable languages in Wikibase API - change (wikidata...gui)
jenkins-bot has submitted this change and it was merged. Change subject: Enable languages in Wikibase API .. Enable languages in Wikibase API Bug: T132756 Change-Id: Ia5bfbba735ba8914b8c0cb62187ade0f8d7ece13 --- M .jshintrc M index.html A vendor/js-cookie/js.cookie.js M wikibase/config.js M wikibase/init.js M wikibase/queryService/api/Wikibase.js 6 files changed, 200 insertions(+), 4 deletions(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified diff --git a/.jshintrc b/.jshintrc index ac8fb6c..cb28d30 100644 --- a/.jshintrc +++ b/.jshintrc @@ -41,6 +41,7 @@ "CONFIG": true, "d3": false, "sparqljs": false, - "_": false + "_": false, + "Cookies": false } } diff --git a/index.html b/index.html index 1c57c1c..308ff6e 100644 --- a/index.html +++ b/index.html @@ -207,6 +207,7 @@ + diff --git a/vendor/js-cookie/js.cookie.js b/vendor/js-cookie/js.cookie.js new file mode 100644 index 000..d53363a --- /dev/null +++ b/vendor/js-cookie/js.cookie.js @@ -0,0 +1,151 @@ +/*! + * JavaScript Cookie v2.1.0 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } else { + var _OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = _OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function init (converter) { + function api (key, value, attributes) { + var result; + if (typeof document === 'undefined') { + return; + } + + // Write + + if (arguments.length > 1) { + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + var expires = new Date(); + expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); + attributes.expires = expires; + } + + try { + result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + if (!converter.write) { + value = encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + } else { + value = converter.write(value, key); + } + + key = encodeURIComponent(String(key)); + key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); + key = key.replace(/[\(\)]/g, escape); + + return (document.cookie = [ + key, '=', value, + attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE + attributes.path&& '; path=' + attributes.path, + attributes.domain && '; domain=' + attributes.domain, + attributes.secure ? '; secure' : '' + ].join('')); + } + + // Read + + if (!key) { + result = {}; + } + +
[MediaWiki-commits] [Gerrit] Tox test configuration - change (mediawiki...kafka-watcher)
Smalyshev has uploaded a new change for review. https://gerrit.wikimedia.org/r/284604 Change subject: Tox test configuration .. Tox test configuration Change-Id: I1575a7b5632ff81f869845c83ea247bd8ca807b6 --- M .gitignore M handlers/Dump.py M handlers/Memcached.py M kafka-watcher.py A requirements.txt A setup.cfg A tox.ini 7 files changed, 43 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/kafka-watcher refs/changes/04/284604/1 diff --git a/.gitignore b/.gitignore index 0d20b64..aec3d96 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +.tox/ diff --git a/handlers/Dump.py b/handlers/Dump.py index 6805d70..48f9dfe 100644 --- a/handlers/Dump.py +++ b/handlers/Dump.py @@ -1,8 +1,8 @@ class Dump(object): - - def __init__(self, **params): - print(params) - - def handle(self, topic, message): - print(topic) - print(message) + +def __init__(self, **params): +print(params) + +def handle(self, topic, message): +print(topic) +print(message) diff --git a/handlers/Memcached.py b/handlers/Memcached.py index 3b45cff..e6e231a 100644 --- a/handlers/Memcached.py +++ b/handlers/Memcached.py @@ -1,6 +1,9 @@ import memcache +import time + class Memcached(object): + def __init__(self, hostname, **params): self.mc = memcache.Client([hostname]) @@ -16,7 +19,7 @@ purge_time = time.time() + message.get('uto', 0) text = text.replace('$UNIXTIME$', '%.6f' % purge_time) #print("Set {0}-{1}-{2}".format(message['key'].encode('utf-8'), text, int(message['ttl']))) -self.mc.set(message['key'].encode('utf-8'), text, int(message['ttl']) ) +self.mc.set(message['key'].encode('utf-8'), text, int(message['ttl'])) def delete(self, message): -self.mc.delete(message['key']) \ No newline at end of file +self.mc.delete(message['key']) diff --git a/kafka-watcher.py b/kafka-watcher.py index b336742..0e49860 100755 --- a/kafka-watcher.py +++ b/kafka-watcher.py @@ -38,7 +38,7 @@ print("Could not parse data, meh") continue try: -handlers[msg.topic].handle(msg.topic, data) +handlers[msg.topic].handle(msg.topic, data) except: e = sys.exc_info() print("Oops, something happened: " + str(e)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000..04741d5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +yaml +kafka +memcache diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000..b7b70a3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +# configuration for flake8 +[flake8] +# Raise the default 79 limit +max-line-length = 120 +ignore = E128 diff --git a/tox.ini b/tox.ini new file mode 100644 index 000..00c9e9d --- /dev/null +++ b/tox.ini @@ -0,0 +1,21 @@ +# Tox configuration +[tox] +minversion = 1.6 +skipsdist = True +# List the environment that will be run by default +envlist = flake8, py27 + +[testenv] +# Default configuration. py26 and py27 will end up using this +setenv = VIRTUAL_ENV={envdir} + +# Settings specific to the flake8 environment +[testenv:flake8] +# The command to run: +commands = flake8 +# We only need flake8 when linting, we do not care about the project dependencies +deps = flake8 + +[testenv:venv] +# Let you pass additional arguments when invoking tox +commands = {posargs} -- To view, visit https://gerrit.wikimedia.org/r/284604 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1575a7b5632ff81f869845c83ea247bd8ca807b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/kafka-watcher Gerrit-Branch: master Gerrit-Owner: Smalyshev___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] netboot: add install1001, use partman for VMs - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: netboot: add install1001, use partman for VMs .. netboot: add install1001, use partman for VMs Bug:T132757 Change-Id: I3ad24b2e3de8a487d1b97ccfddde19fadb8b0178 --- M modules/install_server/files/autoinstall/netboot.cfg 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/install_server/files/autoinstall/netboot.cfg b/modules/install_server/files/autoinstall/netboot.cfg index 63573ea..3208f1a 100755 --- a/modules/install_server/files/autoinstall/netboot.cfg +++ b/modules/install_server/files/autoinstall/netboot.cfg @@ -70,7 +70,7 @@ eeden|bast3001|maerlant|multatuli|nescio) echo partman/raid1-1partition.cfg ;; \ elastic10[0-2][0-9]|elastic103[0-1]) echo partman/elasticsearch-raid0.cfg ;; \ elastic20[0-2][0-9]|elastic203[0-1]) echo partman/elasticsearch-raid1.cfg ;; \ - bromine|bohrium|dubnium|etherpad[12]001|fermium|hassaleh|hassium|krypton|meitnerium|mendelevium|planet1001|pollux|rutherfordium|seaborgium|serpens|alsafi|furud|kraz) echo partman/flat.cfg virtual.cfg ;; \ + bromine|bohrium|dubnium|etherpad[12]001|fermium|hassaleh|hassium|krypton|meitnerium|mendelevium|planet1001|pollux|rutherfordium|seaborgium|serpens|alsafi|furud|kraz|install1001) echo partman/flat.cfg virtual.cfg ;; \ eventlog[1-2]001|ocg100[1-3]|sc[ab]100[1-2]) echo partman/raid1.cfg ;; \ francium|nobelium|tegmen) echo partman/raid10-gpt.cfg ;; \ ganeti100[1-9]) echo partman/ganeti-raid1.cfg ;; \ -- To view, visit https://gerrit.wikimedia.org/r/284603 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ad24b2e3de8a487d1b97ccfddde19fadb8b0178 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-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] QA: Updates to browser tests to avoid flakiness - change (mediawiki...Popups)
jenkins-bot has submitted this change and it was merged. Change subject: QA: Updates to browser tests to avoid flakiness .. QA: Updates to browser tests to avoid flakiness * Wait until the form submits successfully, verifying it worked by testing for the notification toast. * Drop sleep statements where possible - instead use when_present Use one when asserting something doesn't show to avoid false positives * Allow more time for the hovercard to show (5s) - API requests might take longer than default time. * Assert popups JavaScript loads before continuing with test. This helped trap a bug in testing and will be useful for future. Bug: T133019 Depends-On: Icb1e6ddc8f95da5e4b4de2916d292694c11ba731 Change-Id: Iacd3beedf44cadffcf0285231b2df7e5b64294f6 --- M tests/browser/features/popups_core.feature M tests/browser/features/support/pages/special_preferences_page.rb M tests/browser/features/support/step_definitions/common_steps.rb M tests/browser/features/support/step_definitions/popups_core.rb 4 files changed, 18 insertions(+), 4 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/features/popups_core.feature b/tests/browser/features/popups_core.feature index aa243ce..13b0893 100644 --- a/tests/browser/features/popups_core.feature +++ b/tests/browser/features/popups_core.feature @@ -5,6 +5,7 @@ And I am logged in And HoverCards is enabled as a beta feature And I am on the "Popups test page" page + And the Hovercards JavaScript module has loaded Scenario: Hover card is visible on mouse over And I hover over the first valid link diff --git a/tests/browser/features/support/pages/special_preferences_page.rb b/tests/browser/features/support/pages/special_preferences_page.rb index 897851e..cff4fa5 100644 --- a/tests/browser/features/support/pages/special_preferences_page.rb +++ b/tests/browser/features/support/pages/special_preferences_page.rb @@ -5,11 +5,16 @@ a(:beta_features_tab, css: '#preftab-betafeatures') text_field(:hovercards_checkbox, css: '#mw-input-wppopups') button(:submit_button, css: '#prefcontrol') + div(:notification, css: ".mw-notification") def enable_hovercards beta_features_tab_element.when_present.click return unless hovercards_checkbox_element.attribute('checked').nil? hovercards_checkbox_element.click submit_button_element.when_present.click + +# Note well that Element#wait_until_present is more semantic but is +# deprecated. Fortunately, #when_present simply wraps #wait_until_present. +notification_element.when_present end -end \ No newline at end of file +end diff --git a/tests/browser/features/support/step_definitions/common_steps.rb b/tests/browser/features/support/step_definitions/common_steps.rb index 0ad6985..008b7bf 100644 --- a/tests/browser/features/support/step_definitions/common_steps.rb +++ b/tests/browser/features/support/step_definitions/common_steps.rb @@ -9,3 +9,11 @@ Then(/^HoverCards is enabled as a beta feature$/) do visit(SpecialPreferencesPage).enable_hovercards end + +Given(/^the Hovercards JavaScript module has loaded$/) do + on(ArticlePage) do |page| +page.wait_until do + browser.execute_script("return mw.loader.getState('ext.popups.desktop') === 'ready'") +end + end +end diff --git a/tests/browser/features/support/step_definitions/popups_core.rb b/tests/browser/features/support/step_definitions/popups_core.rb index 23f061b..d1374c1 100644 --- a/tests/browser/features/support/step_definitions/popups_core.rb +++ b/tests/browser/features/support/step_definitions/popups_core.rb @@ -1,17 +1,17 @@ When(/^I hover over the page header$/) do on(ArticlePage).page_header_element.hover - sleep 1 # and dwell on it for a sec to give time for the visible hover card hide itself end When(/^I hover over the first valid link$/) do on(ArticlePage).first_valid_link_element.hover - sleep 1 # and dwell on it for a sec to give time for hover card to appear end Then(/^I should see a hover card$/) do - expect(on(ArticlePage).hovercard_element).to be_visible + expect(on(ArticlePage).hovercard_element.when_present(5)).to be_visible end Then(/^I should not see a hover card$/) do + # Requesting a hovercard hits API so wait time before asserting it did not show + sleep 5 expect(on(ArticlePage).hovercard_element).not_to be_visible end -- To view, visit https://gerrit.wikimedia.org/r/284449 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iacd3beedf44cadffcf0285231b2df7e5b64294f6 Gerrit-PatchSet: 8 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: BmansurovGerrit-Reviewer: Bmansurov Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Phuedx
[MediaWiki-commits] [Gerrit] netboot: add install1001 to have RAID1 like install2001 - change (operations/puppet)
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/284603 Change subject: netboot: add install1001 to have RAID1 like install2001 .. netboot: add install1001 to have RAID1 like install2001 Bug:T132757 Change-Id: I3ad24b2e3de8a487d1b97ccfddde19fadb8b0178 --- M modules/install_server/files/autoinstall/netboot.cfg 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/03/284603/1 diff --git a/modules/install_server/files/autoinstall/netboot.cfg b/modules/install_server/files/autoinstall/netboot.cfg index 63573ea..8a5445a 100755 --- a/modules/install_server/files/autoinstall/netboot.cfg +++ b/modules/install_server/files/autoinstall/netboot.cfg @@ -55,7 +55,7 @@ aqs100[123]) echo partman/raid1-30G.cfg ;; \ antimony|arsenic|heze|magnesium|neodymium|oxygen|palladium|promethium|strontium|terbium) echo partman/lvm.cfg ;; \ argon|bast1001|bast2001|bast4001|copper|neon|ruthenium|subra|suhail|titanium|ytterbium) echo partman/raid1-lvm.cfg ;; \ -californium|dbproxy10[0-1][0-9]|holmium|install2001|iridium) echo partman/raid1.cfg ;; \ + californium|dbproxy10[0-1][0-9]|holmium|install1001|install2001|iridium) echo partman/raid1.cfg ;; \ boron|chromium|hydrogen) echo partman/lvm.cfg ;; \ helium|potassium|tmh1002) echo partman/raid1-1partition.cfg ;; \ lawrencium|netmon1001|notebook1001|notebook1002|stat1002|tungsten|labsdb1008) echo partman/db.cfg ;; \ -- To view, visit https://gerrit.wikimedia.org/r/284603 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ad24b2e3de8a487d1b97ccfddde19fadb8b0178 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] Use selection weights deterministically - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Use selection weights deterministically .. Use selection weights deterministically The previous behavior was to roll a random number if more than one form was available to handle the donor's context, and to use selection weight as a probability to make some forms more or less likely to be chosen. This patch makes a purely deterministic choice instead, using the highest available weight. We can add the A/B, random thing back later whenever we want to use it intentionally. We weight AstroPay more heavily so that it's always chosen in the countries where it's supported. Bug: T133181 Change-Id: I6f6959fea22b92c0b4e80d264b9aca881423442e --- M DonationInterfaceFormSettings.php M special/GatewayFormChooser.php 2 files changed, 20 insertions(+), 19 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php index a86724d..832aa47 100644 --- a/DonationInterfaceFormSettings.php +++ b/DonationInterfaceFormSettings.php @@ -485,6 +485,7 @@ 'santander', ), ), + 'selection_weight' => 110, ); $forms_whitelist['astropay-ar'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', @@ -512,6 +513,7 @@ 'santander_rio', ), ), + 'selection_weight' => 110, ); $forms_whitelist['astropay-cl'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', @@ -533,6 +535,7 @@ 'webpay_bt', ), ), + 'selection_weight' => 110, ); $forms_whitelist['astropay-co'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', @@ -554,6 +557,7 @@ 'pse', ), ), + 'selection_weight' => 110, ); $forms_whitelist['astropay-mx'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', @@ -574,6 +578,7 @@ 'cash_bancomer', ), ), + 'selection_weight' => 110, ); $forms_whitelist['astropay-uy'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', @@ -585,6 +590,7 @@ 'cash_red_pagos', ), ), + 'selection_weight' => 110, ); /** diff --git a/special/GatewayFormChooser.php b/special/GatewayFormChooser.php index dcdb472..f8339b2 100644 --- a/special/GatewayFormChooser.php +++ b/special/GatewayFormChooser.php @@ -465,28 +465,23 @@ return key ( $valid_forms ); } - //Hell: we're still here. Throw a freaking dart - $total_weight = 0; - foreach ( array_keys( $valid_forms ) as $form_name ) { - if ( !array_key_exists( 'selection_weight', $valid_forms[$form_name] ) ) { - $valid_forms[$form_name]['selection_weight'] = 100; + // Choose the form with the highest selection weight. + $greatest_weight = 0; + $heaviest_form = null; + foreach ( $valid_forms as $form_name => &$meta ) { + // Assume a default weight of 100. + if ( !array_key_exists( 'selection_weight', $meta ) ) { + $meta['selection_weight'] = 100; } - $form_weight = $valid_forms[$form_name]['selection_weight']; - if ( $form_weight === 0 ) { - unset( $valid_forms[$form_name] ); - continue; - } - $total_weight += $form_weight; - } - $count = 0; - $randN = rand( 1, $total_weight ); - foreach ( $valid_forms as $form_name => $meta ) { - $count += $meta['selection_weight']; - if ( $randN <= $count ) { - return $form_name; + + // Note that we'll never choose a weightless form. + if ( $meta['selection_weight'] > $greatest_weight ) { + $heaviest_form = $form_name; + $greatest_weight = $meta['selection_weight']; } } - return null; + + return $heaviest_form; } /** -- To view, visit https://gerrit.wikimedia.org/r/284503 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f6959fea22b92c0b4e80d264b9aca881423442e Gerrit-PatchSet: 3 Gerrit-Project:
[MediaWiki-commits] [Gerrit] Restore exception handler - change (mediawiki...kafka-watcher)
Smalyshev has uploaded a new change for review. https://gerrit.wikimedia.org/r/284602 Change subject: Restore exception handler .. Restore exception handler Change-Id: I4cdd569298e839f4082cf7ee581c852f1b31b274 --- M kafka-watcher.py 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/kafka-watcher refs/changes/02/284602/1 diff --git a/kafka-watcher.py b/kafka-watcher.py index 2685f8e..b336742 100755 --- a/kafka-watcher.py +++ b/kafka-watcher.py @@ -37,8 +37,8 @@ if not data: print("Could not parse data, meh") continue -#try: +try: handlers[msg.topic].handle(msg.topic, data) -#except: -#e = sys.exc_info() -#print("Oops, something happened: " + str(e)) +except: +e = sys.exc_info() +print("Oops, something happened: " + str(e)) -- To view, visit https://gerrit.wikimedia.org/r/284602 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cdd569298e839f4082cf7ee581c852f1b31b274 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/kafka-watcher Gerrit-Branch: master Gerrit-Owner: Smalyshev___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add install1001 to site.pp and DHCP - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: add install1001 to site.pp and DHCP .. add install1001 to site.pp and DHCP Created as a Ganeti VM on eqiad cluster, so this is the MAC i got assigned. Adding to site.pp and puppet without roles at first. Bug:T132757 Change-Id: Iee6fe88084f52a50cdc7e87ebd2865cc78b429eb --- M manifests/site.pp M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 2 files changed, 20 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/manifests/site.pp b/manifests/site.pp index e07a5a5..bca584f 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1382,6 +1382,17 @@ include base::firewall } +# partially replaces carbon (T132757) +node 'install1001.wikimedia.org' { +$cluster = 'misc' + +interface::add_ip6_mapped { 'main': +interface => 'eth0', +} + +include standard +} + node 'install2001.wikimedia.org' { role installserver::tftp_server $cluster = 'misc' diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index d0d68ae..df876d9 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -2593,6 +2593,15 @@ fixed-address hydrogen.wikimedia.org; } +host install1001 { +hardware ethernet aa:00:00:5d:92:b9; +fixed-address install1001.wikimedia.org; +option pxelinux.pathprefix "jessie-installer/"; +filename "jessie-installer/debian-installer/amd64/pxelinux.0"; + +next-server 208.80.153.4; # install2001 (tftp server) +} + host install2001 { hardware ethernet D4:AE:52:AA:06:C3; fixed-address install2001.wikimedia.org; -- To view, visit https://gerrit.wikimedia.org/r/284600 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee6fe88084f52a50cdc7e87ebd2865cc78b429eb Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-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] Allow decommissioning OCG hosts. - change (mediawiki...OfflineContentGenerator)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/284601 Change subject: Allow decommissioning OCG hosts. .. Allow decommissioning OCG hosts. A decommissioned host will answer frontend requests but not take new backend jobs from the redis queue. This allows us to remove its cached jobs from redis (either proactively or by timing them out), after which it should receive no further frontend requests and can be shut down. For cluster failover, the "backup" hosts on the secondary cluster can all be listed as decommissioned using a regexp until they are needed. Bug: T120077 Change-Id: I5b8388ac914a2129f8346ee3f4932455fa14c8e4 --- M defaults.js M mw-ocg-service.js 2 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator refs/changes/01/284601/1 diff --git a/defaults.js b/defaults.js index a97637a..3355ec3 100644 --- a/defaults.js +++ b/defaults.js @@ -24,6 +24,11 @@ /** Public hostname of this instance for HTTP GET requests for locally stored content. */ hostname: null, + /** Array of strings or regular expressions naming hosts which +* should be "decommissioned" --- that is, they should not +* launch backend threads. */ + decommission: [], + /** How often (in seconds) to check for configuration changes. * We gracefully shutdown when we get a config change; presumably * upstart or some other service runner will restart us. Defaults diff --git a/mw-ocg-service.js b/mw-ocg-service.js index e140ee6..c702c48 100755 --- a/mw-ocg-service.js +++ b/mw-ocg-service.js @@ -182,6 +182,18 @@ if (autoThreads === 'auto') { autoThreads = os.cpus().length; } + // Check: is this host decommissioned? If so, don't launch any + // background threads. + var host = config.coordinator.hostname || os.hostname(); + var decommission = config.coordinator.decommission; + if (!Array.isArray(decommission)) { decommission = [ decommission ]; } + if (decommission.some(function(s) { + // s could be a string or a regular expression + return host===s || (s.test && s.test(host)); + })) { + console.warn('%s decommissioned; no backend threads launched.', host); + autoThreads = 0; + } for (i = 0; i < autoThreads; i++) { spawnWorker('backend'); } -- To view, visit https://gerrit.wikimedia.org/r/284601 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b8388ac914a2129f8346ee3f4932455fa14c8e4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator Gerrit-Branch: master Gerrit-Owner: Cscott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add install1001 to site.pp and DHCP - change (operations/puppet)
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/284600 Change subject: add install1001 to site.pp and DHCP .. add install1001 to site.pp and DHCP Bug:T132757 Change-Id: Iee6fe88084f52a50cdc7e87ebd2865cc78b429eb --- M manifests/site.pp M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/00/284600/1 diff --git a/manifests/site.pp b/manifests/site.pp index e07a5a5..bca584f 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1382,6 +1382,17 @@ include base::firewall } +# partially replaces carbon (T132757) +node 'install1001.wikimedia.org' { +$cluster = 'misc' + +interface::add_ip6_mapped { 'main': +interface => 'eth0', +} + +include standard +} + node 'install2001.wikimedia.org' { role installserver::tftp_server $cluster = 'misc' diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index d0d68ae..ef06b00 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -2593,6 +2593,15 @@ fixed-address hydrogen.wikimedia.org; } +host install1001 { +hardware ethernet ; +fixed-address install1001.wikimedia.org; +option pxelinux.pathprefix "jessie-installer/"; +filename "jessie-installer/debian-installer/amd64/pxelinux.0"; + +next-server 208.80.153.4; # install2001 (tftp server) +} + host install2001 { hardware ethernet D4:AE:52:AA:06:C3; fixed-address install2001.wikimedia.org; -- To view, visit https://gerrit.wikimedia.org/r/284600 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee6fe88084f52a50cdc7e87ebd2865cc78b429eb 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] Improve graceful shutdown. - change (mediawiki...OfflineContentGenerator)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/284598 Change subject: Improve graceful shutdown. .. Improve graceful shutdown. During a graceful shutdown we don't halt background render tasks or garbage collections which are in progress; instead waiting politely for these to finish before shutting down. We also shut down the front end tasks *last* to minimize downtime for those fetching cached resources. Change-Id: Id128e7ad3ba06d4da6302c2c42b8f2c32e58de9b --- M lib/RedisWrapper.js M lib/threads/backend.js M lib/threads/frontend.js M lib/threads/gc.js M mw-ocg-service.js 5 files changed, 125 insertions(+), 70 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator refs/changes/98/284598/1 diff --git a/lib/RedisWrapper.js b/lib/RedisWrapper.js index 36d9b12..323a5a6 100644 --- a/lib/RedisWrapper.js +++ b/lib/RedisWrapper.js @@ -86,7 +86,8 @@ /** * Gracefully closes the connection. Emits 'closed' when complete. */ -RedisWrapper.prototype.close = function() { +RedisWrapper.prototype.close = function(cb) { + if (cb) { this.once('closed', cb); } if (this.client && this.client.connected) { this.client.quit(); } else { diff --git a/lib/threads/backend.js b/lib/threads/backend.js index e3a60d1..8723c09 100644 --- a/lib/threads/backend.js +++ b/lib/threads/backend.js @@ -47,6 +47,7 @@ var config = null; var redisClient = null; +var stopping = false; /* === Public Exported Functions === */ /** @@ -120,16 +121,13 @@ * Starts the backend server */ function startBackend() { - var loop = false; redisClient.on('closed', function() { - if (!loop) { - loop = true; - console.error( - 'Backend connection to redis died unexpectedly.', - { channel: 'backend.error.fatal' } - ); - stopBackend(process.exit); - } + if (stopping) return; + console.error( + 'Backend connection to redis died unexpectedly.', + { channel: 'backend.error.fatal' } + ); + stopBackend(process.exit); }); redisClient.on('opened', getNewItemFromQueue); redisClient.connect(); @@ -145,8 +143,8 @@ * @param {callback} callbackFunc - Function to call when server successfully closed */ function stopBackend(callbackFunc) { - redisClient.close(); - callbackFunc(); + stopping = callbackFunc || function() { }; + // now we have to wait until the backend is done with its job. } /* === Private Functions === */ @@ -155,43 +153,51 @@ * then starts the promise chain to bundle, render, and cleanup. */ function getNewItemFromQueue() { - redisClient.blpop(config.redis.job_queue_name, 0) + // Before checking the redis queue, see if this thread should shut down + if (stopping) { + console.info( + 'Backend thread halting as requested.', { channel: 'backend' } + ); + return redisClient.close(stopping); + } + redisClient.blpop(config.redis.job_queue_name, 3) .then(function(result) { // The return, if there is one, will be [,] if (!result) { - throw new BackendError('Redis returned nil when picking up new job from queue.'); - } else { - console.info( - 'Got new job "%s", attempting to get status details and launching', - result[1], - { - channel: 'backend', - job: { id: result[1] }, - } - ); - return redisClient.hget(config.redis.status_set_name, result[1]); + // Timeout. Check our host status, and then retry. + return; } - }) - .catch(function(err) { + console.info( + 'Got new job "%s", attempting to get status details and launching', + result[1], + { + channel: 'backend', + job: { id: result[1] }, + } + ); + return
[MediaWiki-commits] [Gerrit] Periodically check for configuration file changes. - change (mediawiki...OfflineContentGenerator)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/284599 Change subject: Periodically check for configuration file changes. .. Periodically check for configuration file changes. This allows a service to gracefully restart when its configuration changes. Change-Id: I586c2c39b8efcacbd50e884374aaeae2890b4bb9 --- M defaults.js M lib/cli.js M mw-ocg-service.js 3 files changed, 61 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator refs/changes/99/284599/1 diff --git a/defaults.js b/defaults.js index edfc8ed..a97637a 100644 --- a/defaults.js +++ b/defaults.js @@ -23,6 +23,12 @@ /** Public hostname of this instance for HTTP GET requests for locally stored content. */ hostname: null, + + /** How often (in seconds) to check for configuration changes. +* We gracefully shutdown when we get a config change; presumably +* upstart or some other service runner will restart us. Defaults +* to zero which means, "never check for configuration changes". */ + checkTime: 0, }, /** Configuration for the frontend HTTP server thread. You can choose to serve * content via a local socket, or an IP address. If both are null the server will diff --git a/lib/cli.js b/lib/cli.js index 7972cdb..77d07a8 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -18,9 +18,15 @@ // Parse configuration files, with optional command-line override. var parseConfig = exports.parseConfig = function(commanderConfig) { + var deps = [], latest = 0, req = function(f) { + f = path.resolve(__dirname, f); + deps.push('+' + f); // record filenames for all config files parsed. + latest = Math.max(latest, fs.statSync(f).ctime.getTime()); + return require(f); + }; /* === Configuration Options & File === */ - var config = require('../defaults.js'), configPath = '..'; + var config = req('../defaults.js'), configPath = '..'; // Local configuration overrides. while (config.config) { var configFile = relativeTo(configPath, config.config); @@ -28,9 +34,10 @@ try { fs.statSync(configFile); } catch (e) { + deps.push('-' + configFile); break; // File not present. } - config = require(configFile)(config) || config; + config = req(configFile)(config) || config; configPath = path.dirname(configFile); } @@ -41,7 +48,7 @@ // to the current working directory instead of relative to the path of this // file. commanderConfig = relativeTo(process.cwd(), commanderConfig); - config = require(commanderConfig)(config) || config; + config = req(commanderConfig)(config) || config; } } catch (err) { console.error('Could not open configuration file %s! %s', commanderConfig, err); @@ -54,9 +61,38 @@ "Failed jobs shouldn't be gc'd before the lockout time expires." ); + // Record all dependent files and the latest ctime. + config.config_deps = deps; + config.config_time = latest; return config; }; +// Check to see if any configuration files have changed. +var configChanged = exports.configChanged = function(config) { + var deps = config.config_deps, latest = config.config_time, i; + for (i=0; ilatest) { + // Newer file, or an expected file disappeared. + return true; + } + } else { + if (s!==null) { + // A file appeared! + return true; + } + } + } + // No changes. + return false; +}; + // Set up logging. var setupLogging = exports.setupLogging = function(config, forceStdout) { var bunyan = require('bunyan'); diff --git a/mw-ocg-service.js b/mw-ocg-service.js index 9f99d66..e140ee6 100755 --- a/mw-ocg-service.js +++ b/mw-ocg-service.js @@ -71,8 +71,10 @@ var i; /* --- Thread management --- */ + var checkTimer = 0; var gracefulShutdown = function gracefulShutdown() { respawnWorkers
[MediaWiki-commits] [Gerrit] lshell scaffolding for restricting Labs users - change (operations/puppet)
Rush has submitted this change and it was merged. Change subject: lshell scaffolding for restricting Labs users .. lshell scaffolding for restricting Labs users Bug: T102395 Change-Id: Iece9c2fb54a9376e6d59ddcb4bc120f29d4efc58 --- A modules/lshell/manifests/init.pp A modules/lshell/templates/lshell.conf.erb 2 files changed, 123 insertions(+), 0 deletions(-) Approvals: Rush: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/lshell/manifests/init.pp b/modules/lshell/manifests/init.pp new file mode 100644 index 000..5358541 --- /dev/null +++ b/modules/lshell/manifests/init.pp @@ -0,0 +1,62 @@ +# Limited shell environment +# +# * Anything that allows shelling out escapes +# * This is not a full shell replacment +# * Combine with @shell_override in nslcd.conf.erb +# +# === Parameters +# +# [*$allowed_cmds*] +# Whitelist of allowed interactive shell commands +# No specified commands will result in permissive +# +# [*$allowed_cmd_path*] +# Whitelist of all commands in an array of paths +# +# [*$forbidden*] +# Invalid characters +# +# [*$banner*] +# Display text upon login +# +# [*$overssh*] +# Noninteractive shell commands allowed +# +# [*$timer*] +# Session duration length allowed +# +# [*$path] +# Array of paths user is allowed to interact with +# +# [*$prompt] +# Shell prompt +# + +class lshell ( +$allowed_cmds = [], +$allowed_cmd_path = [], +$banner = 'This is a limited shell.', +$overssh = [], +$timer= 86400, +$path = ['/home'], +$prompt = '%u', +$exempt_grps = ['ops'], +) { + +# allowed_cmd_paths with permissive allowed_cmds +# is disingenious as it won't actually restrict +if empty($allowed_cmds) and !empty($allowed_cmd_path){ +fail('allowed_cmd_path will have no effect') +} + +package { 'lshell': +ensure => present +} + +file { '/etc/lshell.conf': +content => template('lshell/lshell.conf.erb'), +owner => root, +group => root, +mode=> '0444', +} +} diff --git a/modules/lshell/templates/lshell.conf.erb b/modules/lshell/templates/lshell.conf.erb new file mode 100644 index 000..9e0851f --- /dev/null +++ b/modules/lshell/templates/lshell.conf.erb @@ -0,0 +1,61 @@ +[global] + +[default] +intro = '<%= @banner %>\n' +timer = <%= @timer %> +login_script : '' + +# example: %u@%h +prompt : "<%= @prompt %>" +prompt_short: 0 + +history_size : 100 +history_file : "/home/%u/.lshell_history" + + +# count invalid commands and terminate on this count +# -1 disables +warning_counter : -1 +# set to 1 to count forbidden commands for enforcement +# 0 disables and only warns as "*** unknown syntax" +strict : 0 + + +forbidden: ['&', '`','>','<', '$(', '${'] + +aliases : {'ll':'ls -l', + 'vim':'rvim'} + +# These are paths the user can access +path: [ +<% @path.each do |p| -%> +'<%= p %>', +<% end -%> +] + +sudo_commands : [''] + +# include all commands as allowed in $path +allowed_cmd_path: [ +<% @allowed_cmd_path.each do |cpath| -%> +'<%= cpath %>', +<% end -%> +] + +# command whitelist +<% if @allowed_cmds.empty? %> +allowed: 'all' +<% else %> +allowed : [ +<% @allowed_cmds.each do |cmd| -%> +'<%= cmd %>', +<% end -%> +] +<% end -%> + +# allow users in some groups to issue all commands +<% @exempt_grps.each do |group| -%> +[grp:<%= group -%>] +intro = '\n<%= group -%>: lshell standard user shell except all commands available.\n' +allowed: 'all' +<% end -%> -- To view, visit https://gerrit.wikimedia.org/r/284530 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iece9c2fb54a9376e6d59ddcb4bc120f29d4efc58 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RushGerrit-Reviewer: Rush Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Integrate with PHP-Queue - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/284597 Change subject: [WIP] Integrate with PHP-Queue .. [WIP] Integrate with PHP-Queue Get a new FIFO queue by name, like: $queue = new FifoDataStore( "pending" ); $queue->push( $message ); TODO: * Write tests. Change-Id: I4d1b870d1fb6da6132a8d81cf266ff6313a24306 --- A Core/DataStores/FifoDataStore.php 1 file changed, 64 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/97/284597/1 diff --git a/Core/DataStores/FifoDataStore.php b/Core/DataStores/FifoDataStore.php new file mode 100644 index 000..5cfd1e4 --- /dev/null +++ b/Core/DataStores/FifoDataStore.php @@ -0,0 +1,64 @@ +getConfiguration(); + + // Default to the unmapped queue name. + $queueNameDefaults = array( + 'queue' => $queueName, + ); + + // Merge config options, from least to greatest precedence. + $options = array(); + $options = array_merge( + $queueNameDefaults, + $c->val( "data-stores/queues/default" ), + $c->val( "data-stores/queues/{$queueName}" ), + $options + ); + + // What is this? Make one. + $className = $options['type']; + if ( !($className instanceof \PHPQueue\Interfaces\FifoQueueStore) + || !class_exists( $className ) + ) { + throw new RuntimeException( "Queue backend class not found: [$className]" ); + } + $this->backend = new $className( $options ); + $this->queueName = $queueName; + } + + public function push( $message ) { + Logger::debug( "Pushing to {$this->queueName}" ); + $this->backend->push( $message ); + } + + public function pop() { + Logger::debug( "Popping from {$this->queueName}" ); + return $this->backend->pop(); + } + + public function commit() { + // TODO + Logger::error( "Unimplemented: " . __METHOD__ ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/284597 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d1b870d1fb6da6132a8d81cf266ff6313a24306 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Align amount and currency inputs - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284596 Change subject: Align amount and currency inputs .. Align amount and currency inputs Also, don't make 'em quite so huge on mobile. Bug: T113306 Change-Id: Icade93fd701e16839b7191f7deb1ef821ccd900b --- M gateway_forms/mustache/forms.css 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/96/284596/1 diff --git a/gateway_forms/mustache/forms.css b/gateway_forms/mustache/forms.css index 3ffb961..2dcc3ce 100644 --- a/gateway_forms/mustache/forms.css +++ b/gateway_forms/mustache/forms.css @@ -194,9 +194,12 @@ } .amount_header span { - font-size: 1.8em; display: block; color: #006699; +} + +span#selected-amount { + font-size: 1.8em; } .cc_header { @@ -255,6 +258,10 @@ #payment-table-donor select { padding: .9em 1em !important; line-height: 40px; } +#amount_input * { +vertical-align: top; +} + #topError { max-width: 481px; } -- To view, visit https://gerrit.wikimedia.org/r/284596 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icade93fd701e16839b7191f7deb1ef821ccd900b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] TabOptionWidget: Disabled OptionWidget should receive defaul... - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: TabOptionWidget: Disabled OptionWidget should receive default cursor .. TabOptionWidget: Disabled OptionWidget should receive default cursor A disabled OptionWidget of a TabOptionWidget should receive the default cursor instead of a text selection cursor. Bug: T133210 Change-Id: Ia53b3762da04433dab12f347870558d3557119c3 --- M src/styles/widgets/OptionWidget.less 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/src/styles/widgets/OptionWidget.less b/src/styles/widgets/OptionWidget.less index 0b4451e..837532b 100644 --- a/src/styles/widgets/OptionWidget.less +++ b/src/styles/widgets/OptionWidget.less @@ -7,6 +7,9 @@ &.oo-ui-widget-enabled { cursor: pointer; } + &.oo-ui-widget-disabled { + cursor: default; + } &.oo-ui-labelElement .oo-ui-labelElement-label { display: block; -- To view, visit https://gerrit.wikimedia.org/r/284558 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia53b3762da04433dab12f347870558d3557119c3 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: VolkerEGerrit-Reviewer: Bartosz Dziewoński 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] WIP: Content negotiation - change (mediawiki...parsoid)
Arlolra has uploaded a new change for review. https://gerrit.wikimedia.org/r/284595 Change subject: WIP: Content negotiation .. WIP: Content negotiation Change-Id: Ie3a7042d78c310ef20eee79cb0a38c7cd40ec3cc --- M lib/api/apiUtils.js M lib/api/routes.js M npm-shrinkwrap.json M package.json M tests/mocha/api.js 5 files changed, 69 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/95/284595/1 diff --git a/lib/api/apiUtils.js b/lib/api/apiUtils.js index 674f43d..351656f 100644 --- a/lib/api/apiUtils.js +++ b/lib/api/apiUtils.js @@ -274,8 +274,12 @@ return 'text/plain; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/wikitext/' + env.conf.parsoid.WIKITEXT_VERSION + '"'; }; +apiUtils.htmlProfile = function(env) { + return 'https://www.mediawiki.org/wiki/Specs/HTML/' + env.conf.parsoid.HTML_VERSION; +}; + apiUtils.htmlContentType = function(env) { - return 'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/' + env.conf.parsoid.HTML_VERSION + '"'; + return 'text/html; charset=utf-8; profile="' + apiUtils.htmlProfile(env) + '"'; }; apiUtils.dataParsoidContentType = function(env) { diff --git a/lib/api/routes.js b/lib/api/routes.js index ada7fef..a6881b7 100644 --- a/lib/api/routes.js +++ b/lib/api/routes.js @@ -4,6 +4,7 @@ var childProcess = require('child_process'); var corepath = require('path'); var qs = require('querystring'); +var Negotiator = require('negotiator'); var pkg = require('../../package.json'); var apiUtils = require('./apiUtils.js'); @@ -105,6 +106,11 @@ res.locals.pageName = original.title; } } + + // Just do the parsing here. + var negotiator = new Negotiator(req); + res.locals.acceptableTypes = + negotiator.mediaTypes(undefined, { detailed: true }); res.locals.opts = opts; next(); @@ -373,6 +379,28 @@ var stats = env.conf.parsoid.stats; var startTimers = new Map(); + // FIXME: what accept header is pagebundle going to be sending? + // presumably it'll be 'application/json' but then with which profile? + // just the html? ++ data-parsoid? what about when we start putting + // data-mw? + if (opts.format === 'html') { + for (var i = 0; i < res.locals.acceptableTypes.length; i++) { + var t = res.locals.acceptableTypes[i]; + if (t.type === 'text/html') { + var tp = t.parameters; // Ignore other parameters? + if (tp && tp.profile && tp.profile !== apiUtils.htmlProfile(env)) { + apiUtils.fatalRequest(env, 'Not acceptable.', 406); + return; + } else { + // Accepts the latests. + break; + } + } else { + // Probably need to consider wilcards here ... + } + } + } + var p = Promise.method(function() { // Check early if we have a wt string. if (typeof wt === 'string') { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4d09636..8a375c5 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2358,6 +2358,11 @@ } } }, +"negotiator": { + "version": "0.6.0", + "from": "negotiator@git+https://github.com/ethanresnick/negotiator.git#e2fe4abc56271b9851132f3e508e7323415c8aea;, + "resolved": "git+https://github.com/ethanresnick/negotiator.git#e2fe4abc56271b9851132f3e508e7323415c8aea; +}, "node-txstatsd": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/node-txstatsd/-/node-txstatsd-0.1.5.tgz; diff --git a/package.json b/package.json index f8739bd..f4e2aaf 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "finalhandler": "^0.4.0", "gelf-stream": "^0.2.4", "html5": "^1.0.5", +"negotiator": "git+https://github.com/ethanresnick/negotiator#full-parse-access;, "node-txstatsd": "^0.1.5", "node-uuid": "^1.4.7", "pegjs": "git+https://github.com/tstarling/pegjs#fork;, diff --git a/tests/mocha/api.js b/tests/mocha/api.js index dd821d5..207e83d 100644 --- a/tests/mocha/api.js +++ b/tests/mocha/api.js @@ -82,6 +82,36 @@ }); // formats + describe.only("accepts",
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 0f60df5..ad436e2 - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/284594 Change subject: Syncronize VisualEditor: 0f60df5..ad436e2 .. Syncronize VisualEditor: 0f60df5..ad436e2 Change-Id: I34a84f0a5bf140bd8dd689aa3fc8250b5d669427 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/94/284594/1 diff --git a/VisualEditor b/VisualEditor index 0f60df5..ad436e2 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 0f60df5d9ef18d9de74c53b98c934b3a6efe246d +Subproject commit ad436e29ff35ed216a8b9b0473c78ad9c42d16f3 -- To view, visit https://gerrit.wikimedia.org/r/284594 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34a84f0a5bf140bd8dd689aa3fc8250b5d669427 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 0f60df5..ad436e2 - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: 0f60df5..ad436e2 .. Syncronize VisualEditor: 0f60df5..ad436e2 Change-Id: I34a84f0a5bf140bd8dd689aa3fc8250b5d669427 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Jenkins-mwext-sync: Verified; Looks good to me, approved diff --git a/VisualEditor b/VisualEditor index 0f60df5..ad436e2 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 0f60df5d9ef18d9de74c53b98c934b3a6efe246d +Subproject commit ad436e29ff35ed216a8b9b0473c78ad9c42d16f3 -- To view, visit https://gerrit.wikimedia.org/r/284594 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34a84f0a5bf140bd8dd689aa3fc8250b5d669427 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-syncGerrit-Reviewer: Jenkins-mwext-sync ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Consolidate and simplify lazy loaded references logic - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/284592 Change subject: Consolidate and simplify lazy loaded references logic .. Consolidate and simplify lazy loaded references logic This now behaves just like lazy loaded images Bug: T129693 Change-Id: I76c3a85e316637abc31f58db888b6c5e0418059e --- M includes/MobileContext.php M includes/MobileFrontend.body.php M includes/MobileFrontend.hooks.php M resources/skins.minerva.scripts/references.js 4 files changed, 21 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/92/284592/1 diff --git a/includes/MobileContext.php b/includes/MobileContext.php index 0300937..c751615 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -28,6 +28,11 @@ */ protected $lazyLoadImages; /** +* Save whether references will be lazy loaded for current user +* @var boolean $lazyLoadReferences +*/ + protected $lazyLoadReferences; + /** * Save explicitly requested format * @var string $useFormat */ @@ -165,6 +170,19 @@ } /** +* Checks whether references should be lazy loaded for the current user +* @return bool +*/ + public function isLazyLoadReferencesEnabled() { + if ( $this->lazyLoadReferences === null ) { + $mfLazyLoadReferences = $this->getMFConfig()->get( 'MFLazyLoadReferences' ); + $this->lazyLoadReferences = $mfLazyLoadReferences['base'] || + ( $this->isBetaGroupMember() && $mfLazyLoadReferences['beta'] ); + } + return $this->lazyLoadReferences; + } + + /** * Checks whether images should be lazy loaded for the current user * @return bool */ diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php index bbad009..99bd4c2 100644 --- a/includes/MobileFrontend.body.php +++ b/includes/MobileFrontend.body.php @@ -62,11 +62,8 @@ && $context->getRequest()->getText( 'action', 'view' ) == 'view' ); - $mfLazyLoadReferences = $config->get( 'MFLazyLoadReferences' ); - $removeImages = $context->isLazyLoadImagesEnabled(); - $removeReferences = $mfLazyLoadReferences['base'] || - ( $isBeta && $mfLazyLoadReferences['beta'] ); + $removeReferences = $context->isLazyLoadReferencesEnabled(); if ( $context->getContentTransformations() ) { // Remove images if they're disabled from special pages, but don't transform otherwise diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index d738d45..0672380 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -471,7 +471,6 @@ 'wgMFEditorOptions' => $config->get( 'MFEditorOptions' ), 'wgMFLicense' => MobileFrontendSkinHooks::getLicense( 'editor' ), 'wgMFSchemaEditSampleRate' => $config->get( 'MFSchemaEditSampleRate' ), - 'wgMFLazyLoadReferences' => $config->get( 'MFLazyLoadReferences' ), 'wgMFSchemaMobileWebLanguageSwitcherSampleRate' => $config->get( 'MFSchemaMobileWebLanguageSwitcherSampleRate' ), 'wgMFExperiments' => $config->get( 'MFExperiments' ), @@ -1341,6 +1340,7 @@ unset( $vars['wgCategories'] ); $vars['wgMFMode'] = $context->isBetaGroupMember() ? 'beta' : 'stable'; $vars['wgMFLazyLoadImages'] = $context->isLazyLoadImagesEnabled(); + $vars['wgMFLazyLoadReferences'] = $context->isLazyLoadReferencesEnabled(); } $title = $out->getTitle(); $vars['wgPreferredVariant'] = $title->getPageLanguage()->getPreferredVariant(); diff --git a/resources/skins.minerva.scripts/references.js b/resources/skins.minerva.scripts/references.js index 4e58287..8e41cf1 100644 --- a/resources/skins.minerva.scripts/references.js +++ b/resources/skins.minerva.scripts/references.js @@ -12,9 +12,7 @@ * @returns {String} name of the class implementing ReferenceGateway to use */ function getReferenceGatewayClassName() { - var config = mw.config.get( 'wgMFLazyLoadReferences', {} ); - - return config.base || ( isBeta && config.beta ) ? + return mw.config.get( 'wgMFLazyLoadReferences', false ) ? 'ReferencesMobileViewGateway' : 'ReferencesHtmlScraperGateway'; } -- To view, visit https://gerrit.wikimedia.org/r/284592 To
[MediaWiki-commits] [Gerrit] Allow optin to lazy loaded references via cookie - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/284593 Change subject: Allow optin to lazy loaded references via cookie .. Allow optin to lazy loaded references via cookie Depends-On: I1526c844ad34f5dc61a1485120245c362c00118e Change-Id: Ib59dc05710357d13903330b87060ac8f4a7394cf --- M includes/MobileContext.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/93/284593/1 diff --git a/includes/MobileContext.php b/includes/MobileContext.php index c751615..950b434 100644 --- a/includes/MobileContext.php +++ b/includes/MobileContext.php @@ -11,6 +11,8 @@ const USER_MODE_PREFERENCE_NAME = 'mfMode'; const LAZY_LOAD_IMAGES_COOKIE_NAME = 'mfLazyLoadImages'; const LAZY_LOAD_IMAGES_COOKIE_VALUE = 'A'; + const LAZY_LOAD_REFERENCES_COOKIE_NAME = 'mfLazyLoadReferences'; + const LAZY_LOAD_REFERENCES_COOKIE_VALUE = 'A'; /** * Saves the testing mode user has opted in: 'beta' or 'stable' @@ -176,8 +178,10 @@ public function isLazyLoadReferencesEnabled() { if ( $this->lazyLoadReferences === null ) { $mfLazyLoadReferences = $this->getMFConfig()->get( 'MFLazyLoadReferences' ); + $cookie = $this->getRequest()->getCookie( self::LAZY_LOAD_REFERENCES_COOKIE_NAME, '' ); $this->lazyLoadReferences = $mfLazyLoadReferences['base'] || - ( $this->isBetaGroupMember() && $mfLazyLoadReferences['beta'] ); + ( $this->isBetaGroupMember() && $mfLazyLoadReferences['beta'] ) || + $cookie === self::LAZY_LOAD_REFERENCES_COOKIE_VALUE; } return $this->lazyLoadReferences; } -- To view, visit https://gerrit.wikimedia.org/r/284593 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib59dc05710357d13903330b87060ac8f4a7394cf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend 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] Remove NetSpeedB cache splitting - change (operations/puppet)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/284577 Change subject: Remove NetSpeedB cache splitting .. Remove NetSpeedB cache splitting The NetSpeed cookie is no longer in use in MobileFrontend and can be removed (unless I'm missing something) See I7f74cb014a9d4587badddfc715ce906f4518a9a2 Change-Id: Iac9bdf800e33e3e09a3948c72fd94dac68ce8852 --- M templates/varnish/text-common.inc.vcl.erb 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/77/284577/1 diff --git a/templates/varnish/text-common.inc.vcl.erb b/templates/varnish/text-common.inc.vcl.erb index 0021cee..e4b8e27 100644 --- a/templates/varnish/text-common.inc.vcl.erb +++ b/templates/varnish/text-common.inc.vcl.erb @@ -100,13 +100,6 @@ hash_data("disableImages=1"); } - // Split the cache if the NetSpeed cookie is set and if its value is 'B'. The only other - // permissable value is 'A', which is equivalent to not having the cookie at all, so we - // don't need to update the hash in that case. - if (req.http.X-Orig-Cookie ~ "(^|;\s*)NetSpeed=B" || req.http.Cookie ~ "(^|;\s*)NetSpeed=B") { - hash_data("NetSpeed=B"); - } - // Split the cache for the beta variant of the mobile site. if (req.http.X-Orig-Cookie ~ "(^|;\s*)optin=beta" || req.http.Cookie ~ "(^|;\s*)optin=beta") { hash_data("optin=beta"); -- To view, visit https://gerrit.wikimedia.org/r/284577 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac9bdf800e33e3e09a3948c72fd94dac68ce8852 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Split mobile text cache for lazy loaded references testing - change (operations/puppet)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/284576 Change subject: Split mobile text cache for lazy loaded references testing .. Split mobile text cache for lazy loaded references testing Change-Id: I1526c844ad34f5dc61a1485120245c362c00118e --- M templates/varnish/text-common.inc.vcl.erb 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/76/284576/1 diff --git a/templates/varnish/text-common.inc.vcl.erb b/templates/varnish/text-common.inc.vcl.erb index 9c29e8b..0021cee 100644 --- a/templates/varnish/text-common.inc.vcl.erb +++ b/templates/varnish/text-common.inc.vcl.erb @@ -116,6 +116,11 @@ if (req.http.X-Orig-Cookie ~ "(^|;\s*)mfLazyLoadImages=A" || req.http.Cookie ~ "(^|;\s*)mfLazyLoadImages=A") { hash_data("mfLazyLoadImages=A"); } + + // Split the cache for non-beta lazy reference loading tests + if (req.http.X-Orig-Cookie ~ "(^|;\s*)mfLazyLoadReferences=A" || req.http.Cookie ~ "(^|;\s*)mfLazyLoadReferences=A") { + hash_data("mfLazyLoadReferences=A"); + } } } -- To view, visit https://gerrit.wikimedia.org/r/284576 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1526c844ad34f5dc61a1485120245c362c00118e Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] TabOptionWidget: Disabled OptionWidget should receive defaul... - change (oojs/ui)
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/284558 Change subject: TabOptionWidget: Disabled OptionWidget should receive default cursor .. TabOptionWidget: Disabled OptionWidget should receive default cursor A disabled OptionWidget of a TabOptionWidget should receive the default cursor instead of a text selection cursor. Bug: T133210 Change-Id: Ia53b3762da04433dab12f347870558d3557119c3 --- M src/styles/widgets/OptionWidget.less 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/58/284558/1 diff --git a/src/styles/widgets/OptionWidget.less b/src/styles/widgets/OptionWidget.less index 0b4451e..837532b 100644 --- a/src/styles/widgets/OptionWidget.less +++ b/src/styles/widgets/OptionWidget.less @@ -7,6 +7,9 @@ &.oo-ui-widget-enabled { cursor: pointer; } + &.oo-ui-widget-disabled { + cursor: default; + } &.oo-ui-labelElement .oo-ui-labelElement-label { display: block; -- To view, visit https://gerrit.wikimedia.org/r/284558 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia53b3762da04433dab12f347870558d3557119c3 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] Fix duplicate Search icon for RTL in API <23 - change (apps...wikipedia)
Dbrant has uploaded a new change for review. https://gerrit.wikimedia.org/r/284545 Change subject: Fix duplicate Search icon for RTL in API <23 .. Fix duplicate Search icon for RTL in API <23 There are two places in our code where we use "drawableStart" to insert a drawable at the start of a TextView. The Android guidelines (as well as the IDE) encourage us to *also* supplement it with "drawableLeft" for compatibility with API <17. However, when switching to RTL under API <23, this seems to be having the effect of rendering *both* the "start" drawable, as well as the "left" drawable... whereas theoretically the "start" drawable should override the "left" drawable. Anyway, it looks like it's perfectly acceptable to remove the "left" drawable, and suppress the IDE check for it. On API 17+ this means that it will use the "start" drawable as expected, and on API <17 it still renders the "start" drawable, but always places it on the left, which is also expected. Bug: T133169 Change-Id: Ia43adf10165543a9630c086c702005f1f07fc964 --- M app/src/main/res/layout/activity_page.xml M app/src/main/res/layout/custom_error_view.xml 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/45/284545/1 diff --git a/app/src/main/res/layout/activity_page.xml b/app/src/main/res/layout/activity_page.xml index a630791..f792374 100644 --- a/app/src/main/res/layout/activity_page.xml +++ b/app/src/main/res/layout/activity_page.xml @@ -91,7 +91,7 @@ android:shadowRadius="2" android:layout_gravity="center_vertical" android:drawableStart="@drawable/ic_search" -android:drawableLeft="@drawable/ic_search" +tools:ignore="RtlCompat" android:drawablePadding="4dp"/> -- To view, visit https://gerrit.wikimedia.org/r/284545 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia43adf10165543a9630c086c702005f1f07fc964 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update Gruntfile.js and package.json and packages - change (mediawiki...BetaFeatures)
jenkins-bot has submitted this change and it was merged. Change subject: Update Gruntfile.js and package.json and packages .. Update Gruntfile.js and package.json and packages This removes duplicate jsonlint task, also update somethings todo with js. Updates packages: grunt-banana-checker to 0.4.0 grunt-contrib-jshint to 1.0.0 grunt-jscs to 2.8.0 Also jshint will now search in all the js files. Change-Id: Ifd638069d9367b356e606fa4ea557f6d05cb8883 --- M .jshintignore M .jshintrc M Gruntfile.js M package.json 4 files changed, 12 insertions(+), 13 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/.jshintignore b/.jshintignore index e69de29..a860310 100644 --- a/.jshintignore +++ b/.jshintignore @@ -0,0 +1 @@ +node_modules/** diff --git a/.jshintrc b/.jshintrc index 4c5e00f..22a4f47 100644 --- a/.jshintrc +++ b/.jshintrc @@ -5,7 +5,7 @@ "bitwise": true, "eqeqeq": true, "freeze": true, - "latedef": true, + "latedef": "nofunc", "noarg": true, "nonew": true, "undef": true, @@ -22,8 +22,7 @@ /* Local */ - "predef": [ - "mediaWiki", - "jQuery" - ] + "globals": { + "mediaWiki": false + } } diff --git a/Gruntfile.js b/Gruntfile.js index 0ec2649..4a3de2b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,12 +7,11 @@ /*jshint node:true */ module.exports = function ( grunt ) { var conf = grunt.file.readJSON( 'extension.json' ); - grunt.loadNpmTasks( 'grunt-jsonlint' ); - grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-jscs' ); + grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); - grunt.loadNpmTasks( 'grunt-jscs' ); grunt.initConfig( { jshint: { @@ -20,8 +19,8 @@ jshintrc: true }, all: [ - '*.js', - 'resources/*.js' + '**/*.js', + '!node_modules/**' ] }, jscs: { diff --git a/package.json b/package.json index 16b008f..548e84b 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "devDependencies": { "grunt": "0.4.5", "grunt-cli": "0.1.13", -"grunt-banana-checker": "0.2.2", -"grunt-contrib-jshint": "0.11.3", +"grunt-contrib-jshint": "1.0.0", +"grunt-banana-checker": "0.4.0", +"grunt-jscs": "2.8.0", "grunt-contrib-watch": "0.6.1", -"grunt-jscs": "2.1.0", "grunt-jsonlint": "1.0.7" } } -- To view, visit https://gerrit.wikimedia.org/r/275183 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifd638069d9367b356e606fa4ea557f6d05cb8883 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/BetaFeatures Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Hashar Gerrit-Reviewer: JanZerebecki Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: MarkTraceur 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] changed RHEL value in conditionals - change (mediawiki...ansible-wikifarm)
Cicalese has submitted this change and it was merged. Change subject: changed RHEL value in conditionals .. changed RHEL value in conditionals Change-Id: Ie19409517286fd9785a4f4087817d6e7cafca95a --- M roles/deploy_mw_host/tasks/configure_squid.yml M roles/deploy_mw_host/templates/wikifarm.conf.j2 M roles/setup/tasks/main.yml 3 files changed, 13 insertions(+), 13 deletions(-) Approvals: Cicalese: Verified; Looks good to me, approved diff --git a/roles/deploy_mw_host/tasks/configure_squid.yml b/roles/deploy_mw_host/tasks/configure_squid.yml index 48a4489..c7ad29d 100644 --- a/roles/deploy_mw_host/tasks/configure_squid.yml +++ b/roles/deploy_mw_host/tasks/configure_squid.yml @@ -23,14 +23,14 @@ src=squid.conf-el6.j2 dest=/etc/squid/squid.conf backup=yes - when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '6' + when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '6' - name: edit Squid configuration file template: src=squid.conf-el7.j2 dest=/etc/squid/squid.conf backup=yes - when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: configure Squid to start at boot service: diff --git a/roles/deploy_mw_host/templates/wikifarm.conf.j2 b/roles/deploy_mw_host/templates/wikifarm.conf.j2 index cdb0e0b..65b82e2 100644 --- a/roles/deploy_mw_host/templates/wikifarm.conf.j2 +++ b/roles/deploy_mw_host/templates/wikifarm.conf.j2 @@ -21,11 +21,11 @@ Include {{ APACHE_CONF_DIRECTORY }}/optional.conf Include {{ APACHE_CONF_DIRECTORY }}/http_redirect.conf -{% if (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '6' %} +{% if (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '6' %} Include {{ APACHE_INSTANCE_DIRECTORY }}/*.conf -{% elif (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' %} +{% elif (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' %} IncludeOptional {{ APACHE_INSTANCE_DIRECTORY }}/*.conf diff --git a/roles/setup/tasks/main.yml b/roles/setup/tasks/main.yml index 792c458..4f3b41c 100644 --- a/roles/setup/tasks/main.yml +++ b/roles/setup/tasks/main.yml @@ -8,54 +8,54 @@ yum: name=iptables-services state=latest - when: (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: install iptables if CentOS/RHEL 7 (2/3) shell: systemctl enable iptables - when: (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: install iptables if CentOS/RHEL 7 (3/3) shell: systemctl start iptables - when: (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: add MySQL repo (1/2) get_url: url=http://repo.mysql.com/mysql-community-release-el{{ ansible_distribution_major_version }}.rpm dest=/root/mysql-community-release-el{{ ansible_distribution_major_version }}.rpm validate_certs={{ VALIDATE_CERTS }} - when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' + when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' - name: add MySQL repo (2/2) shell: rpm -Uvh mysql-community-release-el{{ ansible_distribution_major_version }}.rpm args: chdir: /root ignore_errors: true - when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' + when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' - name: add epel repo (1/2) get_url: url=https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm dest=/root/epel-release-latest-{{
[MediaWiki-commits] [Gerrit] Remove errors when things look good - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284532 Change subject: Remove errors when things look good .. Remove errors when things look good Just a start, works with amount error individually or personal fields as a group. When we rewrite validation, we can remove personal field error messages individually. Bug: T112323 Change-Id: Ie23556ced899f3f0d7c63aad0396bbc4df00450b --- M gateway_common/gateway.adapter.php M gateway_forms/mustache/index.html.mustache M modules/js/ext.donationInterface.validation.js 3 files changed, 21 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/32/284532/1 diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index 609d7ef..2a5a653 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -3670,5 +3670,6 @@ public function setClientVariables( &$vars ) { $vars['wgDonationInterfacePriceFloor'] = $this->getGlobal( 'PriceFloor' ); $vars['wgDonationInterfacePriceCeiling'] = $this->getGlobal( 'PriceCeiling' ); + $vars['wgDonationInterfaceErrors'] = $this->getAllErrors(); } } diff --git a/gateway_forms/mustache/index.html.mustache b/gateway_forms/mustache/index.html.mustache index 309ca82..ea57e55 100644 --- a/gateway_forms/mustache/index.html.mustache +++ b/gateway_forms/mustache/index.html.mustache @@ -8,7 +8,7 @@ {{> no_script }} - {{# errors }}{{{ message }}}{{/ errors }} + {{# errors }}{{{ message }}}{{/ errors }} diff --git a/modules/js/ext.donationInterface.validation.js b/modules/js/ext.donationInterface.validation.js index 0ba984e..1fb9b7f 100644 --- a/modules/js/ext.donationInterface.validation.js +++ b/modules/js/ext.donationInterface.validation.js @@ -6,8 +6,25 @@ ( function ( $, mw ) { var di = mw.donationInterface = {}; + function validateAmount() { + var result = window.validateAmount(); + if ( result ) { + $( 'p.error[data-field=amount]' ).remove(); + } + return result; + } + + function validateForm() { + var result = window.validate_form(); + if ( result ) { + // Assuming all errors are fixed + $( 'p.error' ).remove(); + } + return result; + } + di.validation = { - validateAmount: window.validateAmount, - validateForm: window.validate_form + validateAmount: validateAmount, + validateForm: validateForm }; } )( jQuery, mediaWiki ); -- To view, visit https://gerrit.wikimedia.org/r/284532 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie23556ced899f3f0d7c63aad0396bbc4df00450b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] changed RHEL value in conditionals - change (mediawiki...ansible-wikifarm)
Cicalese has uploaded a new change for review. https://gerrit.wikimedia.org/r/284531 Change subject: changed RHEL value in conditionals .. changed RHEL value in conditionals Change-Id: Ie19409517286fd9785a4f4087817d6e7cafca95a --- M roles/deploy_mw_host/tasks/configure_squid.yml M roles/deploy_mw_host/templates/wikifarm.conf.j2 M roles/setup/tasks/main.yml 3 files changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/ansible-wikifarm refs/changes/31/284531/1 diff --git a/roles/deploy_mw_host/tasks/configure_squid.yml b/roles/deploy_mw_host/tasks/configure_squid.yml index 48a4489..c7ad29d 100644 --- a/roles/deploy_mw_host/tasks/configure_squid.yml +++ b/roles/deploy_mw_host/tasks/configure_squid.yml @@ -23,14 +23,14 @@ src=squid.conf-el6.j2 dest=/etc/squid/squid.conf backup=yes - when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '6' + when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '6' - name: edit Squid configuration file template: src=squid.conf-el7.j2 dest=/etc/squid/squid.conf backup=yes - when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: SQUID_HOSTNAME is defined and (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: configure Squid to start at boot service: diff --git a/roles/deploy_mw_host/templates/wikifarm.conf.j2 b/roles/deploy_mw_host/templates/wikifarm.conf.j2 index cdb0e0b..65b82e2 100644 --- a/roles/deploy_mw_host/templates/wikifarm.conf.j2 +++ b/roles/deploy_mw_host/templates/wikifarm.conf.j2 @@ -21,11 +21,11 @@ Include {{ APACHE_CONF_DIRECTORY }}/optional.conf Include {{ APACHE_CONF_DIRECTORY }}/http_redirect.conf -{% if (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '6' %} +{% if (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '6' %} Include {{ APACHE_INSTANCE_DIRECTORY }}/*.conf -{% elif (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' %} +{% elif (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' %} IncludeOptional {{ APACHE_INSTANCE_DIRECTORY }}/*.conf diff --git a/roles/setup/tasks/main.yml b/roles/setup/tasks/main.yml index 792c458..4f3b41c 100644 --- a/roles/setup/tasks/main.yml +++ b/roles/setup/tasks/main.yml @@ -8,54 +8,54 @@ yum: name=iptables-services state=latest - when: (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: install iptables if CentOS/RHEL 7 (2/3) shell: systemctl enable iptables - when: (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: install iptables if CentOS/RHEL 7 (3/3) shell: systemctl start iptables - when: (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux') and ansible_distribution_major_version == '7' + when: (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat') and ansible_distribution_major_version == '7' - name: add MySQL repo (1/2) get_url: url=http://repo.mysql.com/mysql-community-release-el{{ ansible_distribution_major_version }}.rpm dest=/root/mysql-community-release-el{{ ansible_distribution_major_version }}.rpm validate_certs={{ VALIDATE_CERTS }} - when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' + when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' - name: add MySQL repo (2/2) shell: rpm -Uvh mysql-community-release-el{{ ansible_distribution_major_version }}.rpm args: chdir: /root ignore_errors: true - when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' + when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' - name: add epel repo (1/2) get_url: url=https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version
[MediaWiki-commits] [Gerrit] lshell scaffolding for restricting Labs users - change (operations/puppet)
Rush has uploaded a new change for review. https://gerrit.wikimedia.org/r/284530 Change subject: lshell scaffolding for restricting Labs users .. lshell scaffolding for restricting Labs users Bug: T102395 Change-Id: Iece9c2fb54a9376e6d59ddcb4bc120f29d4efc58 --- A modules/lshell/manifests/init.pp A modules/lshell/templates/lshell.conf.erb 2 files changed, 126 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/30/284530/1 diff --git a/modules/lshell/manifests/init.pp b/modules/lshell/manifests/init.pp new file mode 100644 index 000..b2b2c16 --- /dev/null +++ b/modules/lshell/manifests/init.pp @@ -0,0 +1,61 @@ +# Limited shell environment +# +# * Anything that allows shelling out escapes +# * This is not a full shell replacment +# * Combine with @shell_override in nslcd.conf.erb +# +# === Parameters +# +# [*$allowed_cmds*] +# Whitelist of allowed interactive shell commands +# No specified commands will result in permissive +# +# [*$allowed_cmd_path*] +# Whitelist of all commands in an array of paths +# +# [*$forbidden*] +# Invalid characters +# +# [*$banner*] +# Display text upon login +# +# [*$overssh*] +# Noninteractive shell commands allowed +# +# [*$timer*] +# Session duration length allowed +# +# [*$path] +# Array of paths user is allowed to interact with +# +# [*$prompt] +# Shell prompt +# + +class lshell ( +$allowed_cmds = [], +$allowed_cmd_path = [], +$forbidden= ['&', '`','>','<', '$(', '${'], +$banner = 'This is a limited shell.', +$overssh = [], +$timer= 86400, +$path = ['/home'], +$prompt = '%u', +$exempt_grps = ['ops'], +) { + +# allowed_cmd_paths with permissive allowed_cmds +# is disingenious as it won't actually restrict +if empty($allowed_cmds) and !empty($allowed_cmd_path){ + fail("allowed_cmd_path will have no effect") +} + +package { 'lshell': ensure => present} + +file { '/etc/lshell.conf': +content => template('lshell/lshell.conf.erb'), +owner => root, +group => root, +mode=> 0444, +} +} diff --git a/modules/lshell/templates/lshell.conf.erb b/modules/lshell/templates/lshell.conf.erb new file mode 100644 index 000..e2a246b --- /dev/null +++ b/modules/lshell/templates/lshell.conf.erb @@ -0,0 +1,65 @@ +[global] + +[default] +intro = '<%= @banner %>\n' +timer = <%= @timer %> +login_script : '' + +# example: %u@%h +prompt : "<%= @prompt %>" +prompt_short: 0 + +history_size : 100 +history_file : "/home/%u/.lshell_history" + + +# count invalid commands and terminate on this count +# -1 disables +warning_counter : -1 +# set to 1 to count forbidden commands for enforcement +# 0 disables and only warns as "*** unknown syntax" +strict : 0 + + +aliases : {'ll':'ls -l', + 'vim':'rvim'} + +# These are paths the user can access +path : [ +<% @path.each do |p| -%> + '<%= p %>', +<% end -%> + ] + +sudo_commands : [''] + +# include all commands as allowed in $path +allowed_cmd_path : [ +<% @allowed_cmd_path.each do |cpath| -%> + '<%= cpath %>', +<% end -%> + ] + +# command whitelist +<% if @allowed_cmds.empty? %> +allowed: 'all' +<% else %> +allowed : [ +<% @allowed_cmds.each do |cmd| -%> + '<%= cmd %>', +<% end -%> + ] +<% end -%> + +forbidden : [ +<% @forbidden.each do |cmd| -%> + '<%= cmd %>', +<% end -%> + ] + +# allow users in some groups to issue all commands +<% @exempt_grps.each do |group| -%> +[grp:<%= group -%>] +intro = '\n<%= group -%>: lshell standard user shell except all commands available.\n' +allowed: 'all' +<% end -%> -- To view, visit https://gerrit.wikimedia.org/r/284530 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iece9c2fb54a9376e6d59ddcb4bc120f29d4efc58 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Rush___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ButtonWidget: Implement, document and demonstrate the 'activ... - change (oojs/ui)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/284529 Change subject: ButtonWidget: Implement, document and demonstrate the 'active' config option .. ButtonWidget: Implement, document and demonstrate the 'active' config option ButtonWidget can now be marked as active (`active: true`) to indicate that clicking the button will only refresh the current page. This is meant to be used in navigation menus shaped like buttons in PHP. The JavaScript ButtonWidget was also updated to match, though. PHP ButtonWidget has gained two new methods: setActive() and isActive(). In JavaScript, they were already implemented on ButtonElement, because they are used in implementation details of ButtonOptionWidget and ToggleButtonWidget (and because moving them elsewhere would break backwards compatibility). Marked them as @protected on ButtonElement now, and @public on ButtonWidget. Change-Id: I088c2cc1cbd498046fad4238af1fdad0f3d7467f --- M demos/demos.php M php/widgets/ButtonWidget.php M src/mixins/ButtonElement.js M src/widgets/ButtonWidget.js 4 files changed, 58 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/29/284529/1 diff --git a/demos/demos.php b/demos/demos.php index d09aae8..8d8b8dd 100644 --- a/demos/demos.php +++ b/demos/demos.php @@ -56,10 +56,12 @@ new OOUI\ButtonWidget( array( 'label' => 'MediaWiki', 'href' => '?' . http_build_query( array_merge( $query, array( 'theme' => 'mediawiki' ) ) ), + 'active' => $query['theme'] === 'mediawiki', ) ), new OOUI\ButtonWidget( array( 'label' => 'Apex', 'href' => '?' . http_build_query( array_merge( $query, array( 'theme' => 'apex' ) ) ), + 'active' => $query['theme'] === 'apex', ) ), ) ) ); @@ -69,10 +71,12 @@ new OOUI\ButtonWidget( array( 'label' => 'LTR', 'href' => '?' . http_build_query( array_merge( $query, array( 'direction' => 'ltr' ) ) ), + 'active' => $query['direction'] === 'ltr', ) ), new OOUI\ButtonWidget( array( 'label' => 'RTL', 'href' => '?' . http_build_query( array_merge( $query, array( 'direction' => 'rtl' ) ) ), + 'active' => $query['direction'] === 'rtl', ) ), ) ) ); @@ -83,10 +87,12 @@ new OOUI\ButtonWidget( array( 'label' => 'JS', 'href' => ".#$page-$theme-$direction", + 'active' => false, ) ), new OOUI\ButtonWidget( array( 'label' => 'PHP', 'href' => '?' . http_build_query( $query ), + 'active' => true, ) ), ) ) ); diff --git a/php/widgets/ButtonWidget.php b/php/widgets/ButtonWidget.php index 18fe6df..1ae97aa 100644 --- a/php/widgets/ButtonWidget.php +++ b/php/widgets/ButtonWidget.php @@ -16,6 +16,13 @@ use AccessKeyedElement; /** +* Whether button is active. +* +* @var boolean +*/ + protected $active = false; + + /** * Hyperlink to visit when clicked. * * @var string @@ -40,6 +47,7 @@ /** * @param array $config Configuration options +* @param string $config['active'] Whether button should be shown as active (default: false) * @param string $config['href'] Hyperlink to visit when clicked *
[MediaWiki-commits] [Gerrit] Pretty up the test suite - change (mediawiki...TemplateStyles)
jenkins-bot has submitted this change and it was merged. Change subject: Pretty up the test suite .. Pretty up the test suite Add some comments and tweak the formatting of the test suite. Some things that were hardcoded can now be tweaked by the parse->render->verify tests if desired. Change-Id: I36abc9fa2b9971d6b92d5714c4583dea6ad26b88 --- M tests/CSSParseRenderTest.php 1 file changed, 222 insertions(+), 214 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/CSSParseRenderTest.php b/tests/CSSParseRenderTest.php index 3ebff59..c6ac683 100644 --- a/tests/CSSParseRenderTest.php +++ b/tests/CSSParseRenderTest.php @@ -5,233 +5,241 @@ */ class CSSParseRenderTest extends MediaWikiTestCase { - protected function setUp() { - parent::setUp(); - } - - public static function provideCSSParser() { - return [ - [ 'test' => 'Bare declaration', - 'expect' => '', - 'css' => << 'Blacklisted property', - 'expect' => '.X .sel {good:123;} ', - 'css' => << 'Case insensivity', - 'expect' => '@media screen { .X .sel1 {prop:WhiteListed(foo);} } ', - 'css' => << 'Comment trickery', - 'expect' => '.X .sel1 {} .X .sel2 .sel3 {prop3:val3;} ', - 'css' => << 'Complex selectors', - 'expect' => '.X .sel1[foo=\'ba{r\'] #id a.foo::hover {prop1:val1;} ', - 'css' => << 'Edge cases', - 'expect' => '.X :sel {} ', - 'css' => << 'Function in function', - 'expect' => '.X .sel1 {} ', - 'css' => << 'Incomplete rule', - 'expect' => '.X .sel {prop:val;} ', - 'css' => << 'Media block', - 'expect' => '.X .sel2 {prop2:val2;} @media print { .X .sel1 {prop1:val1;} } ', - 'css' => << 'Multiple rules', - 'expect' => '.X .sel1 A {prop1:val1;} .X T.sel2 {prop2:val2;} ', - 'css' => << 'Multiple selectors', - 'expect' => '.X .sel1,.X TD .sel2["a,comma"],.X #id {prop:val;} ', - 'css' => << 'No selector', - 'expect' => '{prop1:val1;} ', - 'css' => << 'Not a declaration', - 'expect' => '.X .sel {prop:val;} ', - 'css' => << 'Obfuscated properties', - 'expect' => '.X .sel {good:val2;} ', - 'css' => << 'Rule within rule', - 'expect' => '.X .sel1 {prop1:val1;} .X .sel3 {prop4:val4;} ', - 'css' => << 'String literals', - 'expect' => '.X .sel {prop1:\'val1\';prop3:"v/**/al\"3";bad:"broken" ;} ', - 'css' => << 'Unsupported block', - 'expect' => '.X .sel {prop2:val2;} ', - 'css' => << 'Unwhitelisted function', - 'expect' => '.X .sel {prop1:whitelisted(val1);} ', - 'css' => << 'Values', - 'expect' => '.X .sel {prop:1em .5px 12% #FFF;} ', - 'css' => << 'Whitespace', - 'expect' => '.X .sel1 #id{prop2:whitelisted ( val2 ) ;prop3:not whitelisted( val3 );} ', - 'css' => <rules( $baseSelector ); if ( !$rules ) { - $this->fail( "$test: Stylesheet did not parse." ); - return; + $this->fail( "Failed to parse $source" ); } $r = new CSSRenderer(); $r->add( $rules ); - $css = $r->render( [ "whitelisted" ], [ "-evil" ] ); + $css = $r->render( $functionWhitelist, $propertyBlacklist ); $this->assertEquals( $expect, - preg_replace( '/[ \t\n]+/', ' ', $css ), - "$test: parse did not return expected output." + // Normalize whitespace inherited from the heredocs + preg_replace( '/[ \t\n]+/', ' ', $css ) ); - } + /** +* @see testRendererAfterParse +*/ + public function provideRendererAfterParse() { +
[MediaWiki-commits] [Gerrit] Ignore local Composer artifacts - change (mediawiki...TemplateStyles)
jenkins-bot has submitted this change and it was merged. Change subject: Ignore local Composer artifacts .. Ignore local Composer artifacts Change-Id: Id88d177a43f7be4932fd774c519498871b42944e --- A .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..ff72e2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/composer.lock +/vendor -- To view, visit https://gerrit.wikimedia.org/r/284522 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id88d177a43f7be4932fd774c519498871b42944e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TemplateStyles Gerrit-Branch: master Gerrit-Owner: BryanDavisGerrit-Reviewer: Jforrester Gerrit-Reviewer: coren Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] PHP ButtonElement: Fix toggleFramed() to actually be chainable - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: PHP ButtonElement: Fix toggleFramed() to actually be chainable .. PHP ButtonElement: Fix toggleFramed() to actually be chainable Change-Id: Iedb970a8ea84173e2f8865880f666a1b9d1d87d3 --- M php/mixins/ButtonElement.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/php/mixins/ButtonElement.php b/php/mixins/ButtonElement.php index 875144f..671ebb5 100644 --- a/php/mixins/ButtonElement.php +++ b/php/mixins/ButtonElement.php @@ -61,6 +61,7 @@ $this->framed = $framed !== null ? !!$framed : !$this->framed; $this->toggleClasses( [ 'oo-ui-buttonElement-framed' ], $this->framed ); $this->toggleClasses( [ 'oo-ui-buttonElement-frameless' ], !$this->framed ); + return $this; } /** -- To view, visit https://gerrit.wikimedia.org/r/284523 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iedb970a8ea84173e2f8865880f666a1b9d1d87d3 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Bartosz DziewońskiGerrit-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] wfTempDir try harder to get a tmp dir on Windows - change (mediawiki/core)
Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/284528 Change subject: wfTempDir try harder to get a tmp dir on Windows .. wfTempDir try harder to get a tmp dir on Windows Change-Id: If6f93ed50dfd93a1ffe046218058674a2197a626 --- M includes/GlobalFunctions.php 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/28/284528/1 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5c42bc2..7332db8 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2120,6 +2120,21 @@ return $tmp; } } + + /** +* PHP on Windows will detect C:\Windows\Temp as not writable even though PHP can write to it +* so create a directory within that PHP will detect as writable and use that. +*/ + if ( isset( $_SERVER['windir'] ) ) { + $tmp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'mwtmp'; + if ( !file_exists( $tmp ) ) { + mkdir( $tmp ); + } + if ( file_exists( $tmp ) && is_dir( $tmp ) && is_writable( $tmp ) ) { + return $tmp; + } + } + throw new MWException( 'No writable temporary directory could be found. ' . 'Please set $wgTmpDirectory to a writable directory.' ); } -- To view, visit https://gerrit.wikimedia.org/r/284528 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6f93ed50dfd93a1ffe046218058674a2197a626 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Addshore___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Topmost: Minor follow-up to add fallback for missing topmost... - change (mediawiki...Flow)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/284524 Change subject: Topmost: Minor follow-up to add fallback for missing topmost post ID .. Topmost: Minor follow-up to add fallback for missing topmost post ID It shouldn't fail to calculate the topmost, but just in case, handle this gracefully. Bug: T126264 Change-Id: I6c544e174d101924333c4e7aa1af64068540de11 --- M includes/Notifications/PostReplyPresentationModel.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/24/284524/1 diff --git a/includes/Notifications/PostReplyPresentationModel.php b/includes/Notifications/PostReplyPresentationModel.php index 4d160ad..ac300da 100644 --- a/includes/Notifications/PostReplyPresentationModel.php +++ b/includes/Notifications/PostReplyPresentationModel.php @@ -26,7 +26,8 @@ $notificationController = Container::get( 'controller.notification' ); $firstChronologicallyEvent = end( $bundledEvents ); $firstChronologicallyPostId = $firstChronologicallyEvent->getExtraParam( 'post-id' ); - $topmostPostID = $notificationController->getTopmostPostId( $bundledEvents ); + $topmostPostID = $notificationController->getTopmostPostId( $bundledEvents ) ?: + $firstChronologicallyPostId; } else { $event = $this->event; -- To view, visit https://gerrit.wikimedia.org/r/284524 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c544e174d101924333c4e7aa1af64068540de11 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] PHP ButtonElement: Fix toggleFramed() to actually be chainable - change (oojs/ui)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/284523 Change subject: PHP ButtonElement: Fix toggleFramed() to actually be chainable .. PHP ButtonElement: Fix toggleFramed() to actually be chainable Change-Id: Iedb970a8ea84173e2f8865880f666a1b9d1d87d3 --- M php/mixins/ButtonElement.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/23/284523/1 diff --git a/php/mixins/ButtonElement.php b/php/mixins/ButtonElement.php index 875144f..671ebb5 100644 --- a/php/mixins/ButtonElement.php +++ b/php/mixins/ButtonElement.php @@ -61,6 +61,7 @@ $this->framed = $framed !== null ? !!$framed : !$this->framed; $this->toggleClasses( [ 'oo-ui-buttonElement-framed' ], $this->framed ); $this->toggleClasses( [ 'oo-ui-buttonElement-frameless' ], !$this->framed ); + return $this; } /** -- To view, visit https://gerrit.wikimedia.org/r/284523 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iedb970a8ea84173e2f8865880f666a1b9d1d87d3 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui 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] Correct the vlan used for nova-network on labtest. - change (operations/puppet)
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/284520 Change subject: Correct the vlan used for nova-network on labtest. .. Correct the vlan used for nova-network on labtest. Change-Id: I0e33dab51371e8edb1f2f43664b6b741eb937ace --- M hieradata/codfw/labtest.yaml 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/20/284520/1 diff --git a/hieradata/codfw/labtest.yaml b/hieradata/codfw/labtest.yaml index 9d9251c..f296902 100644 --- a/hieradata/codfw/labtest.yaml +++ b/hieradata/codfw/labtest.yaml @@ -53,10 +53,10 @@ libvirt_type: 'kvm' my_ip: "%{::ipaddress_eth0}" network_public_interface: 'eth0' - network_flat_interface: 'eth1.1102' + network_flat_interface: 'eth1.2102' network_flat_tagged_base_interface: 'eth1' - network_flat_interface_vlan: '1102' - flat_network_bridge: 'br1102' + network_flat_interface_vlan: '2102' + flat_network_bridge: 'br2102' fixed_range: '10.196.16.0/21' dhcp_start: '10.196.16.4' network_public_ip: '208.80.155.255' -- To view, visit https://gerrit.wikimedia.org/r/284520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e33dab51371e8edb1f2f43664b6b741eb937ace Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add unit tests for CSSParse and CSSRender - change (mediawiki...TemplateStyles)
jenkins-bot has submitted this change and it was merged. Change subject: Add unit tests for CSSParse and CSSRender .. Add unit tests for CSSParse and CSSRender Test the roundtrip on a collection of correct and pathological stylesheets to ascertain whether the parse is behaving as expected. Bug: T483 Change-Id: I484cc856b5696c1fa6265769320f79853365e1d6 --- M TemplateStyles.hooks.php M extension.json A tests/CSSParseRenderTest.php 3 files changed, 245 insertions(+), 0 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/TemplateStyles.hooks.php b/TemplateStyles.hooks.php index 9a0c0c7..b75e356 100644 --- a/TemplateStyles.hooks.php +++ b/TemplateStyles.hooks.php @@ -15,6 +15,11 @@ return true; } + public static function onUnitTestsList( &$paths ) { + $paths[] = __DIR__ . '/tests/phpunit/'; + return true; + } + private static function decodeFromBlob( $blob ) { $tree = gzdecode( $blob ); if ( $tree ) { diff --git a/extension.json b/extension.json index 3e0f3e0..13f787a 100644 --- a/extension.json +++ b/extension.json @@ -36,6 +36,9 @@ ], "OutputPageParserOutput": [ "TemplateStylesHooks::onOutputPageParserOutput" + ], + "UnitTestList": [ + "TemplateStyleHooks::onUnitTestList" ] } } diff --git a/tests/CSSParseRenderTest.php b/tests/CSSParseRenderTest.php new file mode 100644 index 000..3ebff59 --- /dev/null +++ b/tests/CSSParseRenderTest.php @@ -0,0 +1,237 @@ + 'Bare declaration', + 'expect' => '', + 'css' => << 'Blacklisted property', + 'expect' => '.X .sel {good:123;} ', + 'css' => << 'Case insensivity', + 'expect' => '@media screen { .X .sel1 {prop:WhiteListed(foo);} } ', + 'css' => << 'Comment trickery', + 'expect' => '.X .sel1 {} .X .sel2 .sel3 {prop3:val3;} ', + 'css' => << 'Complex selectors', + 'expect' => '.X .sel1[foo=\'ba{r\'] #id a.foo::hover {prop1:val1;} ', + 'css' => << 'Edge cases', + 'expect' => '.X :sel {} ', + 'css' => << 'Function in function', + 'expect' => '.X .sel1 {} ', + 'css' => << 'Incomplete rule', + 'expect' => '.X .sel {prop:val;} ', + 'css' => << 'Media block', + 'expect' => '.X .sel2 {prop2:val2;} @media print { .X .sel1 {prop1:val1;} } ', + 'css' => << 'Multiple rules', + 'expect' => '.X .sel1 A {prop1:val1;} .X T.sel2 {prop2:val2;} ', + 'css' => << 'Multiple selectors', + 'expect' => '.X .sel1,.X TD .sel2["a,comma"],.X #id {prop:val;} ', + 'css' => << 'No selector', + 'expect' => '{prop1:val1;} ', + 'css' => << 'Not a declaration', + 'expect' => '.X .sel {prop:val;} ', + 'css' => << 'Obfuscated properties', + 'expect' => '.X .sel {good:val2;} ', + 'css' => << 'Rule within rule', + 'expect' => '.X .sel1 {prop1:val1;} .X .sel3 {prop4:val4;} ', + 'css' => << 'String literals', + 'expect' => '.X .sel {prop1:\'val1\';prop3:"v/**/al\"3";bad:"broken" ;} ', + 'css' => << 'Unsupported block', + 'expect' => '.X .sel {prop2:val2;} ', + 'css' => << 'Unwhitelisted function', + 'expect' => '.X .sel {prop1:whitelisted(val1);} ', + 'css' => << 'Values', + 'expect' => '.X .sel {prop:1em .5px 12% #FFF;} ', + 'css' => << 'Whitespace', + 'expect' => '.X .sel1 #id{prop2:whitelisted ( val2 ) ;prop3:not whitelisted( val3 );} ', + 'css' => <fail( "$test: Stylesheet did not parse." ); + return; + } + + $r = new CSSRenderer(); + $r->add( $rules ); + $css = $r->render( [ "whitelisted" ], [ "-evil" ] );
[MediaWiki-commits] [Gerrit] Ignore local Composer artifacts - change (mediawiki...TemplateStyles)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/284522 Change subject: Ignore local Composer artifacts .. Ignore local Composer artifacts Change-Id: Id88d177a43f7be4932fd774c519498871b42944e --- A .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateStyles refs/changes/22/284522/1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..ff72e2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/composer.lock +/vendor -- To view, visit https://gerrit.wikimedia.org/r/284522 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id88d177a43f7be4932fd774c519498871b42944e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TemplateStyles Gerrit-Branch: master Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Pretty up the test suite - change (mediawiki...TemplateStyles)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/284521 Change subject: Pretty up the test suite .. Pretty up the test suite Add some comments and tweak the formatting of the test suite. Some things that were hardcoded can now be tweaked by the parse->render->verify tests if desired. Change-Id: I36abc9fa2b9971d6b92d5714c4583dea6ad26b88 --- M tests/CSSParseRenderTest.php 1 file changed, 222 insertions(+), 214 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateStyles refs/changes/21/284521/1 diff --git a/tests/CSSParseRenderTest.php b/tests/CSSParseRenderTest.php index 3ebff59..c6ac683 100644 --- a/tests/CSSParseRenderTest.php +++ b/tests/CSSParseRenderTest.php @@ -5,233 +5,241 @@ */ class CSSParseRenderTest extends MediaWikiTestCase { - protected function setUp() { - parent::setUp(); - } - - public static function provideCSSParser() { - return [ - [ 'test' => 'Bare declaration', - 'expect' => '', - 'css' => << 'Blacklisted property', - 'expect' => '.X .sel {good:123;} ', - 'css' => << 'Case insensivity', - 'expect' => '@media screen { .X .sel1 {prop:WhiteListed(foo);} } ', - 'css' => << 'Comment trickery', - 'expect' => '.X .sel1 {} .X .sel2 .sel3 {prop3:val3;} ', - 'css' => << 'Complex selectors', - 'expect' => '.X .sel1[foo=\'ba{r\'] #id a.foo::hover {prop1:val1;} ', - 'css' => << 'Edge cases', - 'expect' => '.X :sel {} ', - 'css' => << 'Function in function', - 'expect' => '.X .sel1 {} ', - 'css' => << 'Incomplete rule', - 'expect' => '.X .sel {prop:val;} ', - 'css' => << 'Media block', - 'expect' => '.X .sel2 {prop2:val2;} @media print { .X .sel1 {prop1:val1;} } ', - 'css' => << 'Multiple rules', - 'expect' => '.X .sel1 A {prop1:val1;} .X T.sel2 {prop2:val2;} ', - 'css' => << 'Multiple selectors', - 'expect' => '.X .sel1,.X TD .sel2["a,comma"],.X #id {prop:val;} ', - 'css' => << 'No selector', - 'expect' => '{prop1:val1;} ', - 'css' => << 'Not a declaration', - 'expect' => '.X .sel {prop:val;} ', - 'css' => << 'Obfuscated properties', - 'expect' => '.X .sel {good:val2;} ', - 'css' => << 'Rule within rule', - 'expect' => '.X .sel1 {prop1:val1;} .X .sel3 {prop4:val4;} ', - 'css' => << 'String literals', - 'expect' => '.X .sel {prop1:\'val1\';prop3:"v/**/al\"3";bad:"broken" ;} ', - 'css' => << 'Unsupported block', - 'expect' => '.X .sel {prop2:val2;} ', - 'css' => << 'Unwhitelisted function', - 'expect' => '.X .sel {prop1:whitelisted(val1);} ', - 'css' => << 'Values', - 'expect' => '.X .sel {prop:1em .5px 12% #FFF;} ', - 'css' => << 'Whitespace', - 'expect' => '.X .sel1 #id{prop2:whitelisted ( val2 ) ;prop3:not whitelisted( val3 );} ', - 'css' => <rules( $baseSelector ); if ( !$rules ) { - $this->fail( "$test: Stylesheet did not parse." ); - return; + $this->fail( "Failed to parse $source" ); } $r = new CSSRenderer(); $r->add( $rules ); - $css = $r->render( [ "whitelisted" ], [ "-evil" ] ); + $css = $r->render( $functionWhitelist, $propertyBlacklist ); $this->assertEquals( $expect, - preg_replace( '/[ \t\n]+/', ' ', $css ), - "$test: parse did not return expected output." + // Normalize whitespace inherited from the heredocs + preg_replace( '/[ \t\n]+/', ' ', $css ) ); - } + /** +* @see testRendererAfterParse +*/ +
[MediaWiki-commits] [Gerrit] Correct the vlan used for nova-network on labtest. - change (operations/puppet)
Andrew Bogott has submitted this change and it was merged. Change subject: Correct the vlan used for nova-network on labtest. .. Correct the vlan used for nova-network on labtest. Change-Id: I0e33dab51371e8edb1f2f43664b6b741eb937ace --- M hieradata/codfw/labtest.yaml 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved Rush: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/hieradata/codfw/labtest.yaml b/hieradata/codfw/labtest.yaml index 9d9251c..f296902 100644 --- a/hieradata/codfw/labtest.yaml +++ b/hieradata/codfw/labtest.yaml @@ -53,10 +53,10 @@ libvirt_type: 'kvm' my_ip: "%{::ipaddress_eth0}" network_public_interface: 'eth0' - network_flat_interface: 'eth1.1102' + network_flat_interface: 'eth1.2102' network_flat_tagged_base_interface: 'eth1' - network_flat_interface_vlan: '1102' - flat_network_bridge: 'br1102' + network_flat_interface_vlan: '2102' + flat_network_bridge: 'br2102' fixed_range: '10.196.16.0/21' dhcp_start: '10.196.16.4' network_public_ip: '208.80.155.255' -- To view, visit https://gerrit.wikimedia.org/r/284520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e33dab51371e8edb1f2f43664b6b741eb937ace Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Chasemp Gerrit-Reviewer: Rush Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert "[PerformanceInspector] Register extension" - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Revert "[PerformanceInspector] Register extension" .. Revert "[PerformanceInspector] Register extension" Until Jenkins works for this extension This reverts commit 7c542385311af0bfe9b5a814119d6a13ab2dc7d1. Change-Id: If7644362891dac37286413f91657fc3eb2f6c846 --- M groups/MediaWiki/mediawiki-extensions.txt 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Raimond Spekking: Looks good to me, approved jenkins-bot: Verified diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index e4ef9a6..56c016e 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -1853,8 +1853,6 @@ Per Page License -Performance Inspector - Persona aliasfile = Persona/Persona.i18n.alias.php -- To view, visit https://gerrit.wikimedia.org/r/284519 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7644362891dac37286413f91657fc3eb2f6c846 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Raimond SpekkingGerrit-Reviewer: Raimond Spekking Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Beta: fix tagline appearance - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: Beta: fix tagline appearance .. Beta: fix tagline appearance * Increase the font size; * Change the margins. Bug: T132199 Change-Id: I474307348fc249744d0966067425549d0af3bf60 --- M resources/skins.minerva.base.styles/pageactions.less 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/skins.minerva.base.styles/pageactions.less b/resources/skins.minerva.base.styles/pageactions.less index eb72435..479ab4f 100644 --- a/resources/skins.minerva.base.styles/pageactions.less +++ b/resources/skins.minerva.base.styles/pageactions.less @@ -23,8 +23,8 @@ .tagline { color: @colorGray5; - font-size: 0.8em; - margin: 10px 0; + font-size: .85em; + margin: 7px 0 10px 0; &:first-letter { text-transform: capitalize; -- To view, visit https://gerrit.wikimedia.org/r/282402 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I474307348fc249744d0966067425549d0af3bf60 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: BmansurovGerrit-Reviewer: Bmansurov Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Phuedx Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert "[PerformanceInspector] Register extension" - change (translatewiki)
Raimond Spekking has uploaded a new change for review. https://gerrit.wikimedia.org/r/284519 Change subject: Revert "[PerformanceInspector] Register extension" .. Revert "[PerformanceInspector] Register extension" Until Jenkins works for this extension This reverts commit 7c542385311af0bfe9b5a814119d6a13ab2dc7d1. Change-Id: If7644362891dac37286413f91657fc3eb2f6c846 --- M groups/MediaWiki/mediawiki-extensions.txt 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/19/284519/1 diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index e4ef9a6..56c016e 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -1853,8 +1853,6 @@ Per Page License -Performance Inspector - Persona aliasfile = Persona/Persona.i18n.alias.php -- To view, visit https://gerrit.wikimedia.org/r/284519 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7644362891dac37286413f91657fc3eb2f6c846 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Raimond Spekking___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow viewing all ref type commits - change (phabricator/phabricator)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/284517 Change subject: Allow viewing all ref type commits .. Allow viewing all ref type commits This allows us to view ref types such as refs/changes and refs/meta since we use gerrit where we have the repo's but we carn't currently view all commit since some are open and stored in refs/changes which phabricator dosen't view yet, with this patch it lets us view those commits. Change-Id: I7f8205651f717e98271f6f18c37730955f953d68 --- M src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php M src/applications/repository/engine/PhabricatorRepositoryPullEngine.php 2 files changed, 70 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/phabricator/phabricator refs/changes/17/284517/1 diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php index 1f17f5f..08d9e2d 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php @@ -43,6 +43,10 @@ $prefixes[] = 'refs/tags/'; } +if (!$this->isTag) { + $prefixes[] = 'refs/meta/'; +} + $order = '-creatordate'; $futures = array(); @@ -55,6 +59,7 @@ } // Resolve all the futures first. We want to iterate over them in prefix + // order, not resolution order. foreach (new FutureIterator($futures) as $prefix => $future) { $future->resolvex(); @@ -63,7 +68,6 @@ $results = array(); foreach ($futures as $prefix => $future) { list($stdout) = $future->resolvex(); - $stdout = rtrim($stdout); if (!strlen($stdout)) { continue; @@ -103,7 +107,70 @@ } } -return $results; +$prefixes_custom = array(); + +if (!$this->isTag) { + $prefixes_custom[] = 'refs/changes/'; +} + +$futures_custom = array(); +foreach ($prefixes_custom as $prefix_custom) { + $futures_custom['refs/'] = $repository->getLocalCommandFuture( +'for-each-ref --sort=%s --format=%s %s', +$order, +$this->getFormatString(), +$prefix_custom); +} + +// Resolve all the futures first. We want to iterate over them in prefix +// order, not resolution order. +foreach (new FutureIterator($futures_custom) as $prefix_custom => $future_custom) { + $future_custom->resolvex(); +} + +foreach ($futures_custom as $prefix_custom => $future_custom) { + list($stdout) = $future_custom->resolvex(); + + $stdout = rtrim($stdout); + if (!strlen($stdout)) { +continue; + } + + // NOTE: Although git supports --count, we can't apply any offset or + // limit logic until the very end because we may encounter a HEAD which + // we want to discard. + + $lines = explode("\5", $stdout); + $lines = array_filter($lines); + foreach ($lines as $line) { +$fields = $this->extractFields($line); + +$creator = $fields['creator']; +$matches = null; +if (preg_match('/^(.*) ([0-9]+) ([0-9+-]+)$/', $creator, $matches)) { + $fields['author'] = $matches[1]; + $fields['epoch'] = (int)$matches[2]; +} else { + $fields['author'] = null; + $fields['epoch'] = null; +} + +$commit = nonempty($fields['*objectname'], $fields['objectname']); + +$short = substr($fields['refname'], strlen($prefix_custom)); +if ($short == 'HEAD') { + continue; +} + +$ref = id(new DiffusionRepositoryRef()) + ->setShortName($short) + ->setCommitIdentifier($commit) + ->setRawFields($fields); + +$results[] = $ref; + } +} + return $results; } /** diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php index 690f942..3fbbd53 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php @@ -314,7 +314,7 @@ // For bare working copies, we need this magic incantation. $future = $repository->getRemoteCommandFuture( 'fetch origin %s --prune', - '+refs/heads/*:refs/heads/*'); + '+refs/*:refs/*'); } else { $future = $repository->getRemoteCommandFuture( 'fetch --all --prune'); -- To view, visit https://gerrit.wikimedia.org/r/284517 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f8205651f717e98271f6f18c37730955f953d68 Gerrit-PatchSet: 1 Gerrit-Project: phabricator/phabricator Gerrit-Branch: wmf/dev Gerrit-Owner: Paladox
[MediaWiki-commits] [Gerrit] ssl_ciphersuite: autodetect apache, too - change (operations/puppet)
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/284518 Change subject: ssl_ciphersuite: autodetect apache, too .. ssl_ciphersuite: autodetect apache, too This worked for nginx, do it for apache versioning too and refactor things around that. This way we don't forget to update the ssl_ciphersuite() server during jessie upgrades and such. Change-Id: I851580f72a9d38b5fed92a5f706151d04912e745 --- M manifests/role/icinga.pp M manifests/role/requesttracker.pp M manifests/role/servermon.pp M manifests/role/tendril.pp M modules/ganglia/manifests/web.pp M modules/gerrit/manifests/proxy.pp M modules/librenms/manifests/web.pp M modules/mailman/manifests/webui.pp M modules/puppetmaster/manifests/passenger.pp M modules/role/manifests/labs/openstack/nova.pp M modules/statistics/manifests/web.pp M modules/toolserver_legacy/manifests/init.pp M modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb 13 files changed, 33 insertions(+), 40 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/18/284518/1 diff --git a/manifests/role/icinga.pp b/manifests/role/icinga.pp index 84cf8b1..8e9f88a 100644 --- a/manifests/role/icinga.pp +++ b/manifests/role/icinga.pp @@ -41,7 +41,7 @@ include icinga::ircbot } -$ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365') +$ssl_settings = ssl_ciphersuite('apache', 'compat', '365') sslcert::certificate { 'icinga.wikimedia.org': } monitoring::service { 'https': diff --git a/manifests/role/requesttracker.pp b/manifests/role/requesttracker.pp index b863f41..c096757 100644 --- a/manifests/role/requesttracker.pp +++ b/manifests/role/requesttracker.pp @@ -7,7 +7,7 @@ sslcert::certificate { 'rt.wikimedia.org': } -$ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365') +$ssl_settings = ssl_ciphersuite('apache', 'compat', '365') class { '::requesttracker': apache_site => 'rt.wikimedia.org', diff --git a/manifests/role/servermon.pp b/manifests/role/servermon.pp index fee7108..8ed5cb0 100644 --- a/manifests/role/servermon.pp +++ b/manifests/role/servermon.pp @@ -31,7 +31,7 @@ include passwords::ldap::wmf_cluster $proxypass = $passwords::ldap::wmf_cluster::proxypass -$ssl_settings = ssl_ciphersuite('apache-2.2', 'compat') +$ssl_settings = ssl_ciphersuite('apache', 'compat') class { '::servermon': ensure => 'present', diff --git a/manifests/role/tendril.pp b/manifests/role/tendril.pp index 6e7038c..e2b8861 100644 --- a/manifests/role/tendril.pp +++ b/manifests/role/tendril.pp @@ -6,7 +6,7 @@ system::role { 'role::tendril': description => 'tendril server' } sslcert::certificate { 'tendril.wikimedia.org': } -$ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365') +$ssl_settings = ssl_ciphersuite('apache', 'compat', '365') monitoring::service { 'https-tendril': description => 'HTTPS-tendril', diff --git a/modules/ganglia/manifests/web.pp b/modules/ganglia/manifests/web.pp index e29a6d4..66d7bd8 100644 --- a/modules/ganglia/manifests/web.pp +++ b/modules/ganglia/manifests/web.pp @@ -15,7 +15,7 @@ $ganglia_ssl_cert = '/etc/ssl/localcerts/ganglia.wikimedia.org.crt' $ganglia_ssl_chain = '/etc/ssl/localcerts/ganglia.wikimedia.org.chain.crt' $ganglia_ssl_key = '/etc/ssl/private/ganglia.wikimedia.org.key' -$ssl_settings = ssl_ciphersuite('apache-2.4', 'compat', '365') +$ssl_settings = ssl_ciphersuite('apache', 'compat', '365') # Apache's docroot. Used for populating robots.txt $doc_root = '/var/www' diff --git a/modules/gerrit/manifests/proxy.pp b/modules/gerrit/manifests/proxy.pp index 79930bd..65621b8 100644 --- a/modules/gerrit/manifests/proxy.pp +++ b/modules/gerrit/manifests/proxy.pp @@ -2,7 +2,7 @@ $ssl_cert= '', $ssl_cert_key= '') { -$ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365') +$ssl_settings = ssl_ciphersuite('apache', 'compat', '365') apache::site { 'gerrit.wikimedia.org': content => template('gerrit/gerrit.wikimedia.org.erb'), diff --git a/modules/librenms/manifests/web.pp b/modules/librenms/manifests/web.pp index 3bc5197..4599d07 100644 --- a/modules/librenms/manifests/web.pp +++ b/modules/librenms/manifests/web.pp @@ -7,11 +7,7 @@ include ::apache::mod::ssl -if os_version('debian >= jessie || ubuntu >= trusty') { -$ssl_settings = ssl_ciphersuite('apache-2.4', 'compat', '365') -} else { -$ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365') -} +$ssl_settings = ssl_ciphersuite('apache', 'compat', '365') apache::site { $sitename: content => template('librenms/apache.conf.erb'), diff --git a/modules/mailman/manifests/webui.pp b/modules/mailman/manifests/webui.pp index 4a3ff3e..cabbe72 100644 --- a/modules/mailman/manifests/webui.pp +++
[MediaWiki-commits] [Gerrit] Set db1031 as the local eqiad master and set it to ROW binlog - change (operations/puppet)
Jcrespo has submitted this change and it was merged. Change subject: Set db1031 as the local eqiad master and set it to ROW binlog .. Set db1031 as the local eqiad master and set it to ROW binlog Bug: T120122 Change-Id: I090db65562894e0889c5e8335f86f0e3a9646db1 --- M manifests/site.pp 1 file changed, 11 insertions(+), 7 deletions(-) Approvals: Jcrespo: Looks good to me, approved Volans: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/manifests/site.pp b/manifests/site.pp index eaa8580..e07a5a5 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -782,18 +782,22 @@ } ## x1 shard -node /^db10(29)\.eqiad\.wmnet/ { -include role::coredb::x1 -} - -node /^db10(31)\.eqiad\.wmnet/ { +# eqiad +node 'db1031.eqiad.wmnet' { class { 'role::mariadb::core': -shard => 'x1', -p_s => 'on', +shard => 'x1', +master=> false, +p_s => 'on', +binlog_format => 'ROW', } include base::firewall } +node 'db1029.eqiad.wmnet' { +include role::coredb::x1 +} + +# codfw node 'db2009.codfw.wmnet' { class { 'role::mariadb::core': shard => 'x1', -- To view, visit https://gerrit.wikimedia.org/r/284516 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I090db65562894e0889c5e8335f86f0e3a9646db1 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: JcrespoGerrit-Reviewer: Jcrespo Gerrit-Reviewer: Volans Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set db1031 as the local eqiad master and set it to ROW binlog - change (operations/puppet)
Jcrespo has uploaded a new change for review. https://gerrit.wikimedia.org/r/284516 Change subject: Set db1031 as the local eqiad master and set it to ROW binlog .. Set db1031 as the local eqiad master and set it to ROW binlog Bug: T120122 Change-Id: I090db65562894e0889c5e8335f86f0e3a9646db1 --- M manifests/site.pp 1 file changed, 11 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/16/284516/1 diff --git a/manifests/site.pp b/manifests/site.pp index eaa8580..e07a5a5 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -782,18 +782,22 @@ } ## x1 shard -node /^db10(29)\.eqiad\.wmnet/ { -include role::coredb::x1 -} - -node /^db10(31)\.eqiad\.wmnet/ { +# eqiad +node 'db1031.eqiad.wmnet' { class { 'role::mariadb::core': -shard => 'x1', -p_s => 'on', +shard => 'x1', +master=> false, +p_s => 'on', +binlog_format => 'ROW', } include base::firewall } +node 'db1029.eqiad.wmnet' { +include role::coredb::x1 +} + +# codfw node 'db2009.codfw.wmnet' { class { 'role::mariadb::core': shard => 'x1', -- To view, visit https://gerrit.wikimedia.org/r/284516 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I090db65562894e0889c5e8335f86f0e3a9646db1 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Jcrespo___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update shrinkwrap after 23c97752 - change (mediawiki...parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: Update shrinkwrap after 23c97752 .. Update shrinkwrap after 23c97752 * Didn't blow away the entire node_modules/ at the time. Change-Id: I13b747a4b89d3ea2585058c5403ee1e597660c0d --- M npm-shrinkwrap.json 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c21679f..4d09636 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2116,10 +2116,6 @@ } } }, -"node-uuid": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz; -}, "vow-queue": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.2.tgz; -- To view, visit https://gerrit.wikimedia.org/r/284510 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13b747a4b89d3ea2585058c5403ee1e597660c0d Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: ArlolraGerrit-Reviewer: Cscott Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use $wgNotifyTypeAvailabilityByNotificationType due to Echo ... - change (operations/mediawiki-config)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/284515 Change subject: Use $wgNotifyTypeAvailabilityByNotificationType due to Echo change .. Use $wgNotifyTypeAvailabilityByNotificationType due to Echo change $wgEchoDefaultNotificationTypes has been split into multiple variables. Bug: T132820 Change-Id: I13817c139967ed9e230cfb0c87c5de66da793c96 Depends-On: I09f39f5fc5f13f3253af9f7819bca81f1601da93 --- M wmf-config/CommonSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/15/284515/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 2f37bea..1310725 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -2615,7 +2615,7 @@ } // Temporarily disable thank-you-edit notifications (T128249) - $wgEchoDefaultNotificationTypes['thank-you-edit']['web'] = false; + $wgNotifyTypeAvailabilityByNotificationType['thank-you-edit']['web'] = false; // Default user options: subscriptions foreach ( $wmgEchoDefaultUserSubscriptions as $where => $notifications ) { -- To view, visit https://gerrit.wikimedia.org/r/284515 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13817c139967ed9e230cfb0c87c5de66da793c96 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add install1001.wikimedia.org using 208.80.154.83 - change (operations/dns)
Dzahn has submitted this change and it was merged. Change subject: add install1001.wikimedia.org using 208.80.154.83 .. add install1001.wikimedia.org using 208.80.154.83 Assign a new public IP in eqiad to install1001 as part of T132757. No mgmt entry because this is going to be a ganeti VM. It looks all Ganeti VMs are in the C network when they have public IPs. Bug:T132757 Change-Id: If31aa8e1e9a0b225b38e1ca085e31bd0e550354f --- M templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa M templates/154.80.208.in-addr.arpa M templates/wikimedia.org 3 files changed, 4 insertions(+), 0 deletions(-) Approvals: RobH: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa index 426a9b9..20c3f05 100644 --- a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa +++ b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa @@ -72,6 +72,7 @@ 3.9.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR radon.wikimedia.org. 4.7.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR fermium.wikimedia.org. 6.7.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR mx1001.wikimedia.org. +3.8.0.0.4.5.1.0.0.8.0.0.8.0.2.0 1H IN PTR install1001.wikimedia.org. ; public1-d-eqiad (2620:0:861:4::/64) $ORIGIN 4.0.0.0.{{ zonename }}. diff --git a/templates/154.80.208.in-addr.arpa b/templates/154.80.208.in-addr.arpa index cab4ba3..69a141d 100644 --- a/templates/154.80.208.in-addr.arpa +++ b/templates/154.80.208.in-addr.arpa @@ -73,6 +73,7 @@ 80 1H IN PTR ytterbium.wikimedia.org. 81 1H IN PTR gerrit.wikimedia.org. 82 1H IN PTR lead.wikimedia.org. +83 1H IN PTR install1001.wikimedia.org. ; VM on the ganeti01.svc.eqiad.wmnet cluster 91 1H IN PTR wiki-mail-eqiad.wikimedia.org. 92 1H IN PTR labcontrol1001.wikimedia.org. diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 06cea5e..4c615f6 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -135,6 +135,8 @@ holmium 1H IN A208.80.154.12 hydrogen1H IN A208.80.154.50 1H IN 2620:0:861:1:208:80:154:50 +install1001 1H IN A208.80.154.83 +1H IN 2620:0:861:3:208:80:154:83 install2001 1H IN A208.80.153.4 1H IN 2620:0:860:1:208:80:153:4 iron1H IN A208.80.154.151 -- To view, visit https://gerrit.wikimedia.org/r/284388 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If31aa8e1e9a0b225b38e1ca085e31bd0e550354f Gerrit-PatchSet: 6 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: DzahnGerrit-Reviewer: Dzahn Gerrit-Reviewer: Faidon Liambotis Gerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] switchover: switch (s1-s7, x1) master role to eqiad - change (operations/puppet)
Volans has uploaded a new change for review. https://gerrit.wikimedia.org/r/284514 Change subject: switchover: switch (s1-s7, x1) master role to eqiad .. switchover: switch (s1-s7, x1) master role to eqiad Bug: T133205 Change-Id: Ic8a0fa51450b7669efbc57ad867463793304bd65 --- M manifests/site.pp 1 file changed, 23 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/14/284514/1 diff --git a/manifests/site.pp b/manifests/site.pp index eaa8580..0cb06fd 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -471,7 +471,7 @@ node 'db1057.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's1', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -493,7 +493,7 @@ node 'db2016.codfw.wmnet' { class { 'role::mariadb::core': shard => 's1', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -516,7 +516,7 @@ node 'db1018.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's2', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -538,7 +538,7 @@ node 'db2017.codfw.wmnet' { class { 'role::mariadb::core': shard => 's2', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'multiple-ca', @@ -561,7 +561,7 @@ node 'db1075.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's3', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -583,7 +583,7 @@ node 'db2018.codfw.wmnet' { class { 'role::mariadb::core': shard => 's3', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -606,7 +606,7 @@ node 'db1042.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's4', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -628,7 +628,7 @@ node 'db2019.codfw.wmnet' { class { 'role::mariadb::core': shard => 's4', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -651,7 +651,7 @@ node 'db1049.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's5', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -673,7 +673,7 @@ node 'db2023.codfw.wmnet' { class { 'role::mariadb::core': shard => 's5', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -696,7 +696,7 @@ node 'db1050.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's6', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -718,7 +718,7 @@ node 'db2028.codfw.wmnet' { class { 'role::mariadb::core': shard => 's6', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -741,7 +741,7 @@ node 'db1041.eqiad.wmnet' { class { 'role::mariadb::core': shard => 's7', -master=> false, +master=> true, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -763,7 +763,7 @@ node 'db2029.codfw.wmnet' { class { 'role::mariadb::core': shard => 's7', -master=> true, +master=> false, p_s => 'on', binlog_format => 'STATEMENT', ssl => 'puppet-cert', @@ -782,22 +782,24 @@ } ## x1 shard -node /^db10(29)\.eqiad\.wmnet/ { -include role::coredb::x1 -} - node /^db10(31)\.eqiad\.wmnet/ { class { 'role::mariadb::core': -shard => 'x1', -p_s => 'on', +shard
[MediaWiki-commits] [Gerrit] Use $wgNotifyTypeAvailabilityByNotificationType due to Echo ... - change (mediawiki...BounceHandler)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/284513 Change subject: Use $wgNotifyTypeAvailabilityByNotificationType due to Echo change .. Use $wgNotifyTypeAvailabilityByNotificationType due to Echo change $wgEchoDefaultNotificationTypes has been split into multiple variables. Bug: T132820 Change-Id: I3c669945080d8e1f67880bd8a31af7f88a70904d Depends-On: I09f39f5fc5f13f3253af9f7819bca81f1601da93 --- M BounceHandlerHooks.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler refs/changes/13/284513/1 diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php index 9632808..2b0a5e3 100644 --- a/BounceHandlerHooks.php +++ b/BounceHandlerHooks.php @@ -13,13 +13,13 @@ */ public static function extensionFunction() { global $wgNoReplyAddress, $wgServerName, $wgUnrecognizedBounceNotify, $wgVERPdomainPart, - $wgEchoDefaultNotificationTypes; + $wgNotifyTypeAvailabilityByNotificationType; $wgUnrecognizedBounceNotify = $wgUnrecognizedBounceNotify ? : array( $wgNoReplyAddress ); $wgVERPdomainPart = $wgVERPdomainPart ? : $wgServerName; //We cannot have additional Echo emails being sent after a user is un-subscribed - $wgEchoDefaultNotificationTypes['unsubscribe-bouncehandler']['email'] = false; + $wgNotifyTypeAvailabilityByNotificationType['unsubscribe-bouncehandler']['email'] = false; } /** -- To view, visit https://gerrit.wikimedia.org/r/284513 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c669945080d8e1f67880bd8a31af7f88a70904d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BounceHandler Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ssl_ciphersuite: detect os_version, use always for nginx+jessie - change (operations/puppet)
BBlack has submitted this change and it was merged. Change subject: ssl_ciphersuite: detect os_version, use always for nginx+jessie .. ssl_ciphersuite: detect os_version, use always for nginx+jessie Change-Id: Ie1e50c292e9f1313c7f16138c941c6d638086e1a --- M modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb b/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb index bb6ba2c..2d8b603 100644 --- a/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb +++ b/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb @@ -148,6 +148,7 @@ END ) do |args| +Puppet::Parser::Functions.function(:os_version) if args.length < 2 || args.length > 3 fail(ArgumentError, 'ssl_ciphersuite() requires at least 2 arguments') @@ -229,7 +230,11 @@ end unless hsts_days.nil? hsts_seconds = hsts_days * 86400 -output.push("add_header Strict-Transport-Security \"max-age=#{hsts_seconds}\";") +if function_os_version(['debian >= jessie']) +output.push("add_header Strict-Transport-Security \"max-age=#{hsts_seconds}\" always;") +else +output.push("add_header Strict-Transport-Security \"max-age=#{hsts_seconds}\";") +end end end return output -- To view, visit https://gerrit.wikimedia.org/r/284507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1e50c292e9f1313c7f16138c941c6d638086e1a Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make MessageCache handle lock timeouts better - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/284512 Change subject: Make MessageCache handle lock timeouts better .. Make MessageCache handle lock timeouts better * Timeouts happen when memcached is cleared or on DC-switchover likewise * Lower the sidebar cache TTL when the MessageCache is disabled * Also lower any output expiry for CDN and set a custom header when the MessageCache is disabled * Log when this happens to a dedicated "MessageCacheError" channel Bug: T133069 Change-Id: I1b80e250532033c52680246279e1e8f56350ae83 --- M includes/DefaultSettings.php M includes/MediaWiki.php M includes/cache/MessageCache.php M includes/skins/Skin.php 4 files changed, 35 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/12/284512/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 10e6adb..939c24a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2590,6 +2590,13 @@ $wgCdnReboundPurgeDelay = 0; /** + * Cache timeout for the CDN when a response is known to be wrong or incomplete (due to load) + * @see $wgSquidMaxage + * @since 1.27 + */ +$wgCdnMaxageSubstitute = 30; + +/** * Default maximum age for raw CSS/JS accesses * * 300 seconds = 5 minutes. diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index ad02e68..3dd7420 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -585,6 +585,13 @@ $request->response()->header( "X-Database-Lagged: true" ); wfDebugLog( 'replication', "Lagged DB used; CDN cache TTL limited to $maxAge seconds" ); } + + // Avoid long-term cache pollution due to message cache rebuild timeouts (T133069) + if ( MessageCache::singleton()->isDisabled() ) { + $maxAge = $config->get( 'CdnMaxageSubstitute' ); + $context->getOutput()->lowerCdnMaxage( $maxAge ); + $request->response()->header( "X-Response-Substitute: true" ); + } } /** diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 0e566ea..62fab5f 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -51,7 +51,7 @@ protected $mCache; /** -* Should mean that database cannot be used, but check +* Should mean that database cannot be used, but check * @var bool $mDisable */ protected $mDisable; @@ -355,6 +355,7 @@ $where[] = 'loading FAILED - cache is disabled'; $this->mDisable = true; $this->mCache = false; + wfDebugLog( 'MessageCacheError', __METHOD__ . ": Failed to load $code\n" ); # This used to throw an exception, but that led to nasty side effects like # the whole wiki being instantly down if the memcached server died } else { @@ -1114,6 +1115,22 @@ } /** +* Whether DB/cache usage is disabled for determining messages +* +* If so, this typically indicates either: +* - a) load() failed to find a cached copy nor query the DB +* - b) we are in a special context or error mode that cannot use the DB +* If the DB is ignored, any derived HTML output or cached objects may be wrong. +* To avoid long-term cache pollution, TTLs can be adjusted accordingly. +* +* @return bool +* @since 1.27 +*/ + public function isDisabled() { + return $this->mDisable; + } + + /** * Clear all stored messages. Mainly used after a mass rebuild. */ function clear() { diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 4d7fc50..aaa594d 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1200,7 +1200,9 @@ $cache = ObjectCache::getMainWANInstance(); $sidebar = $cache->getWithSetCallback( $cache->makeKey( 'sidebar', $this->getLanguage()->getCode() ), - $wgSidebarCacheExpiry, + MessageCache::singleton()->isDisabled() + ? $cache::TTL_MINUTE // bug T133069 + : $wgSidebarCacheExpiry, $callback, [ 'lockTSE' => 30 ] ); -- To view, visit https://gerrit.wikimedia.org/r/284512 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b80e250532033c52680246279e1e8f56350ae83 Gerrit-PatchSet: 1
[MediaWiki-commits] [Gerrit] Update shrinkwrap after 23c977 - change (mediawiki...parsoid)
Arlolra has uploaded a new change for review. https://gerrit.wikimedia.org/r/284510 Change subject: Update shrinkwrap after 23c977 .. Update shrinkwrap after 23c977 * Didn't blow away the entire node_modules/ at the time. Change-Id: I13b747a4b89d3ea2585058c5403ee1e597660c0d --- M npm-shrinkwrap.json 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/10/284510/1 diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c21679f..4d09636 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2116,10 +2116,6 @@ } } }, -"node-uuid": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz; -}, "vow-queue": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.2.tgz; -- To view, visit https://gerrit.wikimedia.org/r/284510 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13b747a4b89d3ea2585058c5403ee1e597660c0d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Upgrade Spoon client to v1.4.0 - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/284511 Change subject: Upgrade Spoon client to v1.4.0 .. Upgrade Spoon client to v1.4.0 https://github.com/square/spoon/blob/master/CHANGELOG.md Change-Id: Ib0ef997e6dc6c7690c23b5b2a9dc9cc318ef8070 --- M app/build.gradle 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/11/284511/1 diff --git a/app/build.gradle b/app/build.gradle index 930d00e..5d128a6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -214,7 +214,7 @@ // Espresso-idling-resource for synchronization with background jobs. androidTestCompile "com.android.support.test.espresso:espresso-idling-resource:$espressoVersion" -androidTestCompile 'com.squareup.spoon:spoon-client:1.3.2' +androidTestCompile 'com.squareup.spoon:spoon-client:1.4.0' } private setSigningConfigKey(config, Properties props) { -- To view, visit https://gerrit.wikimedia.org/r/284511 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0ef997e6dc6c7690c23b5b2a9dc9cc318ef8070 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Turn on client-side amount validation for new forms - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Turn on client-side amount validation for new forms .. Turn on client-side amount validation for new forms FIXME: DRY, should this just happen as a part of validate_form? Bug: T105618 Change-Id: I8e415a4f9ec884a0f3e0dd5037f92920123ef01f --- M adyen_gateway/forms/js/adyen.js M astropay_gateway/astropay.js M worldpay_gateway/forms/js/esop.js 3 files changed, 6 insertions(+), 6 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/adyen_gateway/forms/js/adyen.js b/adyen_gateway/forms/js/adyen.js index 7710ba3..bdccacb 100644 --- a/adyen_gateway/forms/js/adyen.js +++ b/adyen_gateway/forms/js/adyen.js @@ -100,7 +100,7 @@ } $( 'input[name="payment_submethod"]' ).on( 'change', function () { - if ( window.validate_form( document.payment ) ) { + if ( window.validateAmount() && window.validate_form( document.payment ) ) { window.displayCreditCardForm(); } else { $( '#paymentContinue' ).show(); @@ -108,7 +108,7 @@ } ); $( '#paymentContinueBtn' ).on( 'click', function () { - if ( window.validate_form( document.payment ) ) { + if ( window.validateAmount() && window.validate_form( document.payment ) ) { window.displayCreditCardForm(); // hide the continue button so that people don't get confused with two of them $( '#paymentContinue' ).hide(); diff --git a/astropay_gateway/astropay.js b/astropay_gateway/astropay.js index 9ad4093..3a6437b 100644 --- a/astropay_gateway/astropay.js +++ b/astropay_gateway/astropay.js @@ -9,7 +9,7 @@ // Submit on submethod click if valid, // otherwise show continue button. $( 'input[name="payment_submethod"]' ).on( 'click', function() { - if ( window.validate_form( form ) ) { + if ( window.validateAmount() && window.validate_form( form ) ) { submitForm(); } else { $( '#paymentContinue' ).show(); @@ -17,7 +17,7 @@ } ); $( '#paymentContinueBtn' ).click( function() { - if ( window.validate_form( form ) ) { + if ( window.validateAmount() && window.validate_form( form ) ) { submitForm(); } }); diff --git a/worldpay_gateway/forms/js/esop.js b/worldpay_gateway/forms/js/esop.js index f647aa2..f6b7a90 100644 --- a/worldpay_gateway/forms/js/esop.js +++ b/worldpay_gateway/forms/js/esop.js @@ -9,14 +9,14 @@ if ( !$( this ).hasClass( 'enabled' ) ) { return false; } - if ( window.validate_form( form ) ) { + if ( window.validateAmount() && window.validate_form( form ) ) { submitForm(); } } ); // Submit on submethod selection if valid, otherwise show continute button. $( 'input[name="payment_submethod"]' ).on( 'change', function () { - if ( window.validate_form( form ) ) { + if ( window.validateAmount() && window.validate_form( form ) ) { submitForm(); } else { $( '#paymentContinue' ).show(); -- To view, visit https://gerrit.wikimedia.org/r/284367 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e415a4f9ec884a0f3e0dd5037f92920123ef01f Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ssmith Gerrit-Reviewer: XenoRyet Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Account for gateway-specific min/max client-side - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Account for gateway-specific min/max client-side .. Account for gateway-specific min/max client-side After letting this settle a bit, please remove the global window.wgCurrencyMinimums and use the currency rates from config. Bug: T132959 Change-Id: I2239d6d1abf2db21c968817412839bf9eea5a18d --- M amazon_gateway/amazon.adapter.php M amazon_gateway/amazon_gateway.body.php M gateway_common/GatewayPage.php M gateway_common/gateway.adapter.php M modules/CurrencyRatesModule.php M modules/validate_input.js M worldpay_gateway/worldpay.adapter.php M worldpay_gateway/worldpay_gateway.body.php 8 files changed, 29 insertions(+), 8 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/amazon_gateway/amazon.adapter.php b/amazon_gateway/amazon.adapter.php index 2a37854..349a080 100644 --- a/amazon_gateway/amazon.adapter.php +++ b/amazon_gateway/amazon.adapter.php @@ -423,6 +423,7 @@ * @param array $vars */ public function setClientVariables( &$vars ) { + parent::setClientVariables( $vars ); $vars['wgAmazonGatewayClientID'] = $this->account_config['ClientID']; $vars['wgAmazonGatewaySellerID'] = $this->account_config['SellerID']; $vars['wgAmazonGatewaySandbox'] = $this->getGlobal( 'TestMode' ) ? true : false; diff --git a/amazon_gateway/amazon_gateway.body.php b/amazon_gateway/amazon_gateway.body.php index 75f60ed..c40a75c 100644 --- a/amazon_gateway/amazon_gateway.body.php +++ b/amazon_gateway/amazon_gateway.body.php @@ -24,7 +24,6 @@ * Show the special page */ protected function handleRequest() { - Hooks::register( 'MakeGlobalVariablesScript', array( $this->adapter, 'setClientVariables' ) ); $this->getOutput()->addModules( 'ext.donationinterface.amazon.styles' ); $this->getOutput()->addModules( 'ext.donationinterface.amazon.scripts' ); diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index d49f143..8461312 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -90,6 +90,8 @@ public function execute( $par ) { global $wgContributionTrackingFundraiserMaintenance, $wgContributionTrackingFundraiserMaintenanceUnsched; + Hooks::register( 'MakeGlobalVariablesScript', array( $this->adapter, 'setClientVariables' ) ); + // FIXME: Deprecate "language" param. $language = $this->getRequest()->getVal( 'language' ); if ( $language ) { diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index a389f55..609d7ef 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -3662,4 +3662,13 @@ } return $hookResult; } + + /** +* MakeGlobalVariablesScript handler, sends settings to Javascript +* @param array $vars +*/ + public function setClientVariables( &$vars ) { + $vars['wgDonationInterfacePriceFloor'] = $this->getGlobal( 'PriceFloor' ); + $vars['wgDonationInterfacePriceCeiling'] = $this->getGlobal( 'PriceCeiling' ); + } } diff --git a/modules/CurrencyRatesModule.php b/modules/CurrencyRatesModule.php index e9648ec..b0afa22 100644 --- a/modules/CurrencyRatesModule.php +++ b/modules/CurrencyRatesModule.php @@ -9,8 +9,10 @@ * @see ResourceLoaderModule::getScript() */ public function getScript( ResourceLoaderContext $context ) { + // FIXME: get rid of global var return 'window.wgCurrencyMinimums = ' . - Xml::encodeJsVar( CurrencyRates::getCurrencyRates() ) . ';'; + Xml::encodeJsVar( CurrencyRates::getCurrencyRates() ) . ';' . + 'mw.config.set( "wgDonationInterfaceCurrencyRates", window.wgCurrencyMinimums );'; } /** diff --git a/modules/validate_input.js b/modules/validate_input.js index 2aedfcd..ae282e6 100644 --- a/modules/validate_input.js +++ b/modules/validate_input.js @@ -38,11 +38,14 @@ /** * Validate the donation amount to make sure it is formatted correctly and at least a minimum amount. + * TODO: also validate ceiling */ window.validateAmount = function () { var error = true, amount = $( 'input[name="amount"]' ).val(), // get the amount - currency_code = ''; + currency_code = '', + rate, + minUsd = mw.config.get( 'wgDonationInterfacePriceFloor' ); // Normalize weird amount formats. // Don't mess with these unless you know what you're doing. @@ -64,11 +67,14 @@ if ( $( 'select[name="currency_code"]' ).length
[MediaWiki-commits] [Gerrit] Fix blank email error message - change (mediawiki...DonationInterface)
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/284509 Change subject: Fix blank email error message .. Fix blank email error message Used to be popping up "Please enter your Please enter a valid email address " Change-Id: I034fec109f49f89337ad049fdab6f56ed0408ece --- M modules/validate_input.js 1 file changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/09/284509/1 diff --git a/modules/validate_input.js b/modules/validate_input.js index ae282e6..2821b2f 100644 --- a/modules/validate_input.js +++ b/modules/validate_input.js @@ -239,7 +239,8 @@ 'fiscal_number', 'account_name', 'account_number', 'authorization_id', 'bank_code', 'bank_check_digit', 'branch_code', 'email' ], - numFields = fields.length; + numFields = fields.length, + emailValid = false; for ( i = 0; i < numFields; i++ ) { element = document.getElementById( fields[ i ] ); @@ -280,15 +281,19 @@ } // validate email address - $emailAdd = document.getElementById( 'emailAdd' ) || document.getElementById( 'email' ); - if ( $.trim( $emailAdd.value ) && $emailAdd.value !== mediaWiki.msg( 'donate_interface-donor-emailAdd' ) ) { + $emailAdd = document.getElementById( 'email' ); + $emailAdd.value = $emailAdd.value.trim(); + if ( $emailAdd.value && $emailAdd.value !== mw.msg( 'donate_interface-donor-emailAdd' ) ) { apos = $emailAdd.value.indexOf( '@' ); dotpos = $emailAdd.value.lastIndexOf( '.' ); - if ( apos < 1 || dotpos - apos < 2 ) { - output += mediaWiki.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; + if ( apos > 0 && dotpos - apos > 1 ) { + emailValid = true; } } + if ( !emailValid ) { + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; + } // Make sure cookies are enabled document.cookie = 'wmf_test=1;'; -- To view, visit https://gerrit.wikimedia.org/r/284509 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I034fec109f49f89337ad049fdab6f56ed0408ece Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add missing visualClear on search result page - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add missing visualClear on search result page .. Add missing visualClear on search result page I'm not sure, when this was removed or why it broke, but without the visualClear (clear:both), the text match section is near the title match section, instead of after it. Bug: T133071 Change-Id: I68028a8658ba0aa526ce1a6ef6401f9fd79533f8 --- M includes/specials/SpecialSearch.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php old mode 100644 new mode 100755 index 45ef679..2bf8385 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -376,6 +376,7 @@ if ( $textMatches && !$textStatus ) { // output appropriate heading if ( $numTextMatches > 0 && $numTitleMatches > 0 ) { + $out->addHTML( '' ); // if no title matches the heading is redundant $out->wrapWikiMsg( "==$1==\n", 'textmatches' ); } -- To view, visit https://gerrit.wikimedia.org/r/284236 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68028a8658ba0aa526ce1a6ef6401f9fd79533f8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: FlorianschmidtwelzowGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits