Page MenuHomePhabricator

revalidateLinkRecommendations.php has misleading output
Closed, ResolvedPublic0.5 Estimated Story Points

Description

As part of Txxx, I'm running the revalidateLinkRecommendations.php maintenance script for itwiki. Its output includes the following:

[...]
  scheduling deleting null recommendation for page ID 3327... done.
[...]

Checking in the code, this happens in RevalidateLinkRecommendations.php::handleNullRecommendation, which (1) makes the log and (2) calls LinkRecommendationStore::deleteByPageIds(). That method then does:

$dbw = $this->growthLoadBalancer->getConnection( DB_PRIMARY );
$dbw->newDeleteQueryBuilder()
	->deleteFrom( 'growthexperiments_link_recommendations' )
	->where( [ 'gelr_page' => $pageIds ] )
	->caller( __METHOD__ )
	->execute();
return $dbw->affectedRows();

where $pageIds is whatever the revalidation script passed. As far as I can see, no actual "scheduling" is happening – the script just makes a DELETE query, which is processed right when it is issued. Can we rewrite the log to "deleting null recommendation for page ID blah" instead, to be more accurate?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Michael As the person who added null recommendations into the system, do you know of any reason why "scheduling" would make sense here?

Change #1216769 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] fix(AddLink): adjust log message when deleting null recommendations

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

@Michael As the person who added null recommendations into the system, do you know of any reason why "scheduling" would make sense here?

No idea why I did it. That was almost a year ago in feat(AddLink): store null if there is no recommendation. I looked through the comments on that change, but we never discussed that line.

I've added a tiny patch to remove the "scheduling".

Change #1216769 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] fix(AddLink): adjust log message when deleting null recommendations

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

Urbanecm_WMF set the point value for this task to 0.5.