Page MenuHomePhabricator

Recommendation API needs to take a domain as a parameter
Closed, ResolvedPublic

Description

The service gives lists of articles that exist in one language, but not another. However, it doesn't handle passing in a domain as a parameter, rather it takes a source language and a destination language. Apart from the conceptual problem, in practice when calling the MW Action API, it needs to supply a domain in the request. As it does not, the MW API returns a 404.

I propose to fix this problem by declaring the target language to be the domain. In practical terms, that means that the end points would become:

  • /{domain}/v1/translation/articles/{source}
  • /{domain}/v1/translation/articles/{source}/{seed}

Here, {domain} denotes the target language's domain. This is in line with T107914: Migrate content translation to the REST API where we will be using the target wiki's domain as the main one.

Event Timeline

schana moved this task from Backlog to Next up on the Recommendation-API board.

I'll work on this tomorrow.

Change 364786 had a related patch set uploaded (by Nschaaf; owner: Nschaaf):
[mediawiki/services/recommendation-api@master] Add domain parameter

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

Or I suppose I'll work on it today :)

Change 364786 merged by Mobrovac:
[mediawiki/services/recommendation-api@master] Add domain parameter

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

schana moved this task from For Review to Done on the Recommendation-API board.
schana removed a project: Patch-For-Review.

Change 364791 had a related patch set uploaded (by Giuseppe Lavagetto; owner: Giuseppe Lavagetto):
[operations/puppet@production] pybal: remove proxyfetch from recommendation-api temporarily

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

Change 364791 merged by Giuseppe Lavagetto:
[operations/puppet@production] pybal: remove proxyfetch from recommendation-api temporarily

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

Mentioned in SAL (#wikimedia-operations) [2017-07-12T18:15:37Z] <mobrovac@tin> Started deploy [recommendation-api/deploy@7fd10f2]: Use the domain parameter as the target language - T170439

Mentioned in SAL (#wikimedia-operations) [2017-07-12T18:16:17Z] <mobrovac@tin> Finished deploy [recommendation-api/deploy@7fd10f2]: Use the domain parameter as the target language - T170439 (duration: 00m 40s)

The checks are still failing in production, I will investigate why

It turns out that extra problems were caused by misconfiguration. I think we can declare this one done.