Page MenuHomePhabricator

Wikimedia\Assert\ParameterTypeException: Bad value for parameter $taskType: must be a GrowthExperiments\NewcomerTasks\TaskType\ImageRecommendationBaseTaskType
Closed, ResolvedPublicBUG REPORT

Description

logstash

Bad value for parameter $taskType: must be a GrowthExperiments\NewcomerTasks\TaskType\ImageRecommendationBaseTaskType
from /srv/mediawiki/php-1.41.0-wmf.9/vendor/wikimedia/assert/src/Assert.php(105)
#0 /srv/mediawiki/php-1.41.0-wmf.9/extensions/GrowthExperiments/includes/Api/ApiQueryImageSuggestionData.php(74): Wikimedia\Assert\Assert::parameterType(array, NULL, string)
#1 /srv/mediawiki/php-1.41.0-wmf.9/includes/api/ApiQuery.php(688): GrowthExperiments\Api\ApiQueryImageSuggestionData->execute()
#2 /srv/mediawiki/php-1.41.0-wmf.9/includes/api/ApiMain.php(1914): ApiQuery->execute()
#3 /srv/mediawiki/php-1.41.0-wmf.9/includes/api/ApiMain.php(890): ApiMain->executeAction()
#4 /srv/mediawiki/php-1.41.0-wmf.9/includes/api/ApiMain.php(861): ApiMain->executeActionWithErrorHandling()
#5 /srv/mediawiki/php-1.41.0-wmf.9/api.php(93): ApiMain->execute()
#6 /srv/mediawiki/php-1.41.0-wmf.9/api.php(48): wfApiMain()
#7 /srv/mediawiki/w/api.php(3): require(string)
#8 {main}

Caused by T335641: Use the prop=growthimagesuggestiondata API as an image recommendation source. Happens on URLs like
https://cs.wikipedia.org/w/api.php?action=query&prop=growthimagesuggestiondata&titles=MusicBrainz&gisdtasktype=section-image-recommendation&format=json&formatversion=2&errorformat=wikitext&errorlang=en

Event Timeline

Presumably the consequence of section-image-recommendation not being defined in the JSON config, but that should be handled more gracefully.

Indeed goes away after adding that task type to the configuration (even if it's disabled).

@Tgr - What are your thoughts on the severity of this? Will this need to be resolved prior to the MVP release?

It's not really needed by us (it only happens when you try to use a section-image related API on a wiki where section images aren't set up in community configuration). We'll need to fix it before Android starts using the feature. (Or we can just do the setup on all Wikipedias by editing community config, I guess.)

It's not really needed by us (it only happens when you try to use a section-image related API on a wiki where section images aren't set up in community configuration). We'll need to fix it before Android starts using the feature. (Or we can just do the setup on all Wikipedias by editing community config, I guess.)

Thanks! Let's add @JTannerWMF so she is aware and can add any app tags to this task if needed.

@Tgr or @KStoller-WMF could you please add more details about what the issue is and what the Android team needs to understand about it?

@Tgr or @KStoller-WMF could you please add more details about what the issue is and what the Android team needs to understand about it?

This error prevents the use of the growthimagesuggestiondata API. It happens on wikis where the community configuration for image recommendations is not set up. So we should make sure that setup is done on all the wikis where Android wants to use the feature.

To clarify, it sounds like this is only a problem for section-level image recommendations? (We're not planning on using that for our initial iteration.)

To clarify, it sounds like this is only a problem for section-level image recommendations? (We're not planning on using that for our initial iteration.)

No, whatever task type you are using growthimagesuggestiondata for needs to be declared in the wiki's community configuration. It's not a big deal (we have a maintenance script for it), just making sure we don't forget.

You are targeting all Wikipedias, right?

No, whatever task type you are using growthimagesuggestiondata for needs to be declared in the wiki's community configuration. It's not a big deal (we have a maintenance script for it), just making sure we don't forget.

You are targeting all Wikipedias, right?

Got it; yes, it would be good to have it be available on all Wikipedias.

Do you have a target date for this?

@JTannerWMF can confirm, but likely by end of Q1.

Hi, just want to confirm we do want this rolled out to all languages. We would like to have something released ideally in August at the absolute latest September. @Tgr @Dbrant

Filed T341150: Ensure growthimagesuggestiondata API works on all Wikipedias so we have a tracking task with a more meaningful title.

What's left here is providing a nicer error (calling an API on a wiki with no appropriate community configuration is a user error, it should not result in an exception).

Change 936655 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] ApiQueryImageSuggestionData: Do not throw an exception if configuration lacks task

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

Urbanecm_WMF subscribed.

This is now resolved in Wikimedia production (see T341150); the patch above will result in a nicer error message when community configuration misses the task type.

Change 936655 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] ApiQueryImageSuggestionData: Do not throw an exception if configuration lacks task

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