[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.UI: Remove deprecated `.mw-ui-constructive` class
VolkerE has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355892 ) Change subject: mediawiki.UI: Remove deprecated `.mw-ui-constructive` class .. mediawiki.UI: Remove deprecated `.mw-ui-constructive` class Removing `.mw-ui-constructive` class, which got deprecated in I095eddfe5ec2f1fbc81939b67ed467484e15092b of v1.27. Change-Id: I328ad277b82d724b51f07357785693fe54fe69ef --- M resources/src/mediawiki.ui/components/buttons.less 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/92/355892/1 diff --git a/resources/src/mediawiki.ui/components/buttons.less b/resources/src/mediawiki.ui/components/buttons.less index abe7c46..d94a983 100644 --- a/resources/src/mediawiki.ui/components/buttons.less +++ b/resources/src/mediawiki.ui/components/buttons.less @@ -128,7 +128,6 @@ // Progressive buttons // // Use progressive buttons for actions which lead to a next step in the process. - // .mw-ui-constructive is deprecated; consolidated with `progressive`, see T110555 // // Markup: // @@ -139,8 +138,7 @@ // // // Styleguide 2.1.1. - &.mw-ui-progressive, - &.mw-ui-constructive { + &.mw-ui-progressive { .button-colors-primary( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive ); &.mw-ui-quiet { -- To view, visit https://gerrit.wikimedia.org/r/355892 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I328ad277b82d724b51f07357785693fe54fe69ef Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: VolkerE___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] oojs/ui[master]: Apex theme: Ensure vertical centering of ButtonElement's icon
VolkerE has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355891 ) Change subject: Apex theme: Ensure vertical centering of ButtonElement's icon .. Apex theme: Ensure vertical centering of ButtonElement's icon Bug: T166212 Change-Id: I056f11b3aa9268b63029ba71ecf61fe2ea44451c --- M src/themes/apex/elements.less 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/91/355891/1 diff --git a/src/themes/apex/elements.less b/src/themes/apex/elements.less index 65f8e31..dd85330 100644 --- a/src/themes/apex/elements.less +++ b/src/themes/apex/elements.less @@ -12,10 +12,6 @@ } } - &.oo-ui-iconElement > .oo-ui-buttonElement-button > .oo-ui-iconElement-icon { - margin-left: 0; - } - // Support `` from ButtonInputWidget > input.oo-ui-buttonElement-button, &.oo-ui-labelElement .oo-ui-labelElement-label { @@ -24,6 +20,7 @@ &.oo-ui-iconElement { .oo-ui-iconElement-icon { + height: 100%; margin-left: 0; } -- To view, visit https://gerrit.wikimedia.org/r/355891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I056f11b3aa9268b63029ba71ecf61fe2ea44451c Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: VolkerE___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add fr (French) as fallback for kbp (Kabiyè)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355746 ) Change subject: Add fr (French) as fallback for kbp (Kabiyè) .. Add fr (French) as fallback for kbp (Kabiyè) Follow-up to 03e306dd3bc72fd134375a60ecd8b88541ea2973 Change-Id: I06f9788eb16cb1b40faac33aaa75d56e8075bc49 --- A languages/messages/MessagesKbp.php 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Raimond Spekking: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/messages/MessagesKbp.php b/languages/messages/MessagesKbp.php new file mode 100644 index 000..c473933 --- /dev/null +++ b/languages/messages/MessagesKbp.php @@ -0,0 +1,11 @@ +https://translatewiki.net + * + * @ingroup Language + * @file + * + */ + +$fallback = 'fr'; -- To view, visit https://gerrit.wikimedia.org/r/355746 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06f9788eb16cb1b40faac33aaa75d56e8075bc49 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Nemo bisGerrit-Reviewer: Raimond Spekking Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GlobalUserrights[master]: Fix the viewing of global user rights
Mainframe98 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355884 ) Change subject: Fix the viewing of global user rights .. Fix the viewing of global user rights Bug: T166436 Change-Id: I5f1033485d847528b075b1cea9c80b7f9a85c8ef --- M GlobalUserrights_body.php 1 file changed, 52 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUserrights refs/changes/84/355884/1 diff --git a/GlobalUserrights_body.php b/GlobalUserrights_body.php index c728b2a..6827581 100644 --- a/GlobalUserrights_body.php +++ b/GlobalUserrights_body.php @@ -20,10 +20,16 @@ /** * Save global user groups changes in the DB * -* @param $username String: username -* @param $reason String: reason +* @param User|UserRightsProxy $user +* @param array $add +* @param array $remove +* @param string $reason reason +* @param array $tags +* @param array $groupExpiries +* @return array +* @internal param string $username username */ - function doSaveUserGroups( $user, $add, $remove, $reason = '' ) { + function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [], $groupExpiries = [] ) { $oldGroups = GlobalUserrightsHooks::getGroups( $user ); $newGroups = $oldGroups; @@ -52,49 +58,57 @@ // if anything changed, log it if ( $newGroups != $oldGroups ) { - $this->addLogEntry( $user, $oldGroups, $newGroups, $reason ); + $this->addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, [], [] ); } - return array( $add, $remove ); + return [ $add, $remove ]; } function addGroup( $uid, $group ) { $dbw = wfGetDB( DB_MASTER ); $dbw->insert( 'global_user_groups', - array( + [ 'gug_user' => $uid, 'gug_group' => $group - ), + ], __METHOD__, 'IGNORE' ); } + /** +* @param int $uid +* @param $group +*/ function removeGroup( $uid, $group ) { $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'global_user_groups', - array( + [ 'gug_user' => $uid, 'gug_group' => $group - ), + ], __METHOD__ ); } /** * Add a gblrights log entry +* @param User|UserRightsProxy $user +* @param array $oldGroups +* @param array $newGroups +* @param string $reason */ - function addLogEntry( $user, $oldGroups, $newGroups, $reason ) { + function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, $oldUGMs, $newUGMs ) { $log = new LogPage( 'gblrights' ); $log->addEntry( 'rights', $user->getUserPage(), $reason, - array( + [ $this->makeGroupNameList( $oldGroups ), $this->makeGroupNameList( $newGroups ) - ) + ] ); } @@ -116,29 +130,43 @@ } } - protected function showEditUserGroupsForm( $user, $groups ) { + /** +* @param User|UserRightsProxy $user +* @param array $groups +* @param array $groupMemberships +*/ + protected function showEditUserGroupsForm( $user, $groups, $groupMemberships ) { // override the $groups that is passed, which will be // the user's local groups $groups = GlobalUserrightsHooks::getGroups( $user ); - parent::showEditUserGroupsForm( $user, $groups ); + parent::showEditUserGroupsForm( $user, $groups, $groupMemberships ); } + /** +* @return array +*/ function changeableGroups() { - global $wgUser; - if ( $wgUser->isAllowed( 'userrights-global' ) ) { + $groups = [ + 'add' => [], + 'remove' => [], + 'add-self' => [], + 'remove-self' => [] + ]; + + if ( $this->getUser()->isAllowed( 'userrights-global' ) ) { // all groups can be added globally
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix incomplete Language::getDatePreferences() documentation
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355399 ) Change subject: Fix incomplete Language::getDatePreferences() documentation .. Fix incomplete Language::getDatePreferences() documentation Look at languages/messages/MessagesEo.php for one of about a dozen real world examples where this is set to false. All code calling getDatePreferences checks if it got a truthy value first before using it. Change-Id: I4ef5c8be618d41039297325c9dd4cf554ea14559 --- M languages/Language.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Nikerabbit: Looks good to me, approved diff --git a/languages/Language.php b/languages/Language.php index 14e6f5c..fb45cf7 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -725,7 +725,7 @@ } /** -* @return array +* @return string[]|bool List of date format preference keys, or false if disabled. */ public function getDatePreferences() { return self::$dataCache->getItem( $this->mCode, 'datePreferences' ); -- To view, visit https://gerrit.wikimedia.org/r/355399 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ef5c8be618d41039297325c9dd4cf554ea14559 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE)Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Raimond Spekking Gerrit-Reviewer: Siebrand 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] pywikibot/core[master]: Unhide followlive from README.rst
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355873 ) Change subject: Unhide followlive from README.rst .. Unhide followlive from README.rst followlive was merged. Change-Id: I9863f9445fc8d4252f3a490bb99d9e77532ef14e --- M scripts/README.rst 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/README.rst b/scripts/README.rst index 86f0bde..1d55830 100644 --- a/scripts/README.rst +++ b/scripts/README.rst @@ -95,7 +95,7 @@ ++-+ | flickrripper.py| Upload images from Flickr easily. | ++-+ -| #followlive.py | follow new articles on a wikipedia and flag them| +| followlive.py | follow new articles on a wikipedia and flag them| || with a template. | ++++ | freebasemappingupload.py| Docstring fixes in scripts | -- To view, visit https://gerrit.wikimedia.org/r/355873 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9863f9445fc8d4252f3a490bb99d9e77532ef14e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Magul Gerrit-Reviewer: Mpaa 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...ProofreadPage[master]: Uses IndexContent in ProofreadIndexPage
Tpt has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355883 ) Change subject: Uses IndexContent in ProofreadIndexPage .. Uses IndexContent in ProofreadIndexPage Change-Id: I85b0aaa72fcf696c903f80c48701624c1e9ef305 --- M includes/index/EditIndexPage.php M includes/index/ProofreadIndexPage.php M includes/page/PageContentBuilder.php M tests/phpunit/index/IndexContentHandlerTest.php M tests/phpunit/index/ProofreadIndexPageTest.php 5 files changed, 89 insertions(+), 68 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/83/355883/1 diff --git a/includes/index/EditIndexPage.php b/includes/index/EditIndexPage.php index 819389e..909b96f 100644 --- a/includes/index/EditIndexPage.php +++ b/includes/index/EditIndexPage.php @@ -2,6 +2,7 @@ namespace ProofreadPage\Index; +use ContentHandler; use EditPage; use Html; use OutputPage; @@ -41,8 +42,7 @@ $inputAttributes['readonly'] = ''; } - $index = new ProofreadIndexPage( $this->mTitle, ProofreadIndexPage::getDataConfig(), $this->textbox1 ); - $entries = $index->getIndexEntries(); + $entries = $this->getActualContent()->getIndexEntries(); $out->addHTML( Html::openElement( 'table', [ 'id' => 'prp-formTable' ] ) ); $i = 10; @@ -178,7 +178,7 @@ * @see EditPage::internalAttemptSave */ public function internalAttemptSave( &$result, $bot = false ) { - $index = new ProofreadIndexPage( $this->mTitle, ProofreadIndexPage::getDataConfig(), $this->textbox1 ); + $index = $this->getActualContent(); // Get list of pages titles $links = $index->getLinksToPageNamespace(); @@ -198,4 +198,12 @@ return parent::internalAttemptSave( $result, $bot ); } + + private function getActualContent() { + return new ProofreadIndexPage( + $this->mTitle, + ProofreadIndexPage::getDataConfig(), + ContentHandler::getForModelID( $this->contentModel )->unserializeContent( $this->textbox1, $this->contentFormat ) + ); + } } diff --git a/includes/index/ProofreadIndexPage.php b/includes/index/ProofreadIndexPage.php index e1543f6..b82374e 100644 --- a/includes/index/ProofreadIndexPage.php +++ b/includes/index/ProofreadIndexPage.php @@ -21,6 +21,7 @@ use ProofreadPage\Context; use ProofreadPage\FileNotFoundException; +use ProofreadPage\Index\IndexContent; use ProofreadPage\Pagination\PageList; /** @@ -34,14 +35,9 @@ protected $title; /** -* @var string content of the page +* @var IndexContent|null content of the page */ - protected $text; - - /** -* @var ProofreadIndexEntry[] entries of the page -*/ - protected $entries; + protected $content; /** * @var array configuration array @@ -51,12 +47,12 @@ /** * @param Title $title Reference to a Title object. * @param array $config the configuration array (see ProofreadIndexPage::getDataConfig) -* @param string $text content of the page. Warning: only done for EditProofreadIndexPage use. +* @param IndexContent|null $content content of the page. Warning: only done for EditProofreadIndexPage use. */ - public function __construct( Title $title, $config, $text = null ) { + public function __construct( Title $title, $config, IndexContent $content = null ) { $this->title = $title; $this->config = $config; - $this->text = $text; + $this->content = $content; } /** @@ -65,7 +61,7 @@ * @return ProofreadIndexPage */ public static function newFromTitle( Title $title ) { - return new self( $title, self::getDataConfig(), null ); + return new self( $title, self::getDataConfig() ); } /** @@ -102,18 +98,23 @@ /** * Return content of the page -* @return string +* @return IndexContent */ - protected function getText() { - if ( $this->text === null ) { + private function getContent() { + if ( $this->content === null ) { $rev = Revision::newFromTitle( $this->title ); if ( $rev === null ) { - $this->text = ''; + $this->content = new IndexContent( [] ); } else { - $this->text = ContentHandler::getContentText( $rev->getContent() ); + $content = $rev->getContent(); + if ( $content
[MediaWiki-commits] [Gerrit] operations/puppet[production]: admins: revoke ladsgroups key temporarily
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355882 ) Change subject: admins: revoke ladsgroups key temporarily .. admins: revoke ladsgroups key temporarily Change-Id: I7fe7544fefbd2cf24be827e965480332ca4ce96a --- M modules/admin/data/data.yaml 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml index b7a5144..b06e497 100644 --- a/modules/admin/data/data.yaml +++ b/modules/admin/data/data.yaml @@ -985,9 +985,7 @@ gid: 500 name: ladsgroup realname: Amir Sarabadani -ssh_keys: - - ssh-rsa B3NzaC1yc2EDAQABAAACAQC4VTfdeTSboPh/af2zT6ov13A7kSygXEspRgq3/d2BWcNFvwIIpgtpCnHzA6YPvuhrjksw34jk3OvuuQoTyWYfuwql8Wu8O9f32WD4dhrKhB8Rchxj6rrncBrGS5k0HeLr+HMrknVSSXGH60GAFNRGYLCGA+zBXLAja+xROTipIRHOF0SLlsfpY04HTrEtKcKdj8n9BnGpbT7vFp+AmXeSHg9DwRn6yvem3x1ghBFdfg+XwmIqsV4wR2b7GLX2Y6+ei53657v2VxVsORdfn4yV7FcjeVYnwNxMOVMfYcFCz+1LU9ROPDw5sCqyDPMtyQPxExiprKNT9UHkUj7aqE61o4AF1vSb9AEdUpjGgiMl+Dr8Sd+T2sNOq5uFxtWSfuNqgGHY+nOYPmSHsxthwXc7CH7x/eBDefUZwTdwX8Vf/FYOAyiviknCzwLoAbkQwRjOwFZVqJMwRwRyMToKODTTgOM0s3g/5P8n5AYwTLt1I6dLeC3nju3lywyeWb6DkFOB48mg561AU1soTnSKffse7AtJ5Ye3GFEBKxBCRJUpc7EVesOhjTdcmBWYeSSmwxHCjiCact4tyk8ZiLuRqd3EZ0KFT/6W5d4csrJUwBDNWo+7M69gVIMn/zDCy3ZViGMsqPFfXSrpKw8k0WtPBTKdHFPJ0KoLERctzkrNkfBTVw== Ladsgroup @ prod - - ssh-rsa B3NzaC1yc2EDAQABAAABAQCY5EyIRrtuxDgh8SOkTQl8tYAu5ZOGMO0MA9RiqMb6za8ossDmKCwD5JKwooYmT8yFA5JnvyOC0adsCCA+enylrX6r6FK0ur+dekfCGF/dsyxSJU9aw6WwVr2BThrfPjzbMR1IuN4I0t134fYE0VUvibod1kGoxSGYdWvqEFf+v7b2MqWtU+xASBFEbrx2knqVBjyy6+O8sUikfKX+vyCSxiQa2GE66LM8SuX+0JnhlDNuXleQzdFpJ9novw/+/1KqOJOg3i8/Jb1/AEMf/eChombWdjNccGtPueRyJAXEl2tCuLvt9Vf7PBZaoxhAV0Bo0GcwRVBwvsyaNDuVabLJ +ssh_keys: [] uid: 3182 email: amir.tafreshi_...@wikimedia.de manybubbles: -- To view, visit https://gerrit.wikimedia.org/r/355882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7fe7544fefbd2cf24be827e965480332ca4ce96a Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: admins: revoke ladsgroups key temporarily
Dzahn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355882 ) Change subject: admins: revoke ladsgroups key temporarily .. admins: revoke ladsgroups key temporarily Change-Id: I7fe7544fefbd2cf24be827e965480332ca4ce96a --- M modules/admin/data/data.yaml 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/82/355882/1 diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml index b7a5144..b06e497 100644 --- a/modules/admin/data/data.yaml +++ b/modules/admin/data/data.yaml @@ -985,9 +985,7 @@ gid: 500 name: ladsgroup realname: Amir Sarabadani -ssh_keys: - - ssh-rsa B3NzaC1yc2EDAQABAAACAQC4VTfdeTSboPh/af2zT6ov13A7kSygXEspRgq3/d2BWcNFvwIIpgtpCnHzA6YPvuhrjksw34jk3OvuuQoTyWYfuwql8Wu8O9f32WD4dhrKhB8Rchxj6rrncBrGS5k0HeLr+HMrknVSSXGH60GAFNRGYLCGA+zBXLAja+xROTipIRHOF0SLlsfpY04HTrEtKcKdj8n9BnGpbT7vFp+AmXeSHg9DwRn6yvem3x1ghBFdfg+XwmIqsV4wR2b7GLX2Y6+ei53657v2VxVsORdfn4yV7FcjeVYnwNxMOVMfYcFCz+1LU9ROPDw5sCqyDPMtyQPxExiprKNT9UHkUj7aqE61o4AF1vSb9AEdUpjGgiMl+Dr8Sd+T2sNOq5uFxtWSfuNqgGHY+nOYPmSHsxthwXc7CH7x/eBDefUZwTdwX8Vf/FYOAyiviknCzwLoAbkQwRjOwFZVqJMwRwRyMToKODTTgOM0s3g/5P8n5AYwTLt1I6dLeC3nju3lywyeWb6DkFOB48mg561AU1soTnSKffse7AtJ5Ye3GFEBKxBCRJUpc7EVesOhjTdcmBWYeSSmwxHCjiCact4tyk8ZiLuRqd3EZ0KFT/6W5d4csrJUwBDNWo+7M69gVIMn/zDCy3ZViGMsqPFfXSrpKw8k0WtPBTKdHFPJ0KoLERctzkrNkfBTVw== Ladsgroup @ prod - - ssh-rsa B3NzaC1yc2EDAQABAAABAQCY5EyIRrtuxDgh8SOkTQl8tYAu5ZOGMO0MA9RiqMb6za8ossDmKCwD5JKwooYmT8yFA5JnvyOC0adsCCA+enylrX6r6FK0ur+dekfCGF/dsyxSJU9aw6WwVr2BThrfPjzbMR1IuN4I0t134fYE0VUvibod1kGoxSGYdWvqEFf+v7b2MqWtU+xASBFEbrx2knqVBjyy6+O8sUikfKX+vyCSxiQa2GE66LM8SuX+0JnhlDNuXleQzdFpJ9novw/+/1KqOJOg3i8/Jb1/AEMf/eChombWdjNccGtPueRyJAXEl2tCuLvt9Vf7PBZaoxhAV0Bo0GcwRVBwvsyaNDuVabLJ +ssh_keys: [] uid: 3182 email: amir.tafreshi_...@wikimedia.de manybubbles: -- To view, visit https://gerrit.wikimedia.org/r/355882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7fe7544fefbd2cf24be827e965480332ca4ce96a Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Adding the domain for the Bayerische Staatsgemäldesammlungen
Multichill has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355881 ) Change subject: Adding the domain for the Bayerische Staatsgemäldesammlungen .. Adding the domain for the Bayerische Staatsgemäldesammlungen A lot of freely licensed pretty pictures at https://www.sammlung.pinakothek.de/en/ Bug: T166437 Change-Id: I0873bfed0c48d7f21c7584d08944e29de244f33e --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/81/355881/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4711cb8..68e32bf 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -12840,6 +12840,7 @@ 'finds.org.uk', // Portable Antiquities Scheme - T155844 'images.metmuseum.org', // MET - T156855 '*.esa.int',// ESA - T164643 + 'media.static.onlinesammlung.thenetexperts.info', // Bayerische Staatsgemäldesammlungen - T166437 ], ], -- To view, visit https://gerrit.wikimedia.org/r/355881 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0873bfed0c48d7f21c7584d08944e29de244f33e Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Multichill___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GlobalUserrights[master]: Fix the incompatible function declarations
Mainframe98 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355880 ) Change subject: Fix the incompatible function declarations .. Fix the incompatible function declarations This allows the extension to function on Special:SpecialPages without displaying errors Bug: T166436 Change-Id: I8e023b5d37fa2c3f791a1d92366a179c3407f767 --- M GlobalUserrights_body.php 1 file changed, 17 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUserrights refs/changes/80/355880/1 diff --git a/GlobalUserrights_body.php b/GlobalUserrights_body.php index c728b2a..dd11692 100644 --- a/GlobalUserrights_body.php +++ b/GlobalUserrights_body.php @@ -20,10 +20,16 @@ /** * Save global user groups changes in the DB * -* @param $username String: username -* @param $reason String: reason +* @param User|UserRightsProxy $user +* @param array $add +* @param array $remove +* @param string $reason reason +* @param array $tags +* @param array $groupExpiries +* @return array +* @internal param string $username username */ - function doSaveUserGroups( $user, $add, $remove, $reason = '' ) { + function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [], $groupExpiries = [] ) { $oldGroups = GlobalUserrightsHooks::getGroups( $user ); $newGroups = $oldGroups; @@ -52,7 +58,7 @@ // if anything changed, log it if ( $newGroups != $oldGroups ) { - $this->addLogEntry( $user, $oldGroups, $newGroups, $reason ); + $this->addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, [], [] ); } return array( $add, $remove ); } @@ -84,8 +90,12 @@ /** * Add a gblrights log entry +* @param User|UserRightsProxy $user +* @param array $oldGroups +* @param array $newGroups +* @param string $reason */ - function addLogEntry( $user, $oldGroups, $newGroups, $reason ) { + function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags, $oldUGMs, $newUGMs ) { $log = new LogPage( 'gblrights' ); $log->addEntry( 'rights', @@ -116,11 +126,11 @@ } } - protected function showEditUserGroupsForm( $user, $groups ) { + protected function showEditUserGroupsForm( $user, $groups, $groupMemberships ) { // override the $groups that is passed, which will be // the user's local groups $groups = GlobalUserrightsHooks::getGroups( $user ); - parent::showEditUserGroupsForm( $user, $groups ); + parent::showEditUserGroupsForm( $user, $groups, $groupMemberships ); } function changeableGroups() { -- To view, visit https://gerrit.wikimedia.org/r/355880 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e023b5d37fa2c3f791a1d92366a179c3407f767 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GlobalUserrights Gerrit-Branch: master Gerrit-Owner: Mainframe98___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Intorduce MessageLocalizer interface for exposing msg() method
Ladsgroup has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355879 ) Change subject: Intorduce MessageLocalizer interface for exposing msg() method .. Intorduce MessageLocalizer interface for exposing msg() method Bug: T162594 Change-Id: I2d9af9fc05264bffda675af46f656038cd72d0db --- M autoload.php A languages/MessageLocalizer.php 2 files changed, 39 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/79/355879/1 diff --git a/autoload.php b/autoload.php index 6d2b66b..69d6d55 100644 --- a/autoload.php +++ b/autoload.php @@ -978,6 +978,7 @@ 'MessageBlobStore' => __DIR__ . '/includes/cache/MessageBlobStore.php', 'MessageCache' => __DIR__ . '/includes/cache/MessageCache.php', 'MessageContent' => __DIR__ . '/includes/content/MessageContent.php', + 'MessageLocalizer' => __DIR__ . '/languages/MessageLocalizer.php', 'MessageSpecifier' => __DIR__ . '/includes/libs/MessageSpecifier.php', 'MigrateFileRepoLayout' => __DIR__ . '/maintenance/migrateFileRepoLayout.php', 'MigrateUserGroup' => __DIR__ . '/maintenance/migrateUserGroup.php', diff --git a/languages/MessageLocalizer.php b/languages/MessageLocalizer.php new file mode 100644 index 000..26eb6ef --- /dev/null +++ b/languages/MessageLocalizer.php @@ -0,0 +1,38 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup Language + */ + +/** + * Interface for exposing mediawiki messages + * + * @since 1.29 + * @ingroup Language + */ +interface MessageLocalizer { + + /** +* Get a Message object with context set. See wfMessage for parameters. +* +* @param mixed ... +* @return Message +*/ + public function msg(); + +} -- To view, visit https://gerrit.wikimedia.org/r/355879 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d9af9fc05264bffda675af46f656038cd72d0db Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...pybal[2.0-dev]: Fix tox.ini in order to work on newer systems
Giuseppe Lavagetto has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355876 ) Change subject: Fix tox.ini in order to work on newer systems .. Fix tox.ini in order to work on newer systems Newer systems default to using python3, and we don't want that for running coverage; also fix the dependencies list while we're at it. Change-Id: I7701662a8236807a21de2255169d3954f981fb20 --- M tox.ini 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/76/355876/1 diff --git a/tox.ini b/tox.ini index 02234ba..f56eee7 100644 --- a/tox.ini +++ b/tox.ini @@ -17,8 +17,10 @@ coverage run --source pybal --branch {envdir}/bin/trial pybal coverage report --omit=pybal/test --show-missing deps = - twisted - coverage + coverage + {[testenv]deps} +basepython = python2.7 + [testenv:flake8] commands = flake8 -- To view, visit https://gerrit.wikimedia.org/r/355876 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7701662a8236807a21de2255169d3954f981fb20 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/pybal Gerrit-Branch: 2.0-dev Gerrit-Owner: Giuseppe Lavagetto___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...pybal[2.0-dev]: Enable flake8 on pybal/monitors
Giuseppe Lavagetto has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355878 ) Change subject: Enable flake8 on pybal/monitors .. Enable flake8 on pybal/monitors The only section that is left out is pybal/bgp, which might change further before it's stable enough in master Change-Id: I7611c9fe4def08567fb6bd513e2196321b544d22 --- M pybal/monitors/__skeleton__.py M pybal/monitors/dnsquery.py M pybal/monitors/idleconnection.py M pybal/monitors/proxyfetch.py M pybal/monitors/runcommand.py M tox.ini 6 files changed, 45 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/78/355878/1 diff --git a/pybal/monitors/__skeleton__.py b/pybal/monitors/__skeleton__.py index 5592b4b..a2e8a77 100644 --- a/pybal/monitors/__skeleton__.py +++ b/pybal/monitors/__skeleton__.py @@ -9,23 +9,24 @@ from pybal import monitor + class SkeletonMonitoringProtocol(monitor.MonitoringProtocol): """ Description. """ - + __name__ = 'Skeleton' - + def __init__(self, coordinator, server, configuration): """Constructor""" -# Call ancestor constructor +# Call ancestor constructor super(SkeletonMonitoringProtocol, self).__init__(coordinator, server, configuration) - + def run(self): -"""Start the monitoring""" +"""Start the monitoring""" pass - + def stop(self): """Stop the monitoring""" pass diff --git a/pybal/monitors/dnsquery.py b/pybal/monitors/dnsquery.py index b374791..3c447c5 100644 --- a/pybal/monitors/dnsquery.py +++ b/pybal/monitors/dnsquery.py @@ -4,15 +4,16 @@ DNS Monitor class implementation for PyBal """ - -from pybal import monitor +import logging +import random +import socket from twisted.internet import reactor, defer from twisted.names import client, dns, error from twisted.python import runtime -import logging -import random, socket +from pybal import monitor + class DNSQueryMonitoringProtocol(monitor.MonitoringProtocol): """ @@ -28,7 +29,6 @@ error.AuthoritativeDomainError, error.DNSFormatError, error.DNSNameError, error.DNSQueryRefusedError, error.DNSQueryTimeoutError, error.DNSServerError, error.DNSUnknownError) - def __init__(self, coordinator, server, configuration): """Constructor""" @@ -79,9 +79,8 @@ elif query.type == dns.: self.DNSQueryDeferred = self.resolver.lookupIPV6Address(hostname, timeout=[self.toQuery]) -self.DNSQueryDeferred.addCallback(self._querySuccessful, query -).addErrback(self._queryFailed, query -).addBoth(self._checkFinished) +self.DNSQueryDeferred.addCallback(self._querySuccessful, query) \ +.addErrback(self._queryFailed, query).addBoth(self._checkFinished) return self.DNSQueryDeferred def _querySuccessful(self, (answers, authority, additional), query): @@ -96,8 +95,8 @@ else: resultStr = None -self.report('DNS query successful, %.3f s' % (runtime.seconds() - self.checkStartTime) -+ (resultStr and (': ' + resultStr) or "")) +self.report('DNS query successful, %.3f s' % (runtime.seconds() - self.checkStartTime) + +(resultStr and (': ' + resultStr) or "")) self._resultUp() return answers, authority, additional diff --git a/pybal/monitors/idleconnection.py b/pybal/monitors/idleconnection.py index 42c556d..f1cadec 100644 --- a/pybal/monitors/idleconnection.py +++ b/pybal/monitors/idleconnection.py @@ -7,7 +7,7 @@ from pybal import monitor -from twisted.internet import reactor, protocol +from twisted.internet import protocol import logging import socket diff --git a/pybal/monitors/proxyfetch.py b/pybal/monitors/proxyfetch.py index 3468e73..c6da271 100644 --- a/pybal/monitors/proxyfetch.py +++ b/pybal/monitors/proxyfetch.py @@ -5,12 +5,14 @@ Monitor class implementations for PyBal """ -from pybal import monitor, util +import logging +import random from twisted.internet import reactor, defer from twisted.web import client from twisted.python.runtime import seconds -import logging, random + +from pybal import monitor, util log = util.log diff --git a/pybal/monitors/runcommand.py b/pybal/monitors/runcommand.py index a0ca0ec..c7f498c 100644 --- a/pybal/monitors/runcommand.py +++ b/pybal/monitors/runcommand.py @@ -4,14 +4,16 @@ Monitor class implementations for PyBal """ +import errno +import logging +import os +import signal + +from twisted.internet import reactor, process, error from pybal import monitor from pybal.util import log -import os, sys, signal, errno -import logging - -from twisted.internet import reactor, process, error class ProcessGroupProcess(process.Process, object):
[MediaWiki-commits] [Gerrit] operations...pybal[2.0-dev]: Enable flake8 enforcement on part of the code
Giuseppe Lavagetto has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355877 ) Change subject: Enable flake8 enforcement on part of the code .. Enable flake8 enforcement on part of the code And also fix the issues. Change-Id: Id0ae621ae4f53d711aa83d302bafc28297a28a0a --- M pybal/__init__.py M pybal/bgpfailover.py M pybal/config.py M pybal/coordinator.py M pybal/etcd.py M pybal/instrumentation.py M pybal/ipvs/exception.py M pybal/ipvs/interface.py M pybal/ipvs/manager.py M pybal/ipvs/server.py M pybal/ipvs/service.py M pybal/main.py M tox.ini 13 files changed, 48 insertions(+), 39 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/77/355877/1 diff --git a/pybal/__init__.py b/pybal/__init__.py index ade8bc3..72e1388 100644 --- a/pybal/__init__.py +++ b/pybal/__init__.py @@ -4,9 +4,9 @@ The pybal package contains all PyBal modules """ -import test +import test # noqa F401 -from .version import * +from .version import * # noqa F403 __all__ = ('ipvs', 'monitor', 'pybal', 'util', 'monitors', 'bgp', diff --git a/pybal/bgpfailover.py b/pybal/bgpfailover.py index 5392bcb..070843f 100755 --- a/pybal/bgpfailover.py +++ b/pybal/bgpfailover.py @@ -36,7 +36,8 @@ asPath = [int(asn) for asn in self.globalConfig.get('bgp-as-path', str(self.bgpPeering.myASN)).split()] med = self.globalConfig.getint('bgp-med', 0) baseAttrs = [bgp.OriginAttribute(), bgp.ASPathAttribute(asPath)] -if med: baseAttrs.append(bgp.MEDAttribute(med)) +if med: +baseAttrs.append(bgp.MEDAttribute(med)) attributes = {} try: diff --git a/pybal/config.py b/pybal/config.py index 3c5b167..65e69b1 100644 --- a/pybal/config.py +++ b/pybal/config.py @@ -10,9 +10,7 @@ import ast import json -import logging import os -import re from twisted.internet import task from twisted.web import client diff --git a/pybal/coordinator.py b/pybal/coordinator.py index 26905ef..74a5739 100755 --- a/pybal/coordinator.py +++ b/pybal/coordinator.py @@ -83,12 +83,14 @@ lookups = [] query = dns.Query(self.host, dns.A) -lookups.append(client.lookupAddress(self.host, timeout -).addCallback(self._lookupFinished, socket.AF_INET, query)) +lookups.append( +client.lookupAddress(self.host, timeout).addCallback(self._lookupFinished, socket.AF_INET, query) +) query = dns.Query(self.host, dns.) -lookups.append(client.lookupIPV6Address(self.host, timeout -).addCallback(self._lookupFinished, socket.AF_INET6, query)) +lookups.append( +client.lookupIPV6Address(self.host, timeout).addCallback(self._lookupFinished, socket.AF_INET6, query) +) return defer.DeferredList(lookups).addBoth(self._hostnameResolved) @@ -103,7 +105,7 @@ self.ip6_addresses = ips # TODO: expire TTL -#if self.ip: +# if self.ip: #minTTL = min([r.ttl for r in answers # if r.name == query.name and r.type == query.type]) @@ -119,18 +121,16 @@ log.debug(msg) ip_addresses = { -socket.AF_INET: -self.ip4_addresses, -socket.AF_INET6: -self.ip6_addresses -}[self.addressFamily] +socket.AF_INET: self.ip4_addresses, +socket.AF_INET6: self.ip6_addresses +}[self.addressFamily] try: if not self.ip or self.ip not in ip_addresses: self.ip = random.choice(list(ip_addresses)) # TODO: (re)pool except IndexError: -return failure.Failure() # TODO: be more specific? +return failure.Failure() # TODO: be more specific? else: return True @@ -168,10 +168,10 @@ """ log.error("Initialization failed for server {}".format(self.host)) -assert self.ready == False +assert self.ready is False self.maintainState() -return False # Continue on success callback chain +return False # Continue on success callback chain def createMonitoringInstances(self, coordinator): """Creates and runs monitoring instances for this Server""" @@ -193,7 +193,8 @@ else: for monitorname in monitorlist: try: -monitormodule = getattr(__import__('pybal.monitors', fromlist=[monitorname.lower()], level=0), monitorname.lower()) +monitormodule = getattr( +__import__('pybal.monitors', fromlist=[monitorname.lower()], level=0), monitorname.lower()) except AttributeError: log.err("Monitor {} does not exist".format(monitorname)) else: @@ -205,14 +206,14 @@
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add CODE_OF_CONDUCT.md
Ladsgroup has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355875 ) Change subject: Add CODE_OF_CONDUCT.md .. Add CODE_OF_CONDUCT.md Bug: T165540 Change-Id: Ie8954750177a573624e98b061ba35cbf892c4487 --- A CODE_OF_CONDUCT.md 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/75/355875/1 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000..999640c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +This project is covered by a code of conduct. Please see [the mediawiki page](https://www.mediawiki.org/wiki/Code_of_Conduct) for more details. -- To view, visit https://gerrit.wikimedia.org/r/355875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8954750177a573624e98b061ba35cbf892c4487 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Making the default toggle look clickable again
Mollgear has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355874 ) Change subject: Making the default toggle look clickable again .. Making the default toggle look clickable again The toggle should now look same same prior to the premade toggle changes. The brackets are not part of the link, but the text inbetween. The link has no href property, so the toggle action is still triggered. Bug: T166359 Change-Id: I38698cd66d380626728eae9b8a9da1e465b207a6 --- M resources/src/jquery/jquery.makeCollapsible.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/74/355874/1 diff --git a/resources/src/jquery/jquery.makeCollapsible.js b/resources/src/jquery/jquery.makeCollapsible.js index ac4a392..5ce9b1f 100644 --- a/resources/src/jquery/jquery.makeCollapsible.js +++ b/resources/src/jquery/jquery.makeCollapsible.js @@ -262,7 +262,7 @@ // Default toggle link. Only build it when needed to avoid jQuery memory leaks (event data). buildDefaultToggleLink = function () { - return $( '' ) + return $( '' ) .text( collapseText ) .wrap( '' ).parent() .attr( { -- To view, visit https://gerrit.wikimedia.org/r/355874 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38698cd66d380626728eae9b8a9da1e465b207a6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mollgear___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Use custom actions for editing Index: pages
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/331416 ) Change subject: Use custom actions for editing Index: pages .. Use custom actions for editing Index: pages Change-Id: I96bfbf31e17da95e874bb036a211b7b866c1c7a3 --- M ProofreadPage.body.php M extension.json R includes/index/EditIndexPage.php M includes/index/IndexContentHandler.php A includes/index/IndexEditAction.php A includes/index/IndexSubmitAction.php 6 files changed, 92 insertions(+), 62 deletions(-) Approvals: Seb35: Looks good to me, but someone else must approve jenkins-bot: Verified Tpt: Looks good to me, approved Jforrester: Looks good to me, but someone else must approve diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php index 4ff0e43..c279c67 100644 --- a/ProofreadPage.body.php +++ b/ProofreadPage.body.php @@ -20,9 +20,10 @@ */ use ProofreadPage\Context; +use ProofreadPage\FileNotFoundException; +use ProofreadPage\Index\EditIndexPage; use ProofreadPage\Page\PageContent; use ProofreadPage\Page\PageContentBuilder; -use ProofreadPage\FileNotFoundException; use ProofreadPage\Pagination\PageNotInPaginationException; /* @@ -93,23 +94,6 @@ return false; } elseif ( $title->inNamespace( self::getIndexNamespaceId() ) ) { $model = CONTENT_MODEL_PROOFREAD_INDEX; - return false; - } else { - return true; - } - } - - /** -* Set up our custom edition system. -* -* @param Article $article being edited -* @param User $user User performing the edit -* @return boolean hook return value -*/ - public static function onCustomEditor( Article $article, User $user ) { - if ( $article->getTitle()->inNamespace( self::getIndexNamespaceId() ) ) { // TODO ExternalEditor case - $editor = new EditProofreadIndexPage( $article ); - $editor->edit(); return false; } else { return true; diff --git a/extension.json b/extension.json index c89fdb1..6443ac8 100644 --- a/extension.json +++ b/extension.json @@ -42,12 +42,14 @@ "ProofreadPage\\DiffFormatterUtils": "includes/DiffFormatterUtils.php", "ProofreadPage\\FileNotFoundException": "includes/FileNotFoundException.php", "ProofreadPage\\FileProvider": "includes/FileProvider.php", - "EditProofreadIndexPage": "includes/index/EditProofreadIndexPage.php", "ProofreadIndexEntry": "includes/index/ProofreadIndexEntry.php", "ProofreadIndexPage": "includes/index/ProofreadIndexPage.php", "ProofreadPage\\Index\\IndexContent": "includes/index/IndexContent.php", "ProofreadPage\\Index\\IndexRedirectContent": "includes/index/IndexRedirectContent.php", "ProofreadPage\\Index\\IndexContentHandler": "includes/index/IndexContentHandler.php", + "ProofreadPage\\Index\\IndexEditAction": "includes/index/IndexEditAction.php", + "ProofreadPage\\Index\\IndexSubmitAction": "includes/index/IndexSubmitAction.php", + "ProofreadPage\\Index\\EditIndexPage": "includes/index/EditIndexPage.php", "ProofreadIndexDbConnector": "includes/index/ProofreadIndexDbConnector.php", "ProofreadPage\\Pagination\\PaginationFactory": "includes/Pagination/PaginationFactory.php", "ProofreadPage\\Pagination\\PageNumber": "includes/Pagination/PageNumber.php", @@ -282,9 +284,6 @@ ], "GetPreferences": [ "ProofreadPage::onGetPreferences" - ], - "CustomEditor": [ - "ProofreadPage::onCustomEditor" ], "CanonicalNamespaces": [ "ProofreadPage::addCanonicalNamespaces" diff --git a/includes/index/EditProofreadIndexPage.php b/includes/index/EditIndexPage.php similarity index 76% rename from includes/index/EditProofreadIndexPage.php rename to includes/index/EditIndexPage.php index 38d9707..819389e 100644 --- a/includes/index/EditProofreadIndexPage.php +++ b/includes/index/EditIndexPage.php @@ -1,33 +1,37 @@ http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup ProofreadPage + * @licence GNU GPL v2+ */ +class EditIndexPage extends EditPage { -class EditProofreadIndexPage extends EditPage { - + /** +* @see EditPage::isSectionEditSupported +*/ protected function isSectionEditSupported() { return false; // sections and forms don't mix } /** -* Add custom fields +* @see EditPage::isSupportedContentModel +*/ + public function
[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Chunk page ids in internal API call to avoid too-many-pageid...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355866 ) Change subject: Chunk page ids in internal API call to avoid too-many-pageids-for-query .. Chunk page ids in internal API call to avoid too-many-pageids-for-query One of many reasons that internal API calls are bad. Bug: T41936 Change-Id: I412b74228a9b70ac4ed0cb5744adb99a6a82d9eb --- M ApiQueryProofread.php 1 file changed, 44 insertions(+), 42 deletions(-) Approvals: jenkins-bot: Verified Tpt: Looks good to me, approved diff --git a/ApiQueryProofread.php b/ApiQueryProofread.php index a225c84..a2b0583 100644 --- a/ApiQueryProofread.php +++ b/ApiQueryProofread.php @@ -53,53 +53,55 @@ } $qualityLevels = array_flip( $qualityCategories ); - // johnduhart, it'd seem sane rather than duplicating the functionality - $params = new DerivativeRequest( $this->getRequest(), [ - 'action' => 'query', - 'prop' => 'categories', - 'pageids' => implode( '|', $pageIds ), - 'clcategories' => implode( '|', $qualityCategories ), - 'cllimit' => 'max', - 'errorformat' => 'raw', - ] ); + foreach ( array_chunk( $pageIds, ApiBase::LIMIT_SML1 ) as $chunk ) { + // johnduhart, it'd seem sane rather than duplicating the functionality + $params = new DerivativeRequest( $this->getRequest(), [ + 'action' => 'query', + 'prop' => 'categories', + 'pageids' => implode( '|', $chunk ), + 'clcategories' => implode( '|', $qualityCategories ), + 'cllimit' => 'max', + 'errorformat' => 'raw', + ] ); - $api = new ApiMain( $params ); - $api->execute(); - $data = $api->getResult()->getResultData(); - $pages = ApiResult::stripMetadataNonRecursive( - (array)$data['query']['pages'] - ); - unset( $api ); + $api = new ApiMain( $params ); + $api->execute(); + $data = $api->getResult()->getResultData(); + $pages = ApiResult::stripMetadataNonRecursive( + (array)$data['query']['pages'] + ); + unset( $api ); - if ( array_key_exists( 'errors', $data ) ) { - $status = StatusValue::newGood(); - foreach ( $data['errors'] as $error ) { - $status->fatal( ApiMessage::create( - array_merge( [ $data['key'] ], $data['params'] ), - $data['code'], - isset( $data['data'] ) ? $data['data'] : [] - ) ); + if ( array_key_exists( 'errors', $data ) ) { + $status = StatusValue::newGood(); + foreach ( $data['errors'] as $error ) { + $status->fatal( ApiMessage::create( + array_merge( [ $data['key'] ], $data['params'] ), + $data['code'], + isset( $data['data'] ) ? $data['data'] : [] + ) ); + } + $this->dieStatus( $status ); } - $this->dieStatus( $status ); - } - $result = $this->getResult(); - foreach ( $pages as $pageid => $data ) { - if ( !array_key_exists( 'categories', $data ) ) { - continue; + $result = $this->getResult(); + foreach ( $pages as $pageid => $data ) { + if ( !array_key_exists( 'categories', $data ) ) { + continue; + } + $title = $data['categories'][0]['title']; + + if ( !array_key_exists( $title, $qualityLevels ) ) { + continue; + } + $pageQuality = $qualityLevels[ $title ]; + + $val = [ + 'quality' => $pageQuality, + 'quality_text' =>