Page MenuHomePhabricator

Related Articles should come from GettingStarted API
Closed, ResolvedPublic3 Estimated Story Points

Description

When no related articles magic words are present on a page we should show related articles based on the getting started api.

We may want to move GettingStarted API out of GettingStarted extension to support this but this should be done in parallel and not block this task.

Sign off:

  • Enable config variable on beta labs

Event Timeline

Jdlrobson raised the priority of this task from to Medium.
Jdlrobson updated the task description. (Show Details)
Jdlrobson subscribed.

Steps I'm going to take:

  • Add a gateway to RelatedArticles extension (porting the one in Gather which can later rely on it)
    • The gateway when the API module is not available will simply return an empty list. It doesn't need to care where it comes from.
  • Given RelatedArticles is installed on beta labs we'll be able to test there. It's not installed on Wikivoyage so we'll be also able to check what happens when it's not installed

In parallel we should decide where this module ultimately should live. Personally I think this extension would be an obvious place.

Change 250866 had a related patch set uploaded (by Jdlrobson):
Related articles should come from API

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

Not done... but I'd appreciate some early feedback on the approach.

@Jdlrobson, @bmansurov: Do you think that not testing that CirrusSearch before making an API call to it is inelegant? I understand that it'll fail gracefully but still…

I think it's OK. It would be nice of course if we can check if it's available before making an API call though.

I added a config variable so we can turn it off in places we know the API is not available. Given it's off by default we're gonna have to enable it on beta labs via config change... Whoever signs off on this should make sure that happens.

I added a config variable so we can turn it off in places we know the API is not available. Given it's off by default we're gonna have to enable it on beta labs via config change... Whoever signs off on this should make sure that happens.

Neato! Then we can simply make the config:

$wgRelatedArticlesUseCirrusSearchMoreLike = defined('CIRRUS_SEARCH'); // Or equivalent…

Yeh or just manually configure it on and say this should be a human step and up to the installer.

Change 250866 merged by jenkins-bot:
Fall back to CirrusSearch's morelike: feature

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

Change 252022 had a related patch set uploaded (by Bmansurov):
Enable RelatedArticles on beta labs

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

Will sign off once the above patch is merged.

I've left a minor question on 252022 but it LGTM.

I've added the following to the reading-web-staging RelatedArticles config:

$wgRelatedArticlesUseCirrusSearch = true;

and enabled the CirrusSearch role.

Thanks, @phuedx!

Confirming that an API request is being issued. I had to enable the wikidata role in labs-vagrant though. The search itself is returning an error though (which is unrelated to this task):

{"error":{"code":"gsrsearch-error","info":"We could not complete your search due to a temporary problem. Please try again later.","docref":"See http://reading-web-staging.wmflabs.org/w/api.php for API usage"}}

Change 252022 abandoned by Bmansurov:
Use CirrusSearch API in RelatedArticles on beta labs

Reason:
not sure if we still need it.

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