[MediaWiki-commits] [Gerrit] mediawiki...GoogleDocs4MW[master]: Fix escaping
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356986 ) Change subject: Fix escaping .. Fix escaping Change-Id: I0ee65f67c99efb13a1baf60baed2263ccc9ad408 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jack Phoenix: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 1452ce6..7201bb7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,5 +2,5 @@ "@metadata": { "authors": [] }, - "googledocs4mw-desc": "Addstag for Google Docs\\' spreadsheets display" + "googledocs4mw-desc": "Adds tag for Google Docs' spreadsheets display" } -- To view, visit https://gerrit.wikimedia.org/r/356986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ee65f67c99efb13a1baf60baed2263ccc9ad408 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GoogleDocs4MW Gerrit-Branch: master Gerrit-Owner: Jack Phoenix Gerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...EnhanceContactForm[master]: Remove unnecessary single quote
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356985 ) Change subject: Remove unnecessary single quote .. Remove unnecessary single quote Change-Id: If296959fdd81266801f1d002dac5c1a3e1af65e3 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jack Phoenix: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 245ad08..1270987 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,5 +2,5 @@ "@metadata": { "authors": [] }, - "enhancecontactform-desc": "Enhances [[Special:Contact]] by sending more info'" + "enhancecontactform-desc": "Enhances [[Special:Contact]] by sending more info" } -- To view, visit https://gerrit.wikimedia.org/r/356985 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If296959fdd81266801f1d002dac5c1a3e1af65e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EnhanceContactForm Gerrit-Branch: master Gerrit-Owner: Jack Phoenix Gerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GoogleDocs4MW[master]: Fix escaping
Jack Phoenix has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356986 ) Change subject: Fix escaping .. Fix escaping Change-Id: I0ee65f67c99efb13a1baf60baed2263ccc9ad408 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleDocs4MW refs/changes/86/356986/1 diff --git a/i18n/en.json b/i18n/en.json index 1452ce6..7201bb7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,5 +2,5 @@ "@metadata": { "authors": [] }, - "googledocs4mw-desc": "Addstag for Google Docs\\' spreadsheets display" + "googledocs4mw-desc": "Adds tag for Google Docs' spreadsheets display" } -- To view, visit https://gerrit.wikimedia.org/r/356986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ee65f67c99efb13a1baf60baed2263ccc9ad408 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GoogleDocs4MW Gerrit-Branch: master Gerrit-Owner: Jack Phoenix ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...EnhanceContactForm[master]: Remove unnecessary single quote
Jack Phoenix has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356985 ) Change subject: Remove unnecessary single quote .. Remove unnecessary single quote Change-Id: If296959fdd81266801f1d002dac5c1a3e1af65e3 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EnhanceContactForm refs/changes/85/356985/1 diff --git a/i18n/en.json b/i18n/en.json index 245ad08..1270987 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,5 +2,5 @@ "@metadata": { "authors": [] }, - "enhancecontactform-desc": "Enhances [[Special:Contact]] by sending more info'" + "enhancecontactform-desc": "Enhances [[Special:Contact]] by sending more info" } -- To view, visit https://gerrit.wikimedia.org/r/356985 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If296959fdd81266801f1d002dac5c1a3e1af65e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EnhanceContactForm Gerrit-Branch: master Gerrit-Owner: Jack Phoenix ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid DB_MASTER queries in User::newSystemUser() when possible
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/353827 ) Change subject: Avoid DB_MASTER queries in User::newSystemUser() when possible .. Avoid DB_MASTER queries in User::newSystemUser() when possible Bug: T92357 Change-Id: I1c90fef9b4f3acc658f4911a8db6f985e7cc7c83 --- M includes/user/User.php 1 file changed, 19 insertions(+), 7 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/user/User.php b/includes/user/User.php index 5dd4be1..ce6bbc3 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -693,19 +693,31 @@ return null; } - $fields = self::selectFields(); - - $dbw = wfGetDB( DB_MASTER ); - $row = $dbw->selectRow( + $dbr = wfGetDB( DB_REPLICA ); + $row = $dbr->selectRow( 'user', - $fields, + self::selectFields(), [ 'user_name' => $name ], __METHOD__ ); if ( !$row ) { - // No user. Create it? - return $options['create'] ? self::createNew( $name, [ 'token' => self::INVALID_TOKEN ] ) : null; + // Try the master database... + $dbw = wfGetDB( DB_MASTER ); + $row = $dbw->selectRow( + 'user', + self::selectFields(), + [ 'user_name' => $name ], + __METHOD__ + ); } + + if ( !$row ) { + // No user. Create it? + return $options['create'] + ? self::createNew( $name, [ 'token' => self::INVALID_TOKEN ] ) + : null; + } + $user = self::newFromRow( $row ); // A user is considered to exist as a non-system user if it can -- To view, visit https://gerrit.wikimedia.org/r/353827 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c90fef9b4f3acc658f4911a8db6f985e7cc7c83 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-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] operations/mediawiki-config[master]: db-eqiad.php: Depool db1089
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356984 ) Change subject: db-eqiad.php: Depool db1089 .. db-eqiad.php: Depool db1089 The host is broken Change-Id: I7f38bdd2e346f37b80d558cf7ebdb5fbcd897bb4 --- M wmf-config/db-eqiad.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Marostegui: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index 3544f10..43a38a7 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -103,7 +103,7 @@ 'db1073' => 50, # B3 2.8TB 160GB, api 'db1080' => 500, # A2 3.6TB 512GB 'db1083' => 500, # B1 3.6TB 512GB - 'db1089' => 500, # C3 3.6TB 512GB +# 'db1089' => 500, # C3 3.6TB 512GB #broken ], 's2' => [ 'db1054' => 0, # A3 2.8TB 96GB, master -- To view, visit https://gerrit.wikimedia.org/r/356984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f38bdd2e346f37b80d558cf7ebdb5fbcd897bb4 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Marostegui Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Marostegui Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Depool db1089
Marostegui has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356984 ) Change subject: db-eqiad.php: Depool db1089 .. db-eqiad.php: Depool db1089 The host is broken Change-Id: I7f38bdd2e346f37b80d558cf7ebdb5fbcd897bb4 --- M wmf-config/db-eqiad.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/84/356984/1 diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index 3544f10..43a38a7 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -103,7 +103,7 @@ 'db1073' => 50, # B3 2.8TB 160GB, api 'db1080' => 500, # A2 3.6TB 512GB 'db1083' => 500, # B1 3.6TB 512GB - 'db1089' => 500, # C3 3.6TB 512GB +# 'db1089' => 500, # C3 3.6TB 512GB #broken ], 's2' => [ 'db1054' => 0, # A3 2.8TB 96GB, master -- To view, visit https://gerrit.wikimedia.org/r/356984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f38bdd2e346f37b80d558cf7ebdb5fbcd897bb4 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Marostegui ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: Suppressing question numbering in a quiz when only one quest...
Harjotsingh has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356983 ) Change subject: Suppressing question numbering in a quiz when only one question in a quiz .. Suppressing question numbering in a quiz when only one question in a quiz Bug:T162803 Change-Id: I6931c03208d8ecece0b8113c3b0603f8c0682187 --- M Quiz.class.php M templates/Question.mustache 2 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz refs/changes/83/356983/1 diff --git a/Quiz.class.php b/Quiz.class.php index 6f6c9c8..ec308d7 100755 --- a/Quiz.class.php +++ b/Quiz.class.php @@ -250,6 +250,8 @@ $output = ''; $questionPattern = '`(.*?[^|\}])\}[ \t]*(\n(.*)|$)`s'; + $numQuestion = count( $unparsedQuestions ); + $numDisplay = ( $numQuestion == 1 ) ? false : true; foreach ( $unparsedQuestions as $unparsedQuestion ) { // If this "unparsedQuestion" is not a full question, // we put the text into a buffer to add it at the beginning of the next question. @@ -259,7 +261,7 @@ if ( preg_match( $questionPattern, $unparsedQuestion, $matches ) ) { $buffer = ''; - $output .= $this->parseQuestion( $matches ); + $output .= $this->parseQuestion( $matches , $numDisplay ); } else { $buffer = $unparsedQuestion; } @@ -279,9 +281,10 @@ * @param $matches array: elements matching $questionPattern. * $matches[1] is the question header. * $matches[3] is the question object. +* @param $numDisplay Boolean: specifies whether to display question number. * @return string */ - function parseQuestion( $matches ) { + function parseQuestion( $matches , $numDisplay ) { $question = new Question( $this->mBeingCorrected, $this->mCaseSensitive, @@ -401,6 +404,7 @@ array( 'question' => array( 'id' => $this->mQuestionId, + 'numdis' => $numDisplay, 'text' => $questionText, 'answers' => $answers ), diff --git a/templates/Question.mustache b/templates/Question.mustache index 790f13a..54c70d9 100644 --- a/templates/Question.mustache +++ b/templates/Question.mustache @@ -1,6 +1,8 @@ - {{ question.id }} + {{#if question.numdis }} + {{ question.id }} + {{/if}} {{{ question.text }}} @@ -8,4 +10,4 @@ {{{ question.answers }}} - \ No newline at end of file + -- To view, visit https://gerrit.wikimedia.org/r/356983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6931c03208d8ecece0b8113c3b0603f8c0682187 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Quiz Gerrit-Branch: master Gerrit-Owner: Harjotsingh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: Remove references to hooked functions which are gone
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356981 ) Change subject: Remove references to hooked functions which are gone .. Remove references to hooked functions which are gone The functions were removed in commit f13b180d900ad251c09626160e485de5d05a0a4d Change-Id: Idae602531491e4ea8055224e94f0dfcae62ce6f3 --- M extension.json 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: SamanthaNguyen: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 5d960a9..945de40 100644 --- a/extension.json +++ b/extension.json @@ -429,8 +429,6 @@ "MakeGlobalVariablesScript": "ArticleFeedbackv5Hooks::makeGlobalVariablesScript", "GetPreferences": "ArticleFeedbackv5Hooks::getPreferences", "EditPage::showEditForm:fields": "ArticleFeedbackv5Hooks::pushFieldsToEdit", - "EditPage::attemptSave": "ArticleFeedbackv5Hooks::editAttempt", - "PageContentSaveComplete": "ArticleFeedbackv5Hooks::editSuccess", "ContribsPager::reallyDoQuery": "ArticleFeedbackv5Hooks::contributionsData", "ContributionsLineEnding": "ArticleFeedbackv5Hooks::contributionsLineEnding", "ProtectionForm::buildForm": "ArticleFeedbackv5Hooks::onProtectionForm", -- To view, visit https://gerrit.wikimedia.org/r/356981 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idae602531491e4ea8055224e94f0dfcae62ce6f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5 Gerrit-Branch: master Gerrit-Owner: Jack Phoenix Gerrit-Reviewer: SamanthaNguyen Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...dashboard[master]: Deploy fixes
Chelsyx has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356982 ) Change subject: Deploy fixes .. Deploy fixes Change-Id: I92d0cbe388113e3b878c82f73f3970e64ebfbae1 --- M shiny-server/portal 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Chelsyx: Verified; Looks good to me, approved diff --git a/shiny-server/portal b/shiny-server/portal index 51df8cf..fa78f60 16 --- a/shiny-server/portal +++ b/shiny-server/portal @@ -1 +1 @@ -Subproject commit 51df8cf55d3856c0277a55f15d43a780b477b8f8 +Subproject commit fa78f60f4734432e4fd3c5f8e61803f5a870a024 -- To view, visit https://gerrit.wikimedia.org/r/356982 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I92d0cbe388113e3b878c82f73f3970e64ebfbae1 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/dashboard Gerrit-Branch: master Gerrit-Owner: Chelsyx Gerrit-Reviewer: Chelsyx ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...dashboard[master]: Deploy fixes
Chelsyx has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356982 ) Change subject: Deploy fixes .. Deploy fixes Change-Id: I92d0cbe388113e3b878c82f73f3970e64ebfbae1 --- M shiny-server/portal 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/dashboard refs/changes/82/356982/1 diff --git a/shiny-server/portal b/shiny-server/portal index 51df8cf..fa78f60 16 --- a/shiny-server/portal +++ b/shiny-server/portal @@ -1 +1 @@ -Subproject commit 51df8cf55d3856c0277a55f15d43a780b477b8f8 +Subproject commit fa78f60f4734432e4fd3c5f8e61803f5a870a024 -- To view, visit https://gerrit.wikimedia.org/r/356982 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92d0cbe388113e3b878c82f73f3970e64ebfbae1 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/dashboard Gerrit-Branch: master Gerrit-Owner: Chelsyx ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: Remove references to hooked functions which are gone
Jack Phoenix has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356981 ) Change subject: Remove references to hooked functions which are gone .. Remove references to hooked functions which are gone The functions were removed in commit f13b180d900ad251c09626160e485de5d05a0a4d Change-Id: Idae602531491e4ea8055224e94f0dfcae62ce6f3 --- M extension.json 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 refs/changes/81/356981/1 diff --git a/extension.json b/extension.json index 5d960a9..945de40 100644 --- a/extension.json +++ b/extension.json @@ -429,8 +429,6 @@ "MakeGlobalVariablesScript": "ArticleFeedbackv5Hooks::makeGlobalVariablesScript", "GetPreferences": "ArticleFeedbackv5Hooks::getPreferences", "EditPage::showEditForm:fields": "ArticleFeedbackv5Hooks::pushFieldsToEdit", - "EditPage::attemptSave": "ArticleFeedbackv5Hooks::editAttempt", - "PageContentSaveComplete": "ArticleFeedbackv5Hooks::editSuccess", "ContribsPager::reallyDoQuery": "ArticleFeedbackv5Hooks::contributionsData", "ContributionsLineEnding": "ArticleFeedbackv5Hooks::contributionsLineEnding", "ProtectionForm::buildForm": "ArticleFeedbackv5Hooks::onProtectionForm", -- To view, visit https://gerrit.wikimedia.org/r/356981 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idae602531491e4ea8055224e94f0dfcae62ce6f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5 Gerrit-Branch: master Gerrit-Owner: Jack Phoenix ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...SoftwareVersion[master]: Generalize SoftwareVersion so it's easier for third-parties ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354885 ) Change subject: Generalize SoftwareVersion so it's easier for third-parties to use .. Generalize SoftwareVersion so it's easier for third-parties to use Change-Id: Ief2c8ea7bb7ca8987c9267c274ffd0295ab5266f --- D ShoutWikiSoftwareVersion.class.php A SoftwareVersion.class.php M extension.json M i18n/en.json M i18n/qqq.json 5 files changed, 97 insertions(+), 69 deletions(-) Approvals: Jack Phoenix: Looks good to me, approved jenkins-bot: Verified diff --git a/ShoutWikiSoftwareVersion.class.php b/ShoutWikiSoftwareVersion.class.php deleted file mode 100644 index 60a6c90..000 --- a/ShoutWikiSoftwareVersion.class.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @copyright Copyright © 2009-2016 Jack Phoenix - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later - */ - -class ShoutWikiSoftwareVersion { - - /** -* Adds ShoutWiki component into Special:Version and sets MW's version to $wgVersion -* -* @param array $software Array of software information -* @return bool -*/ - public static function addShoutWikiInfo( &$software ) { - global $wgVersion, $IP; - - // Set MW version to $wgVersion - $software['[https://www.mediawiki.org/ MediaWiki]'] = $wgVersion; - - // This is ugly, or at least uglier than in the past, because it wouldn't - // work anymore on my local machine. - // First, we do a "svn info $IP", then JSON-encode the result, and explode - // along newlines and use PHP's array access to access the revision number - // and last changed date, which will be added to the version table. - // - // Why is this so ugly? Because svn info returns a string, instead of a - // sane array that we could easily manipulate. - // - // We also strip out the English words from the svn info output, so the - // final output that an end-user viewing Special:Version sees is something - // like "r1811 (2012-05-16 00:31:45 +0300)". - if ( !wfIsWindows() ) { - $svnInfo = wfShellExec( '/usr/bin/svn info ' . $IP, $error ); - $newline = "\n"; - } else { - // why yes, I'm hardcoding my TortoiseSVN's installation path here - $svnInfo = wfShellExec( '"C:\Program Files\TortoiseSVN\bin\svn.exe" info ' . $IP, $error ); - $newline = "\r\n"; - } - - $json = json_encode( $svnInfo ); - $exploded = explode( $newline, $svnInfo ); - - // Add ShoutWiki component (revision number and last changed date) - $software['[http://www.shoutwiki.com/ ShoutWiki]'] = - str_replace( 'Revision: ', 'r', $exploded[6] ) /* Revision */ . - ' (' . - str_replace( 'Last Changed Date: ', '', preg_replace( '/ \(.*\)/', '', $exploded[11] ) ) ./* Last Changed Date */ - ')'; - - return true; - } - -} \ No newline at end of file diff --git a/SoftwareVersion.class.php b/SoftwareVersion.class.php new file mode 100644 index 000..ff86238 --- /dev/null +++ b/SoftwareVersion.class.php @@ -0,0 +1,70 @@ + + * @copyright Copyright © 2009-2016 Jack Phoenix + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + */ + +class SoftwareVersion { + + /** +* Adds local wiki component into Special:Version and sets MW's version to $wgVersion +* +* @param array $software Array of software information +* @return bool +*/ + public static function addSVNInfo( &$software ) { + global $wgVersion, $wgCanonicalServer, $wgSitename, + $wgSoftwareVersionExecutablePath, $IP; + + // Set MW version to $wgVersion + $software['[https://www.mediawiki.org/ MediaWiki]'] = $wgVersion; + + // This is ugly, or at least uglier than in the past, because it wouldn't + // work anymore on my local machine. + // First, we do a "svn info $IP", then JSON-encode the result, and explode + // along newlines and use PHP's array access to access the revision number + // and last changed date, which will be added to the version table. + // + // Why is this so ugly? Because svn info returns a string, instead of a + // sane array that we could easily manipulate. + // + // We also strip out the English words from the svn info output, so the +
[MediaWiki-commits] [Gerrit] wikimedia...prince[master]: Use new path in ui.R
Chelsyx has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356980 ) Change subject: Use new path in ui.R .. Use new path in ui.R Change-Id: I981a31e3d8462c2609203653838b636cd7c5935a --- M ui.R 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Chelsyx: Verified; Looks good to me, approved diff --git a/ui.R b/ui.R index 84f69c7..8b2ece9 100644 --- a/ui.R +++ b/ui.R @@ -1,7 +1,7 @@ library(shiny) library(shinydashboard) -all_country_data <- polloi::read_dataset("discovery/portal/all_country_data.tsv", col_types = "Dcididid") +all_country_data <- polloi::read_dataset("discovery/metrics/portal/all_country_data.tsv", col_types = "Dcididid") function(request) { dashboardPage( -- To view, visit https://gerrit.wikimedia.org/r/356980 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I981a31e3d8462c2609203653838b636cd7c5935a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/prince Gerrit-Branch: master Gerrit-Owner: Chelsyx Gerrit-Reviewer: Chelsyx ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...prince[master]: Use new path in ui.R
Chelsyx has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356980 ) Change subject: Use new path in ui.R .. Use new path in ui.R Change-Id: I981a31e3d8462c2609203653838b636cd7c5935a --- M ui.R 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/prince refs/changes/80/356980/1 diff --git a/ui.R b/ui.R index 84f69c7..8b2ece9 100644 --- a/ui.R +++ b/ui.R @@ -1,7 +1,7 @@ library(shiny) library(shinydashboard) -all_country_data <- polloi::read_dataset("discovery/portal/all_country_data.tsv", col_types = "Dcididid") +all_country_data <- polloi::read_dataset("discovery/metrics/portal/all_country_data.tsv", col_types = "Dcididid") function(request) { dashboardPage( -- To view, visit https://gerrit.wikimedia.org/r/356980 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I981a31e3d8462c2609203653838b636cd7c5935a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/prince Gerrit-Branch: master Gerrit-Owner: Chelsyx ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GlobalNotice[master]: Make warning on forced-globalnotice message feature configur...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356963 ) Change subject: Make warning on forced-globalnotice message feature configurable .. Make warning on forced-globalnotice message feature configurable This introduces $wgGlobalNoticeDisplayWarningOnEditPage, which is by default equal to false. When set to true, a warning will show to the editor who's editing MediaWiki:Forced-globalnotice for informing the purpose of the message. This change also makes the areas where the message is emphasized more semantic, by using instead of the and element. See also: https://writers.stackexchange.com/q/4674 Change-Id: I020cb5cde923937d33f2ba68488dc7b8109408d1 --- M GlobalNotice.class.php M extension.json 2 files changed, 24 insertions(+), 17 deletions(-) Approvals: Jack Phoenix: Looks good to me, approved jenkins-bot: Verified diff --git a/GlobalNotice.class.php b/GlobalNotice.class.php index 12a58e9..20fedca 100644 --- a/GlobalNotice.class.php +++ b/GlobalNotice.class.php @@ -78,33 +78,39 @@ } /** -* Show an annoying notice when editing MediaWiki:Forced-globalnotice because +* Show an annoying warning when editing MediaWiki:Forced-globalnotice because * that message is Serious Business™. -* Disabled for production, might be too annoying -- but I just wanted to code -* this feature. :) * -* Would be hooked into the 'EditPage::showEditForm:initial' hook. +* Disabled for production by default (but can be configured), +* might be too annoying -- but I just wanted to code this feature. :) * * @param EditPage $editPage Instance of EditPage class * @return bool - public static function displayNoticeOnEditPage( &$editPage ) { +*/ + public static function displayWarningOnEditPage( &$editPage ) { + global $wgGlobalNoticeDisplayWarningOnEditPage; + + if ( !$wgGlobalNoticeDisplayWarningOnEditPage ) { + return true; + } + // only initialize this when editing pages in MediaWiki namespace if ( $editPage->mTitle->getNamespace() != 8 ) { return true; } - // Show an annoying notice when editing MediaWiki:Forced-globalnotice + // Show an annoying warning when editing MediaWiki:Forced-globalnotice // I considered using confirm() JS but it doesn't allow CSS properties // AFAIK and no CSS properties = less obtrusive notice = bad, so I ditched // that idea. if ( $editPage->mTitle->getDBkey() == 'Forced-globalnotice' ) { $editPage->editFormPageTop .= 'Hey, hold it right there! -The value of this message is shown to all users, no matter what is their language. This can be extremely annoying. -Only use this for really important things, like server maintenance notices! -Understood? - + The value of this message is shown to all users, no matter what is their language. This can be extremely annoying. + Only use this for really important things, like server maintenance notices! + Understood? + -Yes!'; + Yes!'; // JavaScript must be injected here, wpTextbox1 doesn't exist before... $editPage->editFormTextAfterWarn .= '
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Batch cancel Amazon payments
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356979 ) Change subject: Batch cancel Amazon payments .. Batch cancel Amazon payments Change-Id: Ia08d21fdffd005b8ec6212fa61dfa1e57a0a845f --- M PaymentProviders/Amazon/AmazonApi.php A PaymentProviders/Amazon/Maintenance/Cancel.php 2 files changed, 60 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/79/356979/1 diff --git a/PaymentProviders/Amazon/AmazonApi.php b/PaymentProviders/Amazon/AmazonApi.php index 4e0e47e..46d6fb4 100644 --- a/PaymentProviders/Amazon/AmazonApi.php +++ b/PaymentProviders/Amazon/AmazonApi.php @@ -145,4 +145,14 @@ } return $authorizeResult['AuthorizeResult']['AuthorizationDetails']; } + + public function cancelOrderReference( $orderReferenceId, $reason = null ) { + $params = array( + 'amazon_order_reference_id' => $orderReferenceId + ); + if( $reason ) { + $params['cancelation_reason'] = $reason; + } + $this->client->cancelOrderReference( $params ); + } } diff --git a/PaymentProviders/Amazon/Maintenance/Cancel.php b/PaymentProviders/Amazon/Maintenance/Cancel.php new file mode 100644 index 000..1cbdafd --- /dev/null +++ b/PaymentProviders/Amazon/Maintenance/Cancel.php @@ -0,0 +1,50 @@ +addOption( 'reason', 'Reason for cancellation', '' ); + $this->addArgument( + 'file', + 'File with one order reference ID per line', + true + ); + $this->desiredOptions['config-node']['default'] = 'amazon'; + } + + public function execute() { + $api = AmazonApi::get(); + + $filename = $this->getArgument( 'file' ); + $reason = $this->getOption( 'reason' ); + + $f = fopen( $filename, 'r' ); + if ( !$f ) { + $this->error( "Could not open $filename for read", true ); + } + + // Do the loop! + while ( ( $line = fgets( $f ) ) !== false ) { + $orderRef = trim( $line ); + try { + $api->cancelOrderReference( $orderRef, $reason ); + print "Canceled $orderRef"; + } catch ( \Exception $ex ) { + print( $ex->getMessage() ); + } + } + } +} + +require ( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/356979 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia08d21fdffd005b8ec6212fa61dfa1e57a0a845f Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig 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] operations/dns[master]: remove "ja" and "ca" planet.wikimedia.org
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356978 ) Change subject: remove "ja" and "ca" planet.wikimedia.org .. remove "ja" and "ca" planet.wikimedia.org Change-Id: I78ddce81e5136550514262d5da104159b954f37f --- M templates/wikimedia.org 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/78/356978/1 diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 2688b6c..3840abf 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -687,7 +687,6 @@ planet 600 IN DYNA geoip!misc-addrs ar.planet600 IN DYNA geoip!misc-addrs bg.planet600 IN DYNA geoip!misc-addrs -ca.planet600 IN DYNA geoip!misc-addrs cs.planet600 IN DYNA geoip!misc-addrs da.planet600 IN DYNA geoip!misc-addrs de.planet600 IN DYNA geoip!misc-addrs @@ -700,7 +699,6 @@ id.planet600 IN DYNA geoip!misc-addrs is.planet600 IN DYNA geoip!misc-addrs it.planet600 IN DYNA geoip!misc-addrs -ja.planet600 IN DYNA geoip!misc-addrs nb.planet600 IN DYNA geoip!misc-addrs nn.planet600 IN DYNA geoip!misc-addrs no.planet600 IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/356978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78ddce81e5136550514262d5da104159b954f37f Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: planet: remove "ja" and "ca" (empty), add link to new "el"
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356977 ) Change subject: planet: remove "ja" and "ca" (empty), add link to new "el" .. planet: remove "ja" and "ca" (empty), add link to new "el" Change-Id: Idda7f0213e0778ecbbc7af494a698b34c13d2d98 --- D modules/planet/templates/feeds/ca_config.erb D modules/planet/templates/feeds/ja_config.erb M modules/planet/templates/html/index.html.tmpl.erb M modules/profile/manifests/planet/venus.pp 4 files changed, 1 insertion(+), 69 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/77/356977/1 diff --git a/modules/planet/templates/feeds/ca_config.erb b/modules/planet/templates/feeds/ca_config.erb deleted file mode 100644 index 1c339bf..000 --- a/modules/planet/templates/feeds/ca_config.erb +++ /dev/null @@ -1,25 +0,0 @@ -# ! This file is managed by puppet ! -# ca.planet.wm - Planet Venus configuration file - -# Documentation: -# Examples: -# Filters: -# Themes: - -# Global configuration - -[Planet] - -name= ca.planet.wikimedia -link= https://ca.planet.<%= scope.lookupvar('planet::planet_domain_name') %>/ -owner_name = planet -owner_email = pla...@wikimedia.org -output_theme= /usr/share/planet-venus/theme/wikimedia/ca -cache_directory = /var/cache/planet/ca/ -output_dir = /var/www/planet/ca/ -feed_timeout= 20 -items_per_page = 60 -log_level = DEBUG - -# Subscription configuration - diff --git a/modules/planet/templates/feeds/ja_config.erb b/modules/planet/templates/feeds/ja_config.erb deleted file mode 100644 index df94817..000 --- a/modules/planet/templates/feeds/ja_config.erb +++ /dev/null @@ -1,24 +0,0 @@ -# ! This file is managed by puppet ! -# ja.planet.wm - Planet Venus configuration file - -# Documentation: -# Examples: -# Filters: -# Themes: - -# Global configuration - -[Planet] - -name= ja.planet.wikimedia -link= https://ja.planet.<%= scope.lookupvar('planet::planet_domain_name') %>/ -owner_name = planet -owner_email = pla...@wikimedia.org -output_theme= /usr/share/planet-venus/theme/wikimedia/ja -cache_directory = /var/cache/planet/ja/ -output_dir = /var/www/planet/ja/ -feed_timeout= 20 -items_per_page = 60 -log_level = DEBUG - -# Subscription configuration diff --git a/modules/planet/templates/html/index.html.tmpl.erb b/modules/planet/templates/html/index.html.tmpl.erb index 7f2392b..d07cd1f 100644 --- a/modules/planet/templates/html/index.html.tmpl.erb +++ b/modules/planet/templates/html/index.html.tmpl.erb @@ -116,16 +116,15 @@ <%= scope.lookupvar('planet::planet_languages')[@title]['wikimedia'] %> http://ar.planet.wikimedia.org/";>ar.planet.wm -http://ca.planet.wikimedia.org/";>ca.planet.wm http://cs.planet.wikimedia.org/";>cs.planet.wm http://de.planet.wikimedia.org/";>de.planet.wm +http://el.planet.wikimedia.org/";>en.planet.wm http://en.planet.wikimedia.org/";>en.planet.wm http://es.planet.wikimedia.org/";>es.planet.wm http://fr.planet.wikimedia.org/";>fr.planet.wm http://gmq.planet.wikimedia.org/";>gmq.planet.wm http://id.planet.wikimedia.org/";>id.planet.wm http://it.planet.wikimedia.org/";>it.planet.wm -http://ja.planet.wikimedia.org/";>ja.planet.wm http://pl.planet.wikimedia.org/";>pl.planet.wm http://pt.planet.wikimedia.org/";>pt.planet.wm http://ro.planet.wikimedia.org/";>ro.planet.wm diff --git a/modules/profile/manifests/planet/venus.pp b/modules/profile/manifests/planet/venus.pp index 25db0be..117 100644 --- a/modules/profile/manifests/planet/venus.pp +++ b/modules/profile/manifests/planet/venus.pp @@ -33,15 +33,6 @@ 'wikimedia' => 'Уикимедия', 'planetarium' => 'планетарий', }, -ca => { -'subscribe' => 'Subscriure\'s', -'subscriptions' => 'Subscripcions', -'lastupdated' => 'Última actualització', -'alltimesutc' => 'Tots els temps són UTC.', -'poweredby' => 'Basat en', -'wikimedia' => 'Wikimedia', -'planetarium' => 'Planetari', -}, cs => { 'subscribe' => 'Přihlásit odběr', 'subscriptions' => 'Odběry', @@ -122,15 +113,6 @@ 'poweredby' => 'Reso possibile da', 'wikimedia' => 'Wikimedia', 'planetarium' => 'Planetarium', -}, -ja => { -'subscribe' => '購読する', -'subscriptions' => '登録されているブログ', -'lastupdated' => '最終更新日時', -'alltimesutc' => '時刻はすべてUTC表記です。', -'poweredby' => 'Powered by', -'wikimedia' => 'ウィキメディア', -'planetarium' => 'プラネタリウム', }, pl => { 'subscribe' => 'Subskrybuj', -- To view, visit https://gerrit.wikimedia.org/r/3
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix indentation of Gerrit downtime page
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356478 ) Change subject: Fix indentation of Gerrit downtime page .. Fix indentation of Gerrit downtime page Failing in style. Change-Id: I01e56c390cab94b4684db1e03c5ee9641602aee6 --- M modules/gerrit/templates/error.html.erb 1 file changed, 36 insertions(+), 36 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/gerrit/templates/error.html.erb b/modules/gerrit/templates/error.html.erb index 8e6549d..c397985 100644 --- a/modules/gerrit/templates/error.html.erb +++ b/modules/gerrit/templates/error.html.erb @@ -3,45 +3,45 @@ Gerrit - Error - - body { - color: #353535 !important; - background: #fff url(/page-bkg.cache.jpg) no-repeat 0 0 !important; - position: static; - } - h1 { - margin: 0; - padding: 14px 0 0 17px; - font-family: 'PT Sans', sans-serif; - font-weight: normal; - letter-spacing: -1px; - /* This color isn't used since there is an image there, -* but it kept for consistency when used for display of alt-text -*/ - color: #99; - min-height: 59px; - background: transparent url(/wikimedia-codereview-logo.cache.png) no-repeat 0 0; - text-indent: -px; - overflow: hidden; - } - p { - font-size: 150%; - } - + + body { +color: #353535 !important; +background: #fff url(/page-bkg.cache.jpg) no-repeat 0 0 !important; +position: static; + } + h1 { +margin: 0; +padding: 14px 0 0 17px; +font-family: 'PT Sans', sans-serif; +font-weight: normal; +letter-spacing: -1px; +/* This color isn't used since there is an image there, + * but it kept for consistency when used for display of alt-text + */ +color: #99; +min-height: 59px; +background: transparent url(/wikimedia-codereview-logo.cache.png) no-repeat 0 0; +text-indent: -px; +overflow: hidden; + } + p { +font-size: 150%; + } + -Wikimedia Code Review - -<%- if @maint_mode -%> -Gerrit is currently down for planned maintenance. Current ETA is <%= @maint_mode %>. -<%- else -%> -Gerrit is down. We're working on bringing it back as soon as possible. - -Please follow along the discussion at #wikimedia-operations on freenode as we debug. -<%- end -%> - +Wikimedia Code Review -Please try again later! + <%- if @maint_mode -%> + Gerrit is currently down for planned maintenance. Current ETA is <%= @maint_mode %>. + <%- else -%> + Gerrit is down. We're working on bringing it back as soon as possible. + + Please follow along the discussion at #wikimedia-operations on freenode as we debug. + <%- end -%> + + + Please try again later! -- To view, visit https://gerrit.wikimedia.org/r/356478 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01e56c390cab94b4684db1e03c5ee9641602aee6 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Bartosz Dziewoński Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Hashar Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix typo on Gerrit downtime page
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356477 ) Change subject: Fix typo on Gerrit downtime page .. Fix typo on Gerrit downtime page This message sure looks like it was written in panic. Change-Id: I1fd52be400f28df568bba5aaaf77b3ea0d04fb52 --- M modules/gerrit/templates/error.html.erb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/gerrit/templates/error.html.erb b/modules/gerrit/templates/error.html.erb index d424386..8e6549d 100644 --- a/modules/gerrit/templates/error.html.erb +++ b/modules/gerrit/templates/error.html.erb @@ -37,7 +37,7 @@ <%- else -%> Gerrit is down. We're working on bringing it back as soon as possible. -Please follow along the disccusion at #wikimedia-operations on freenode as we debug. +Please follow along the discussion at #wikimedia-operations on freenode as we debug. <%- end -%> -- To view, visit https://gerrit.wikimedia.org/r/356477 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1fd52be400f28df568bba5aaaf77b3ea0d04fb52 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Bartosz Dziewoński Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Hashar 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] apps...wikipedia[master]: Only request aggregated feed content for WP hosts
BearND has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356976 ) Change subject: Only request aggregated feed content for WP hosts .. Only request aggregated feed content for WP hosts The aggregated feed content is highly specific to Wikipedia. It would make sense to also check for the wiki site being a Wikipedia site (in addition to RESTBase being enabled). Bug: T166920 Change-Id: I6c347b53b0835dfba85172cd9f71eefad4375acd --- M app/src/main/java/org/wikipedia/dataclient/WikiSite.java M app/src/main/java/org/wikipedia/feed/FeedCoordinator.java M app/src/test/java/org/wikipedia/dataclient/WikiSiteTest.java 3 files changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/76/356976/1 diff --git a/app/src/main/java/org/wikipedia/dataclient/WikiSite.java b/app/src/main/java/org/wikipedia/dataclient/WikiSite.java index 909d1d5..5f2a064 100644 --- a/app/src/main/java/org/wikipedia/dataclient/WikiSite.java +++ b/app/src/main/java/org/wikipedia/dataclient/WikiSite.java @@ -137,6 +137,13 @@ return authorityToMobile(authority()); } +/** + * @return true if this WikiSite is pointing to a wikipedia.org domain. + */ +public boolean isWikipedia() { +return uri.getHost().endsWith(".wikipedia.org"); +} + @NonNull public String host() { return uri.getHost(); diff --git a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java index 11346b1..26ba340 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java +++ b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java @@ -21,7 +21,7 @@ @Override protected void buildScript(int age, WikiSite wiki) { -boolean restBaseEnabled = RbSwitch.INSTANCE.isRestBaseEnabled(wiki); +boolean restBaseEnabled = RbSwitch.INSTANCE.isRestBaseEnabled(wiki) && wiki.isWikipedia(); if (age == 0) { addPendingClient(new SearchClient()); diff --git a/app/src/test/java/org/wikipedia/dataclient/WikiSiteTest.java b/app/src/test/java/org/wikipedia/dataclient/WikiSiteTest.java index a664032..cd6ecd2 100644 --- a/app/src/test/java/org/wikipedia/dataclient/WikiSiteTest.java +++ b/app/src/test/java/org/wikipedia/dataclient/WikiSiteTest.java @@ -151,6 +151,16 @@ assertThat(subject.dbName(), is("nowiki")); } +@Test public void testIsWikipediaTrue() { +WikiSite subject = WikiSite.forLanguageCode("test"); +assertThat(subject.isWikipedia(), is(true)); +} + +@Test public void testIsWikipediaFalse() { +WikiSite subject = new WikiSite("bogus.org"); +assertThat(subject.isWikipedia(), is(false)); +} + @Test public void testHost() { WikiSite subject = WikiSite.forLanguageCode("test"); assertThat(subject.host(), is("test.wikipedia.org")); -- To view, visit https://gerrit.wikimedia.org/r/356976 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c347b53b0835dfba85172cd9f71eefad4375acd Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: BearND ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Introduce global limit parameter.
Smalyshev has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356975 ) Change subject: Introduce global limit parameter. .. Introduce global limit parameter. Currently, every API has its own limit parameter, which may be inconvenient when writing generic API wrappers, since each API instance should carry its own limit even if what we wanted is "limit=max" for all of them. This change introduces a global parameter, so that if, for example, "gcmlimit" is not specified but "limit" is, it is used as if "gcmlimit was specified". Specific limit still takes priority, so if both "limit" and "gcmlimit" are there, only "gcmlimit" is considered. Change-Id: Ied408bcab541dac2fa143d2aeb9d2ccf7b321fa7 --- M includes/api/ApiBase.php M tests/phpunit/includes/api/ApiBaseTest.php 2 files changed, 70 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/75/356975/1 diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index a6c4b2a..d50c111 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1081,6 +1081,12 @@ } } } else { + if ( $type == 'limit' && $this->getMain()->getVal( $encParamName ) === null && +$this->getMain()->getVal( $paramName ) !== null + ) { + // If "gcmlimit" is not specified but "limit" is, use "limit" + $encParamName = $paramName; + } $value = $this->getMain()->getVal( $encParamName, $default ); if ( isset( $value ) && $type == 'namespace' ) { diff --git a/tests/phpunit/includes/api/ApiBaseTest.php b/tests/phpunit/includes/api/ApiBaseTest.php index 253ac95..8ee2221 100644 --- a/tests/phpunit/includes/api/ApiBaseTest.php +++ b/tests/phpunit/includes/api/ApiBaseTest.php @@ -126,6 +126,70 @@ ]; } + /** +* @dataProvider provideGetParameterFromSettingsLimit +* @param array $request +* @param integer $expected +* @param string $warning +*/ + public function testLimitParameter( $request, $expected, $warning = null ) { + $mock = new MockApi(); + $wrapper = TestingAccessWrapper::newFromObject( $mock ); + + $context = new DerivativeContext( $mock ); + $context->setRequest( new FauxRequest( $request ) ); + $wrapper->mMainModule = new ApiMain( $context ); + $wrapper->mModulePrefix = 'acme'; + + $limitSettings = [ + ApiBase::PARAM_TYPE => 'limit', + ApiBase::PARAM_DFLT => 10, + ApiBase::PARAM_MIN => 1, + ApiBase::PARAM_MAX => 100, + ApiBase::PARAM_MAX2 => 200 + ]; + + $result = $wrapper->getParameterFromSettings( 'limit', $limitSettings, true ); + $this->assertEquals( $expected, $result ); + if ( $warning ) { + $first = reset( $mock->warnings ); + $this->assertEquals( $warning, $first->getApiCode() ); + } else { + $this->assertSame( [], $mock->warnings ); + } + + } + + public function provideGetParameterFromSettingsLimit() { + return [ + 'simple limit' => [ + [ 'acmelimit' => '20' ], + 20 + ], + 'global limit' => [ + [ 'limit' => '21' ], + 21 + ], + 'both limits' => [ + [ 'limit' => '42', 'acmelimit' => '22' ], + 22 + ], + 'no limits' => [ + [], + 10 + ], + 'max limit' => [ + [ 'limit' => 'max' ], + 100 + ], + 'less than min' => [ + [ 'limit' => '-5' ], + 1, + 'integeroutofrange' + ], + ]; + } + public function testErrorArrayToStatus() { $mock = new MockApi(); -- To view, visit https://gerrit.wikimedia.org/r/356975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied408bcab541dac2fa143d2aeb9d2ccf7b321fa7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Sma
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Remove unused/discouraged mobile.context methods
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356769 ) Change subject: Hygiene: Remove unused/discouraged mobile.context methods .. Hygiene: Remove unused/discouraged mobile.context methods These are no longer needed. Change-Id: Icfbfebabf0de263a8300366c397b2fbf854d3d55 --- M resources/mobile.startup/context.js M resources/skins.minerva.scripts/init.js 2 files changed, 5 insertions(+), 30 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/mobile.startup/context.js b/resources/mobile.startup/context.js index d4a4de4..718d762 100644 --- a/resources/mobile.startup/context.js +++ b/resources/mobile.startup/context.js @@ -1,13 +1,11 @@ -( function ( M, $ ) { - var context; - +( function ( M ) { /** * Mobile mode helper class * * @class context * @singleton */ - context = { + var context = { /** * Gets current mobile mode * @method @@ -15,32 +13,9 @@ */ getMode: function () { return mw.config.get( 'wgMFMode' ); - }, - - /** -* Determines if mobile mode is beta -* @method -* @return {boolean} -*/ - isBetaGroupMember: function () { - return this.getMode() === 'beta'; - }, - - /** -* Detect module being run outside allowed mode -* @method -* @param {Array} modes Array of allowed mode names -* @throws Error when a module is run out of its allowed modes -*/ - assertMode: function ( modes ) { - var mode = this.getMode(); - if ( $.inArray( mode, modes ) === -1 ) { - throw new Error( 'Attempt to run module outside declared environment mode ' + mode ); - } } }; - M.define( 'mobile.startup/context', context ) - .deprecate( 'mobile.context/context' ); + M.define( 'mobile.startup/context', context ); -}( mw.mobileFrontend, jQuery ) ); +}( mw.mobileFrontend ) ); diff --git a/resources/skins.minerva.scripts/init.js b/resources/skins.minerva.scripts/init.js index bab178a..d34465f 100644 --- a/resources/skins.minerva.scripts/init.js +++ b/resources/skins.minerva.scripts/init.js @@ -136,7 +136,7 @@ settings.save( 'mobile-betaoptin-token', token ); } - inStable = !context.isBetaGroupMember(); + inStable = context.getMode() === 'stable'; inSample = mw.experiments.getBucket( experiment, token ) === 'A'; if ( inStable && ( inSample || mw.util.getParamValue( 'debug' ) ) ) { betaOptinPanel = new BetaOptinPanel( { -- To view, visit https://gerrit.wikimedia.org/r/356769 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icfbfebabf0de263a8300366c397b2fbf854d3d55 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson Gerrit-Reviewer: Bmansurov Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove old expired throttle rules to cleanup throttle.php
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356972 ) Change subject: Remove old expired throttle rules to cleanup throttle.php .. Remove old expired throttle rules to cleanup throttle.php Change-Id: Id7d839197a29369143396dee6d924f4ba4509033 --- M wmf-config/throttle.php 1 file changed, 0 insertions(+), 23 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified Dzahn: Looks good to me, but someone else must approve diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php index d56e306..19307c0 100644 --- a/wmf-config/throttle.php +++ b/wmf-config/throttle.php @@ -39,29 +39,6 @@ 'value' => 200, ]; -$wmgThrottlingExceptions[] = [ // Wikimedia Vienna Hackathon - 'from' => '2017-05-19T08:00 +1:00', - 'to' => '2017-05-21T21:00 +1:00', - 'IP' => [ - '217.196.74.137', - '80.123.167.113', - ], - 'dbname' => [ 'labswiki', 'mediawikiwiki' ], - 'value' => 100, -]; - -$wmgThrottlingExceptions[] = [ // per irc discussion - 'from' => '2017-05-26T19:00 +0:00', - 'to' => '2017-05-26T23:00 +0:00', - 'IP' => [ - '184.171.112.58', - '128.223.223.182', - '2607:8400:2802:0010:0250:56ff:feab:339c' - ], - 'dbname' => [ 'enwiki','commons' ], - 'value' => 40 // 30 expected -]; - $wmgThrottlingExceptions[] = [ // T166619 'from' => '2017-06-01T17:00 UTC', 'to' => '2017-06-01T21:00 UTC', -- To view, visit https://gerrit.wikimedia.org/r/356972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7d839197a29369143396dee6d924f4ba4509033 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Zppix Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Maintenance script to batch capture Amazon payments
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356974 ) Change subject: Maintenance script to batch capture Amazon payments .. Maintenance script to batch capture Amazon payments Change-Id: Ia76da4c0ccdb40a9869abdb073c4b8cc1bc4670e --- M PaymentProviders/Amazon/AmazonApi.php A PaymentProviders/Amazon/Maintenance/AuthorizeAndCapture.php 2 files changed, 59 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/74/356974/1 diff --git a/PaymentProviders/Amazon/AmazonApi.php b/PaymentProviders/Amazon/AmazonApi.php index 6e27411..d0be8ef 100644 --- a/PaymentProviders/Amazon/AmazonApi.php +++ b/PaymentProviders/Amazon/AmazonApi.php @@ -117,4 +117,26 @@ } return $getDetailsResult['GetOrderReferenceDetailsResult']['OrderReferenceDetails']; } + + public function authorizeAndCapture( + $orderReferenceId, + $amount, + $currency, + $merchantReference + ) { + $authorizeResult = $this->client->getOrderReferenceDetails( + array( + 'amazon_order_reference_id' => $orderReferenceId, + 'authorization_amount' => $amount, + 'currency_code' => $currency, + 'capture_now' => true, // combine authorize and capture steps + 'authorization_reference_id' => $merchantReference, + 'transaction_timeout' => 0, + ) + )->toArray(); + if ( !empty( $authorizeResult['Error'] ) ) { + throw new SmashPigException( $authorizeResult['Error']['Message'] ); + } + return $authorizeResult['AuthorizeResult']['AuthorizationDetails']; + } } diff --git a/PaymentProviders/Amazon/Maintenance/AuthorizeAndCapture.php b/PaymentProviders/Amazon/Maintenance/AuthorizeAndCapture.php new file mode 100644 index 000..7c78558 --- /dev/null +++ b/PaymentProviders/Amazon/Maintenance/AuthorizeAndCapture.php @@ -0,0 +1,37 @@ +addArgument( + 'file', + 'CSV file with merchant ref, currency, amount, and order reference ID', + true + ); + } + + public function execute() { + $filename = $this->getArgument( 'file' ); + $reader = new CsvReader( $filename ); + $api = AmazonApi::get(); + do { + $line = $reader->current(); + $merchantRef = $line[0]; + $currency = $line[1]; + $amount = $line[2]; + $orderRef = $line[3]; + $result = $api->authorizeAndCapture( + $orderRef, $amount, $currency, $merchantRef + ); + print_r( $result ); + $reader->next(); + } while ( $reader->valid() ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/356974 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia76da4c0ccdb40a9869abdb073c4b8cc1bc4670e Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig 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] operations/mediawiki-config[master]: Remove old expired throttle rules to cleanup throttle.php
Zppix has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356972 ) Change subject: Remove old expired throttle rules to cleanup throttle.php .. Remove old expired throttle rules to cleanup throttle.php Change-Id: Id7d839197a29369143396dee6d924f4ba4509033 --- M wmf-config/throttle.php 1 file changed, 0 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/72/356972/2 diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php index d56e306..19307c0 100644 --- a/wmf-config/throttle.php +++ b/wmf-config/throttle.php @@ -39,29 +39,6 @@ 'value' => 200, ]; -$wmgThrottlingExceptions[] = [ // Wikimedia Vienna Hackathon - 'from' => '2017-05-19T08:00 +1:00', - 'to' => '2017-05-21T21:00 +1:00', - 'IP' => [ - '217.196.74.137', - '80.123.167.113', - ], - 'dbname' => [ 'labswiki', 'mediawikiwiki' ], - 'value' => 100, -]; - -$wmgThrottlingExceptions[] = [ // per irc discussion - 'from' => '2017-05-26T19:00 +0:00', - 'to' => '2017-05-26T23:00 +0:00', - 'IP' => [ - '184.171.112.58', - '128.223.223.182', - '2607:8400:2802:0010:0250:56ff:feab:339c' - ], - 'dbname' => [ 'enwiki','commons' ], - 'value' => 40 // 30 expected -]; - $wmgThrottlingExceptions[] = [ // T166619 'from' => '2017-06-01T17:00 UTC', 'to' => '2017-06-01T21:00 UTC', -- To view, visit https://gerrit.wikimedia.org/r/356972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7d839197a29369143396dee6d924f4ba4509033 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Zppix Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Revert "Only request Feed content if RESTBase is enabled"
Mholloway has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356973 ) Change subject: Revert "Only request Feed content if RESTBase is enabled" .. Revert "Only request Feed content if RESTBase is enabled" I79e20a8a exposed a race condition in which, on a fresh install, the feed content is likely to be requested and layout begun before the remote config is fetched. I79e20a8a added a check that RESTBase loading was enabled in order for RB-based feed content to be loaded, so it is likely that only the main page and random cards (the only two fully local cards) will appear. When online, the remote config will likely be fetched by the time the user attempts a refresh, useRestbase will then be true, and the expected feed content will appear. When we're offline, however, the remote config fetch call will fail, and will not be attempted for another 24 hours. In the meantime, the user will get no feed content because useRestbase will be false. This shouldn't happen. Really, the race condition should be fixed. I'll file that as a follow- up task. But, the useRestbase restriction on loading feed content seems unnecessary in any case, so this reverts it. This reverts commit 204810b1a3519f8c89f77e90886d8efb6669b5eb. Bug: T166789 Change-Id: I19e1032545485b31820ca64f46e4d304f755721e --- M app/src/main/java/org/wikipedia/feed/FeedCoordinator.java M app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java 2 files changed, 5 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/73/356973/1 diff --git a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java index 11346b1..e8a850a 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java +++ b/app/src/main/java/org/wikipedia/feed/FeedCoordinator.java @@ -3,7 +3,6 @@ import android.content.Context; import android.support.annotation.NonNull; -import org.wikipedia.dataclient.WikiSite; import org.wikipedia.feed.aggregated.AggregatedFeedContentClient; import org.wikipedia.feed.announcement.AnnouncementClient; import org.wikipedia.feed.becauseyouread.BecauseYouReadClient; @@ -11,7 +10,6 @@ import org.wikipedia.feed.mainpage.MainPageClient; import org.wikipedia.feed.random.RandomClient; import org.wikipedia.feed.searchbar.SearchClient; -import org.wikipedia.settings.RbSwitch; class FeedCoordinator extends FeedCoordinatorBase { @@ -20,18 +18,12 @@ } @Override -protected void buildScript(int age, WikiSite wiki) { -boolean restBaseEnabled = RbSwitch.INSTANCE.isRestBaseEnabled(wiki); - +protected void buildScript(int age) { if (age == 0) { addPendingClient(new SearchClient()); -if (restBaseEnabled) { -addPendingClient(new AnnouncementClient()); -} +addPendingClient(new AnnouncementClient()); } -if (restBaseEnabled) { -addPendingClient(new AggregatedFeedContentClient()); -} +addPendingClient(new AggregatedFeedContentClient()); addPendingClient(new ContinueReadingClient()); if (age == 0) { addPendingClient(new MainPageClient()); diff --git a/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java b/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java index c5bef22..5fa2f30 100644 --- a/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java +++ b/app/src/main/java/org/wikipedia/feed/FeedCoordinatorBase.java @@ -80,7 +80,7 @@ currentAge++; } -buildScript(currentAge, wiki); +buildScript(currentAge); requestNextCard(wiki); } @@ -111,7 +111,7 @@ more(wiki); } -protected abstract void buildScript(int age, WikiSite wiki); +protected abstract void buildScript(int age); protected void addPendingClient(FeedClient client) { pendingClients.add(client); -- To view, visit https://gerrit.wikimedia.org/r/356973 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19e1032545485b31820ca64f46e4d304f755721e Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Mholloway ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid scoped lock errors in Category::refreshCounts() due to...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356520 ) Change subject: Avoid scoped lock errors in Category::refreshCounts() due to nesting .. Avoid scoped lock errors in Category::refreshCounts() due to nesting Bug: T166757 Change-Id: Ie59523a8b3315f063c914cd25d7b53c11e03fbcd --- M includes/deferred/LinksDeletionUpdate.php M includes/page/WikiPage.php 2 files changed, 9 insertions(+), 2 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/LinksDeletionUpdate.php b/includes/deferred/LinksDeletionUpdate.php index ca29078..3dd9de6 100644 --- a/includes/deferred/LinksDeletionUpdate.php +++ b/includes/deferred/LinksDeletionUpdate.php @@ -106,7 +106,11 @@ __METHOD__ ); if ( $row ) { - Category::newFromRow( $row, $title )->refreshCounts(); + $cat = Category::newFromRow( $row, $title ); + // T166757: do the update after the main job DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } } diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 7489f44..2adc5fb 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3496,7 +3496,10 @@ ); foreach ( $rows as $row ) { $cat = Category::newFromRow( $row ); - $cat->refreshCounts(); + // T166757: do the update after this DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } } } -- To view, visit https://gerrit.wikimedia.org/r/356520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie59523a8b3315f063c914cd25d7b53c11e03fbcd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-Reviewer: Chad Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add tests for ParserOptions
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356869 ) Change subject: Add tests for ParserOptions .. Add tests for ParserOptions Change-Id: I3e2d945d109bbb0ebc31d65d9f6faaa7482deefe --- A tests/phpunit/includes/parser/ParserOptionsTest.php 1 file changed, 77 insertions(+), 0 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, but someone else must approve diff --git a/tests/phpunit/includes/parser/ParserOptionsTest.php b/tests/phpunit/includes/parser/ParserOptionsTest.php new file mode 100644 index 000..aacdb1a --- /dev/null +++ b/tests/phpunit/includes/parser/ParserOptionsTest.php @@ -0,0 +1,77 @@ + '', + 'wgHooks' => [], + ]; + $globals['wgHooks'] += [ + 'PageRenderingHash' => [], + ] + $wgHooks; + $this->setMwGlobals( $globals ); + + $popt = new ParserOptions(); + foreach ( $options as $setter => $value ) { + $popt->$setter( $value ); + } + $this->assertSame( $expect, $popt->optionsHash( $usedOptions ) ); + } + + public static function provideOptionsHash() { + $used = [ 'wrapclass', 'editsection', 'printable' ]; + + return [ + 'Canonical options, nothing used' => [ [], '*!*!*!*!*!*', [] ], + 'Canonical options, used some options' => [ $used, '*!*!*!*!*', [] ], + 'Used some options, non-default values' => [ + $used, + '*!*!*!*!*!printable=1!wrapclass=foobar', + [ + 'setWrapOutputClass' => 'foobar', + 'setIsPrintable' => true, + ] + ], + 'Canonical options, nothing used, but with hooks and $wgRenderHashAppend' => [ + [], + '*!*!*!*!*!wgRenderHashAppend!*!onPageRenderingHash', + [], + [ + 'wgRenderHashAppend' => '!wgRenderHashAppend', + 'wgHooks' => [ 'PageRenderingHash' => [ [ __CLASS__ . '::onPageRenderingHash' ] ] ], + ] + ], + ]; + } + + public static function onPageRenderingHash( &$confstr ) { + $confstr .= '!onPageRenderingHash'; + } + + public function testMatches() { + $popt1 = new ParserOptions(); + $popt2 = new ParserOptions(); + $this->assertTrue( $popt1->matches( $popt2 ) ); + + $popt1->enableLimitReport( true ); + $popt2->enableLimitReport( false ); + $this->assertTrue( $popt1->matches( $popt2 ) ); + + $popt2->setTidy( !$popt2->getTidy() ); + $this->assertFalse( $popt1->matches( $popt2 ) ); + } + +} -- To view, visit https://gerrit.wikimedia.org/r/356869 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e2d945d109bbb0ebc31d65d9f6faaa7482deefe Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Anomie Gerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: Make the ORD wikitech-static the official wikitech-static.
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356874 ) Change subject: Make the ORD wikitech-static the official wikitech-static. .. Make the ORD wikitech-static the official wikitech-static. Bug: T164271 Change-Id: I969a4b8fb2ecc253f89550894f0b1644fdbc4f6d --- M templates/wikimedia.org 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 55fd890..2688b6c 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -723,18 +723,18 @@ store1H IN CNAMEc.ssl.shopify.com. static-bugzilla 600 IN DYNA geoip!misc-addrs stats600 IN DYNA geoip!misc-addrs -status 5M IN A162.209.126.221 -status 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 +status 5M IN A192.237.162.200 +status 5M IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 techblog 600 IN DYNA geoip!text-addrs ticket 600 IN DYNA geoip!misc-addrs tor-eqiad-1 1H IN CNAMEradium mirrors 1H IN CNAMEsodium yarn 600 IN DYNA geoip!misc-addrs -wikitech 1H IN CNAMEsilver -wikitech-static 5M IN A162.209.126.221 -wikitech-static 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 -wikitech-static-ord 5M IN A 192.237.162.200 -wikitech-static-ord 5M IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 +wikitech 1H IN CNAMEsilver +wikitech-static-iad 5M IN A162.209.126.221 +wikitech-static-iad 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 +wikitech-static 5M IN A192.237.162.200 +wikitech-static 5M IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 labtestwikitech 1H IN CNAMElabtestweb2001 labtesthorizon 1H IN DYNA geoip!misc-addrs labtestspice 1H IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/356874 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I969a4b8fb2ecc253f89550894f0b1644fdbc4f6d Gerrit-PatchSet: 3 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Andrew Bogott Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_28]: Better handling of jobs execution in post-connection shutdown
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356880 ) Change subject: Better handling of jobs execution in post-connection shutdown .. Better handling of jobs execution in post-connection shutdown In the postprocessing, some jobs can be executed but given the deferred updates were already "closed", any new DeferredUpdate were directly called (as explained by Krinkle on T165714), and the transactions opened by classical jobs are badly mixed with transactions (directly) executed by DeferredUpdates jobs, issuing a DBError, avoiding the job, which stays in a 'claimed' status even if failed. Quite similarly, some DeferredUpdates callables use JobQueueGroup::lazyPush so it is needed to really push the generated jobs. This change removes the run-immediately-deferred-updates behaviour even in the post-connection shutdown, and given there is a call to DeferredUpdates::doUpdates in JobRunner::execute it is not necessary to add another one and hence execution of Web jobs is more similar to execution of CLI jobs. In the same spirit to reconcile Web jobs and CLI jobs, the call to JobQueueGroup::pushLazyJobs is done in JobRunner::execute. Bug: T165714 Bug: T100085 Change-Id: I721e7167eca5b0b6227234fe516005243ab22388 (cherry picked from commit d80fca05e18d9654b8458ed6966c5d3c4991d88e) --- M includes/MediaWiki.php M includes/deferred/DeferredUpdates.php M includes/jobqueue/JobRunner.php 3 files changed, 4 insertions(+), 10 deletions(-) Approvals: Seb35: Looks good to me, but someone else must approve Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index aabaf30..f668717 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -889,7 +889,6 @@ // Do any deferred jobs DeferredUpdates::doUpdates( 'enqueue' ); - DeferredUpdates::setImmediateMode( true ); // Make sure any lazy jobs are pushed JobQueueGroup::pushLazyJobs(); diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 1ba6c1f..fd3a1af 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -52,8 +52,6 @@ private static $preSendUpdates = []; /** @var DeferrableUpdate[] Updates to be deferred until after request end */ private static $postSendUpdates = []; - /** @var bool Whether to just run updates in addUpdate() */ - private static $immediateMode = false; const ALL = 0; // all updates; in web requests, use only after flushing the output buffer const PRESEND = 1; // for updates that should run before flushing output buffer @@ -85,12 +83,6 @@ self::push( self::$preSendUpdates, $update ); } else { self::push( self::$postSendUpdates, $update ); - } - - if ( self::$immediateMode ) { - // No more explicit doUpdates() calls will happen, so run this now - self::doUpdates( 'run' ); - return; } // Try to run the updates now if in CLI mode and no transaction is active. @@ -137,9 +129,10 @@ /** * @param bool $value Whether to just immediately run updates in addUpdate() * @since 1.28 +* @deprecated 1.29 Causes issues in Web-executed jobs - see T165714 and T100085. */ public static function setImmediateMode( $value ) { - self::$immediateMode = (bool)$value; + wfDeprecated( __METHOD__, '1.29' ); } /** diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index 0469eeb..aa8917c 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -277,6 +277,8 @@ $this->commitMasterChanges( $lbFactory, $job, $fnameTrxOwner ); // Run any deferred update tasks; doUpdates() manages transactions itself DeferredUpdates::doUpdates(); + // Push lazy jobs added by the job or its deferred udpates + JobQueueGroup::pushLazyJobs(); } catch ( Exception $e ) { MWExceptionHandler::rollbackMasterChangesAndLog( $e ); $status = false; -- To view, visit https://gerrit.wikimedia.org/r/356880 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I721e7167eca5b0b6227234fe516005243ab22388 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_28 Gerrit-Owner: Seb35 Gerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Chad Gerrit-Reviewer: Seb35 Gerrit-Reviewer: jenkins-bot <> _
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: WIP: Handle url-encoded hrefs properly while detecting inter...
Subramanya Sastry has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356971 ) Change subject: WIP: Handle url-encoded hrefs properly while detecting interwiki shortcuts .. WIP: Handle url-encoded hrefs properly while detecting interwiki shortcuts Quick friday evening patch. Sanity to be verified and whether it is okay to url-decode everything instead of just pieces[0]. Change-Id: I2cb64905d890d92c2b06bafa3da7d45a6b4a870d --- M lib/html2wt/LinkHandler.js M tests/parserTests.txt 2 files changed, 29 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/71/356971/1 diff --git a/lib/html2wt/LinkHandler.js b/lib/html2wt/LinkHandler.js index b2db533..9a8a620 100644 --- a/lib/html2wt/LinkHandler.js +++ b/lib/html2wt/LinkHandler.js @@ -182,8 +182,29 @@ return rtData; } + var processHref = function(s, sep) { + var pieces = s.split(sep); + if (pieces.length === 1) { + return s; + } + + // Decode url-encoded entities in the first piece so we + // can more accurate detect interwiki prefixes. + return Util.decodeURI(pieces[0]) + sep + pieces.slice(1).join(sep); + } + + var iwMatchStr; + if (/^\.\//.test(href)) { + // With a leading './', 'foo:' is an interwiki prefix + iwMatchStr = processHref(href, ':'); + } else { + // Without a leading './', we treat 'foo:' prefix as a url protocol. + // But, 'foo%3A' is a valid interwiki prefix. + iwMatchStr = processHref(href, '%3A'); + } + // Check if the href matches any of our interwiki URL patterns - var interWikiMatch = wiki.interWikiMatcher().match(href); + var interWikiMatch = wiki.interWikiMatcher().match(iwMatchStr); if (interWikiMatch // Remaining target // 1) is not just a fragment id (#foo), and diff --git a/tests/parserTests.txt b/tests/parserTests.txt index df98feb..34e69ca 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -25922,6 +25922,9 @@ Foo Foo Foo +Foo +Foo +Foo !! wikitext [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] @@ -25930,6 +25933,10 @@ [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] [[:fr:Foo|Foo]] + +[[:fr:Foo|Foo]] +[[:fr:Foo|Foo]] +[[:fr:Foo|Foo]] !! end !! test -- To view, visit https://gerrit.wikimedia.org/r/356971 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2cb64905d890d92c2b06bafa3da7d45a6b4a870d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Fix wrong syntax in ~/.gitconfig
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356969 ) Change subject: Gerrit: Fix wrong syntax in ~/.gitconfig .. Gerrit: Fix wrong syntax in ~/.gitconfig I by mistake did gc.= instead of [gc] = Change-Id: I825a7c9f0d7f708ba3a838bf4a59aa0bc7b8ba63 --- M modules/gerrit/files/.gitconfig 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/gerrit/files/.gitconfig b/modules/gerrit/files/.gitconfig index f792b05..574b652 100644 --- a/modules/gerrit/files/.gitconfig +++ b/modules/gerrit/files/.gitconfig @@ -1,2 +1,3 @@ -gc.auto=0 -gc.autopacklimit=0 +[gc] +auto = 0 +autopacklimit = 0 -- To view, visit https://gerrit.wikimedia.org/r/356969 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I825a7c9f0d7f708ba3a838bf4a59aa0bc7b8ba63 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Hashar Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Alert on Amazon message verification failure
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356970 ) Change subject: Alert on Amazon message verification failure .. Alert on Amazon message verification failure We should know about these ASAP Bug: T166087 Change-Id: Icd269abe5706d82fcf7aa5c81f4baeeae5ea5996 --- M PaymentProviders/Amazon/AmazonListener.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/70/356970/1 diff --git a/PaymentProviders/Amazon/AmazonListener.php b/PaymentProviders/Amazon/AmazonListener.php index 6d7a831..96ead27 100644 --- a/PaymentProviders/Amazon/AmazonListener.php +++ b/PaymentProviders/Amazon/AmazonListener.php @@ -6,6 +6,7 @@ use SmashPig\Core\Listeners\ListenerDataException; use SmashPig\Core\Listeners\RestListener; use SmashPig\Core\Logging\Logger; +use SmashPig\Maintenance\TestFailMail; /** * Uses the Amazon SDK to parse incoming IPN messages @@ -57,6 +58,7 @@ // because of how RestListener is implemented and because we only // process one message per request // Bad form, but it would be odd to hold this till doMessageSecurity + Logger::alert( 'Error validating Amazon message. Firewall problem?' ); throw new ListenerSecurityException( $ex->getMessage() ); } $messageValues = $amazonHandlerMessage->toArray(); -- To view, visit https://gerrit.wikimedia.org/r/356970 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd269abe5706d82fcf7aa5c81f4baeeae5ea5996 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig 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] operations/puppet[production]: Gerrit: Fix wrong syntax in ~/.gitconfig
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356969 ) Change subject: Gerrit: Fix wrong syntax in ~/.gitconfig .. Gerrit: Fix wrong syntax in ~/.gitconfig I by mistake did gc. instead of [gc] Change-Id: I825a7c9f0d7f708ba3a838bf4a59aa0bc7b8ba63 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/69/356969/1 -- To view, visit https://gerrit.wikimedia.org/r/356969 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I825a7c9f0d7f708ba3a838bf4a59aa0bc7b8ba63 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GlobalNotice[master]: [WIP] Make warning on forced-globalnotice message feature co...
SamanthaNguyen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356963 ) Change subject: [WIP] Make warning on forced-globalnotice message feature configurable .. [WIP] Make warning on forced-globalnotice message feature configurable This introduces $wgGlobalNoticeDisplayWarningOnEditPage, which is by default equal to false. When set to true, a warning will show to the editor who's editing MediaWiki:Forced-globalnotice for informing the purpose of the message. Change-Id: I020cb5cde923937d33f2ba68488dc7b8109408d1 --- M GlobalNotice.class.php M extension.json 2 files changed, 38 insertions(+), 33 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalNotice refs/changes/63/356963/1 diff --git a/GlobalNotice.class.php b/GlobalNotice.class.php index 12a58e9..b8d6a9d 100644 --- a/GlobalNotice.class.php +++ b/GlobalNotice.class.php @@ -78,41 +78,44 @@ } /** -* Show an annoying notice when editing MediaWiki:Forced-globalnotice because +* Show an annoying warning when editing MediaWiki:Forced-globalnotice because * that message is Serious Business™. -* Disabled for production, might be too annoying -- but I just wanted to code -* this feature. :) * -* Would be hooked into the 'EditPage::showEditForm:initial' hook. +* Disabled for production by default (but can be configured), +* might be too annoying -- but I just wanted to code this feature. :) * * @param EditPage $editPage Instance of EditPage class * @return bool - public static function displayNoticeOnEditPage( &$editPage ) { - // only initialize this when editing pages in MediaWiki namespace - if ( $editPage->mTitle->getNamespace() != 8 ) { +*/ + public static function displayWarningOnEditPage( &$editPage ) { + global $wgGlobalNoticeDisplayWarningOnEditPage; + + if ( $wgGlobalNoticeDisplayWarningOnEditPage ) { + // only initialize this when editing pages in MediaWiki namespace + if ( $editPage->mTitle->getNamespace() != 8 ) { + return true; + } + + // Show an annoying warning when editing MediaWiki:Forced-globalnotice + // I considered using confirm() JS but it doesn't allow CSS properties + // AFAIK and no CSS properties = less obtrusive notice = bad, so I ditched + // that idea. + if ( $editPage->mTitle->getDBkey() == 'Forced-globalnotice' ) { + $editPage->editFormPageTop .= 'Hey, hold it right there! + The value of this message is shown to all users, no matter what is their language. This can be extremely annoying. + Only use this for really important things, like server maintenance notices! + Understood? + + + Yes!'; + // JavaScript must be injected here, wpTextbox1 doesn't exist before... + $editPage->editFormTextAfterWarn .= ' + document.getElementById( \'wpTextbox1\' ).style.display = \'none\'; + '; + } + return true; } - - // Show an annoying notice when editing MediaWiki:Forced-globalnotice - // I considered using confirm() JS but it doesn't allow CSS properties - // AFAIK and no CSS properties = less obtrusive notice = bad, so I ditched - // that idea. - if ( $editPage->mTitle->getDBkey() == 'Forced-globalnotice' ) { - $editPage->editFormPageTop .= 'Hey, hold it right there! -The value of this message is shown to all users, no matter what is their language. This can be extremely annoying. -Only use this for really important things, like server maintenance notices! -Understood? - - -Yes!'; - // JavaScript must be injected here, wpTextbox1 doesn't exist before... - $editPage->editFormTextAfterWarn .= ' - document.getElementById( \'wpTextbox1\' ).style.display = \'none\'; - '; - } - - return true; } - */ -} \ No newline at end of file +} diff --git a/extension.json b/extension.json index 60d06c4..86e3283 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "GlobalNotice", - "version": "0.5", + "version": "0.6.0", "author": [ "Misza", "Jack Phoenix" @@ -18,9 +18,11 @@ "GlobalNotice": "GlobalNotice.class.php" }, "Hooks": { -
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Set gc.auto and gc.autopacklimit to 0 in ~/.gitconfig
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356824 ) Change subject: Gerrit: Set gc.auto and gc.autopacklimit to 0 in ~/.gitconfig .. Gerrit: Set gc.auto and gc.autopacklimit to 0 in ~/.gitconfig This is for gerrit 2.14 and won't affect gerrit 2.13. Apparently in the newer jgit release which gerrit 2.14 has they added support for gc.auto but we have gc switched off but it doesn't seem to affect gc.auto. So we have to switch it off globally in a gitconfig file. See disccusion at https://groups.google.com/forum/#!topic/repo-discuss/lVR37Pm4G3c Bug: T151676 Bug: T156120 Change-Id: Icbcee9c080a3ee618104a5bf2c1b7c579ca33b5f --- A modules/gerrit/files/.gitconfig M modules/gerrit/manifests/jetty.pp 2 files changed, 11 insertions(+), 0 deletions(-) Approvals: Chad: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/gerrit/files/.gitconfig b/modules/gerrit/files/.gitconfig new file mode 100644 index 000..f792b05 --- /dev/null +++ b/modules/gerrit/files/.gitconfig @@ -0,0 +1,2 @@ +gc.auto=0 +gc.autopacklimit=0 diff --git a/modules/gerrit/manifests/jetty.pp b/modules/gerrit/manifests/jetty.pp index 134eeb5..8a6c701 100644 --- a/modules/gerrit/manifests/jetty.pp +++ b/modules/gerrit/manifests/jetty.pp @@ -81,6 +81,15 @@ require => Package['gerrit'], } +file { '/var/lib/gerrit2/.gitconfig': +ensure => directory, +mode=> '0644', +owner => 'gerrit2', +group => 'gerrit2', +require => File['/var/lib/gerrit2'], +source => 'puppet:///modules/gerrit/.gitconfig', +} + file { '/var/lib/gerrit2/.ssh': ensure => directory, recurse => remote, -- To view, visit https://gerrit.wikimedia.org/r/356824 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbcee9c080a3ee618104a5bf2c1b7c579ca33b5f Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Hashar Gerrit-Reviewer: Muehlenhoff Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mathoid[master]: Add the Dockerfile to be used in Kubernetes
Mobrovac has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356962 ) Change subject: Add the Dockerfile to be used in Kubernetes .. Add the Dockerfile to be used in Kubernetes Change-Id: I4dda33d5a37bad936220af9ccb4db4e2fddec609 --- M .gitignore A dist/Dockerfile 2 files changed, 10 insertions(+), 1 deletion(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/.gitignore b/.gitignore index c817e86..3ab592c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -Dockerfile +/Dockerfile .idea/ coverage npm-debug.log diff --git a/dist/Dockerfile b/dist/Dockerfile new file mode 100644 index 000..fc091d2 --- /dev/null +++ b/dist/Dockerfile @@ -0,0 +1,9 @@ +FROM wikimedia/nodejs +RUN apt-get update && apt-get install -y librsvg2-dev && rm -rf /var/lib/apt/lists/* +RUN mkdir /opt/service +ADD . /opt/service +WORKDIR /opt/service +ENV HOME=/root LINK=g++ +RUN npm install && npm dedupe +ENV IN_DOCKER=1 +CMD npm start -- To view, visit https://gerrit.wikimedia.org/r/356962 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4dda33d5a37bad936220af9ccb4db4e2fddec609 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mathoid Gerrit-Branch: master Gerrit-Owner: Mobrovac Gerrit-Reviewer: Mobrovac ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mathoid[master]: Add the Dockerfile to be used in Kubernetes
Mobrovac has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356962 ) Change subject: Add the Dockerfile to be used in Kubernetes .. Add the Dockerfile to be used in Kubernetes Change-Id: I4dda33d5a37bad936220af9ccb4db4e2fddec609 --- M .gitignore A dist/Dockerfile 2 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid refs/changes/62/356962/1 diff --git a/.gitignore b/.gitignore index c817e86..3ab592c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -Dockerfile +/Dockerfile .idea/ coverage npm-debug.log diff --git a/dist/Dockerfile b/dist/Dockerfile new file mode 100644 index 000..fc091d2 --- /dev/null +++ b/dist/Dockerfile @@ -0,0 +1,9 @@ +FROM wikimedia/nodejs +RUN apt-get update && apt-get install -y librsvg2-dev && rm -rf /var/lib/apt/lists/* +RUN mkdir /opt/service +ADD . /opt/service +WORKDIR /opt/service +ENV HOME=/root LINK=g++ +RUN npm install && npm dedupe +ENV IN_DOCKER=1 +CMD npm start -- To view, visit https://gerrit.wikimedia.org/r/356962 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4dda33d5a37bad936220af9ccb4db4e2fddec609 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mathoid Gerrit-Branch: master Gerrit-Owner: Mobrovac ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Increase packedGitOpenFiles to 6000
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356586 ) Change subject: Gerrit: Increase packedGitOpenFiles to 6000 .. Gerrit: Increase packedGitOpenFiles to 6000 Matches changes done in cf3fd766857ee5bf57b23840efb1bca4a10e2c90 "Increasing core.packedGitOpenFiles to 6000 so that it is over the average and not significatly under it. It also matches the systemd version where we set the value to 6000" chad says "we currently only use about 4800-4900 on average" Change-Id: I693bf289fb00634604d1485dba27e70c8e3c8ec3 --- M modules/gerrit/templates/gerrit.config.erb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Chad: Looks good to me, but someone else must approve Dzahn: Verified; Looks good to me, approved diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb index b22b005..443e327 100644 --- a/modules/gerrit/templates/gerrit.config.erb +++ b/modules/gerrit/templates/gerrit.config.erb @@ -66,7 +66,7 @@ heapLimit = <%= @heap_limit %> slave = <%= @slave %> [core] -packedGitOpenFiles = 4096 +packedGitOpenFiles = 6000 packedGitLimit = 2g packedGitWindowSize = 16k streamFileThreshold = 100m -- To view, visit https://gerrit.wikimedia.org/r/356586 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I693bf289fb00634604d1485dba27e70c8e3c8ec3 Gerrit-PatchSet: 6 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Muehlenhoff Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Stop masking possible test failure
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356961 ) Change subject: Stop masking possible test failure .. Stop masking possible test failure All test constructors are called BEFORE executing any tests, so we were initializing the SmashPig context in every case. Stop doing that Change-Id: I0719890bd0611d87d64b46349bd1db1899d575b1 --- M tests/phpunit/Adapter/Adyen/AdyenTest.php M tests/phpunit/Adapter/Amazon/AmazonTest.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/61/356961/1 diff --git a/tests/phpunit/Adapter/Adyen/AdyenTest.php b/tests/phpunit/Adapter/Adyen/AdyenTest.php index ef39dce..cc45e92 100644 --- a/tests/phpunit/Adapter/Adyen/AdyenTest.php +++ b/tests/phpunit/Adapter/Adyen/AdyenTest.php @@ -33,11 +33,11 @@ public function __construct( $name = null, array $data = array(), $dataName = '' ) { parent::__construct( $name, $data, $dataName ); $this->testAdapterClass = 'TestingAdyenAdapter'; - DonationInterface::initializeSmashPig( 'adyen' ); } public function setUp() { parent::setUp(); + DonationInterface::initializeSmashPig( 'adyen' ); $this->setMwGlobals( array( 'wgAdyenGatewayEnabled' => true, diff --git a/tests/phpunit/Adapter/Amazon/AmazonTest.php b/tests/phpunit/Adapter/Amazon/AmazonTest.php index ee4d5c1..25c94b7 100644 --- a/tests/phpunit/Adapter/Amazon/AmazonTest.php +++ b/tests/phpunit/Adapter/Amazon/AmazonTest.php @@ -31,11 +31,11 @@ public function __construct( $name = null, array $data = array(), $dataName = '' ) { parent::__construct( $name, $data, $dataName ); $this->testAdapterClass = 'TestingAmazonAdapter'; - DonationInterface::initializeSmashPig( 'amazon' ); } public function setUp() { parent::setUp(); + DonationInterface::initializeSmashPig( 'amazon' ); TestingAmazonAdapter::$mockClient = new MockAmazonClient(); -- To view, visit https://gerrit.wikimedia.org/r/356961 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0719890bd0611d87d64b46349bd1db1899d575b1 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] mediawiki...DonationInterface[master]: Add API test for Amazon
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356959 ) Change subject: Add API test for Amazon .. Add API test for Amazon This would have caught the SmashPig init failure Change-Id: Id75d9f1471f092cc9cb2b81147428bee1dd28b04 --- M amazon_gateway/amazon.api.php A tests/phpunit/Adapter/Amazon/AmazonApiTest.php 2 files changed, 60 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/59/356959/1 diff --git a/amazon_gateway/amazon.api.php b/amazon_gateway/amazon.api.php index 740b912..3b9cd54 100644 --- a/amazon_gateway/amazon.api.php +++ b/amazon_gateway/amazon.api.php @@ -24,7 +24,9 @@ ), ); - $adapter = new AmazonAdapter( $adapterParams ); + $adapterClass = DonationInterface::getAdapterClassForGateway( 'amazon' ); + // @var AmazonAdapter + $adapter = new $adapterClass( $adapterParams ); if ( $adapter->getErrorState()->hasErrors() ) { $output->addValue( diff --git a/tests/phpunit/Adapter/Amazon/AmazonApiTest.php b/tests/phpunit/Adapter/Amazon/AmazonApiTest.php new file mode 100644 index 000..0b168dd --- /dev/null +++ b/tests/phpunit/Adapter/Amazon/AmazonApiTest.php @@ -0,0 +1,57 @@ +setMwGlobals( array( + 'wgDonationInterfaceEnableQueue' => true, + 'wgDonationInterfaceDefaultQueueServer' => array( + 'type' => 'TestingQueue', + ), + ) ); + } + + public function tearDown() { + TestingAmazonAdapter::$mockClient = null; + parent::tearDown(); + } + + public function testDoPaymentSuccess() { + $params = array( + 'amount' => '1.55', + 'currency' => 'USD', + 'recurring' => '0', + 'wmf_token' => 'e601502632e5e51dc2a17a0045162272+\\', + 'orderReferenceId' => mt_rand( 0, 1000 ), + 'action' => 'di_amazon_bill', + ); + $session = array( + 'Donor' => array( + 'amount' => '1.55', + 'currency' => 'USD', + 'recurring' => '0', + 'contribution_tracking_id' => mt_rand( 0, 1000 ), + 'country' => 'US', + ), + 'amazonEditToken' => 'kjaskdjahsdkjsad', + ); + $apiResult = $this->doApiRequest( $params, $session ); + $redirect = $apiResult[0]['redirect']; + $this->assertEquals( 'https://wikimediafoundation.org/wiki/Thank_You/en?country=US', $redirect ); + $mockClient = TestingAmazonAdapter::$mockClient; + $setOrderReferenceDetailsArgs = $mockClient->calls['setOrderReferenceDetails'][0]; + $oid = $session['Donor']['contribution_tracking_id'] . '-0'; + $this->assertEquals( $oid, $setOrderReferenceDetailsArgs['seller_order_id'], 'Did not set order id on order reference' ); + $this->assertEquals( $params['amount'], $setOrderReferenceDetailsArgs['amount'], 'Did not set amount on order reference' ); + + $this->assertEquals( $params['currency'], $setOrderReferenceDetailsArgs['currency_code'], 'Did not set currency code on order reference' ); + $message = DonationQueue::instance()->pop( 'complete' ); + $this->assertNotNull( $message, 'Not sending a message to the donations queue' ); + $this->assertEquals( 'S01-0391295-0674065-C095112', $message['gateway_txn_id'], 'Queue message has wrong txn ID' ); + } +} -- To view, visit https://gerrit.wikimedia.org/r/356959 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id75d9f1471f092cc9cb2b81147428bee1dd28b04 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] mediawiki...CirrusSearch[master]: Use \MediaWiki\suppressWarnings to suppress warnings
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356454 ) Change subject: Use \MediaWiki\suppressWarnings to suppress warnings .. Use \MediaWiki\suppressWarnings to suppress warnings Silencing errors is discouraged Change-Id: I600fdf0ac04999a54757ff1f64dbf23836c12b62 --- M tests/unit/InterwikiResolverTest.php 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Cindy-the-browser-test-bot: Looks good to me, but someone else must approve jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/unit/InterwikiResolverTest.php b/tests/unit/InterwikiResolverTest.php index 7ba5f52..01746ce 100644 --- a/tests/unit/InterwikiResolverTest.php +++ b/tests/unit/InterwikiResolverTest.php @@ -301,6 +301,9 @@ } private static function readDbListFile( $fileName ) { - return @file( $fileName, FILE_IGNORE_NEW_LINES ); + \MediaWiki\suppressWarnings(); + $fileContent = file( $fileName, FILE_IGNORE_NEW_LINES ); + \MediaWiki\restoreWarnings(); + return $fileContent; } } -- To view, visit https://gerrit.wikimedia.org/r/356454 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I600fdf0ac04999a54757ff1f64dbf23836c12b62 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Cindy-the-browser-test-bot Gerrit-Reviewer: DCausse Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: Gehel Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: Tjones Gerrit-Reviewer: Umherirrender Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BounceHandler[master]: Break long lines
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356647 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: I3e88e147aad5a2896e190571fce354cc3a623b41 --- M BounceHandler.php M BounceHandlerHooks.php M includes/BounceHandlerActions.php M includes/ProcessBounceEmails.php M includes/ProcessBounceWithRegex.php M includes/ProcessUnRecognizedBounces.php M includes/VerpAddressGenerator.php M tests/VERPEncodeDecodeTest.php 8 files changed, 51 insertions(+), 26 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/BounceHandler.php b/BounceHandler.php index abe09c4..fb53a70 100644 --- a/BounceHandler.php +++ b/BounceHandler.php @@ -4,10 +4,11 @@ // Keep i18n globals so mergeMessageFileList.php doesn't break $wgMessagesDirs['BounceHandler'] = __DIR__ . '/i18n'; /* wfWarn( - 'Deprecated PHP entry point used for BounceHandler extension. Please use wfLoadExtension instead, ' . + 'Deprecated PHP entry point used for BounceHandler extension. ' . + 'Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' ); */ return; } else { die( 'This version of the BounceHandler extension requires MediaWiki 1.25+' ); -} \ No newline at end of file +} diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php index 3976953..19130d1 100644 --- a/BounceHandlerHooks.php +++ b/BounceHandlerHooks.php @@ -98,9 +98,15 @@ */ public static function LoadExtensionSchemaUpdates( DatabaseUpdater $updater ) { $updater->addExtensionTable( 'bounce_records', __DIR__ . '/sql/bounce_records.sql' ); - $updater->modifyExtensionField( 'bounce_records', 'br_user', __DIR__ . '/sql/alter_user_column.sql' ); - $updater->addExtensionIndex( 'bounce_records', 'br_mail_timestamp', __DIR__ .'/sql/create_index_mail_timestamp.sql' ); - $updater->addExtensionIndex( 'bounce_records', 'br_timestamp', __DIR__ .'/sql/create_index_timestamp.sql' ); + $updater->modifyExtensionField( + 'bounce_records', 'br_user', __DIR__ . '/sql/alter_user_column.sql' + ); + $updater->addExtensionIndex( + 'bounce_records', 'br_mail_timestamp', __DIR__ .'/sql/create_index_mail_timestamp.sql' + ); + $updater->addExtensionIndex( + 'bounce_records', 'br_timestamp', __DIR__ .'/sql/create_index_timestamp.sql' + ); return true; } diff --git a/includes/BounceHandlerActions.php b/includes/BounceHandlerActions.php index ad0bf8f..cb5a0f3 100644 --- a/includes/BounceHandlerActions.php +++ b/includes/BounceHandlerActions.php @@ -38,13 +38,15 @@ /** * @param string $wikiId The database id of the failing recipient -* @param int $bounceRecordPeriod Time period for which bounce activities are considered before un-subscribing +* @param int $bounceRecordPeriod Time period for which bounce activities are considered +* before un-subscribing * @param int $bounceRecordLimit The number of bounce allowed in the bounceRecordPeriod. * @param bool $bounceHandlerUnconfirmUsers Enable/Disable user un-subscribe action * @param string $emailRaw The raw bounce Email * @throws Exception */ - public function __construct( $wikiId, $bounceRecordPeriod, $bounceRecordLimit, $bounceHandlerUnconfirmUsers, $emailRaw + public function __construct( + $wikiId, $bounceRecordPeriod, $bounceRecordLimit, $bounceHandlerUnconfirmUsers, $emailRaw ) { if ( $wikiId !== wfWikiID() ) { // We want to use the User class methods, which make no sense on the wrong wiki @@ -110,7 +112,8 @@ } /** -* Function to inject Echo notification to the last source of bounce for an unsubscribed Global user +* Function to inject Echo notification to the last source of bounce for an +* unsubscribed Global user * * @param $bounceUserId * @param $originalEmail @@ -149,7 +152,8 @@ $caUser->saveSettings(); $this->notifyGlobalUser( $bounceUserId, $originalEmail ); wfDebugLog( 'BounceHandler', - "Un-subscribed global user {$caUser->getName()} <$originalEmail> for exceeding Bounce Limit $this->bounceRecordLimit.\nProcessed Headers:\n" . + "Un-subscribed global user {$caUser->getName()} <$originalEmail> for " . +
[MediaWiki-commits] [Gerrit] mediawiki...BounceHandler[master]: Skip broken unit test
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356653 ) Change subject: Skip broken unit test .. Skip broken unit test See T142134 Change-Id: If7eac278d4c4b391036a12f62e5e0a79ac5e0887 --- M tests/UnSubscribeUserTest.php 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/UnSubscribeUserTest.php b/tests/UnSubscribeUserTest.php index 2335732..c965a83 100644 --- a/tests/UnSubscribeUserTest.php +++ b/tests/UnSubscribeUserTest.php @@ -11,6 +11,8 @@ class UnSubscribeUserTest extends MediaWikiTestCase { function testUnSubscribeUser() { + $this->markTestSkipped( 'Broken, needs fixing - see T142134' ); + $user = User::newFromName( 'TestUser' ); $user->setEmail( 'b...@example.ext' ); $user->addToDatabase(); -- To view, visit https://gerrit.wikimedia.org/r/356653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7eac278d4c4b391036a12f62e5e0a79ac5e0887 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BounceHandler Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BounceHandler[master]: Remove usage of RequestContext::getStats()
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348463 ) Change subject: Remove usage of RequestContext::getStats() .. Remove usage of RequestContext::getStats() Bug: T156810 Change-Id: Ie5e1d8b4c36e8a833092eaafeb31be0dff0f6172 --- M includes/BounceHandlerActions.php M includes/ProcessBounceEmails.php 2 files changed, 5 insertions(+), 3 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/includes/BounceHandlerActions.php b/includes/BounceHandlerActions.php index ad0bf8f..0263c2b 100644 --- a/includes/BounceHandlerActions.php +++ b/includes/BounceHandlerActions.php @@ -141,6 +141,7 @@ $bounceUserId = $failedUser['rawUserId']; $user = User::newFromId( $bounceUserId ); + $stats = \MediaWiki\MediaWikiServices::getInstance()->getStatsdDataFactory(); // Handle the central account email status (if applicable) if ( class_exists( 'CentralAuthUser') ) { $caUser = CentralAuthUser::getInstance( $user ); @@ -152,7 +153,7 @@ "Un-subscribed global user {$caUser->getName()} <$originalEmail> for exceeding Bounce Limit $this->bounceRecordLimit.\nProcessed Headers:\n" . $this->formatHeaders( $emailHeaders ) . "\nBounced Email: \n$this->emailRaw" ); - RequestContext::getMain()->getStats()->increment( 'bouncehandler.unsub.global' ); + $stats->increment( 'bouncehandler.unsub.global' ); } } else { // Invalidate the email-id of a local user @@ -163,7 +164,7 @@ "Un-subscribed {$user->getName()} <$originalEmail> for exceeding Bounce limit $this->bounceRecordLimit.\nProcessed Headers:\n" . $this->formatHeaders( $emailHeaders ). "\nBounced Email: \n$this->emailRaw" ); - RequestContext::getMain()->getStats()->increment( 'bouncehandler.unsub.local' ); + $stats->increment( 'bouncehandler.unsub.local' ); } } diff --git a/includes/ProcessBounceEmails.php b/includes/ProcessBounceEmails.php index 1a37e1d..0fcee64 100644 --- a/includes/ProcessBounceEmails.php +++ b/includes/ProcessBounceEmails.php @@ -74,7 +74,8 @@ 'br_reason' => $subject ); $dbw->insert( 'bounce_records', $rowData, __METHOD__ ); - RequestContext::getMain()->getStats()->increment( 'bouncehandler.bounces' ); + \MediaWiki\MediaWikiServices::getInstance() + ->getStatsdDataFactory()->increment( 'bouncehandler.bounces' ); if ( $wgBounceRecordMaxAge ) { $pruneOldRecords = new PruneOldBounceRecords( $wgBounceRecordMaxAge ); -- To view, visit https://gerrit.wikimedia.org/r/348463 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie5e1d8b4c36e8a833092eaafeb31be0dff0f6172 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/BounceHandler Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MapSources[master]: Add phpcs and make pass
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356958 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I8c322b466ac8d40df52c80fa5a78153a592d5a98 --- M MapSources.hooks.php M MapSources.i18n.alias.php M MapSources.i18n.magic.php M MapSources.php M MapSources_body.php M MapSources_math.php M MapSources_transform.php M composer.json A phpcs.xml 9 files changed, 125 insertions(+), 111 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MapSources refs/changes/58/356958/1 diff --git a/MapSources.hooks.php b/MapSources.hooks.php index fdf907a..fb12077 100644 --- a/MapSources.hooks.php +++ b/MapSources.hooks.php @@ -70,7 +70,9 @@ break; case 'precision': $precision = $parts[1]; - if ( !is_numeric( $precision ) ) $precision = 4; + if ( !is_numeric( $precision ) ) { + $precision = 4; + } break; } } @@ -135,7 +137,7 @@ } } - $args = array(); + $args = []; $lat = new MapSourcesMath( $lat, $precision, 'lat', 2 ); $long = new MapSourcesMath( $long, $precision, 'long', 2 ); @@ -171,8 +173,7 @@ if ( $long->error == 0 ) { $args[] = $long->dec; - } - else { + } else { $args[] = '0'; } diff --git a/MapSources.i18n.alias.php b/MapSources.i18n.alias.php index ccd0209..50439a9 100644 --- a/MapSources.i18n.alias.php +++ b/MapSources.i18n.alias.php @@ -5,81 +5,80 @@ * @file * @ingroup Extensions */ -// @codingStandardsIgnoreFile -$specialPageAliases = array(); +$specialPageAliases = []; /** English (English) */ -$specialPageAliases['en'] = array( - 'MapSources' => array( 'MapSources' ), -); +$specialPageAliases['en'] = [ + 'MapSources' => [ 'MapSources' ], +]; /** Arabic (العربية) */ -$specialPageAliases['ar'] = array( - 'MapSources' => array( 'مصادر_الخريطة' ), -); +$specialPageAliases['ar'] = [ + 'MapSources' => [ 'مصادر_الخريطة' ], +]; /** Egyptian Arabic (مصرى) */ -$specialPageAliases['arz'] = array( - 'MapSources' => array( 'مصادر_الخريطه' ), -); +$specialPageAliases['arz'] = [ + 'MapSources' => [ 'مصادر_الخريطه' ], +]; /** Western Balochi (بلوچی رخشانی) */ -$specialPageAliases['bgn'] = array( - 'MapSources' => array( 'نخشه_ئی_زهی' ), -); +$specialPageAliases['bgn'] = [ + 'MapSources' => [ 'نخشه_ئی_زهی' ], +]; /** German (Deutsch) */ -$specialPageAliases['de'] = array( - 'MapSources' => array( 'Kartenherkunft', 'Kartenquellen' ), -); +$specialPageAliases['de'] = [ + 'MapSources' => [ 'Kartenherkunft', 'Kartenquellen' ], +]; /** Zazaki (Zazaki) */ -$specialPageAliases['diq'] = array( - 'MapSources' => array( 'ÇımeyĞeriter' ), -); +$specialPageAliases['diq'] = [ + 'MapSources' => [ 'ÇımeyĞeriter' ], +]; /** Persian (فارسی) */ -$specialPageAliases['fa'] = array( - 'MapSources' => array( 'منابع_نقشه' ), -); +$specialPageAliases['fa'] = [ + 'MapSources' => [ 'منابع_نقشه' ], +]; /** Upper Sorbian (hornjoserbsce) */ -$specialPageAliases['hsb'] = array( - 'MapSources' => array( 'Kartowe_žórła' ), -); +$specialPageAliases['hsb'] = [ + 'MapSources' => [ 'Kartowe_žórła' ], +]; /** Korean (한국어) */ -$specialPageAliases['ko'] = array( - 'MapSources' => array( '지도원본' ), -); +$specialPageAliases['ko'] = [ + 'MapSources' => [ '지도원본' ], +]; /** Macedonian (македонски) */ -$specialPageAliases['mk'] = array( - 'MapSources' => array( 'КартографскиИзвори' ), -); +$specialPageAliases['mk'] = [ + 'MapSources' => [ 'КартографскиИзвори' ], +]; /** Malayalam (മലയാളം) */ -$specialPageAliases['ml'] = array( - 'MapSources' => array( 'ഭൂപടസ്രോതസ്സുകൾ' ), -); +$specialPageAliases['ml'] = [ + 'MapSources' => [ 'ഭൂപടസ്രോതസ്സുകൾ' ], +]; /** Dutch (Nederlands) */ -$specialPageAliases['nl'] = array( - 'MapSources' => array( 'MapBronnen' ), -); +$specialPageAliases['nl'] = [ + 'MapSources' => [ 'MapBronnen' ], +]; /** Vietnamese (Tiếng Việt) */ -$specialPageAliases['vi'] = array( - 'MapSources' => array( 'Nguồn_bản_đồ' ), -); +$specialPageAliases['vi'] = [ + 'MapSources' => [ 'Nguồn_bản_đồ' ], +]; /** Simplified Chinese (中文(简体)) */ -$specialPageAliases['zh-hans'] = array( - 'MapSources' => array( '地图来源' ), -); +$specialPageAliases['z
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix: only tally page sizes of offline pages
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356956 ) Change subject: Fix: only tally page sizes of offline pages .. Fix: only tally page sizes of offline pages If a page was marked for offline and then marked online, it may have offline disk statistics. It's a bug to show file sizes for a page that is no longer on disk so filter out pages not marked for offline. Bug: T162267 Change-Id: I7ab6afc89a539a60411da6ad7fa710df6f193f1a --- M app/src/main/java/org/wikipedia/readinglist/ReadingList.java 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/56/356956/1 diff --git a/app/src/main/java/org/wikipedia/readinglist/ReadingList.java b/app/src/main/java/org/wikipedia/readinglist/ReadingList.java index c14d0f4..d2a0f47 100644 --- a/app/src/main/java/org/wikipedia/readinglist/ReadingList.java +++ b/app/src/main/java/org/wikipedia/readinglist/ReadingList.java @@ -85,7 +85,7 @@ public long physicalSize() { long sum = 0; for (ReadingListPage page : pages) { -sum += page.physicalSize() == null ? 0 : page.physicalSize(); +sum += !page.isOffline() || page.physicalSize() == null ? 0 : page.physicalSize(); } return sum; } @@ -94,7 +94,7 @@ public long logicalSize() { long sum = 0; for (ReadingListPage page : pages) { -sum += page.logicalSize() == null ? 0 : page.logicalSize(); +sum += !page.isOffline() || page.logicalSize() == null ? 0 : page.logicalSize(); } return sum; } -- To view, visit https://gerrit.wikimedia.org/r/356956 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ab6afc89a539a60411da6ad7fa710df6f193f1a Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski Gerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix: update reading list UI on change
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356957 ) Change subject: Fix: update reading list UI on change .. Fix: update reading list UI on change - Move ReadingListSyncEvent postage from a callback in ReadingListSynchronizer to the end of a sync in SavedPageSyncService. This will cause the event to be posted whenever a page is added, removed, or updated at the source which appears to be in line with the original intent of the event. - Register for sync events in ReadingListFragment. ReadingListsFragment (plural) already subscribes to these events and the choice to use bus events over a CursorLoader was discussed here: https://gerrit.wikimedia.org/r/#/c/341620/ https://gerrit.wikimedia.org/r/#/c/338107/ Bug: T162267 Change-Id: Icd19c8ccd0219e9c688fed8b1100b0472af540d2 --- M app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java M app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java M app/src/main/java/org/wikipedia/savedpages/SavedPageSyncService.java 3 files changed, 22 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/57/356957/1 diff --git a/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java b/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java index 44b08fe..cf88509 100644 --- a/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java +++ b/app/src/main/java/org/wikipedia/readinglist/ReadingListFragment.java @@ -26,8 +26,11 @@ import android.view.ViewGroup; import android.widget.TextView; +import com.squareup.otto.Subscribe; + import org.wikipedia.Constants; import org.wikipedia.R; +import org.wikipedia.WikipediaApp; import org.wikipedia.analytics.ReadingListsFunnel; import org.wikipedia.concurrency.CallbackTask; import org.wikipedia.history.HistoryEntry; @@ -39,6 +42,7 @@ import org.wikipedia.readinglist.page.ReadingListPage; import org.wikipedia.readinglist.page.database.ReadingListDaoProxy; import org.wikipedia.readinglist.page.database.ReadingListPageDao; +import org.wikipedia.readinglist.sync.ReadingListSyncEvent; import org.wikipedia.readinglist.sync.ReadingListSynchronizer; import org.wikipedia.settings.Prefs; import org.wikipedia.util.FeedbackUtil; @@ -74,6 +78,7 @@ @BindView(R.id.search_empty_view) SearchEmptyView searchEmptyView; private Unbinder unbinder; +@NonNull private final EventBusMethods eventBusMethods = new EventBusMethods(); @Nullable private ReadingList readingList; @Nullable private String readingListTitle; private ReadingListPageItemAdapter adapter = new ReadingListPageItemAdapter(); @@ -135,6 +140,8 @@ readingListTitle = getArguments().getString(EXTRA_READING_LIST_TITLE); updateReadingListData(); +WikipediaApp.getInstance().getBus().register(eventBusMethods); + return view; } @@ -145,6 +152,8 @@ } @Override public void onDestroyView() { +WikipediaApp.getInstance().getBus().unregister(eventBusMethods); + readingList = null; readingLists.set(Collections.emptyList()); recyclerView.setAdapter(null); @@ -718,4 +727,12 @@ toggleOffline(page); } } + +private class EventBusMethods { +@Subscribe public void on(@NonNull ReadingListSyncEvent event) { +if (isAdded()) { +update(); +} +} +} } diff --git a/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java b/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java index 74af9a0..0051fa9 100644 --- a/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java +++ b/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java @@ -2,7 +2,6 @@ import android.content.Intent; import android.os.Handler; -import android.os.Looper; import android.support.annotation.NonNull; import org.wikipedia.WikipediaApp; @@ -95,7 +94,6 @@ reconcileAsRightJoin(remoteReadingLists); Prefs.setReadingListSyncRev(remoteReadingLists.rev()); WikipediaApp.getInstance().getOnboardingStateMachine().setReadingListTutorial(); -postEvent(new ReadingListSyncEvent()); } else { L.d("Local and remote reading lists are in sync."); } @@ -123,12 +121,6 @@ private void bumpRev() { Prefs.setReadingListSyncRev(Prefs.getReadingListSyncRev() + 1); -} - -private void postEvent(@NonNull Object event) { -// Note: this method posts from a background thread but subscribers expect events to be -// received on the main thead. -WikipediaApp.getInstance().g
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: refactor event bus thread concerns to separate class
Niedzielski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356955 ) Change subject: Hygiene: refactor event bus thread concerns to separate class .. Hygiene: refactor event bus thread concerns to separate class Change-Id: I88f2a27706ed242e1fb04251cd0096b52a3f17c3 --- M app/src/main/java/org/wikipedia/WikipediaApp.java A app/src/main/java/org/wikipedia/concurrency/ThreadSafeBus.java M app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java 3 files changed, 38 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/55/356955/1 diff --git a/app/src/main/java/org/wikipedia/WikipediaApp.java b/app/src/main/java/org/wikipedia/WikipediaApp.java index 57cc363..c6ca95d 100644 --- a/app/src/main/java/org/wikipedia/WikipediaApp.java +++ b/app/src/main/java/org/wikipedia/WikipediaApp.java @@ -23,6 +23,7 @@ import org.wikipedia.analytics.FunnelManager; import org.wikipedia.analytics.SessionFunnel; import org.wikipedia.auth.AccountUtil; +import org.wikipedia.concurrency.ThreadSafeBus; import org.wikipedia.connectivity.NetworkConnectivityReceiver; import org.wikipedia.crash.CrashReporter; import org.wikipedia.crash.hockeyapp.HockeyAppCrashReporter; @@ -148,7 +149,7 @@ // See Javadocs and http://developer.android.com/tools/support-library/index.html#rev23-4-0 AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); -bus = new Bus(); +bus = new ThreadSafeBus(); ViewAnimations.init(getResources()); currentTheme = unmarshalCurrentTheme(); diff --git a/app/src/main/java/org/wikipedia/concurrency/ThreadSafeBus.java b/app/src/main/java/org/wikipedia/concurrency/ThreadSafeBus.java new file mode 100644 index 000..568b771 --- /dev/null +++ b/app/src/main/java/org/wikipedia/concurrency/ThreadSafeBus.java @@ -0,0 +1,32 @@ +package org.wikipedia.concurrency; + +import android.os.Handler; +import android.os.Looper; +import android.support.annotation.NonNull; + +import com.squareup.otto.Bus; + +// https://github.com/square/otto/issues/38 +public class ThreadSafeBus extends Bus { +private final Handler handler = new Handler(Looper.getMainLooper()); + +public ThreadSafeBus() { +super(); +} + +public ThreadSafeBus(String identifier) { +super(identifier); +} + +@Override public void post(@NonNull final Object event) { +if (Looper.myLooper() == Looper.getMainLooper()) { +super.post(event); +} else { +handler.post(new Runnable() { +@Override public void run() { +ThreadSafeBus.super.post(event); +} +}); +} +} +} diff --git a/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java b/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java index 80fc7d9..74af9a0 100644 --- a/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java +++ b/app/src/main/java/org/wikipedia/readinglist/sync/ReadingListSynchronizer.java @@ -125,12 +125,10 @@ Prefs.setReadingListSyncRev(Prefs.getReadingListSyncRev() + 1); } -private void postEvent(@NonNull final Object event) { -new Handler(Looper.getMainLooper()).post(new Runnable() { -@Override public void run() { -WikipediaApp.getInstance().getBus().post(event); -} -}); +private void postEvent(@NonNull Object event) { +// Note: this method posts from a background thread but subscribers expect events to be +// received on the main thead. +WikipediaApp.getInstance().getBus().post(event); } private void reconcileAsRightJoin(@NonNull RemoteReadingLists remoteReadingLists) { -- To view, visit https://gerrit.wikimedia.org/r/356955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88f2a27706ed242e1fb04251cd0096b52a3f17c3 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski Gerrit-Reviewer: Sniedzielski ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaIncubator[master]: Add phpcs and make pass
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356272 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: Ia2e962db11f4733a275e648ff378d5254c9e620c --- M CreateAccountTestWiki.php M InfoPage.php M ListUsersTestWiki.php M SpecialIncubatorFirstSteps.php M SpecialRandomByTest.php M SpecialSearchWiki.php M SpecialViewUserLang.php M WikimediaIncubator.class.php M composer.json A phpcs.xml 10 files changed, 115 insertions(+), 47 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/CreateAccountTestWiki.php b/CreateAccountTestWiki.php index eafb14b..8ea9b27 100644 --- a/CreateAccountTestWiki.php +++ b/CreateAccountTestWiki.php @@ -21,7 +21,9 @@ global $wgRequest, $wmincProjects; $projectvalue = strtolower( $wgRequest->getVal( 'testwikiproject', '' ) ); $codevalue = strtolower( $wgRequest->getVal( 'testwikicode', '' ) ); - if ( WikimediaIncubator::validateLanguageCode( $codevalue ) && isset( $wmincProjects[$projectvalue] ) ) { + if ( WikimediaIncubator::validateLanguageCode( $codevalue ) + && isset( $wmincProjects[$projectvalue] ) + ) { $template->set( 'header', Html::hidden( 'testwiki-project', $projectvalue ) . Html::hidden( 'testwiki-code', $codevalue ) @@ -38,7 +40,9 @@ global $wgRequest, $wmincProjects, $wmincPref; $projectvalue = $wgRequest->getVal( 'testwiki-project' ); $codevalue = $wgRequest->getVal( 'testwiki-code' ); - if ( WikimediaIncubator::validateLanguageCode( $codevalue ) && isset( $wmincProjects[$projectvalue] ) ) { + if ( WikimediaIncubator::validateLanguageCode( $codevalue ) + && isset( $wmincProjects[$projectvalue] ) + ) { $user->setOption( $wmincPref . '-project', $projectvalue ); $user->setOption( $wmincPref . '-code', $codevalue ); $user->saveSettings(); diff --git a/InfoPage.php b/InfoPage.php index d4474cc..76c95d0 100644 --- a/InfoPage.php +++ b/InfoPage.php @@ -7,11 +7,15 @@ * 'incubator' showIncubatingWiki() *'open': This is a new Incubator wiki that is not yet verified by the language committee. *'eligible': This Incubator wiki has been marked as eligible by the language committee. - *'imported': This Incubator wiki has been imported from xyz.wikiproject.org after that wiki was closed. - *'approved': This Incubator wiki has been approved by the language committee and will soon be created. + *'imported': This Incubator wiki has been imported from xyz.wikiproject.org after that wiki + * was closed. + *'approved': This Incubator wiki has been approved by the language committee and will soon + * be created. * 'existing' showExistingWiki() - *'created': This project has been approved by the language committee and is now available at xyz.wikiproject.org. - *'beforeincubator': This project was created before Wikimedia Incubator started and is available at xyz.wikiproject.org. + *'created': This project has been approved by the language committee and is now available at + * xyz.wikiproject.org. + *'beforeincubator': This project was created before Wikimedia Incubator started and is + * available at xyz.wikiproject.org. * * @file * @ingroup Extensions @@ -41,11 +45,14 @@ $name = Language::fetchLanguageName( $this->mLangCode, $wgLang->getCode(), 'all' ); $this->mLangName = $name ? $name : Language::fetchLanguageName( $this->mLangCode, 'en', 'all' ); - $titleParam = $this->mLangName ? $this->mLangName : wfMessage( 'quotation-marks', $this->mLangCode )->text(); # Name, else code + $titleParam = $this->mLangName ? $this->mLangName + : wfMessage( 'quotation-marks', $this->mLangCode )->text(); # Name, else code # Give grep a chance to find the usages: - # wminc-infopage-title-p, wminc-infopage-title-b, wminc-infopage-title-t, wminc-infopage-title-q, - # wminc-infopage-title-n, wminc-infopage-title-s, wminc-infopage-title-v, wminc-infopage-title-y - $this->mFormatTitle = wfMessage( 'wminc-infopage-title-' . $this->mProjectCode, $titleParam )->escaped(); + # wminc-infopage-title-p, wminc-infopage-title-b, wminc-infopage-title-t, + # wminc-infopage-title-q, wminc-infopage-title-n, wminc-infopage-title-s, + # wminc-infopage-title-v, wminc-infopage-title-y + $this->mFormatTitle = wfMessage( 'wminc-infopage-title-' .
[MediaWiki-commits] [Gerrit] mediawiki...PageImages[master]: Add phpcs and make pass
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356240 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I129fd23a375b4f7de893d3b98f67fdd8de89b4bd --- M composer.json M includes/ApiQueryPageImages.php M includes/Job/InitImageDataJob.php M includes/PageImages.php M maintenance/initImageData.php A phpcs.xml M tests/phpunit/ApiQueryPageImagesTest.php M tests/phpunit/LinksUpdateHookHandlerTest.php 8 files changed, 77 insertions(+), 34 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/composer.json b/composer.json index 686b65b..b8f68fb 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,14 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "jakub-onderka/php-console-highlighter": "0.3.2" + "jakub-onderka/php-console-highlighter": "0.3.2", + "mediawiki/mediawiki-codesniffer": "0.7.2" }, "scripts": { + "fix": "phpcbf", "test": [ - "parallel-lint . --exclude vendor" + "parallel-lint . --exclude vendor", + "phpcs -p -s" ] } } diff --git a/includes/ApiQueryPageImages.php b/includes/ApiQueryPageImages.php index bd89f38..9d957f8 100644 --- a/includes/ApiQueryPageImages.php +++ b/includes/ApiQueryPageImages.php @@ -216,13 +216,14 @@ // DEPRECATED: The original image URL was originally provided as a property of // the "thumbnail" object, but we now provide the original image info in its own // object on the same level as the thumbnail. - // // Remove this functionality, and the warning, after a reasonable amount of time // has passed since December 2016. if ( is_callable( [ $this, 'addWarning' ] ) ) { $this->addWarning( 'apiwarn-query+pageimages-original-in-thumbnail-deprecated' ); } else { - $this->setWarning( "The original image's source URL is now provided with its dimensions in its own property for the page object. It will be removed from the 'thumbnail' property in a future release." ); + $this->setWarning( "The original image's source URL is now provided with " . + "its dimensions in its own property for the page object. It will be " . + "removed from the 'thumbnail' property in a future release." ); } $vals['thumbnail']['original'] = $original_url; } diff --git a/includes/Job/InitImageDataJob.php b/includes/Job/InitImageDataJob.php index a6ec772..238732e 100644 --- a/includes/Job/InitImageDataJob.php +++ b/includes/Job/InitImageDataJob.php @@ -20,7 +20,7 @@ try { RefreshLinks::fixLinksFromArticle( $id ); $lbFactory->waitForReplication(); - } catch (\Exception $e) { + } catch ( \Exception $e ) { // There are some broken pages out there that just don't parse. // Log it and keep on trucking. MWExceptionHandler::logException( $e ); diff --git a/includes/PageImages.php b/includes/PageImages.php index 4a8004b..51d37c5 100644 --- a/includes/PageImages.php +++ b/includes/PageImages.php @@ -50,7 +50,10 @@ $dbr = wfGetDB( DB_SLAVE ); $fileName = $dbr->selectField( 'page_props', [ 'pp_value' ], - [ 'pp_page' => $title->getArticleID(), 'pp_propname' => [ self::PROP_NAME, self::PROP_NAME_FREE ] ], + [ + 'pp_page' => $title->getArticleID(), + 'pp_propname' => [ self::PROP_NAME, self::PROP_NAME_FREE ] + ], __METHOD__, [ 'ORDER BY' => 'pp_propname' ] ); diff --git a/maintenance/initImageData.php b/maintenance/initImageData.php index 53e104d..69d6bab 100644 --- a/maintenance/initImageData.php +++ b/maintenance/initImageData.php @@ -4,7 +4,7 @@ if ( $IP === false ) { $IP = __DIR__ . '/../../..'; } -require_once ( "$IP/maintenance/Maintenance.php" ); +re
[MediaWiki-commits] [Gerrit] mediawiki...GlobalUsage[master]: Add phpcs and make pass
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356215 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I45262b760dd004a3a3eb629f6293cf078a046a3e --- M GlobalUsage.php M composer.json M includes/ApiQueryGlobalUsage.php M includes/GlobalUsageHooks.php M includes/GlobalUsageImagePageHooks.php M includes/SpecialGlobalUsage.php M includes/SpecialGloballyWantedFiles.php M includes/SpecialMostGloballyLinkedFiles.php A phpcs.xml M refreshGlobalimagelinks.php 10 files changed, 50 insertions(+), 31 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/GlobalUsage.php b/GlobalUsage.php index 3db8fed..7947c43 100644 --- a/GlobalUsage.php +++ b/GlobalUsage.php @@ -30,7 +30,8 @@ $wgMessagesDirs['GlobalUsage'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['GlobalUsageAliases'] = __DIR__ . '/GlobalUsage.alias.php'; /* wfWarn( - 'Deprecated PHP entry point used for GlobalUsage extension. Please use wfLoadExtension instead, ' . + 'Deprecated PHP entry point used for GlobalUsage extension. ' . + 'Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' ); */ return; diff --git a/composer.json b/composer.json index 686b65b..b8f68fb 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,14 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", - "jakub-onderka/php-console-highlighter": "0.3.2" + "jakub-onderka/php-console-highlighter": "0.3.2", + "mediawiki/mediawiki-codesniffer": "0.7.2" }, "scripts": { + "fix": "phpcbf", "test": [ - "parallel-lint . --exclude vendor" + "parallel-lint . --exclude vendor", + "phpcs -p -s" ] } } diff --git a/includes/ApiQueryGlobalUsage.php b/includes/ApiQueryGlobalUsage.php index 71b46f1..0c1ddc8 100644 --- a/includes/ApiQueryGlobalUsage.php +++ b/includes/ApiQueryGlobalUsage.php @@ -61,8 +61,10 @@ 'wiki' => WikiMap::getWikiName( $wiki ) ]; if ( isset( $prop['url'] ) ) { - /* We expand the url because we don't want protocol relative urls in API results */ - $result['url'] = wfExpandUrl( WikiMap::getForeignUrl( $item['wiki'], $title ), PROTO_CURRENT ); + // We expand the url because we don't want protocol relative urls + // in API results + $result['url'] = wfExpandUrl( + WikiMap::getForeignUrl( $item['wiki'], $title ), PROTO_CURRENT ); } if ( isset( $prop['pageid'] ) ) { $result['pageid'] = $item['id']; diff --git a/includes/GlobalUsageHooks.php b/includes/GlobalUsageHooks.php index 3228395..8c6729a 100644 --- a/includes/GlobalUsageHooks.php +++ b/includes/GlobalUsageHooks.php @@ -208,12 +208,14 @@ $updater->addExtensionUpdate( [ 'addTable', 'globalimagelinks', "$dir/GlobalUsage.sql", true ] ); $updater->addExtensionUpdate( [ 'addIndex', 'globalimagelinks', - 'globalimagelinks_wiki_nsid_title', "$dir/patch-globalimagelinks_wiki_nsid_title.sql", true ] ); + 'globalimagelinks_wiki_nsid_title', + "$dir/patch-globalimagelinks_wiki_nsid_title.sql", true ] ); } elseif ( $updater->getDB()->getType() == 'postgresql' ) { $updater->addExtensionUpdate( [ 'addTable', 'globalimagelinks', "$dir/GlobalUsage.pg.sql", true ] ); $updater->addExtensionUpdate( [ 'addIndex', 'globalimagelinks', - 'globalimagelinks_wiki_nsid_title', "$dir/patch-globalimagelinks_wiki_nsid_title.pg.sql", true ] ); + 'globalimagelinks_wiki_nsid_title', + "$dir/patch-globalimagelinks_wiki_nsid_title.pg.sql", true ] ); } return true; } diff --git a/includes/GlobalUsageImagePageHooks.php b/includes/GlobalUsageImagePageHooks.php index 07f4d
[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Add phpcs and make pass
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356902 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I9d154d4a076f40892f99c2c41c651581f556b906 --- M BetaFeatures.alias.php M BetaFeaturesHooks.php M composer.json M includes/ApiListBetaFeatures.php M includes/HTMLFeatureField.php M includes/HTMLHorizontalRuleField.php M includes/HTMLTextBlockField.php M includes/NewHTMLCheckField.php M includes/UpdateBetaFeatureUserCountsJob.php A phpcs.xml 10 files changed, 191 insertions(+), 180 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/BetaFeatures.alias.php b/BetaFeatures.alias.php index 2fc2ff4..0df3165 100644 --- a/BetaFeatures.alias.php +++ b/BetaFeatures.alias.php @@ -2,151 +2,150 @@ /** * Aliases for special pages in the BetaFeatures extension. */ -// @codingStandardsIgnoreFile -$specialPageAliases = array(); +$specialPageAliases = []; /** English (English) */ -$specialPageAliases['en'] = array( - 'BetaFeatures' => array( 'BetaFeatures' ), -); +$specialPageAliases['en'] = [ + 'BetaFeatures' => [ 'BetaFeatures' ], +]; /** Arabic (العربية) */ -$specialPageAliases['ar'] = array( - 'BetaFeatures' => array( 'خصائص_البيتا' ), -); +$specialPageAliases['ar'] = [ + 'BetaFeatures' => [ 'خصائص_البيتا' ], +]; /** Egyptian Arabic (مصرى) */ -$specialPageAliases['arz'] = array( - 'BetaFeatures' => array( 'خصايص_البيتا' ), -); +$specialPageAliases['arz'] = [ + 'BetaFeatures' => [ 'خصايص_البيتا' ], +]; /** Western Balochi (بلوچی رخشانی) */ -$specialPageAliases['bgn'] = array( - 'BetaFeatures' => array( 'ازمایشین_قابلیت' ), -); +$specialPageAliases['bgn'] = [ + 'BetaFeatures' => [ 'ازمایشین_قابلیت' ], +]; /** German (Deutsch) */ -$specialPageAliases['de'] = array( - 'BetaFeatures' => array( 'Beta-Funktionen' ), -); +$specialPageAliases['de'] = [ + 'BetaFeatures' => [ 'Beta-Funktionen' ], +]; /** Zazaki (Zazaki) */ -$specialPageAliases['diq'] = array( - 'BetaFeatures' => array( 'XısusiyetêBeta' ), -); +$specialPageAliases['diq'] = [ + 'BetaFeatures' => [ 'XısusiyetêBeta' ], +]; /** British English (British English) */ -$specialPageAliases['en-gb'] = array( - 'BetaFeatures' => array( 'BetaFeatures' ), -); +$specialPageAliases['en-gb'] = [ + 'BetaFeatures' => [ 'BetaFeatures' ], +]; /** Estonian (eesti) */ -$specialPageAliases['et'] = array( - 'BetaFeatures' => array( 'Beeta' ), -); +$specialPageAliases['et'] = [ + 'BetaFeatures' => [ 'Beeta' ], +]; /** Persian (فارسی) */ -$specialPageAliases['fa'] = array( - 'BetaFeatures' => array( 'قابلیتهای_آزمایشی' ), -); +$specialPageAliases['fa'] = [ + 'BetaFeatures' => [ 'قابلیتهای_آزمایشی' ], +]; /** Hebrew (עברית) */ -$specialPageAliases['he'] = array( - 'BetaFeatures' => array( 'אפשרויות_בטא' ), -); +$specialPageAliases['he'] = [ + 'BetaFeatures' => [ 'אפשרויות_בטא' ], +]; /** Upper Sorbian (hornjoserbsce) */ -$specialPageAliases['hsb'] = array( - 'BetaFeatures' => array( 'Beta-funkcije' ), -); +$specialPageAliases['hsb'] = [ + 'BetaFeatures' => [ 'Beta-funkcije' ], +]; /** Korean (한국어) */ -$specialPageAliases['ko'] = array( - 'BetaFeatures' => array( '베타기능' ), -); +$specialPageAliases['ko'] = [ + 'BetaFeatures' => [ '베타기능' ], +]; /** Luxembourgish (Lëtzebuergesch) */ -$specialPageAliases['lb'] = array( - 'BetaFeatures' => array( 'Beta-Fumktiounen' ), -); +$specialPageAliases['lb'] = [ + 'BetaFeatures' => [ 'Beta-Fumktiounen' ], +]; /** Northern Luri (لۊری شومالی) */ -$specialPageAliases['lrc'] = array( - 'BetaFeatures' => array( 'خوصوٙصیات_بئتا' ), -); +$specialPageAliases['lrc'] = [ + 'BetaFeatures' => [ 'خوصوٙصیات_بئتا' ], +]; /** Malagasy (Malagasy) */ -$specialPageAliases['mg'] = array( - 'BetaFeatures' => array( 'FitaovanaBeta' ), -); +$specialPageAliases['mg'] = [ + 'BetaFeatures' => [ 'FitaovanaBeta' ], +]; /** Macedonian (македонски) */ -$specialPageAliases['mk'] = array( - 'BetaFeatures' => array( 'БетаФункции' ), -); +$specialPageAliases['mk'] = [ + 'BetaFeatures' => [ 'БетаФункции' ], +]; /** Malayalam (മലയാളം) */ -$specialPageAliases['ml'] = array( - 'BetaFeatures' => array( 'പരീക്ഷണസൗകര്യങ്ങൾ' ), -); +$specialPageAliases['ml'] = [ + 'BetaFeatures' => [ 'പരീക്ഷണസൗകര്യങ്ങൾ' ], +]; /** Malay (Bahasa Melayu) */ -$specialPageAliases['ms'] = array( - 'BetaFeatures' => array( 'Ciri-ciri_beta' ), -); +$specialPageAliases['ms'] = [ + 'BetaFeatures' => [ 'Ciri-ciri_beta' ], +]; /** Min Nan Chinese (Bân-lâm-gú) */ -$specialPageAliases['nan'] = array( - 'BetaFeatures' => array( 'Chhì-iōng_kong-lêng' ), -); +$specialPageAliases['nan'] = [ + 'BetaFeatures' => [ 'Chhì-iōng_kong-lêng' ], +]; /*
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Extension Manifest Converter for v1 to v2.
Alexia has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356954 ) Change subject: Extension Manifest Converter for v1 to v2. .. Extension Manifest Converter for v1 to v2. This converts extension manifests from v1 to v2. Change-Id: I9dba6533a7ce2b8457e5dc1c42f9ecfdce2fa738 --- A maintenance/convertExtensionManifestv1tov2.php 1 file changed, 93 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/356954/1 diff --git a/maintenance/convertExtensionManifestv1tov2.php b/maintenance/convertExtensionManifestv1tov2.php new file mode 100644 index 000..c1629e9 --- /dev/null +++ b/maintenance/convertExtensionManifestv1tov2.php @@ -0,0 +1,93 @@ +http://www.curse.com/ + * +**/ + +require_once( __DIR__."/Maintenance.php" ); + +class convertExtensionManifestv1tov2 extends Maintenance { + /** +* Main Constructor +* +* @access public +* @return void +*/ + public function __construct() { + parent::__construct(); + $this->mDescription = "Convert Extension Manifest from v1 to v2."; + $this->addArg( 'path', 'Location to the extension manifest you wish to convert.', true ); + } + + /** +* Main Execution +* +* @access public +* @return void +*/ + public function execute() { + $file = realpath( $this->getArg( 0 ) ); + if ( !is_file( $file ) ) { + $this->error( "{$file} is not a file.", true ); + } + $json = json_decode( file_get_contents( $file ), true ); + if ( empty( $json ) || !isset( $json[ 'manifest_version' ] ) ) { + $this->error( "{$file} is not a valid extension manifest.", true ); + } + if ( $json[ 'manifest_version' ] > 1 ) { + $this->error( "{$file} is already greater than version 1.", true ); + } + + $this->output( "All config settings will be marked path => false and public => false. Please make corrections manually.\n" ); + + $descriptionPrefix = str_replace( ' ', '', ( trim( mb_strtolower( $json[ 'name' ], 'UTF-8' ) ) ) ); + foreach ( $json[ 'config' ] as $key => $value ) { + $json[ 'config' ][ $key ] = $this->configV2( $key, $value, $descriptionPrefix ); + } + if ( isset( $json[ 'config' ][ '_prefix' ] ) ) { + $json[ 'config_prefix' ] = $json[ 'config' ][ '_prefix' ]; + unset( $json[ 'config' ][ '_prefix' ] ); + } + $json[ 'manifest_version' ] = 2; + $json = FormatJson::encode( $json, "\t", FormatJson::ALL_OK ); + file_put_contents( $file, $json ); + $this->output( "Wrote updated manifest.\n" ); + } + + /** +* Convert configuration to version 2. +* +* @access private +* @param string Variable Name +* @param string Variable Value +* @param string Prefix for descriptionmsg. +* @return array Configuration +*/ + private function configV2( $key, $value, $descriptionPrefix ) { + $mergeStrategy = false; + if ( is_array( $value ) && isset( $value[ '_merge_strategy' ] ) ) { + $mergeStrategy = $value[ '_merge_strategy' ]; + unset( $value[ '_merge_strategy' ] ); + } + + $config = [ + 'value' => $value, + 'path' => false, + 'descriptionmsg' => $descriptionPrefix.'-config-'.str_replace( ' ', '-', ( trim( mb_strtolower( $key, 'UTF-8' ) ) ) ), + 'public' => false, + ]; + + if ( $mergeStrategy !== false ) { + $config[ 'merge_strategy' ] = $mergeStrategy; + } + return $config; + } +} + +$maintClass = 'convertExtensionManifestv1tov2'; +require_once( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/356954 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9dba6533a7ce2b8457e5dc1c42f9ecfdce2fa738 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Alexia ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: add el.planet.wikimedia.org
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356952 ) Change subject: add el.planet.wikimedia.org .. add el.planet.wikimedia.org New planet config has been added for a Greek planet (el) in I88c74bb402ad88. Change-Id: I7f6931dc4e653c9a177029916193d2dc7f06f334 --- M templates/wikimedia.org 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 224dee1..55fd890 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -691,6 +691,7 @@ cs.planet600 IN DYNA geoip!misc-addrs da.planet600 IN DYNA geoip!misc-addrs de.planet600 IN DYNA geoip!misc-addrs +el.planet600 IN DYNA geoip!misc-addrs en.planet600 IN DYNA geoip!misc-addrs es.planet600 IN DYNA geoip!misc-addrs fo.planet600 IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/356952 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f6931dc4e653c9a177029916193d2dc7f06f334 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Make phpcs pass - tests/phpunit
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356953 ) Change subject: Make phpcs pass - tests/phpunit .. Make phpcs pass - tests/phpunit Change-Id: I387c7ea4cf73bffcb9e7198a54460659850b2883 --- M tests/phpunit/AutoEnrollmentTest.php M tests/phpunit/BetaFeaturesTestCase.php M tests/phpunit/DependentFeatureTest.php M tests/phpunit/HTMLFeatureFieldTest.php M tests/phpunit/HTMLHorizontalRuleTest.php M tests/phpunit/HTMLTextBlockTest.php M tests/phpunit/HooksRunTest.php M tests/phpunit/NewHTMLCheckFieldTest.php M tests/phpunit/PreferenceHandlingTest.php 9 files changed, 94 insertions(+), 94 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/AutoEnrollmentTest.php b/tests/phpunit/AutoEnrollmentTest.php index 87d09a2..f397a1c 100644 --- a/tests/phpunit/AutoEnrollmentTest.php +++ b/tests/phpunit/AutoEnrollmentTest.php @@ -26,41 +26,41 @@ class AutoEnrollmentTest extends BetaFeaturesTestCase { // Structure of testing preference - public static $testPrefs = array( - 'unittest-all' => array( + public static $testPrefs = [ + 'unittest-all' => [ 'label-message' => 'nullish', 'desc-message' => 'nullish', 'info-link' => 'http://example.org/features', 'discussion-link' => 'http://example.org/feedback', 'auto-enrollment' => 'unittest', - ), + ], - 'unittest-ft1' => array( + 'unittest-ft1' => [ 'label-message' => 'something else', 'desc-message' => 'something even differenter', 'info-link' => 'http://example.org/feature/one', 'discussion-link' => 'http://example.org/feedback/one', 'group' => 'unittest', 'auto-enrollment' => 'unittest2', - ), + ], - 'unittest-ft2' => array( + 'unittest-ft2' => [ 'label-message' => 'something even more else', 'desc-message' => 'something even more differenter', 'info-link' => 'http://example.org/feature/two', 'discussion-link' => 'http://example.org/feedback/two', 'group' => 'unittest2', - ), + ], - 'unittest-ft3' => array( + 'unittest-ft3' => [ 'label-message' => 'something entirely different', 'desc-message' => 'something entirely differenter', 'info-link' => 'http://example.org/feature/three', 'discussion-link' => 'http://example.org/feedback/three', 'group' => 'unittest2', 'exempt-from-auto-enrollment' => true, - ), - ); + ], + ]; public static function hookThatRegistersPreference( $user, &$betaPrefs ) { foreach ( self::$testPrefs as $key => $testPref ) { @@ -71,72 +71,72 @@ } public static function getTestData() { - return array( - array( + return [ + [ null, null, 'unittest-ft1', null, 'Hooks set the preference though auto-enroll was not set.' - ), + ], - array( + [ 'betafeatures-auto-enroll', HTMLFeatureField::OPTION_ENABLED, 'unittest-ft1', HTMLFeatureField::OPTION_ENABLED, 'Hooks did not set the preference though global auto-enroll was set.', - ), + ], - array( + [ null, null, 'unittest-ft1', null, 'Hooks set the preference though group auto-enroll was not set.' - ), + ], - array( + [ 'unittest-all', HTMLFeatureField::OPTION_ENABLED, 'unittest-ft1', HTMLFeatureField::OPTION_ENABLED, 'Hooks did not set the prefe
[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Add phpcs and make pass - tests/phpunit
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356953 ) Change subject: Add phpcs and make pass - tests/phpunit .. Add phpcs and make pass - tests/phpunit Change-Id: I387c7ea4cf73bffcb9e7198a54460659850b2883 --- M tests/phpunit/AutoEnrollmentTest.php M tests/phpunit/BetaFeaturesTestCase.php M tests/phpunit/DependentFeatureTest.php M tests/phpunit/HTMLFeatureFieldTest.php M tests/phpunit/HTMLHorizontalRuleTest.php M tests/phpunit/HTMLTextBlockTest.php M tests/phpunit/HooksRunTest.php M tests/phpunit/NewHTMLCheckFieldTest.php M tests/phpunit/PreferenceHandlingTest.php 9 files changed, 94 insertions(+), 94 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BetaFeatures refs/changes/53/356953/1 diff --git a/tests/phpunit/AutoEnrollmentTest.php b/tests/phpunit/AutoEnrollmentTest.php index 87d09a2..f397a1c 100644 --- a/tests/phpunit/AutoEnrollmentTest.php +++ b/tests/phpunit/AutoEnrollmentTest.php @@ -26,41 +26,41 @@ class AutoEnrollmentTest extends BetaFeaturesTestCase { // Structure of testing preference - public static $testPrefs = array( - 'unittest-all' => array( + public static $testPrefs = [ + 'unittest-all' => [ 'label-message' => 'nullish', 'desc-message' => 'nullish', 'info-link' => 'http://example.org/features', 'discussion-link' => 'http://example.org/feedback', 'auto-enrollment' => 'unittest', - ), + ], - 'unittest-ft1' => array( + 'unittest-ft1' => [ 'label-message' => 'something else', 'desc-message' => 'something even differenter', 'info-link' => 'http://example.org/feature/one', 'discussion-link' => 'http://example.org/feedback/one', 'group' => 'unittest', 'auto-enrollment' => 'unittest2', - ), + ], - 'unittest-ft2' => array( + 'unittest-ft2' => [ 'label-message' => 'something even more else', 'desc-message' => 'something even more differenter', 'info-link' => 'http://example.org/feature/two', 'discussion-link' => 'http://example.org/feedback/two', 'group' => 'unittest2', - ), + ], - 'unittest-ft3' => array( + 'unittest-ft3' => [ 'label-message' => 'something entirely different', 'desc-message' => 'something entirely differenter', 'info-link' => 'http://example.org/feature/three', 'discussion-link' => 'http://example.org/feedback/three', 'group' => 'unittest2', 'exempt-from-auto-enrollment' => true, - ), - ); + ], + ]; public static function hookThatRegistersPreference( $user, &$betaPrefs ) { foreach ( self::$testPrefs as $key => $testPref ) { @@ -71,72 +71,72 @@ } public static function getTestData() { - return array( - array( + return [ + [ null, null, 'unittest-ft1', null, 'Hooks set the preference though auto-enroll was not set.' - ), + ], - array( + [ 'betafeatures-auto-enroll', HTMLFeatureField::OPTION_ENABLED, 'unittest-ft1', HTMLFeatureField::OPTION_ENABLED, 'Hooks did not set the preference though global auto-enroll was set.', - ), + ], - array( + [ null, null, 'unittest-ft1', null, 'Hooks set the preference though group auto-enroll was not set.' - ), + ], - array( + [ 'unittest-all', HTMLFeatureField::OPTION_ENABLED, 'unittest-ft1', HTMLFeatureField::OPTION_ENABLED,
[MediaWiki-commits] [Gerrit] operations/dns[master]: add el.planet.wikimedia.org
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356952 ) Change subject: add el.planet.wikimedia.org .. add el.planet.wikimedia.org New planet config has been added for a Greek planet (el) in I88c74bb402ad88. Change-Id: I7f6931dc4e653c9a177029916193d2dc7f06f334 --- M templates/wikimedia.org 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/52/356952/1 diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 224dee1..55fd890 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -691,6 +691,7 @@ cs.planet600 IN DYNA geoip!misc-addrs da.planet600 IN DYNA geoip!misc-addrs de.planet600 IN DYNA geoip!misc-addrs +el.planet600 IN DYNA geoip!misc-addrs en.planet600 IN DYNA geoip!misc-addrs es.planet600 IN DYNA geoip!misc-addrs fo.planet600 IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/356952 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f6931dc4e653c9a177029916193d2dc7f06f334 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Petition[master]: Add phpcs and make pass
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356951 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I1c55f273826304228f5cfabffbb0a01b3cf26863 --- M Petition.alias.php M Petition.php M PetitionHooks.php M SpecialPetition.php M SpecialPetitionData.php M composer.json A phpcs.xml 7 files changed, 74 insertions(+), 63 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Petition refs/changes/51/356951/1 diff --git a/Petition.alias.php b/Petition.alias.php index fb33640..f0e8830 100644 --- a/Petition.alias.php +++ b/Petition.alias.php @@ -6,11 +6,10 @@ * @ingroup Extensions */ -$specialPageAliases = array(); +$specialPageAliases = []; /** English */ -$specialPageAliases['en'] = array( - 'Petition' => array( 'Petition' ), - 'PetitionData' => array( 'PetitionData' ) -); - +$specialPageAliases['en'] = [ + 'Petition' => [ 'Petition' ], + 'PetitionData' => [ 'PetitionData' ] +]; diff --git a/Petition.php b/Petition.php index 600c331..7f2ff54 100644 --- a/Petition.php +++ b/Petition.php @@ -5,10 +5,11 @@ $wgMessagesDirs['Petition'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['PetitionAlias'] = __DIR__ . '/Petition.alias.php'; /*wfWarn( - 'Deprecated PHP entry point used for Petition extension. Please use wfLoadExtension instead, ' . + 'Deprecated PHP entry point used for Petition extension. ' . + 'Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' );*/ return; } else { die( 'This version of the Petition extension requires MediaWiki 1.25+' ); -} \ No newline at end of file +} diff --git a/PetitionHooks.php b/PetitionHooks.php index 3510e57..5d998c7 100644 --- a/PetitionHooks.php +++ b/PetitionHooks.php @@ -9,4 +9,4 @@ $updater->addExtensionTable( 'petition_data', __DIR__ . '/table.sql', true ); return true; } -} \ No newline at end of file +} diff --git a/SpecialPetition.php b/SpecialPetition.php index 8a9ddc6..91e1273 100755 --- a/SpecialPetition.php +++ b/SpecialPetition.php @@ -30,26 +30,26 @@ $countries = SpecialPetition::getCountryArray( $this->getLanguage()->getCode() ); $form = SpecialPetition::defineForm( $petitionName, $source, $countries ); - $form->setSubmitCallback( array( $this, 'petitionSubmit' ) ); + $form->setSubmitCallback( [ $this, 'petitionSubmit' ] ); $form->prepareForm(); $result = $form->tryAuthorizedSubmit(); if ( $result === true || ( $result instanceof Status && $result->isGood() ) ) { - $htmlOut = '' . wfMessage('petition-done')->text() . ''; + $htmlOut = '' . wfMessage( 'petition-done' )->text() . ''; } else { $htmlOut = '' . "\n"; $numberOfSignatures = SpecialPetition::getNumberOfSignatures( $petitionName ); $htmlOut .= ''; - $htmlOut .= wfMessage('petition-num-signatures', $numberOfSignatures)->escaped(); + $htmlOut .= wfMessage( 'petition-num-signatures', $numberOfSignatures )->escaped(); $htmlOut .= '' . "\n"; // Add the form, with any errors if there was an attempted submission - $htmlOut .= $form->getHtml($result) . "\n"; + $htmlOut .= $form->getHtml( $result ) . "\n"; $htmlOut .= '' . "\n"; } - $out->addHtml($htmlOut); + $out->addHtml( $htmlOut ); } @@ -64,15 +64,15 @@ global $wgPetitionDatabase; if ( $this->getUser()->pingLimiter( 'edit' ) ) { - return wfMessage('actionthrottledtext')->text(); + return wfMessage( 'actionthrottledtext' )->text(); } - $dbw = wfGetDB( DB_MASTER, array(), $wgPetitionDatabase ); + $dbw = wfGetDB( DB_MASTER, [], $wgPetitionDatabase ); if ( $dbw->isReadOnly() ) { throw new ReadOnlyError(); } - $dbw->insert( 'petition_data', array( + $dbw->insert( 'petition_data', [ 'pt_petitionname' => $formData['petitionname'], 'pt_source' => $formData['source'], 'pt_name' => $formData['name'], @@ -81,8 +81,9 @@ 'pt_message' => $formData['personalmessage'], 'pt_share'=> $formData['share'],
[MediaWiki-commits] [Gerrit] mediawiki...UrlShortener[master]: Add phpcs and make pass
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356940 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I978a61841ba6429ce05df5a008c8c8415273e6ec --- M ApiShortenUrl.php M SpecialUrlShortener.php M UrlShortener.alias.php M UrlShortener.hooks.php M UrlShortener.notranslate-alias.php M UrlShortener.utils.php M composer.json M maintenance/dumpURLs.php A phpcs.xml M tests/phpunit/UrlShortenerUtilsTest.php 10 files changed, 118 insertions(+), 109 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UrlShortener refs/changes/40/356940/1 diff --git a/ApiShortenUrl.php b/ApiShortenUrl.php index 31575c9..be5cfc3 100644 --- a/ApiShortenUrl.php +++ b/ApiShortenUrl.php @@ -40,7 +40,7 @@ $this->getMain()->setCacheMaxAge( UrlShortenerUtils::CACHE_TIME ); $this->getResult()->addValue( null, $this->getModuleName(), - array( 'shorturl' => $shortUrl ) + [ 'shorturl' => $shortUrl ] ); } @@ -50,18 +50,17 @@ } protected function getAllowedParams() { - return array( - 'url' => array( + return [ + 'url' => [ ApiBase::PARAM_REQUIRED => true, - ) - ); + ] + ]; } public function getExamplesMessages() { - return array( + return [ 'action=shortenurl&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FArctica' => 'apihelp-shortenurl-example-1', - ); + ]; } } - diff --git a/SpecialUrlShortener.php b/SpecialUrlShortener.php index 5ce0c11..6fb5681 100644 --- a/SpecialUrlShortener.php +++ b/SpecialUrlShortener.php @@ -10,7 +10,7 @@ */ if ( !defined( 'MEDIAWIKI' ) ) { - echo( 'not a valid entry point.\n' ); + echo 'not a valid entry point.\n'; die( 1 ); } @@ -41,7 +41,7 @@ $domains = $wgUrlShortenerApprovedDomains; } else { $parsed = wfParseUrl( $wgServer ); - $domains = array( $parsed['host'] ); + $domains = [ $parsed['host'] ]; } $lang = $this->getLanguage(); @@ -61,12 +61,11 @@ $form->setSubmitTextMsg( 'urlshortener-url-input-submit' ); $form->setFooterText( $this->getApprovedDomainsMessage()->parse() ); $this->getOutput()->addModules( 'ext.urlShortener.special' ); - $this->getOutput()->addJsConfigVars( array( + $this->getOutput()->addJsConfigVars( [ 'wgUrlShortenerDomainsWhitelist' => UrlShortenerUtils::getWhitelistRegex(), 'wgUrlShortenerAllowArbitraryPorts' => $wgUrlShortenerAllowArbitraryPorts, - ) ); + ] ); } - /** * Validate the URL to ensure that we are allowed to create a shorturl for this. @@ -87,15 +86,14 @@ return $validity_check->text(); } - /** * Generate the form used to input the URL to shorten. * @return array A form defintion that can be used by HTMLForm */ protected function getFormFields() { - return array( - 'url' => array( - 'validation-callback' => array( $this, 'validateURL' ), + return [ + 'url' => [ + 'validation-callback' => [ $this, 'validateURL' ], 'required' => true, 'type' => 'url', 'name' => 'url', @@ -103,8 +101,8 @@ 'autofocus' => true, 'id' => 'mw-urlshortener-url-input', 'placeholder' => $this->msg( 'urlshortener-url-input-label' )->text() - ), - ); + ], + ]; } /** @@ -126,10 +124,10 @@ if ( !$status->isOK() ) { return $status; } - $html = new OOUI\TextInputWidget( array( + $html = new OOUI\TextInputWidget( [ 'value' => UrlShortenerUtils::makeUrl( $status->getValue() ), 'readOnly' => true, - ) ); + ] ); $out->addHTML( $html ); return true; } diff --git a/UrlShortener.alias.php b/UrlShortener.alias.php index 21a7640..0e79e3b 100644 --- a/UrlShortener.alias.php +++ b/UrlShortener.alias.php @@ -5,
[MediaWiki-commits] [Gerrit] operations/dns[master]: status.wm.org: lower TTL to 5M
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356936 ) Change subject: status.wm.org: lower TTL to 5M .. status.wm.org: lower TTL to 5M Along with wikitech-static (If1c250419549a8ce6), need to also lower TTL for status.wikimedia.org since it points to the same IP. (ReverseProxy to external "watchmouse" site). So it's also influenced by I969a4b8fb2ecc253f. Bug: T164271 Change-Id: I74ed140c6ef4b4560b68da6e3afc5958506fcf35 --- M templates/wikimedia.org 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 8ea7d17..224dee1 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -722,8 +722,8 @@ store1H IN CNAMEc.ssl.shopify.com. static-bugzilla 600 IN DYNA geoip!misc-addrs stats600 IN DYNA geoip!misc-addrs -status 1H IN A162.209.126.221 -status 1H IN 2001:4802:7800:1:be76:4eff:fe21:3782 +status 5M IN A162.209.126.221 +status 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 techblog 600 IN DYNA geoip!text-addrs ticket 600 IN DYNA geoip!misc-addrs tor-eqiad-1 1H IN CNAMEradium -- To view, visit https://gerrit.wikimedia.org/r/356936 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I74ed140c6ef4b4560b68da6e3afc5958506fcf35 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: status.wm.org: lower TTL to 5M
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356936 ) Change subject: status.wm.org: lower TTL to 5M .. status.wm.org: lower TTL to 5M Along with wikitech-static (If1c250419549a8ce6), need to also lower TTL for status.wikimedia.org since it points to the same IP. (ReverseProxy to external "watchmouse" site). So it's also influenced by I969a4b8fb2ecc253f. Bug: T164271 Change-Id: I74ed140c6ef4b4560b68da6e3afc5958506fcf35 --- M templates/wikimedia.org 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/36/356936/1 diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 8ea7d17..224dee1 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -722,8 +722,8 @@ store1H IN CNAMEc.ssl.shopify.com. static-bugzilla 600 IN DYNA geoip!misc-addrs stats600 IN DYNA geoip!misc-addrs -status 1H IN A162.209.126.221 -status 1H IN 2001:4802:7800:1:be76:4eff:fe21:3782 +status 5M IN A162.209.126.221 +status 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 techblog 600 IN DYNA geoip!text-addrs ticket 600 IN DYNA geoip!misc-addrs tor-eqiad-1 1H IN CNAMEradium -- To view, visit https://gerrit.wikimedia.org/r/356936 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I74ed140c6ef4b4560b68da6e3afc5958506fcf35 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...PropertySuggester[master]: Fix eslint issues in PropertySuggester
Dbarratt has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356935 ) Change subject: Fix eslint issues in PropertySuggester .. Fix eslint issues in PropertySuggester Enabled all eslint rules and disabled no-underscore-dangle for the specific file. Bug: T166215 Change-Id: Iba5767fedc405da22d627d96d07601e3bb50187a --- M .eslintrc.json M modules/ext.PropertySuggester.EntitySelector.js 2 files changed, 5 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PropertySuggester refs/changes/35/356935/1 diff --git a/.eslintrc.json b/.eslintrc.json index 10c901a..db53d75 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,10 +6,5 @@ "globals": { "mediaWiki": false, "OO": false - }, - "rules": { - "no-underscore-dangle": "off", - "no-unused-vars": "off", - "operator-linebreak": "off" } } diff --git a/modules/ext.PropertySuggester.EntitySelector.js b/modules/ext.PropertySuggester.EntitySelector.js index c2c5c8c..0376792 100644 --- a/modules/ext.PropertySuggester.EntitySelector.js +++ b/modules/ext.PropertySuggester.EntitySelector.js @@ -1,3 +1,4 @@ +/* eslint-disable no-underscore-dangle */ /** * override usual entityselector and replace _request and _create * if a property is requested and we are on an Entity page. @@ -34,7 +35,7 @@ // Search for suggestions once the field is initially focused. // We only need to do this once, afterwards the old suggestions // will re-appear on focus anyway. - this.element.one( 'focus', function ( event ) { + this.element.one( 'focus', function () { if ( self._useSuggester() && self.element.val() === '' && !self.options.menu.element.is( ':visible' ) @@ -111,8 +112,7 @@ } return $entityView.length > 0 ? - $entityView.data( 'entityview' ).option( 'value' ) - : null; + $entityView.data( 'entityview' ).option( 'value' ) : null; }, /** @@ -133,8 +133,7 @@ } statement = $statementview.length > 0 ? - $statementview.data( 'statementview' ).option( 'value' ) - : null; + $statementview.data( 'statementview' ).option( 'value' ) : null; return statement ? statement.getClaim().getMainSnak().getPropertyId() : null; }, @@ -193,8 +192,7 @@ _isInNewStatementView: function () { var $statementview = this.element.closest( ':wikibase-statementview' ), value = $statementview.length > 0 ? - $statementview.data( 'statementview' ).option( 'value' ) - : null; + $statementview.data( 'statementview' ).option( 'value' ) : null; return !value; } -- To view, visit https://gerrit.wikimedia.org/r/356935 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba5767fedc405da22d627d96d07601e3bb50187a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PropertySuggester Gerrit-Branch: master Gerrit-Owner: Dbarratt ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: wikitech-static: lower TTL to 5M
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356930 ) Change subject: wikitech-static: lower TTL to 5M .. wikitech-static: lower TTL to 5M Before I969a4b8fb2ecc253f, lower TTL from 1H to 5M to be able to revert quicker if needed. Bug: T164271 Change-Id: If1c250419549a8ce689742ac3a58ceb08dd84c27 --- M templates/wikimedia.org 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 777aade..8ea7d17 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -730,10 +730,10 @@ mirrors 1H IN CNAMEsodium yarn 600 IN DYNA geoip!misc-addrs wikitech 1H IN CNAMEsilver -wikitech-static 1H IN A162.209.126.221 -wikitech-static 1H IN 2001:4802:7800:1:be76:4eff:fe21:3782 -wikitech-static-ord 1H IN A192.237.162.200 -wikitech-static-ord 1H IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 +wikitech-static 5M IN A162.209.126.221 +wikitech-static 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 +wikitech-static-ord 5M IN A 192.237.162.200 +wikitech-static-ord 5M IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 labtestwikitech 1H IN CNAMElabtestweb2001 labtesthorizon 1H IN DYNA geoip!misc-addrs labtestspice 1H IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/356930 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1c250419549a8ce689742ac3a58ceb08dd84c27 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: wikitech-static: lower TTL to 5M
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356930 ) Change subject: wikitech-static: lower TTL to 5M .. wikitech-static: lower TTL to 5M Before I969a4b8fb2ecc253f, lower TTL from 1H to 5M to be able to revert quicker if needed. Bug: T164271 Change-Id: If1c250419549a8ce689742ac3a58ceb08dd84c27 --- M templates/wikimedia.org 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/30/356930/1 diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 777aade..8ea7d17 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -730,10 +730,10 @@ mirrors 1H IN CNAMEsodium yarn 600 IN DYNA geoip!misc-addrs wikitech 1H IN CNAMEsilver -wikitech-static 1H IN A162.209.126.221 -wikitech-static 1H IN 2001:4802:7800:1:be76:4eff:fe21:3782 -wikitech-static-ord 1H IN A192.237.162.200 -wikitech-static-ord 1H IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 +wikitech-static 5M IN A162.209.126.221 +wikitech-static 5M IN 2001:4802:7800:1:be76:4eff:fe21:3782 +wikitech-static-ord 5M IN A 192.237.162.200 +wikitech-static-ord 5M IN 2001:4801:7821:77:be76:4eff:fe10:2ed5 labtestwikitech 1H IN CNAMElabtestweb2001 labtesthorizon 1H IN DYNA geoip!misc-addrs labtestspice 1H IN DYNA geoip!misc-addrs -- To view, visit https://gerrit.wikimedia.org/r/356930 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1c250419549a8ce689742ac3a58ceb08dd84c27 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added support for hierarchy fields in the Page Forms extensi...
Fz-29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356928 ) Change subject: Added support for hierarchy fields in the Page Forms extension. Hierarchy fields automatically get the right input type ("tree"), with the right values filled in. According to the task T161034. .. Added support for hierarchy fields in the Page Forms extension. Hierarchy fields automatically get the right input type ("tree"), with the right values filled in. According to the task T161034. Change-Id: I03bc8cf413ce0969eee6397d652aa5d319a38c86 --- M includes/PF_TemplateField.php M includes/forminputs/PF_TreeInput.php 2 files changed, 29 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms refs/changes/28/356928/1 diff --git a/includes/PF_TemplateField.php b/includes/PF_TemplateField.php index b3c11da..f866b32 100644 --- a/includes/PF_TemplateField.php +++ b/includes/PF_TemplateField.php @@ -127,7 +127,11 @@ // We have some "pseudo-types", used for setting the correct // form input. if ( $fieldDescription->mAllowedValues != null ) { - $this->mFieldType = 'Enumeration'; + if( $fieldDescription->mIsHierarchy == true ) { + $this->mFieldType = 'hierarchy'; + } else { + $this->mFieldType = 'Enumeration'; + } } elseif ( $fieldDescription->mType == 'Text' && $fieldDescription->mSize != '' && $fieldDescription->mSize <= 100 ) { $this->mFieldType = 'String'; } else { diff --git a/includes/forminputs/PF_TreeInput.php b/includes/forminputs/PF_TreeInput.php index 8758d51..e3c760b 100644 --- a/includes/forminputs/PF_TreeInput.php +++ b/includes/forminputs/PF_TreeInput.php @@ -40,6 +40,18 @@ } } + public static function getDefaultCargoTypes() { + return array( + 'hierarchy' => array() + ); + } + + public static function getDefaultCargoTypeLists() { + return array( + 'hierarchy' => array() + ); + } + public static function getOtherCargoTypesHandled() { return array( 'String', 'Page' ); } @@ -51,10 +63,10 @@ public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disabled, $other_args ) { // Handle the now-deprecated 'category' and 'categories' // input types. - if ( $other_args['input type'] == 'category' ) { + if ( array_key_exists( 'input type', $other_args ) && $other_args['input type'] == 'category' ) { $inputType = "radio"; self::$multipleSelect = false; - } elseif ( $other_args['input type'] == 'categories' ) { + } elseif ( array_key_exists( 'input type', $other_args ) && $other_args['input type'] == 'categories' ) { $inputType = "checkbox"; self::$multipleSelect = true; } else { @@ -107,6 +119,16 @@ $structure = $other_args['structure']; $tree = PFTree::newFromWikiText( $structure ); $hideroot = true; + } elseif ( array_key_exists( 'possible_values', $other_args ) ) { + //The possibility of field being of type - 'hierarchy' pseudo-type + if ( count( $other_args['possible_values'] ) >= 1) { + $structure = $other_args['possible_values'][0]; + $tree = PFTree::newFromWikiText( $structure ); + $hideroot = true; + } else { + return null; + } + } else { // Escape - we can't do anything. return null; -- To view, visit https://gerrit.wikimedia.org/r/356928 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03bc8cf413ce0969eee6397d652aa5d319a38c86 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageForms Gerrit-Branch: master Gerrit-Owner: Fz-29 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Add phpcs and make pass
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356902 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I9d154d4a076f40892f99c2c41c651581f556b906 --- M BetaFeaturesHooks.php M composer.json M includes/ApiListBetaFeatures.php M includes/HTMLFeatureField.php M includes/HTMLHorizontalRuleField.php M includes/HTMLTextBlockField.php M includes/NewHTMLCheckField.php M includes/UpdateBetaFeatureUserCountsJob.php A phpcs.xml M tests/phpunit/AutoEnrollmentTest.php M tests/phpunit/BetaFeaturesTestCase.php M tests/phpunit/DependentFeatureTest.php M tests/phpunit/HTMLFeatureFieldTest.php M tests/phpunit/HTMLHorizontalRuleTest.php M tests/phpunit/HTMLTextBlockTest.php M tests/phpunit/HooksRunTest.php M tests/phpunit/NewHTMLCheckFieldTest.php M tests/phpunit/PreferenceHandlingTest.php 18 files changed, 197 insertions(+), 185 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BetaFeatures refs/changes/02/356902/1 diff --git a/BetaFeaturesHooks.php b/BetaFeaturesHooks.php index 451c173..0c5c550 100644 --- a/BetaFeaturesHooks.php +++ b/BetaFeaturesHooks.php @@ -34,14 +34,14 @@ * This also includes a magic value of 'blacklist', which consequently MUST NOT be * used as the name of any registered Beta Feature. */ - private static $features = array(); + private static $features = []; /** * @param array $prefs * @return array */ static function getUserCounts( array $prefs ) { - $counts = array(); + $counts = []; if ( !$prefs ) { return $counts; } @@ -49,8 +49,8 @@ $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'betafeatures_user_counts', - array( 'feature', 'number' ), - array( 'feature' => $prefs ), + [ 'feature', 'number' ], + [ 'feature' => $prefs ], __METHOD__ ); @@ -77,7 +77,7 @@ } $betaFeatures = $wgBetaFeatures; - Hooks::run( 'GetBetaFeaturePreferences', array( $user, &$betaFeatures ) ); + Hooks::run( 'GetBetaFeaturePreferences', [ $user, &$betaFeatures ] ); foreach ( $betaFeatures as $name => $option ) { $newVal = $user->getOption( $name ); @@ -92,7 +92,7 @@ JobQueueGroup::singleton()->push( new UpdateBetaFeatureUserCountsJob( Title::newMainPage(), - array( 'prefs' => array( $name ) ) + [ 'prefs' => [ $name ] ] ) ); } @@ -108,39 +108,39 @@ global $wgBetaFeaturesWhitelist, $wgBetaFeatures; $betaPrefs = $wgBetaFeatures; - $depHooks = array(); + $depHooks = []; - Hooks::run( 'GetBetaFeaturePreferences', array( $user, &$betaPrefs ) ); + Hooks::run( 'GetBetaFeaturePreferences', [ $user, &$betaPrefs ] ); - $prefs['betafeatures-section-desc'] = array( + $prefs['betafeatures-section-desc'] = [ 'class' => 'HTMLTextBlockField', 'label' => wfMessage( 'betafeatures-section-desc' )->numParams( count( $betaPrefs ) )->parse(), 'section' => 'betafeatures', - ); + ]; - $prefs['betafeatures-auto-enroll'] = array( + $prefs['betafeatures-auto-enroll'] = [ 'class' => 'NewHTMLCheckField', 'label-message' => 'betafeatures-auto-enroll', 'section' => 'betafeatures', - ); + ]; // Purely visual field. - $prefs['betafeatures-breaking-hr'] = array( + $prefs['betafeatures-breaking-hr'] = [ 'class' => 'HTMLHorizontalRuleField', 'section' => 'betafeatures', - ); + ]; $counts = self::getUserCounts( array_keys( $betaPrefs ) ); // Set up dependency hooks array // This complex structure brought to you by Per-Wiki Configuration, // coming soon to a wiki very near you. - Hooks::run( 'GetBetaFeatureDependencyHooks', array( &$depHooks ) ); + Hooks::run( 'GetBetaFeatureDependencyHooks', [ &$depHooks ] ); $saveUser = false; $autoEnrollAll = $user->getOption( 'betafeatures-auto-en
[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added Hierarchy option to #cargo_declare in order to complet...
Fz-29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356901 ) Change subject: Added Hierarchy option to #cargo_declare in order to complete the first step in the task T161034. .. Added Hierarchy option to #cargo_declare in order to complete the first step in the task T161034. Change-Id: I53e57ab6b09773d99c983ebbcb7cc50991420014 --- M CargoFieldDescription.php 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo refs/changes/01/356901/1 diff --git a/CargoFieldDescription.php b/CargoFieldDescription.php index 982826a..18e72dd 100644 --- a/CargoFieldDescription.php +++ b/CargoFieldDescription.php @@ -14,6 +14,7 @@ private $mDelimiter; public $mAllowedValues = null; public $mIsHidden = false; + public $mIsHierarchy = false; public $mOtherParams = array(); /** @@ -27,7 +28,7 @@ if ( strpos( $fieldDescriptionStr, 'List' ) === 0 ) { $matches = array(); - $foundMatch = preg_match( '/List \((.*)\) of (.*)/', $fieldDescriptionStr, $matches ); + $foundMatch = preg_match( '/List \((.*)\) of (.*)/s', $fieldDescriptionStr, $matches ); if ( !$foundMatch ) { // Return a true error message here? return null; @@ -39,7 +40,7 @@ // There may be additional parameters, in/ parentheses. $matches = array(); - $foundMatch2 = preg_match( '/([^(]*)\s*\((.*)\)/', $fieldDescriptionStr, $matches ); + $foundMatch2 = preg_match( '/([^(]*)\s*\((.*)\)/s', $fieldDescriptionStr, $matches ); if ( $foundMatch2 ) { $fieldDescriptionStr = trim( $matches[1] ); $extraParamsString = $matches[2]; @@ -48,6 +49,9 @@ $extraParamParts = explode( '=', $extraParam, 2 ); if ( count( $extraParamParts ) == 1 ) { $paramKey = trim( $extraParamParts[0] ); + if($paramKey == 'hierarchy') { + $mIsHierarchy = true; + } $fieldDescription->mOtherParams[$paramKey] = true; } else { $paramKey = trim( $extraParamParts[0] ); @@ -108,6 +112,8 @@ $fieldDescription->mAllowedValues = $value; } elseif ( $param == 'hidden' ) { $fieldDescription->mIsHidden = true; + } elseif ( $param == 'hierarchy' ) { + $fieldDescription->mIsHierarchy = true; } } return $fieldDescription; @@ -144,6 +150,9 @@ if ( $this->mIsHidden ) { $descriptionData['hidden'] = true; } + if ( $this->mIsHierarchy ) { + $descriptionData['hierarchy'] = true; + } foreach ( $this->mOtherParams as $otherParam => $value ) { $descriptionData[$otherParam] = $value; } -- To view, visit https://gerrit.wikimedia.org/r/356901 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53e57ab6b09773d99c983ebbcb7cc50991420014 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Cargo Gerrit-Branch: master Gerrit-Owner: Fz-29 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...UrlShortener[master]: Break long lines
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356857 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: I3e02368e483189fd301caf6ab778babbd50a2863 --- M UrlShortener.hooks.php M tests/phpunit/UrlShortenerUtilsTest.php 2 files changed, 68 insertions(+), 16 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/UrlShortener.hooks.php b/UrlShortener.hooks.php index d1ec206..f945c0b 100644 --- a/UrlShortener.hooks.php +++ b/UrlShortener.hooks.php @@ -57,7 +57,8 @@ unset( $query['title'] ); } $linkToShorten = $skin->getTitle()->getFullURL( $query, false, PROTO_CANONICAL ); - $link = SpecialPage::getTitleFor( 'UrlShortener' )->getLocalURL( array( 'url' => $linkToShorten ) ); + $link = SpecialPage::getTitleFor( 'UrlShortener' ) + ->getLocalURL( array( 'url' => $linkToShorten ) ); $toolbox['urlshortener'] = array( 'id' => 't-urlshortener', 'href' => $link, diff --git a/tests/phpunit/UrlShortenerUtilsTest.php b/tests/phpunit/UrlShortenerUtilsTest.php index 9b62af4..a6af289 100644 --- a/tests/phpunit/UrlShortenerUtilsTest.php +++ b/tests/phpunit/UrlShortenerUtilsTest.php @@ -13,12 +13,36 @@ public static function provideConvertToProtocol() { return array( - array( 'https://example.org/foo?query=bar', PROTO_HTTP, 'http://example.org/foo?query=bar' ), - array( 'http://example.org/foo?query=bar', PROTO_HTTP, 'http://example.org/foo?query=bar' ), - array( '//example.org/foo?query=bar', PROTO_HTTP, 'http://example.org/foo?query=bar' ), - array( 'http://example.org/foo?query=bar', PROTO_HTTPS, 'https://example.org/foo?query=bar' ), - array( 'http://example.org/foo?query=bar', PROTO_RELATIVE, '//example.org/foo?query=bar' ), - array( 'https://example.org/foo?query=bar', PROTO_RELATIVE, '//example.org/foo?query=bar' ), + array( + 'https://example.org/foo?query=bar', + PROTO_HTTP, + 'http://example.org/foo?query=bar' + ), + array( + 'http://example.org/foo?query=bar', + PROTO_HTTP, + 'http://example.org/foo?query=bar' + ), + array( + '//example.org/foo?query=bar', + PROTO_HTTP, + 'http://example.org/foo?query=bar' + ), + array( + 'http://example.org/foo?query=bar', + PROTO_HTTPS, + 'https://example.org/foo?query=bar' + ), + array( + 'http://example.org/foo?query=bar', + PROTO_RELATIVE, + '//example.org/foo?query=bar' + ), + array( + 'https://example.org/foo?query=bar', + PROTO_RELATIVE, + '//example.org/foo?query=bar' + ), ); } @@ -37,22 +61,49 @@ public static function provideNormalizeUrl() { return array( // HTTPS -> HTTP - array( 'https://example.org', 'http://example.org' ), + array( + 'https://example.org', + 'http://example.org' + ), // Article normalized - array( 'http://example.com/w/index.php?title=Main_Page', 'http://example.com/wiki/Main_Page' ), + array( + 'http://example.com/w/index.php?title=Main_Page', + 'http://example.com/wiki/Main_Page' + ), // Already normalized - array( 'http://example.com/wiki/Special:Version', 'http://example.com/wiki/Special:Version' ), + array( + 'http://example.com/wiki/Special:Version', + 'http://example.com/wiki/Special:Version' + ), // Special page normalized - array( 'http://example.com/w/index.php?title=
[MediaWiki-commits] [Gerrit] operations/puppet[production]: kibana: allow any arbitrary setting
Hashar has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356900 ) Change subject: kibana: allow any arbitrary setting .. kibana: allow any arbitrary setting Make ::kibana class to accept a 'settings' hash which is then used to generate the kibana.yaml configuration file. Kept logging.quiet to default to true by using Puppet stdlib merge() https://www.elastic.co/guide/en/kibana/current/settings.html Change-Id: I4083e7315e26b71efb3c95fa5c5cab5a47e30777 --- M modules/kibana/manifests/init.pp 1 file changed, 14 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/00/356900/1 diff --git a/modules/kibana/manifests/init.pp b/modules/kibana/manifests/init.pp index 59597a0..28d5adc 100644 --- a/modules/kibana/manifests/init.pp +++ b/modules/kibana/manifests/init.pp @@ -4,28 +4,32 @@ # types of time-stamped data. It integrates with ElasticSearch and LogStash. # # == Parameters: -# - $default_app_id: Default landing page. You can specify files, scripts or -# saved dashboards here. Default: '/dashboard/file/default.json'. +# - $settings: hash of settings used to generate the kibanal.yaml configuration +# file. See https://www.elastic.co/guide/en/kibana/current/settings.html +# Note: logging.quiet is made to default to true unlike Kibana # # == Sample usage: # # class { 'kibana': -# default_app_id => 'dashboard/default', +# settings = { +# kibana.defaultAppId => 'dashboard/default', +# logging.quiet => false, +# elasticsearch_url => 'http://localhost:9200', +# } # } # -class kibana ( -$default_app_id = 'dashboard/default' -) { +class kibana ( $settings ) { require_package('kibana') + +$default_settings = { +'logging.quiet' => true, +} file { '/etc/kibana/kibana.yml': ensure => file, owner => 'root', group => 'root', -content => ordered_yaml({ -'kibana.defaultAppId' => $default_app_id, -'logging.quiet' => true, -}), +content => ordered_yaml( merge( $default_settings, $settings ) ), mode=> '0444', require => Package['kibana'], } -- To view, visit https://gerrit.wikimedia.org/r/356900 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4083e7315e26b71efb3c95fa5c5cab5a47e30777 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Break long lines
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356899 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: Ia76272aa3d80d2e19b9b9890908da93099aa8701 --- M api/ApiQueryLQTThreads.php M api/ApiThreadAction.php M classes/Hooks.php M classes/Thread.php M classes/ThreadHistoryPager.php M classes/View.php M pages/TalkpageView.php M pages/ThreadActionPage.php 8 files changed, 159 insertions(+), 66 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/99/356899/1 diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php index 1208ee3..be0614d 100644 --- a/api/ApiQueryLQTThreads.php +++ b/api/ApiQueryLQTThreads.php @@ -160,7 +160,9 @@ 'thread_id', 'thread_parent', 'replies', - function($row) { return array( $row->thread_id => array( 'id' => $row->thread_id ) ); }, + function ( $row ) { + return array( $row->thread_id => array( 'id' => $row->thread_id ) ); + }, 'reply' ); } @@ -168,7 +170,9 @@ $result->addIndexedTagName( array( 'query', $this->getModuleName() ), 'thread' ); } - protected function addSubItems( $tableName, $fields, $joinField, $subitemName, /*callable*/ $handleRow, $tagName ) { + protected function addSubItems( + $tableName, $fields, $joinField, $subitemName, /*callable*/ $handleRow, $tagName + ) { $dbr = wfGetDB( DB_SLAVE ); $result = $this->getResult(); diff --git a/api/ApiThreadAction.php b/api/ApiThreadAction.php index 658200f..3f66907 100644 --- a/api/ApiThreadAction.php +++ b/api/ApiThreadAction.php @@ -27,14 +27,18 @@ if ( $threadObj instanceof Thread ) { $threads[] = $threadObj; - if ( !in_array( $action, $actionsAllowedOnNonLqtPage ) && !LqtDispatch::isLqtPage( $threadObj->getTitle() ) ) { + if ( !in_array( $action, $actionsAllowedOnNonLqtPage ) + && !LqtDispatch::isLqtPage( $threadObj->getTitle() ) + ) { $articleTitleDBKey = $threadObj->getTitle()->getDBkey(); if ( is_callable( [ $this, 'dieWithError' ] ) ) { - $this->dieWithError( - [ 'lqt-not-a-liquidthreads-page', wfEscapeWikiText( $articleTitleDBKey ) ] - ); + $this->dieWithError( [ + 'lqt-not-a-liquidthreads-page', + wfEscapeWikiText( $articleTitleDBKey ) + ] ); } else { - $message = wfMessage( 'lqt-not-a-liquidthreads-page', $articleTitleDBKey )->text(); + $message = wfMessage( + 'lqt-not-a-liquidthreads-page', $articleTitleDBKey )->text(); $this->dieUsageMsg( $message ); } } @@ -85,9 +89,11 @@ ); } $newMessagesCount = NewMessages::newMessageCount( $user, DB_MASTER ); - $result[count( $result ) - 1]['unreadlink'] = array( // Only bother to put this on the last threadaction + $msgNewMessages = $newMessagesCount ? 'lqt-newmessages-n' : 'lqt_newmessages'; + // Only bother to put this on the last threadaction + $result[count( $result ) - 1]['unreadlink'] = array( 'href' => SpecialPage::getTitleFor( 'NewMessages' )->getLocalURL(), - 'text' => wfMessage( $newMessagesCount ? 'lqt-newmessages-n' : 'lqt_newmessages' )->numParams( $newMessagesCount )->text(), + 'text' => wfMessage( $msgNewMessages )->numParams( $newMessagesCount )->text(), 'active' => $newMessagesCount
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add missing return value to getPendingUpdates() docs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356536 ) Change subject: Add missing return value to getPendingUpdates() docs .. Add missing return value to getPendingUpdates() docs Change-Id: I917a2eb97e6e99ccc895245b84717ba40b0c88f6 --- M includes/deferred/DeferredUpdates.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 9f5b31a..51f5a28 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -332,6 +332,7 @@ /** * @param integer $stage DeferredUpdates constant (PRESEND, POSTSEND, or ALL) +* @return DeferrableUpdate[] * @since 1.29 */ public static function getPendingUpdates( $stage = self::ALL ) { -- To view, visit https://gerrit.wikimedia.org/r/356536 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I917a2eb97e6e99ccc895245b84717ba40b0c88f6 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Better handling of jobs execution in post-connection shutdown
Seb35 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356887 ) Change subject: Better handling of jobs execution in post-connection shutdown .. Better handling of jobs execution in post-connection shutdown Some DeferredUpdates callables use JobQueueGroup::lazyPush but this is never executed by the job runner, so some jobs are never added in the job queue. In this change a call to JobQueueGroup::pushLazyJobs is done in JobRunner::execute. This change is cherry-picked from the master version, but is quite heavily lightened since an additional issue has been introduced in 1.28. Bug: T100085 Change-Id: I721e7167eca5b0b6227234fe516005243ab22388 (cherry picked from commit d80fca05e18d9654b8458ed6966c5d3c4991d88e) --- M includes/jobqueue/JobRunner.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/87/356887/1 diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index a2f55b9..f82dfc4 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -268,6 +268,8 @@ DeferredUpdates::doUpdates(); $this->commitMasterChanges( $job ); + // Push lazy jobs added by the job or its deferred udpates + JobQueueGroup::pushLazyJobs(); $job->teardown(); } catch ( Exception $e ) { MWExceptionHandler::rollbackMasterChangesAndLog( $e ); -- To view, visit https://gerrit.wikimedia.org/r/356887 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I721e7167eca5b0b6227234fe516005243ab22388 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_27 Gerrit-Owner: Seb35 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...wikihiero[master]: Break long lines
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356886 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: I8862a29d51d81e2618f41876bb4974dccffe130c --- M SpecialHieroglyphs.php M wikihiero.body.php M wikihiero.php 3 files changed, 39 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/wikihiero refs/changes/86/356886/1 diff --git a/SpecialHieroglyphs.php b/SpecialHieroglyphs.php index 43fdc4b..d485d6e 100644 --- a/SpecialHieroglyphs.php +++ b/SpecialHieroglyphs.php @@ -51,7 +51,10 @@ $out = $this->getContext()->getOutput(); $out->addModules( 'ext.wikihiero.Special' ); $out->addModuleStyles( 'ext.wikihiero' ); // apply CSS during slow load - $out->addWikiMsg( 'wikihiero-special-page-text', wfMessage( 'wikihiero-help-link' )->text() ); + $out->addWikiMsg( + 'wikihiero-special-page-text', + wfMessage( 'wikihiero-help-link' )->text() + ); $out->addHTML( '' ); @@ -151,10 +154,18 @@ } } if ( $columns ) { - $html .= "$upperRow" - . ( $columns && $rows ? ' ' : '' ) . "\n"; - $html .= "$lowerRow" - . ( $columns && $rows ? ' ' : '' ) . "\n"; + $html .= "$upperRow" . + ( $columns && $rows + ? ' ' + : '' + ) . "\n"; + $html .= "$lowerRow" . + ( $columns && $rows + ? ' ' + : '' + ) . "\n"; } $html .= "\n"; } diff --git a/wikihiero.body.php b/wikihiero.body.php index 7b206aa..33fe33b 100644 --- a/wikihiero.body.php +++ b/wikihiero.body.php @@ -263,18 +263,23 @@ } elseif ( strchr( $code[0], '<' ) ) { // start cartouche $contentHtml .= '' . $this->renderGlyph( $code[0] ) . ''; $is_cartouche = true; - $contentHtml .= '' . self::TABLE_START . "" . self::TABLE_START . ""; + $contentHtml .= '' . + self::TABLE_START . "" . self::TABLE_START . + ""; } elseif ( strchr( $code[0], '>' ) ) { // end cartouche - $contentHtml .= "'; + $contentHtml .= "'; $is_cartouche = false; $contentHtml .= '' . $this->renderGlyph( $code[0] ) . ''; } elseif ( $code[0] != "" ) { // assume it's a glyph or '..' or '.' - $contentHtml .= '' . $this->renderGlyph( $code[0], $this->resizeGlyph( $code[0], $is_cartouche ) ) . ''; + $contentHtml .= '' . $this->renderGlyph( + $code[0], + $this->resizeGlyph( $code[0], $is_cartouche ) + ) . ''; } // block contains more than 1 glyph @@ -291,7 +296,10 @@ // test if block exists in the prefabs list if ( in_array( $temp, self::$prefabs ) ) { - $contentHtml .= '' . $this->renderGlyph( $temp, $this->resizeGlyph( $temp, $is_cartouche ) ) . ''; + $contentHtml .= '' . $this->renderGlyph( + $temp, + $this->resizeGlyph( $temp, $is_cartouche ) + ) . ''; // block must be manually computed } else { @@ -342,7 +350,10 @@ } else { // resize the glyph according to the block total height - $temp .= $this->renderGlyph( $t, $this->resizeGlyph( $t, $is_cartouche,
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356884 ) Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: Id5fcc693f2917ff2324a743ede7482fc82376bc2 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 91ac51e..c615ad9 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 91ac51eccf8e2a2657ae387f4b27bba73d393b2d +Subproject commit c615ad97d44a6c9576b57e3ed756cb92cef9af84 -- To view, visit https://gerrit.wikimedia.org/r/356884 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5fcc693f2917ff2324a743ede7482fc82376bc2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: Ejegg Gerrit-Reviewer: Awight Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356885 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment f859b7dea More horrifying regexps for ty letter template generation 745d90dfd Update Spanish thank you letter Change-Id: I753071e2f4744b68373cae06e3dc6311ac9afa29 --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/356885 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I753071e2f4744b68373cae06e3dc6311ac9afa29 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Ejegg Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356885 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment f859b7dea More horrifying regexps for ty letter template generation 745d90dfd Update Spanish thank you letter Change-Id: I753071e2f4744b68373cae06e3dc6311ac9afa29 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/85/356885/1 -- To view, visit https://gerrit.wikimedia.org/r/356885 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I753071e2f4744b68373cae06e3dc6311ac9afa29 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Ejegg ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356884 ) Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: Id5fcc693f2917ff2324a743ede7482fc82376bc2 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/84/356884/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 91ac51e..c615ad9 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 91ac51eccf8e2a2657ae387f4b27bba73d393b2d +Subproject commit c615ad97d44a6c9576b57e3ed756cb92cef9af84 -- To view, visit https://gerrit.wikimedia.org/r/356884 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5fcc693f2917ff2324a743ede7482fc82376bc2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: Ejegg ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356883 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment bc5bfa22 Switch TestingAccessWrapper to librarized version a818351f When requested GW is disabled, form chooser allows others ee06df15 Localisation updates from https://translatewiki.net. 6723ff81 Initialize SmashPig in Amazon API entry point 16108165 Fix error serialization in payments.api Change-Id: Iafce72c09cbf7e5b2767fade28923ccab9207cbe --- D tests/phpunit/Adapter/Adyen/AdyenTest.php D tests/phpunit/Adapter/AstroPay/AstroPayTest.php D tests/phpunit/Adapter/GatewayAdapterTest.php D tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php D tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php D tests/phpunit/DonationInterfaceTestCase.php D tests/phpunit/FraudFiltersTest.php 7 files changed, 0 insertions(+), 2,772 deletions(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/tests/phpunit/Adapter/Adyen/AdyenTest.php b/tests/phpunit/Adapter/Adyen/AdyenTest.php deleted file mode 100644 index 6546ecb..000 --- a/tests/phpunit/Adapter/Adyen/AdyenTest.php +++ /dev/null @@ -1,209 +0,0 @@ -<<< HEAD (91ac51 Merge branch 'master' into deployment) -=== -testAdapterClass = 'TestingAdyenAdapter'; - DonationInterface::initializeSmashPig( 'adyen' ); - } - - public function setUp() { - parent::setUp(); - - $this->setMwGlobals( array( - 'wgAdyenGatewayEnabled' => true, - ) ); - } - - /** -* Integration test to verify that the donate transaction works as expected when all necessary data is present. -*/ - function testDoTransactionDonate() { - $init = $this->getDonorTestData(); - $init['payment_submethod'] = 'visa'; - $gateway = $this->getFreshGatewayObject( $init ); - - $gateway->do_transaction( 'donate' ); - $exposed = TestingAccessWrapper::newFromObject( $gateway ); - $ret = $exposed->buildRequestParams(); - - $expected = array ( - 'allowedMethods' => 'card', - 'billingAddress.street' => $init['street_address'], - 'billingAddress.city' => $init['city'], - 'billingAddress.postalCode' => $init['postal_code'], - 'billingAddress.stateOrProvince' => $init['state_province'], - 'billingAddress.country' => $init['country'], - 'billingAddress.houseNumberOrName' => 'NA', - 'billingAddressType' => 2, - 'card.cardHolderName' => $init['first_name'] . ' ' . $init['last_name'], - 'currencyCode' => $init['currency'], - 'merchantAccount' => 'wikitest', - 'merchantReference' => $exposed->getData_Staged( 'order_id' ), - 'merchantSig' => $exposed->getData_Staged( 'hpp_signature' ), - 'paymentAmount' => ($init['amount']) * 100, -// 'sessionValidity' => '2014-03-09T19:41:50+00:00', //commenting out, because this is a problem. -// 'shipBeforeDate' => $exposed->getData_Staged( 'expiration' ), //this too. - 'skinCode' => 'testskin', - 'shopperLocale' => 'en_US', - 'shopperEmail' => 'nob...@wikimedia.org', - 'offset' => '52', //once we construct the FraudFiltersTestCase, it should land here. - ); - - //deal with problem keys. - //@TODO: Refactor gateway so these are more testable - $problems = array ( - 'sessionValidity', - 'shipBeforeDate', - ); - - foreach ( $problems as $oneproblem ) { - if ( isset( $ret[$oneproblem] ) ) { - unset( $ret[$oneproblem] ); - } - } - - $this->assertEquals( $expected, $ret, 'Adyen "donate" transaction not constructing the expected redirect URL' ); - $this->assertNotNull( $gateway->getData_Unstaged_Escaped( 'order_id' ), "Adyen order_id is null, and we need one for 'merchantReference'" ); - } - - function testRiskScoreAddedToQueueMessage() { - $init = $this->getDonorTestData(); - $init['payment_submethod'] = 'visa'; - $gateway = $this->getFreshGatewayObject( $init ); - - $exposed = TestingAccessWrapper::newFromObject( $gateway ); - $exposed->risk_score = 57; - $message = $exposed->ge
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356883 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment bc5bfa22 Switch TestingAccessWrapper to librarized version a818351f When requested GW is disabled, form chooser allows others ee06df15 Localisation updates from https://translatewiki.net. 6723ff81 Initialize SmashPig in Amazon API entry point 16108165 Fix error serialization in payments.api Change-Id: Iafce72c09cbf7e5b2767fade28923ccab9207cbe --- D tests/phpunit/Adapter/Adyen/AdyenTest.php D tests/phpunit/Adapter/AstroPay/AstroPayTest.php D tests/phpunit/Adapter/GatewayAdapterTest.php D tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php D tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php D tests/phpunit/DonationInterfaceTestCase.php D tests/phpunit/FraudFiltersTest.php 7 files changed, 0 insertions(+), 2,772 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/83/356883/1 diff --git a/tests/phpunit/Adapter/Adyen/AdyenTest.php b/tests/phpunit/Adapter/Adyen/AdyenTest.php deleted file mode 100644 index 6546ecb..000 --- a/tests/phpunit/Adapter/Adyen/AdyenTest.php +++ /dev/null @@ -1,209 +0,0 @@ -<<< HEAD (91ac51 Merge branch 'master' into deployment) -=== -testAdapterClass = 'TestingAdyenAdapter'; - DonationInterface::initializeSmashPig( 'adyen' ); - } - - public function setUp() { - parent::setUp(); - - $this->setMwGlobals( array( - 'wgAdyenGatewayEnabled' => true, - ) ); - } - - /** -* Integration test to verify that the donate transaction works as expected when all necessary data is present. -*/ - function testDoTransactionDonate() { - $init = $this->getDonorTestData(); - $init['payment_submethod'] = 'visa'; - $gateway = $this->getFreshGatewayObject( $init ); - - $gateway->do_transaction( 'donate' ); - $exposed = TestingAccessWrapper::newFromObject( $gateway ); - $ret = $exposed->buildRequestParams(); - - $expected = array ( - 'allowedMethods' => 'card', - 'billingAddress.street' => $init['street_address'], - 'billingAddress.city' => $init['city'], - 'billingAddress.postalCode' => $init['postal_code'], - 'billingAddress.stateOrProvince' => $init['state_province'], - 'billingAddress.country' => $init['country'], - 'billingAddress.houseNumberOrName' => 'NA', - 'billingAddressType' => 2, - 'card.cardHolderName' => $init['first_name'] . ' ' . $init['last_name'], - 'currencyCode' => $init['currency'], - 'merchantAccount' => 'wikitest', - 'merchantReference' => $exposed->getData_Staged( 'order_id' ), - 'merchantSig' => $exposed->getData_Staged( 'hpp_signature' ), - 'paymentAmount' => ($init['amount']) * 100, -// 'sessionValidity' => '2014-03-09T19:41:50+00:00', //commenting out, because this is a problem. -// 'shipBeforeDate' => $exposed->getData_Staged( 'expiration' ), //this too. - 'skinCode' => 'testskin', - 'shopperLocale' => 'en_US', - 'shopperEmail' => 'nob...@wikimedia.org', - 'offset' => '52', //once we construct the FraudFiltersTestCase, it should land here. - ); - - //deal with problem keys. - //@TODO: Refactor gateway so these are more testable - $problems = array ( - 'sessionValidity', - 'shipBeforeDate', - ); - - foreach ( $problems as $oneproblem ) { - if ( isset( $ret[$oneproblem] ) ) { - unset( $ret[$oneproblem] ); - } - } - - $this->assertEquals( $expected, $ret, 'Adyen "donate" transaction not constructing the expected redirect URL' ); - $this->assertNotNull( $gateway->getData_Unstaged_Escaped( 'order_id' ), "Adyen order_id is null, and we need one for 'merchantReference'" ); - } - - function testRiskScoreAddedToQueueMessage() { - $init = $this->getDonorTestData(); - $init['payment_submethod'] = 'visa'; - $gateway = $this->getFreshGatewayObject( $init ); - - $exposed = TestingAccessWrapper::newFromObject( $gateway ); - $exposed->risk_score = 57; -
[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Make delete/archive indexing report title instead of timestamp.
Smalyshev has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356882 ) Change subject: Make delete/archive indexing report title instead of timestamp. .. Make delete/archive indexing report title instead of timestamp. Since archive is currently lacking timestamp index (see T164975) we scan the archive by title. However, we report progress by timestamp, which makes no sense. This patch switches to reporting by title, which makes much more sense and actually allows to track progress. "Bad" characters are stripped from reported title and length is limited by 30 chars for better display. Change-Id: I7b05509cec2f36d97d956eb71cf1cc4fb82e6c4c --- M maintenance/forceSearchIndex.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/82/356882/1 diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php index c391355..166c513 100644 --- a/maintenance/forceSearchIndex.php +++ b/maintenance/forceSearchIndex.php @@ -379,8 +379,8 @@ 'titlesToDelete' => $titlesToDelete, 'docIdsToDelete' => $docIdsToDelete, 'archive' => $archive, - 'endingAt' => isset( $row ) - ? ( new MWTimestamp( $row->ar_timestamp ) )->getTimestamp( TS_ISO_8601 ) + 'endingAt' => isset( $title ) ? + substr( preg_replace( '/[^' . Title::legalChars() . ']/', '_', $title->getPrefixedDBkey() ), 0, 30 ) : 'unknown', ]; } ); -- To view, visit https://gerrit.wikimedia.org/r/356882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b05509cec2f36d97d956eb71cf1cc4fb82e6c4c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch 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] mediawiki...DonationInterface[master]: Fix error serialization in payments.api
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356875 ) Change subject: Fix error serialization in payments.api .. Fix error serialization in payments.api Change-Id: I3266a4dfcc33d0bd95cd5ec7cf472425357f4288 --- M gateway_common/donation.api.php 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php index b8959f0..c90896b 100644 --- a/gateway_common/donation.api.php +++ b/gateway_common/donation.api.php @@ -30,7 +30,7 @@ $validated_ok = $gatewayObj->validatedOK(); if ( !$validated_ok ) { $errors = $gatewayObj->getErrorState()->getErrors(); - $outputResult['errors'] = $this->serializeErrors( $errors ); + $outputResult['errors'] = $this->serializeErrors( $errors, $gatewayObj ); // FIXME: What is this junk? Smaller API, like getResult()->addErrors $this->getResult()->setIndexedTagName( $outputResult['errors'], 'error' ); $this->getResult()->addValue( null, 'result', $outputResult ); @@ -81,7 +81,7 @@ } $errors = $result->getErrors(); if ( !empty( $errors ) ) { - $outputResult['errors'] = $this->serializeErrors( $errors ); + $outputResult['errors'] = $this->serializeErrors( $errors, $gatewayObj ); $this->getResult()->setIndexedTagName( $outputResult['errors'], 'error' ); } @@ -91,7 +91,7 @@ $this->getResult()->addValue( null, 'result', $outputResult ); } - protected function serializeErrors( $errors ) { + protected function serializeErrors( $errors, GatewayAdapter $adapter ) { $serializedErrors = array(); foreach( $errors as $error ) { if ( $error instanceof ValidationError ) { @@ -100,11 +100,12 @@ $error->getMessageParams() ); $serializedErrors[$error->getField()] = $message; - } else { - $message = WmfFramework::formatMessage( - $error->getMessageKey() - ); + } elseif ( $error instanceof PaymentError ) { + $message = $adapter->getErrorMapByCodeAndTranslate( $error->getErrorCode() ); $serializedErrors['general'][] = $message; + } else { + $logger = DonationLoggerFactory::getLogger( $adapter ); + $logger->error( 'API trying to serialize unknown error type: ' . get_class( $error ) ); } } return $serializedErrors; -- To view, visit https://gerrit.wikimedia.org/r/356875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3266a4dfcc33d0bd95cd5ec7cf472425357f4288 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg Gerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger 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] mediawiki/core[master]: Process content headers when metadata is empty
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356166 ) Change subject: Process content headers when metadata is empty .. Process content headers when metadata is empty The new width/height override means that files without any metadata can get content headers. Bug: T150741 Change-Id: I92199a4aa9e0408572ebf7d8e4c04cd0196f0d0a --- M includes/filerepo/file/File.php M includes/filerepo/file/LocalFile.php M includes/media/DjVu.php 3 files changed, 13 insertions(+), 7 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 0ad0527..53211fe 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -2165,13 +2165,15 @@ if ( $handler ) { $metadata = $this->getMetadata(); - if ( $metadata ) { - if ( is_string( $metadata ) ) { - $metadata = MediaWiki\quietCall( 'unserialize', $metadata ); - } - - return $handler->getContentHeaders( $metadata, $this->getWidth(), $this->getHeight() ); + if ( is_string( $metadata ) ) { + $metadata = MediaWiki\quietCall( 'unserialize', $metadata ); } + + if ( !is_array( $metadata ) ) { + $metadata = []; + } + + return $handler->getContentHeaders( $metadata, $this->getWidth(), $this->getHeight() ); } return []; diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 8514cc8..a90156f 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1202,6 +1202,10 @@ if ( $handler ) { $metadata = MediaWiki\quietCall( 'unserialize', $props['metadata'] ); + if ( !is_array( $metadata ) ) { + $metadata = []; + } + $options['headers'] = $handler->getContentHeaders( $metadata, $props['width'], $props['height'] ); diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index dcd276c..f260850a 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -471,7 +471,7 @@ * @since 1.30 */ public function getContentHeaders( $metadata, $fallbackWidth = null, $fallbackHeight = null ) { - if ( !is_array( $metadata ) || !isset( $metadata['xml'] ) ) { + if ( !isset( $metadata['xml'] ) ) { return []; } -- To view, visit https://gerrit.wikimedia.org/r/356166 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I92199a4aa9e0408572ebf7d8e4c04cd0196f0d0a Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gilles Gerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Filippo Giunchedi Gerrit-Reviewer: Gilles Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: planet: add Wikikmedia Performance Team blog feed
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356859 ) Change subject: planet: add Wikikmedia Performance Team blog feed .. planet: add Wikikmedia Performance Team blog feed Change-Id: I7677c3510437884ad739277af7e865c563b337b2 --- M modules/planet/templates/feeds/en_config.erb 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/planet/templates/feeds/en_config.erb b/modules/planet/templates/feeds/en_config.erb index 7877dbc..9f5503b 100644 --- a/modules/planet/templates/feeds/en_config.erb +++ b/modules/planet/templates/feeds/en_config.erb @@ -550,3 +550,6 @@ [https://tttwrites.wordpress.com/category/wikimedia/feed/] name=Tony Thomas + +[https://phabricator.wikimedia.org/phame/blog/feed/7/] +name=Wikikmedia Performance Team -- To view, visit https://gerrit.wikimedia.org/r/356859 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7677c3510437884ad739277af7e865c563b337b2 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavis Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Gilles Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] oojs/ui[master]: demos: Add links to documentation from code examples
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356398 ) Change subject: demos: Add links to documentation from code examples .. demos: Add links to documentation from code examples Change-Id: Idaa7cc48bcf0a255706749af3d6b0cbde1cd2bea --- M demos/demo.js 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/demos/demo.js b/demos/demo.js index 3c8dc00..bffdd8f 100644 --- a/demos/demo.js +++ b/demos/demo.js @@ -592,6 +592,9 @@ 'https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/demos/classes/' + item.constructor.name.slice( 4 ) + '.js'; out = '// See source code:\n// ' + url + '\n' + out; + } else { + url = 'https://doc.wikimedia.org/oojs-ui/master/js/#!/api/' + constructorName; + out = '// See documentation at: \n// [' + url + '](' + url + ')\n' + out; } return out; -- To view, visit https://gerrit.wikimedia.org/r/356398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaa7cc48bcf0a255706749af3d6b0cbde1cd2bea Gerrit-PatchSet: 2 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Prtksxna Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Prtksxna Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable ElectronPdf on all projects
Bmansurov has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356881 ) Change subject: Enable ElectronPdf on all projects .. Enable ElectronPdf on all projects Bug: T165954 Change-Id: If1d48e0f8106fef2ffd4fb76ca41e9c522bf3962 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/81/356881/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index d6f1409..ea13071 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -12363,10 +12363,7 @@ ], 'wmgUseElectronPdfService' => [ - 'default' => false, - 'group0' => true, // T150944 - 'metawiki' => true, // T150943 - 'dewiki' => true, // T150942 + 'default' => true ], 'wmgUseSpamBlacklist' => [ -- To view, visit https://gerrit.wikimedia.org/r/356881 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1d48e0f8106fef2ffd4fb76ca41e9c522bf3962 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Bmansurov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.action.history.diff: Remove higher than necessary specifi...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/297394 ) Change subject: mw.action.history.diff: Remove higher than necessary specific selectors .. mw.action.history.diff: Remove higher than necessary specific selectors Change-Id: I59b464d3c0939ec4bc581c11c5c3456d64a56a5e --- M resources/src/mediawiki/mediawiki.diff.styles.css 1 file changed, 20 insertions(+), 19 deletions(-) Approvals: jenkins-bot: Verified VolkerE: Looks good to me, but someone else must approve TheDJ: Looks good to me, approved diff --git a/resources/src/mediawiki/mediawiki.diff.styles.css b/resources/src/mediawiki/mediawiki.diff.styles.css index f93df3c..7a73e98 100644 --- a/resources/src/mediawiki/mediawiki.diff.styles.css +++ b/resources/src/mediawiki/mediawiki.diff.styles.css @@ -1,7 +1,8 @@ /*! * Diff rendering */ -table.diff { + +.diff { border: 0; border-spacing: 4px; margin: 0; @@ -10,34 +11,34 @@ table-layout: fixed; } -table.diff td { +.diff td { padding: 0.33em 0.5em; } -table.diff td.diff-marker { +.diff td.diff-marker { /* Compensate padding for increased font-size */ padding: 0.25em; } -table.diff col.diff-marker { +.diff col.diff-marker { width: 2%; } -table.diff col.diff-content { +.diff .diff-content { width: 48%; } -table.diff td div { +.diff td div { /* Force-wrap very long lines such as URLs or page-widening char strings */ word-wrap: break-word; } -td.diff-otitle, -td.diff-ntitle { +.diff-otitle, +.diff-ntitle { text-align: center; } -td.diff-lineno { +.diff-lineno { font-weight: bold; } @@ -48,9 +49,9 @@ line-height: 1.2; } -td.diff-addedline, -td.diff-deletedline, -td.diff-context { +.diff-addedline, +.diff-deletedline, +.diff-context { font-size: 88%; line-height: 1.6; vertical-align: top; @@ -61,15 +62,15 @@ border-radius: 0.33em; } -td.diff-addedline { +.diff-addedline { border-color: #a3d3ff; } -td.diff-deletedline { +.diff-deletedline { border-color: #ffe49c; } -td.diff-context { +.diff-context { background: #f9f9f9; border-color: #e6e6e6; color: #333; @@ -80,17 +81,17 @@ text-decoration: none; } -td.diff-addedline .diffchange, -td.diff-deletedline .diffchange { +.diff-addedline .diffchange, +.diff-deletedline .diffchange { border-radius: 0.33em; padding: 0.25em 0; } -td.diff-addedline .diffchange { +.diff-addedline .diffchange { background: #d8ecff; } -td.diff-deletedline .diffchange { +.diff-deletedline .diffchange { background: #feeec8; } -- To view, visit https://gerrit.wikimedia.org/r/297394 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59b464d3c0939ec4bc581c11c5c3456d64a56a5e Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Prtksxna Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Edokter Gerrit-Reviewer: Fomafix Gerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: Prtksxna Gerrit-Reviewer: TheDJ 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] mediawiki/core[REL1_28]: Better handling of jobs execution in post-connection shutdown
Seb35 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356880 ) Change subject: Better handling of jobs execution in post-connection shutdown .. Better handling of jobs execution in post-connection shutdown In the postprocessing, some jobs can be executed but given the deferred updates were already "closed", any new DeferredUpdate were directly called (as explained by Krinkle on T165714), and the transactions opened by classical jobs are badly mixed with transactions (directly) executed by DeferredUpdates jobs, issuing a DBError, avoiding the job, which stays in a 'claimed' status even if failed. Quite similarly, some DeferredUpdates callables use JobQueueGroup::lazyPush so it is needed to really push the generated jobs. This change removes the run-immediately-deferred-updates behaviour even in the post-connection shutdown, and given there is a call to DeferredUpdates::doUpdates in JobRunner::execute it is not necessary to add another one and hence execution of Web jobs is more similar to execution of CLI jobs. In the same spirit to reconcile Web jobs and CLI jobs, the call to JobQueueGroup::pushLazyJobs is done in JobRunner::execute. Bug: T165714 Bug: T100085 Change-Id: I721e7167eca5b0b6227234fe516005243ab22388 (cherry picked from commit d80fca05e18d9654b8458ed6966c5d3c4991d88e) --- M includes/MediaWiki.php M includes/deferred/DeferredUpdates.php M includes/jobqueue/JobRunner.php 3 files changed, 4 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/80/356880/1 diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index aabaf30..f668717 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -889,7 +889,6 @@ // Do any deferred jobs DeferredUpdates::doUpdates( 'enqueue' ); - DeferredUpdates::setImmediateMode( true ); // Make sure any lazy jobs are pushed JobQueueGroup::pushLazyJobs(); diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 1ba6c1f..fd3a1af 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -52,8 +52,6 @@ private static $preSendUpdates = []; /** @var DeferrableUpdate[] Updates to be deferred until after request end */ private static $postSendUpdates = []; - /** @var bool Whether to just run updates in addUpdate() */ - private static $immediateMode = false; const ALL = 0; // all updates; in web requests, use only after flushing the output buffer const PRESEND = 1; // for updates that should run before flushing output buffer @@ -85,12 +83,6 @@ self::push( self::$preSendUpdates, $update ); } else { self::push( self::$postSendUpdates, $update ); - } - - if ( self::$immediateMode ) { - // No more explicit doUpdates() calls will happen, so run this now - self::doUpdates( 'run' ); - return; } // Try to run the updates now if in CLI mode and no transaction is active. @@ -137,9 +129,10 @@ /** * @param bool $value Whether to just immediately run updates in addUpdate() * @since 1.28 +* @deprecated 1.29 Causes issues in Web-executed jobs - see T165714 and T100085. */ public static function setImmediateMode( $value ) { - self::$immediateMode = (bool)$value; + wfDeprecated( __METHOD__, '1.29' ); } /** diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index 0469eeb..aa8917c 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -277,6 +277,8 @@ $this->commitMasterChanges( $lbFactory, $job, $fnameTrxOwner ); // Run any deferred update tasks; doUpdates() manages transactions itself DeferredUpdates::doUpdates(); + // Push lazy jobs added by the job or its deferred udpates + JobQueueGroup::pushLazyJobs(); } catch ( Exception $e ) { MWExceptionHandler::rollbackMasterChangesAndLog( $e ); $status = false; -- To view, visit https://gerrit.wikimedia.org/r/356880 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I721e7167eca5b0b6227234fe516005243ab22388 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_28 Gerrit-Owner: Seb35 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ParserFunctions[master]: Break long lines
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356879 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: I82db90da7c8108196f81491068c886c65a7fba4c --- M ParserFunctions.library.php M ParserFunctions.php M ParserFunctions_body.php 3 files changed, 42 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParserFunctions refs/changes/79/356879/1 diff --git a/ParserFunctions.library.php b/ParserFunctions.library.php index d07838d..d817256 100644 --- a/ParserFunctions.library.php +++ b/ParserFunctions.library.php @@ -6,7 +6,9 @@ 'expr' => array( $this, 'expr' ), ); - return $this->getEngine()->registerInterface( __DIR__ . '/mw.ext.ParserFunctions.lua', $lib, array() ); + return $this->getEngine()->registerInterface( + __DIR__ . '/mw.ext.ParserFunctions.lua', $lib, array() + ); } public function expr( $expression = null ) { diff --git a/ParserFunctions.php b/ParserFunctions.php index c38db82..ea526bd 100644 --- a/ParserFunctions.php +++ b/ParserFunctions.php @@ -6,7 +6,8 @@ $wgMessagesDirs['ParserFunctions'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['ParserFunctionsMagic'] = __DIR__ . '/ParserFunctions.i18n.magic.php'; /* wfWarn( - 'Deprecated PHP entry point used for ParserFunctions extension. Please use wfLoadExtension instead, ' . + 'Deprecated PHP entry point used for ParserFunctions extension. ' . + 'Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' ); */ return true; diff --git a/ParserFunctions_body.php b/ParserFunctions_body.php index ea1fc34..d69dc62 100644 --- a/ParserFunctions_body.php +++ b/ParserFunctions_body.php @@ -134,7 +134,10 @@ * @return bool|string */ public static function iferror( $parser, $test = '', $then = '', $else = false ) { - if ( preg_match( '/<(?:strong|span|p|div)\s(?:[^\s>]*\s+)*?class="(?:[^"\s>]*\s+)*?error(?:\s[^">]*)?"/', $test ) ) { + if ( preg_match( + '/<(?:strong|span|p|div)\s(?:[^\s>]*\s+)*?class="(?:[^"\s>]*\s+)*?error(?:\s[^">]*)?"/', + $test ) + ) { return $then; } elseif ( $else === false ) { return $test; @@ -278,7 +281,8 @@ if ( $current === '..' ) { // removing one level if ( !count( $newExploded ) ) { // attempted to access a node above root node - $msg = wfMessage( 'pfunc_rel2abs_invalid_depth', $fullPath )->inContentLanguage()->escaped(); + $msg = wfMessage( 'pfunc_rel2abs_invalid_depth', $fullPath ) + ->inContentLanguage()->escaped(); return '' . $msg . ''; } // remove last level from the stack @@ -302,7 +306,9 @@ * * @return string */ - public static function ifexistCommon( $parser, $frame, $titletext = '', $then = '', $else = '' ) { + public static function ifexistCommon( + $parser, $frame, $titletext = '', $then = '', $else = '' + ) { global $wgContLang; $title = Title::newFromText( $titletext ); $wgContLang->findVariantLink( $titletext, $title, true ); @@ -387,7 +393,9 @@ * @param $local string|bool * @return string */ - public static function timeCommon( $parser, $frame = null, $format = '', $date = '', $language = '', $local = false ) { + public static function timeCommon( + $parser, $frame = null, $format = '', $date = '', $language = '', $local = false + ) { global $wgLocaltimezone; self::registerClearHook(); if ( $date === '' ) { @@ -401,7 +409,9 @@ } if ( isset( self::$mTimeCache[$format][$cacheKey][$language][$local] ) ) { $cachedVal = self::$mTimeCache[$format][$cacheKey][$language][$local]; - if ( $useTTL && $cachedVal[1] !== null && $frame && is_callable( array( $frame, 'setTTL' ) ) ) { + if ( $useTTL + && $cachedVal[1] !== null && $frame && is_callable( array( $frame, 'setTTL' ) ) + ) { $frame->setTTL( $cachedVal[1] ); }
[MediaWiki-commits] [Gerrit] operations/puppet[production]: add admin group releasers-mediawiki to mwreleases1001
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356425 ) Change subject: add admin group releasers-mediawiki to mwreleases1001 .. add admin group releasers-mediawiki to mwreleases1001 This should be a temporary step to give existing MW releasers shell access on the new mwreleases1001 host before a new puppet role has been written for it. Once we have a new role and mwreleases1001 has it applied, this should move to role/common. Bug: T164030 Change-Id: I1a6c72982816bfc8e956c6daa098ab65ad450a65 --- A hieradata/hosts/mwreleases1001.yaml 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Chad: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/hieradata/hosts/mwreleases1001.yaml b/hieradata/hosts/mwreleases1001.yaml new file mode 100644 index 000..4c1bd9e --- /dev/null +++ b/hieradata/hosts/mwreleases1001.yaml @@ -0,0 +1,2 @@ +admin::groups: + - releasers-mediawiki -- To view, visit https://gerrit.wikimedia.org/r/356425 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a6c72982816bfc8e956c6daa098ab65ad450a65 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto 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] mediawiki...MapSources[master]: Break long lines
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356845 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: Iee5066ea229a68b7330b57d842cab0519e676da6 --- M MapSources_body.php 1 file changed, 13 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/MapSources_body.php b/MapSources_body.php index b82c3c1..6ecf8c5 100644 --- a/MapSources_body.php +++ b/MapSources_body.php @@ -56,7 +56,8 @@ // attempt to fetch title, either generic title or in-content-language title $title = Title::makeTitleSafe( NS_PROJECT, $this->msg( 'mapsources' )->text() ); if ( $title === null || !$title->exists() ) { - $title = Title::makeTitleSafe( NS_PROJECT, $this->msg( 'mapsources' )->inContentLanguage()->text() ); + $title = Title::makeTitleSafe( NS_PROJECT, + $this->msg( 'mapsources' )->inContentLanguage()->text() ); } if ( $title !== null && $title->exists() ) { @@ -64,7 +65,8 @@ $text = ContentHandler::getContentText( $rev->getContent() ); $out->addWikiText( $this->replaceText( $text ) ); } else { - $this->errorMsgs[] = $this->msg( 'mapsources-nopage', $this->msg( 'mapsources' )->inContentLanguage()->escaped() )->text(); + $this->errorMsgs[] = $this->msg( 'mapsources-nopage', + $this->msg( 'mapsources' )->inContentLanguage()->escaped() )->text(); } } @@ -83,11 +85,16 @@ $form = Html::rawElement( 'fieldset', array(), - Html::element( 'legend', array(), $this->msg( 'mapsources-search-legend' )->escaped() ) . + Html::element( + 'legend', array(), $this->msg( 'mapsources-search-legend' )->escaped() + ) . Html::rawElement( 'form', array( 'method' => 'get', 'action' => $wgScript ), Html::hidden( 'title', self::getTitleFor( 'MapSources' )->getPrefixedText() ) . Html::rawElement( 'p', array(), - Xml::inputLabel( $this->msg( 'mapsources-coordinate' )->escaped(), 'params', 'params', 80, $defaultValue ) . + Xml::inputLabel( + $this->msg( 'mapsources-coordinate' )->escaped(), + 'params', 'params', 80, $defaultValue + ) . Xml::submitButton( $this->msg( 'mapsources-go' )->escaped() ) ) ) @@ -248,7 +255,8 @@ $this->locName = $request->getText( 'locname' ); } - $referrer = ( $request->getVal( 'referrer' ) ) ? $request->getVal( 'referrer' ) : $request->getHeader( 'referer' ); + $referrer = ( $request->getVal( 'referrer' ) ) + ? $request->getVal( 'referrer' ) : $request->getHeader( 'referer' ); if ( $this->locName == '' && $referrer ) { // check if internal referrer if ( strpos( $referrer, $wgServer ) !== false ) { -- To view, visit https://gerrit.wikimedia.org/r/356845 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee5066ea229a68b7330b57d842cab0519e676da6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MapSources Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Error the official mediawiki way
Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356878 ) Change subject: Error the official mediawiki way .. Error the official mediawiki way Don't confuse users by showing a non-styled 404 page. Bug: T155149 Change-Id: Iea9a8d737df97d7b4e574645e19fb18ec8481603 --- M i18n/en.json M i18n/qqq.json M includes/specials/MobileSpecialPage.php M includes/specials/SpecialMobileContributions.php M includes/specials/SpecialMobileHistory.php 5 files changed, 26 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/78/356878/1 diff --git a/i18n/en.json b/i18n/en.json index 2e9da3f..23747b3 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -56,6 +56,8 @@ "mobile-frontend-cite-error": "A problem occurred while attempting to load citations due to a bad revision identifier.", "mobile-frontend-cite-none-available": "There are no citations available for this page.", "mobile-frontend-clear-search": "Clear", + "mobile-frontend-contributions-404-desc": "Cannot look for contributions without a user or with a user that does not exist.", + "mobile-frontend-contributions-404-title": "Bad username given", "mobile-frontend-cookies-required": "Cookies are required to switch view modes. Please enable them and try again.", "mobile-frontend-copyright": "Content is available under $1 unless otherwise noted.", "mobile-frontend-desc": "Mobile Frontend", diff --git a/i18n/qqq.json b/i18n/qqq.json index b0a7c8e..333114e 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -139,6 +139,8 @@ "mobile-frontend-generic-login-new": "Combined message visible on [[Special:UserLogin]] to remind users how {{SITENAME}} relies on contributions and call to action that follows {{msg-mw|mobile-frontend-generic-login}} asking them to login.\n\nSee also:\n* {{msg-mw|mobile-frontend-generic-login}}* {{msg-mw|mobile-frontend-generic-login-action}}", "mobile-frontend-history": "Used as label for the link which points to the \"Edit history\" page.\n\nThis is shown on the Main Page in place of a last modified label to avoid confusion caused by transclusions.\n\nIf not the Main Page, the following message is used:\n* {{msg-mw|Mobile-frontend-last-modified-date}}", "mobile-frontend-history-404-desc": "Explain the reasons why the user may have arrived on {{msg-mw|mobile-frontend-history-404-title}}", + "mobile-frontend-contributions-404-title": "Title of the 404 error page shown when navigate to [[Special:Contributions/Title of username that does not exist]]", + "mobile-frontend-contributions-404-desc": "Explain the reasons why the user may have arrived on {{msg-mw|mobile-frontend-contributions-404-title}}", "mobile-frontend-history-404-title": "Title of the 404 error page shown when navigate to [[Special:History/Title of page that does not exist]]", "mobile-frontend-history-no-results": "Error shown when there are no history entires for a given/invalid filter.", "mobile-frontend-home-button": "This is the label of one of the buttons that appear if you click the wiki logo near the search box.\n\nThis buttons takes the user to the home page.\n{{Identical|Home}}", diff --git a/includes/specials/MobileSpecialPage.php b/includes/specials/MobileSpecialPage.php index c514d6b..c81703c 100644 --- a/includes/specials/MobileSpecialPage.php +++ b/includes/specials/MobileSpecialPage.php @@ -17,6 +17,10 @@ protected $unstyledContent = true; /** @var Config MobileFrontend's config object */ protected $config = null; + /** @var string a message key for the error message heading that should be shown on a 404 */ + protected $errorNotFoundTitleMsg = 'mobile-frontend-generic-404-title'; + /** @var string a message key for the error message description that should be shown on a 404 */ + protected $errorNotFoundDescriptionMsg = 'mobile-frontend-generic-404-desc'; /** * Wrapper for MobileContext::getMFConfig @@ -116,8 +120,15 @@ * Render mobile specific error page, when special page can not be found */ protected function showPageNotFound() { - wfHttpError( 404, $this->msg( 'mobile-frontend-generic-404-title' )->text(), - $this->msg( 'mobile-frontend-generic-404-desc' )->text() ); + $this->getOutput()->setStatusCode( 404 ); + $this->getOutput()->addHTML( + Html::openElement( 'div', [ 'class' => 'content' ] ) . + MobileUI::errorBox( + Html::element( 'h2', [], $this->msg( $this->errorNotFoundTitleMsg )->text() ) . + $this->msg( $this->errorNotFoundDescriptionMsg )->text() + ) . +
[MediaWiki-commits] [Gerrit] mediawiki...Gadgets[master]: Add phpcs and make pass
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356229 ) Change subject: Add phpcs and make pass .. Add phpcs and make pass Change-Id: I02b7f85f54ffaf8a1c9d5bed6fa20abb1627afe5 --- M GadgetHooks.php M Gadgets.alias.php M Gadgets_body.php M SpecialGadgetUsage.php M composer.json M includes/GadgetDefinitionNamespaceRepo.php M includes/content/GadgetDefinitionContent.php M includes/content/GadgetDefinitionValidator.php A phpcs.xml M tests/phpunit/GadgetTest.php 10 files changed, 34 insertions(+), 18 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/GadgetHooks.php b/GadgetHooks.php index e91c911..d19ff3f 100644 --- a/GadgetHooks.php +++ b/GadgetHooks.php @@ -103,7 +103,7 @@ if ( $section !== '' ) { $section = wfMessage( "gadget-section-$section" )->parse(); - if ( count ( $available ) ) { + if ( count( $available ) ) { $options[$section] = $available; } } else { @@ -253,7 +253,9 @@ if ( !$content instanceof GadgetDefinitionContent ) { // This should not be possible? - throw new Exception( "Tried to save non-GadgetDefinitionContent to {$title->getPrefixedText()}" ); + throw new Exception( + "Tried to save non-GadgetDefinitionContent to {$title->getPrefixedText()}" + ); } $status = $content->validate(); diff --git a/Gadgets.alias.php b/Gadgets.alias.php index eae233e..c71b820 100644 --- a/Gadgets.alias.php +++ b/Gadgets.alias.php @@ -5,7 +5,6 @@ * @file * @ingroup Extensions */ -// @codingStandardsIgnoreFile $specialPageAliases = []; diff --git a/Gadgets_body.php b/Gadgets_body.php index ec5e615..a821869 100644 --- a/Gadgets_body.php +++ b/Gadgets_body.php @@ -11,7 +11,6 @@ * @license GNU General Public Licence 2.0 or later */ - /** * Wrapper for one gadget. */ @@ -117,7 +116,6 @@ return strlen( $id ) > 0 && ResourceLoader::isValidModuleName( Gadget::getModuleName( $id ) ); } - /** * @return String: Gadget name */ @@ -171,12 +169,17 @@ * @return Boolean */ public function isAllowed( $user ) { - return count( array_intersect( $this->requiredRights, $user->getRights() ) ) == count( $this->requiredRights ) - && ( $this->requiredSkins === true || !count( $this->requiredSkins ) || in_array( $user->getOption( 'skin' ), $this->requiredSkins ) ); + return count( array_intersect( $this->requiredRights, $user->getRights() ) ) == + count( $this->requiredRights ) + && ( $this->requiredSkins === true + || !count( $this->requiredSkins ) + || in_array( $user->getOption( 'skin' ), $this->requiredSkins ) + ); } /** -* @return Boolean: Whether this gadget is on by default for everyone (but can be disabled in preferences) +* @return bool Whether this gadget is on by default for everyone +* (but can be disabled in preferences) */ public function isOnByDefault() { return $this->onByDefault; diff --git a/SpecialGadgetUsage.php b/SpecialGadgetUsage.php index 5bfe60f..a8a4720 100644 --- a/SpecialGadgetUsage.php +++ b/SpecialGadgetUsage.php @@ -36,14 +36,12 @@ $this->activeUsers = $this->getConfig()->get( 'SpecialGadgetUsageActiveUsers' ); } - /** * Flag for holding the value of config variable SpecialGadgetUsageActiveUsers * * @var bool $activeUsers */ public $activeUsers; - public function isExpensive() { return true; @@ -132,7 +130,7 @@ if ( $this->activeUsers ) { $headers[] = 'gadgetusage-activeusers'; } - foreach( $headers as $h ) { + foreach ( $headers as $h ) { if ( $h == 'gadgetusage-gadget' ) { $html .= Html::element( 'th', [], $this->msg( $h )->text() ); } else { @@ -201,7 +199,8 @@ $defaultGadgets = $this->getDefaultGadgets( $gadgetRepo, $gadgetIds ); if ( $this->activeUsers ) { $out->addHtml( - $this->msg( 'gadgetusage-intro' )->numParams( $this->getConfig()->get( 'ActiveUserDays' ) )->parseAsBlock() + $this->msg( 'gadgetusage-intr
[MediaWiki-commits] [Gerrit] mediawiki...TitleBlacklist[master]: Avoid error suppressing
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356450 ) Change subject: Avoid error suppressing .. Avoid error suppressing Silencing errors is discouraged Change-Id: If30fd2ebcfd0e4909ce2987eb7feb8d667379696 --- M TitleBlacklist.list.php 1 file changed, 7 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/TitleBlacklist.list.php b/TitleBlacklist.list.php index 55f3add..2e65c09 100644 --- a/TitleBlacklist.list.php +++ b/TitleBlacklist.list.php @@ -447,7 +447,7 @@ * Create a new TitleBlacklistEntry from a line of text * * @param $line String containing a line of blacklist text -* @return TitleBlacklistEntry +* @return TitleBlacklistEntry|null */ public static function newFromString( $line, $source ) { $raw = $line; // Keep line for raw data @@ -456,11 +456,13 @@ $line = preg_replace( "/^\\s*([^#]*)\\s*((.*)?)$/", "\\1", $line ); $line = trim( $line ); // Parse the rest of message - preg_match( '/^(.*?)(\s*<([^<>]*)>)?$/', $line, $pockets ); - @list( $full, $regex, $null, $opts_str ) = $pockets; - $regex = trim( $regex ); + $pockets = []; + if ( !preg_match( '/^(.*?)(\s*<([^<>]*)>)?$/', $line, $pockets ) ) { + return null; + } + $regex = trim( $pockets[1] ); $regex = str_replace( '_', ' ', $regex ); // We'll be matching against text form - $opts_str = trim( $opts_str ); + $opts_str = isset( $pockets[3] ) ? trim( $pockets[3] ) : ''; // Parse opts $opts = preg_split( '/\s*\|\s*/', $opts_str ); foreach ( $opts as $opt ) { -- To view, visit https://gerrit.wikimedia.org/r/356450 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If30fd2ebcfd0e4909ce2987eb7feb8d667379696 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/TitleBlacklist Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: [Upgrade fixes] Re-download saved pages upon most recent db ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/356661 ) Change subject: [Upgrade fixes] Re-download saved pages upon most recent db upgrade. .. [Upgrade fixes] Re-download saved pages upon most recent db upgrade. This is somewhat of a nuclear option, but it has the following benefits: - It completely obliterates the old "savedpages" directory, which was wasting space for no reason, since it's no longer used by us. (The new cached data is stored in the "okhttp-cache" directory.) - If the app is being upgraded from a previous version prior to our reworking of the cache, the user's reading list pages will be migrated correctly, but the *contents* of those pages will not. The user will therefore not be able to browse those pages if they go offline immediately after upgrading the app. This patch will ensure that the reading list pages will be unconditionally requeued for downloading, so that they will be available. - If the app is being upgraded from the immediately-previous version, which wasn't yet recording the size information of saved pages, the user will incorrectly see that their saved pages are taking up 0 MB. This patch, by unconditionally re-downloading the pages, will ensure that their size gets recorded correctly. - If there was any other kind of funk in which the user's saved pages ended up in a previous version, this patch will flush it all out, and ensure that the pages are freshly downloaded in our new format, and with all the newest metadata. Change-Id: I980e65669b77f991e0495cea7b8c5eeb9aafa3a0 --- M app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java M app/src/main/java/org/wikipedia/readinglist/database/ReadingListTable.java M app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java M app/src/main/java/org/wikipedia/util/FileUtil.java M app/src/main/java/org/wikipedia/util/ShareUtil.java 5 files changed, 46 insertions(+), 6 deletions(-) Approvals: Niedzielski: Looks good to me, approved jenkins-bot: Verified Mholloway: Looks good to me, but someone else must approve diff --git a/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java b/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java index 421c752..b9e822f 100644 --- a/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java +++ b/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java @@ -30,7 +30,7 @@ @Override protected void run(Date lastRun) { -FileUtil.clearDirectory(new File(ShareUtil.getShareFolder(context), "share")); +FileUtil.deleteRecursively(new File(ShareUtil.getShareFolder(context), "share")); } @Override diff --git a/app/src/main/java/org/wikipedia/readinglist/database/ReadingListTable.java b/app/src/main/java/org/wikipedia/readinglist/database/ReadingListTable.java index 232e680..0dd886b 100644 --- a/app/src/main/java/org/wikipedia/readinglist/database/ReadingListTable.java +++ b/app/src/main/java/org/wikipedia/readinglist/database/ReadingListTable.java @@ -7,6 +7,7 @@ import org.wikipedia.R; import org.wikipedia.WikipediaApp; +import org.wikipedia.concurrency.CallbackTask; import org.wikipedia.database.DatabaseTable; import org.wikipedia.database.column.Column; import org.wikipedia.database.contract.ReadingListContract; @@ -16,14 +17,19 @@ import org.wikipedia.readinglist.ReadingList; import org.wikipedia.readinglist.page.ReadingListPage; import org.wikipedia.readinglist.page.database.ReadingListDaoProxy; +import org.wikipedia.readinglist.page.database.ReadingListPageDao; +import org.wikipedia.readinglist.sync.ReadingListSynchronizer; import org.wikipedia.savedpages.SavedPage; +import org.wikipedia.util.FileUtil; +import java.io.File; import java.util.ArrayList; import java.util.List; public class ReadingListTable extends DatabaseTable { private static final int DB_VER_INTRODUCED = 13; private static final int DB_VER_SAVED_PAGES_MIGRATED = 14; +private static final int DB_VER_READING_LISTS_REORGANIZED = 17; public ReadingListTable() { super(ReadingListContract.TABLE, ReadingListContract.List.URI); @@ -61,6 +67,8 @@ super.upgradeSchema(db, fromVersion, toVersion); if (toVersion == DB_VER_SAVED_PAGES_MIGRATED) { migrateSavedPages(db); +} else if (toVersion == DB_VER_READING_LISTS_REORGANIZED) { +reorganizeReadingListCache(); } } @@ -128,4 +136,30 @@ cursor.close(); } } + +private void reorganizeReadingListCache() { +CallbackTask.execute(new CallbackTask.Task() { +@Override public Void execute() throws Throwable { +// Completely remove any contents from the old "savedpages" directory, since they +// are now u
[MediaWiki-commits] [Gerrit] mediawiki...CodeReview[master]: Break long lines
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/356877 ) Change subject: Break long lines .. Break long lines Prepare to make phpcs pass Change-Id: I28d225a3fd06ae525ea7d1b19fea7aecfa638212 --- M CodeReviewHooks.php M api/ApiRevisionUpdate.php M api/CodeRevisionCommitterApi.php M backend/CodeCommentLinker.php M backend/CodeRevision.php M backend/CodeSignoff.php M maintenance/populateCaUserColumn.php M maintenance/populateFollowupRevisions.php M maintenance/svnImport.php M tests/phpunit/CodeReviewTest.php M tests/phpunit/DiffHighlighterTest.php M ui/CodeAuthorListView.php M ui/CodeCommentsListView.php M ui/CodeReleaseNotes.php M ui/CodeRepoStatsView.php M ui/CodeRevisionListView.php M ui/CodeRevisionView.php M ui/CodeStatusChangeListView.php M ui/CodeStatusListView.php M ui/SpecialRepoAdmin.php 20 files changed, 174 insertions(+), 88 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeReview refs/changes/77/356877/1 diff --git a/CodeReviewHooks.php b/CodeReviewHooks.php index f8191c5..c99d9a0 100644 --- a/CodeReviewHooks.php +++ b/CodeReviewHooks.php @@ -35,7 +35,9 @@ $base = __DIR__; switch ( $updater->getDB()->getType() ) { case 'mysql': - $updater->addExtensionTable( 'code_rev', "$base/codereview.sql" ); // Initial install tables + // Initial install tables + $updater->addExtensionTable( 'code_rev', "$base/codereview.sql" ); + $updater->addExtensionField( 'code_rev', 'cr_diff', "$base/archives/codereview-cr_diff.sql" ); $updater->addExtensionIndex( 'code_relations', 'repo_to_from', @@ -80,7 +82,8 @@ $updater->addExtensionUpdate( array( 'dropField', 'code_comment', 'cc_review', "$base/archives/code_drop_cc_review.sql", true ) ); - $updater->addExtensionUpdate( array( 'dropTable', 'code_test_suite', "$base/archives/code_drop_test.sql", true ) ); + $updater->addExtensionUpdate( array( 'dropTable', 'code_test_suite', + "$base/archives/code_drop_test.sql", true ) ); $updater->addExtensionUpdate( array( 'addField', 'code_authors', 'ca_user', "$base/archives/code_authors_add_ca_user.sql", true ) ); diff --git a/api/ApiRevisionUpdate.php b/api/ApiRevisionUpdate.php index 938e425..b868ce1 100644 --- a/api/ApiRevisionUpdate.php +++ b/api/ApiRevisionUpdate.php @@ -41,7 +41,8 @@ $this->checkUserRightsAny( 'codereview-post-comment' ); } else { if ( !$user->isAllowed( 'codereview-post-comment' ) ) { - $this->dieUsage( 'You do not have permission to post comment', 'permissiondenied' ); + $this->dieUsage( + 'You do not have permission to post comment', 'permissiondenied' ); } } } @@ -53,7 +54,8 @@ ) { if ( is_callable( array( $this, 'dieWithError' ) ) ) { - $this->dieWithError( 'apierror-codereview-inlinecommentingdisabled', 'inlinecommentingdisabled' ); + $this->dieWithError( + 'apierror-codereview-inlinecommentingdisabled', 'inlinecommentingdisabled' ); } else { $this->dieUsage( 'Can not attach a comment to a diff when inline commenting is disabled ' @@ -66,7 +68,8 @@ $repo = CodeRepository::newFromName( $params['repo'] ); if ( !$repo ) { if ( is_callable( array( $this, 'dieWithError' ) ) ) { - $this->dieWithError( array( 'apierror-invalidrepo', wfEscapeWikiText( $params['repo'] ) ) ); + $this->dieWithError( + array( 'apierror-invalidrepo', wfEscapeWikiText( $params['repo'] ) ) ); } else { $this->dieUsage( "Invalid repo ``{$params['repo']}''", 'invalidrepo' ); } diff --git a/api/CodeRevisionCommitterApi.php b/api/CodeRevisionCommitterApi.php index 2a215b4..f31d676 100644 --- a/api/CodeRevisionCommitterApi.php +++ b/api/CodeRevisionCommitterApi.php @@ -1,8 +1,8 @@ tags) $EXT_LINK_URL_CLASS = '[^][<>"\\x00-\\x20\\x7F\p{Zs}]'; - $text = preg_replace_callback( '/(^|[^\w[])(' . wfUrlProtocolsWithoutPr
[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Add explict var visibility
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355765 ) Change subject: Add explict var visibility .. Add explict var visibility Change-Id: I50a1b0392d97418b980bc5306577b321c18d612d --- M includes/ballots/Ballot.php M includes/crypt/Crypt.php M includes/main/Store.php M includes/user/Auth.php M includes/user/Voter.php 5 files changed, 7 insertions(+), 7 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php index 07887db..10cc35b 100644 --- a/includes/ballots/Ballot.php +++ b/includes/ballots/Ballot.php @@ -6,7 +6,7 @@ abstract class SecurePoll_Ballot { public $election, $context; - static $ballotTypes = array( + private static $ballotTypes = array( 'approval' => 'SecurePoll_ApprovalBallot', 'preferential' => 'SecurePoll_PreferentialBallot', 'choose' => 'SecurePoll_ChooseBallot', diff --git a/includes/crypt/Crypt.php b/includes/crypt/Crypt.php index d4d5a40..7d36b00 100644 --- a/includes/crypt/Crypt.php +++ b/includes/crypt/Crypt.php @@ -25,7 +25,7 @@ */ abstract function canDecrypt(); - static $cryptTypes = array( + private static $cryptTypes = array( 'none' => false, 'gpg' => 'SecurePoll_GpgCrypt', ); diff --git a/includes/main/Store.php b/includes/main/Store.php index 33e97a3..9bac5fb 100644 --- a/includes/main/Store.php +++ b/includes/main/Store.php @@ -372,7 +372,7 @@ public $voteCallback, $voteElectionId, $voteCallbackStatus; /** Valid entity info keys by entity type. */ - static $entityInfoKeys = array( + private static $entityInfoKeys = array( 'election' => array( 'id', 'title', @@ -388,14 +388,14 @@ ); /** The type of each entity child and its corresponding (plural) info element */ - static $childTypes = array( + private static $childTypes = array( 'election' => array( 'question' => 'questions' ), 'question' => array( 'option' => 'options' ), 'option' => array() ); /** All entity types */ - static $entityTypes = array( 'election', 'question', 'option' ); + private static $entityTypes = array( 'election', 'question', 'option' ); /** * Constructor. Note that readFile() must be called before any information diff --git a/includes/user/Auth.php b/includes/user/Auth.php index d68b8fc..7df0391 100644 --- a/includes/user/Auth.php +++ b/includes/user/Auth.php @@ -10,7 +10,7 @@ /** * List of available authorization modules (subclasses) */ - static $authTypes = array( + private static $authTypes = array( 'local' => 'SecurePoll_LocalAuth', 'remote-mw' => 'SecurePoll_RemoteMWAuth', ); diff --git a/includes/user/Voter.php b/includes/user/Voter.php index 9e9850a..699d76d 100644 --- a/includes/user/Voter.php +++ b/includes/user/Voter.php @@ -8,7 +8,7 @@ public $id, $electionId, $name, $domain, $wiki, $type, $url; public $properties = array(); - static $paramNames = array( 'id', 'electionId', 'name', 'domain', 'wiki', 'type', 'url', 'properties' ); + private static $paramNames = array( 'id', 'electionId', 'name', 'domain', 'wiki', 'type', 'url', 'properties' ); /** * Create a voter from the given associative array of parameters -- To view, visit https://gerrit.wikimedia.org/r/355765 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I50a1b0392d97418b980bc5306577b321c18d612d Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/SecurePoll Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: Umherirrender Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Add explict var visibility
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355546 ) Change subject: Add explict var visibility .. Add explict var visibility Change-Id: I697e5d1a14aac4978717429d27cdc85f69387ea6 --- M includes/CentralAuthUser.php M includes/CentralAuthUserArray.php M includes/WikiSet.php M includes/specials/SpecialWikiSets.php 4 files changed, 11 insertions(+), 10 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php index 53701a2..66717e7 100644 --- a/includes/CentralAuthUser.php +++ b/includes/CentralAuthUser.php @@ -20,18 +20,19 @@ * The username of the current user. * @var string */ - /*private*/ var $mName; - /*private*/ var $mStateDirty = false; - /*private*/ var $mDelayInvalidation = 0; + private $mName; + private $mStateDirty = false; + private $mDelayInvalidation = 0; - var $mAttachedArray, $mEmail, $mEmailAuthenticated, $mHomeWiki, $mHidden, $mLocked, $mAttachedList, $mAuthenticationTimestamp; - var $mGroups, $mRights, $mPassword, $mAuthToken, $mSalt, $mGlobalId, $mFromMaster, $mIsAttached, $mRegistration, $mGlobalEditCount; - var $mBeingRenamed, $mBeingRenamedArray; + private $mAttachedArray, $mEmail, $mEmailAuthenticated, $mHomeWiki, $mHidden, $mLocked; + private $mAttachedList, $mAuthenticationTimestamp, $mGroups, $mRights, $mPassword, $mAuthToken; + private $mSalt, $mGlobalId, $mFromMaster, $mIsAttached, $mRegistration, $mGlobalEditCount; + private $mBeingRenamed, $mBeingRenamedArray; protected $mAttachedInfo; /** @var integer */ protected $mCasToken = 0; - static $mCacheVars = array( + private static $mCacheVars = array( 'mGlobalId', 'mSalt', 'mPassword', diff --git a/includes/CentralAuthUserArray.php b/includes/CentralAuthUserArray.php index c7d6f4b..ce435d8 100644 --- a/includes/CentralAuthUserArray.php +++ b/includes/CentralAuthUserArray.php @@ -12,7 +12,7 @@ } class CentralAuthUserArrayFromResult extends UserArrayFromResult { - var $globalData; + private $globalData; /** * @param ResultWrapper $res diff --git a/includes/WikiSet.php b/includes/WikiSet.php index df6e0f0..8ed4b94 100755 --- a/includes/WikiSet.php +++ b/includes/WikiSet.php @@ -13,7 +13,7 @@ // (That means you Reedy & Siebrand) private $mVersion = self::VERSION; // Caching purposes - static $mCacheVars = array( + private static $mCacheVars = array( 'mId', 'mName', 'mType', diff --git a/includes/specials/SpecialWikiSets.php b/includes/specials/SpecialWikiSets.php index f1e124c..a693fb1 100644 --- a/includes/specials/SpecialWikiSets.php +++ b/includes/specials/SpecialWikiSets.php @@ -13,7 +13,7 @@ } class SpecialWikiSets extends SpecialPage { - var $mCanEdit; + private $mCanEdit; public function __construct() { parent::__construct( 'WikiSets' ); -- To view, visit https://gerrit.wikimedia.org/r/355546 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I697e5d1a14aac4978717429d27cdc85f69387ea6 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: Umherirrender Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits