Page MenuHomePhabricator

Decouple UploadWizardConfig.maxUploads and maxUploads for Flickr imports
Closed, ResolvedPublic

Description

Event Timeline

@kaldari @Soda @Masumrezarock100 thanks for your help with T234192. This task is another feature request for UploadWizard, and if implemented would make a rather big change: we could finally enable Flickr import for all users. I predict hundreds of users would take advantage of that possibility. For the current use (only autopatrolled users), see recentchanges. This task is the only blocker to enable Flickr import for all users.

AlexisJazz triaged this task as Medium priority.Mar 3 2020, 9:07 AM

Setting priority to medium as @Aklapper changed the priority of the parent task to medium.

Aklapper raised the priority of this task from Medium to Needs Triage.Mar 3 2020, 10:37 AM

@AlexisJazz: Which isn't realistic either, hence resetting. :-/

@AlexisJazz: Which isn't realistic either, hence resetting. :-/

I don't understand how this works. If it's important to get tomato soup, doesn't that automatically mean that the subtask of buying tomatoes is also important?

var flickrnewbielimit = 4;

If ( user is on a Flickr import page) and ( mw.config.get('wgUserGroups') does not contain "autopatrolled", "sysop" (and probably no patroller or licensereviewer either) ) { UploadWizardConfig.maxUploads = flickrnewbielimit; }

You get the picture. I suck at things.

Change 584060 had a related patch set uploaded (by Kaldari; owner: Kaldari):
[mediawiki/extensions/UploadWizard@master] Decouple regular max uploads from Flickr max uploads

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

Awesome!

Looks good to me, I haven't tested it either though. Probably the most practical thing to do would be to apply this to beta cluster to test it.

Note that in order to test it, user rights for newbies also need to be changed probably.

Probably the most practical thing to do would be to apply this to beta cluster to test it.

Patches are applied to beta soon after it's merged. Before merging I think you could test it through MediaWiki-Vagrant.

Unfortunately, this patch is harder to test than to write, as you have to set up a Flickr API key and configure UploadWizard for Flickr importing, not to mention configuring the user groups and user rights. It's a very low risk patch though, as Flickr importing in UploadWizard is currently a somewhat obscure feature and the code changes involved are minimal (it's really a configuration change). I would be OK with this patch getting merged untested and then testing it on test.wikipedia.org (which is fully configured for Flickr importing).

Unfortunately, this patch is harder to test than to write, as you have to set up a Flickr API key and configure UploadWizard for Flickr importing, not to mention configuring the user groups and user rights. It's a very low risk patch though, as Flickr importing in UploadWizard is currently a somewhat obscure feature and the code changes involved are minimal (it's really a configuration change). I would be OK with this patch getting merged untested and then testing it on test.wikipedia.org (which is fully configured for Flickr importing).

I agree. I've looked at it and I think it'll work, but even if it doesn't, it won't break anything.

Change 584060 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] Decouple regular max uploads from Flickr max uploads

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

@AlexisJazz - The change should take effect on Common on April 29th, if there are no problems on test.wikipedia.

kaldari claimed this task.

@kaldari great! Have the rights (at least for test.wikipedia) also been adjusted? (will be hard to test otherwise)

I misunderstood, it's already active on test.wikipedia. If I load https://www.flickr.com/photos/47515486@N05/albums/72157712540284851 on https://test.wikipedia.beta.wmflabs.org/wiki/Special:UploadWizard I can select up to 4 files. I don't have any advanced rights on test.wikipedia.

It works: https://test.wikimedia.beta.wmflabs.org/wiki/Category:Steam_locomotives (had to disable CSP obviously)

@AlexisJazz - By coincidence, test.wikipedia is already set up with all users having upload_by_url. In addition admins there have mass-upload. So we should be able to test with an admin account and a regular user account to see the difference.

@AlexisJazz - I'm talking about https://test.wikipedia.org/, which has about 500 administrators, including myself.

@AlexisJazz - I'm talking about https://test.wikipedia.org/, which has about 500 administrators, including myself.

So https://test.wikimedia.beta.wmflabs.org/ is the test version of the test Wikipedia.. that's quite meta.

We can test it right now on https://test.wikimedia.beta.wmflabs.org/ (I already tested as a regular user, correctly limited to 4) but on https://test.wikipedia.org/ the patch isn't active yet. I assume it'll take effect on April 29th there as well?

So https://test.wikimedia.beta.wmflabs.org/ is the test version of the test Wikipedia.. that's quite meta.

test.wikipedia.org is part of the deployment train, hence its code is updated once a week.
The Beta Cluster on beta.wmflabs.org is constantly updated to run the latest code that is in the Git/Gerrit code repositories.

https://test.wikimedia.beta.wmflabs.org/ throws error when trying to access its main page, and when trying to enter a "Special:" page it closes the current session:

(Cannot access the database: Cannot access the database: Unknown error (172.16.4.147:3306))

Backtrace:

