Page MenuHomePhabricator

Related Articles should come from GettingStarted API
Closed, ResolvedPublic3 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 Normal.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 27 2015, 1:34 AM
phuedx added a subscriber: phuedx.Nov 2 2015, 1:34 PM

If, for now, we were to set a hard requirement on MediaWiki-extensions-GettingStarted, then you could use mw.gettingStarted.Api#getSuggestions.

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.

(Someone should feel free to pick this up btw)

phuedx added a comment.Nov 4 2015, 9:45 AM

I'll pick it up.

@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.

Jdlrobson updated the task description. (Show Details)Nov 4 2015, 8:59 PM
phuedx added a comment.EditedNov 5 2015, 9:30 AM

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.

phuedx added a comment.EditedNov 11 2015, 12:23 PM

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"}}
phuedx closed this task as Resolved.Nov 12 2015, 9:26 AM

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