Page MenuHomePhabricator

Address Voice and Tone issues in PageImages
Closed, ResolvedPublic5 Estimated Story Points

Description

Background

Targets
    Occurrences of '(white|black)[ \-]?list' in Directory /Users/reedy/PhpstormProjects/mediawiki/extensions/PageImages
Found Occurrences  (26 usages found)
    extensions  (26 usages found)
        PageImages  (26 usages found)
            i18n  (2 usages found)
                en.json  (1 usage found)
                    6 "pageimages-blacklist": "",
                qqq.json  (1 usage found)
                    9 "pageimages-blacklist": "{{notranslate}}\nList of images. They will never be selected as page images",
            includes  (16 usages found)
                Hooks  (16 usages found)
                    LinksUpdateHookHandler.php  (16 usages found)
                        159 $blacklist = $this->getBlacklist();
                        160 if ( isset( $blacklist[$image->getFileName()] ) ) {
                        249 * Returns a list of images blacklisted from influencing this extension's output
                        254 protected function getBlacklist() {
                        255 global $wgPageImagesBlacklistExpiry;
                        260 $cache->makeKey( 'pageimages-blacklist' ),
                        261 $wgPageImagesBlacklistExpiry,
                        263 global $wgPageImagesBlacklist;
                        266 foreach ( $wgPageImagesBlacklist as $source ) {
                        271 $this->getDbBlacklist( $source['db'], $source['page'] )
                        277 $this->getUrlBlacklist( $source['url'] )
                        282 "unrecognized image blacklist type '{$source['type']}'"
                        293 * Returns list of images linked by the given blacklist page
                        300 private function getDbBlacklist( $dbName, $page ) {
                        327 * Returns list of images on given remote blacklist page.
                        335 private function getUrlBlacklist( $url ) {
            tests  (5 usages found)
                phpunit  (5 usages found)
                    Hooks  (5 usages found)
                        LinksUpdateHookHandlerTest.php  (5 usages found)
                            231 ->setMethods( [ 'scoreFromTable', 'getMetadata', 'getRatio', 'getBlacklist' ] )
                            241 ->method( 'getBlacklist' )
                            242 ->willReturn( [ 'blacklisted.jpg' => 1 ] );
                            279 [ 'filename' => 'blacklisted.jpg', 'fullwidth' => 100 ],
                            282 // blacklist score
            extension.json  (3 usages found)
                68 "PageImagesBlacklist": {
                72 "page": "MediaWiki:Pageimages-blacklist",
                77 "PageImagesBlacklistExpiry": {

Acceptance criteria

  • Change naming to "allowlist" and "denylist"

Event Timeline

Change 686748 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/extensions/PageImages@master] Address voice and tone issues.

https://gerrit.wikimedia.org/r/686748

cjming removed cjming as the assignee of this task.May 7 2021, 8:24 PM
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2020-21) board.
cjming subscribed.

Change 686756 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] Drop unused configuration on labs instances

https://gerrit.wikimedia.org/r/686756

Some questions:

  1. There are references to images that will be renamed as a part of this patch but they don't seem to reside in the codebase. Presumably wherever they are fetched from will need to rename these files accordingly. How/where does one take care of this?
  2. I'm also not clear on how to test these changes to make sure nothing breaks.
  1. There are references to images that will be renamed as a part of this patch but they don't seem to reside in the codebase. Presumably wherever they are fetched from will need to rename these files accordingly. How/where does one take care of this?

It's not a physical file. It's just one that's "mocked" to be returned as being bad by the handler given that filename.

I think you can just replace it with "badfile.jpg" or something in both places (provider and the test itself) and it will be fine (CI should still pass)

Change 686756 merged by jenkins-bot:

[operations/mediawiki-config@master] Drop unused configuration on labs instances

https://gerrit.wikimedia.org/r/686756

Change 686748 merged by jenkins-bot:

[mediawiki/extensions/PageImages@master] Address voice and tone issues.

https://gerrit.wikimedia.org/r/686748

I tested and reviewed this with @cjming and we talked about the migration. This impacts 15 wiki pages, so we have decided to run a user notice to handle the migration - T282626

I've migrated all the pages on wiki.