#0 /srv/mediawiki/php-master/includes/libs/rdbms/loadbalancer/LoadBalancer.php(934): Wikimedia\Rdbms\LoadBalancer->reportConnectionError()
#1 /srv/mediawiki/php-master/includes/libs/rdbms/loadbalancer/LoadBalancer.php(901): Wikimedia\Rdbms\LoadBalancer->getServerConnection(1, 'testwikidatawik...', 0)
#2 /srv/mediawiki/php-master/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1031): Wikimedia\Rdbms\LoadBalancer->getConnection(-1, Array, 'testwikidatawik...', 0)
#3 /srv/mediawiki/php-master/includes/dao/DBAccessBase.php(63): Wikimedia\Rdbms\LoadBalancer->getConnectionRef(-1, Array, 'testwikidatawik...')
#4 /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/Sql/SiteLinkTable.php(259): DBAccessBase->getConnection(-1)
#5 /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(147): Wikibase\Lib\Store\Sql\SiteLinkTable->getItemIdForLink('testwiki', 'Main Page')
#6 /srv/mediawiki/php-master/extensions/Wikibase/lib/includes/Store/CachingSiteLinkLookup.php(75): Wikibase\Lib\Store\CachingSiteLinkLookup->getAndCacheItemIdForLink('testwiki', 'Main Page')
#7 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/LangLinkHandler.php(101): Wikibase\Lib\Store\CachingSiteLinkLookup->getItemIdForLink('testwiki', 'Main Page')
#8 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/LangLinkHandler.php(332): Wikibase\Client\LangLinkHandler->getEntityLinks(Object(Title))
#9 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/LangLinkHandler.php(353): Wikibase\Client\LangLinkHandler->getEffectiveRepoLinks(Object(Title), Object(ParserOutput))
#10 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(97): Wikibase\Client\LangLinkHandler->addLinksFromRepository(Object(Title), Object(ParserOutput))
#11 /srv/mediawiki/php-master/extensions/Wikibase/client/includes/Hooks/ParserOutputUpdateHookHandlers.php(65): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers->doContentAlterParserOutput(Object(Title), Object(ParserOutput))
#12 /srv/mediawiki/php-master/includes/HookRunner/HookContainer.php(275): Wikibase\Client\Hooks\ParserOutputUpdateHookHandlers::onContentAlterParserOutput(Object(WikitextContent), Object(Title), Object(ParserOutput))
#13 /srv/mediawiki/php-master/includes/HookRunner/HookContainer.php(126): MediaWiki\HookRunner\HookContainer->callLegacyHook('ContentAlterPar...', Array, Array, Array)
#14 /srv/mediawiki/php-master/includes/Hooks.php(135): MediaWiki\HookRunner\HookContainer->run('ContentAlterPar...', Array, Array)
#15 /srv/mediawiki/php-master/includes/content/AbstractContent.php(569): Hooks::run('ContentAlterPar...', Array)
#16 /srv/mediawiki/php-master/includes/Revision/RenderedRevision.php(267): AbstractContent->getParserOutput(Object(Title), 2196, Object(ParserOptions), true)
#17 /srv/mediawiki/php-master/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(Object(WikitextContent), true)
#18 /srv/mediawiki/php-master/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput('main')
#19 /srv/mediawiki/php-master/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(Object(MediaWiki\Revision\RenderedRevision), Array)
#20 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(Object(MediaWiki\Revision\RenderedRevision), Array)
#21 /srv/mediawiki/php-master/includes/Revision/RenderedRevision.php(198): call_user_func(Object(Closure), Object(MediaWiki\Revision\RenderedRevision), Array)
#22 /srv/mediawiki/php-master/includes/poolcounter/PoolWorkArticleView.php(204): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#23 /srv/mediawiki/php-master/includes/poolcounter/PoolCounterWork.php(128): PoolWorkArticleView->doWork()
#24 /srv/mediawiki/php-master/includes/page/Article.php(791): PoolCounterWork->execute()
#25 /srv/mediawiki/php-master/includes/actions/ViewAction.php(66): Article->view()
#26 /srv/mediawiki/php-master/includes/MediaWiki.php(519): ViewAction->show()
#27 /srv/mediawiki/php-master/includes/MediaWiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#28 /srv/mediawiki/php-master/includes/MediaWiki.php(973): MediaWiki->performRequest()
#29 /srv/mediawiki/php-master/includes/MediaWiki.php(535): MediaWiki->main()
#30 /srv/mediawiki/php-master/index.php(47): MediaWiki->run()
#31 /srv/mediawiki/w/index.php(3): require('/srv/mediawiki/...')
#32 {main}

https://test.wikimedia.beta.wmflabs.org/ throws error when trying to access its main page, and when trying to enter a "Special:" page it closes the current session:

(Cannot access the database: Cannot access the database: Unknown error (172.16.4.147:3306))

That's just T250555.

Use https://test.wikimedia.beta.wmflabs.org/wiki/Special:UploadWizard directly and disable CSP in your browser.

On test, you can view files (just uploaded https://test.wikimedia.beta.wmflabs.org/wiki/File:Steam_coming_out_of_a_steam_locomotive.jpg), contributions and categories but only if they don't have a description page and you're not following a red link. So https://test.wikimedia.beta.wmflabs.org/wiki/Category:Steam_locomotives works but https://test.wikimedia.beta.wmflabs.org/w/index.php?title=Category:Steam_locomotives&action=edit&redlink=1 doesn't.

We can test it right now on https://test.wikimedia.beta.wmflabs.org/ (I already tested as a regular user, correctly limited to 4) but on https://test.wikipedia.org/ the patch isn't active yet. I assume it'll take effect on April 29th there as well?

No, the new code will take effect on https://test.wikipedia.org/ on April 28th. That gives us a day to roll back the changes if there are any problems. You're correct that AlvaroMolina or Petrb could go ahead and test it on https://test.wikimedia.beta.wmflabs.org/ though. They'll just need to confirm that the interface allows them to import 500 images from Flickr instead of 4 (but please don't actually import 500 images).

No, the new code will take effect on https://test.wikipedia.org/ on April 28th.

At what time?

@AlexisJazz - I've tested it on test.wikipedia.org under both an admin account and a regular user account and it works as advertised. The change will go out to Commons tomorrow and shouldn't have any noticeable effect. If nothing breaks, we can change the user rights on Commons after tomorrow.

Tested on Commons and nothing seems broken...