Page MenuHomePhabricator

Create a caching labs endpoint that hits WhoColor/WikiWho
Open, MediumPublic

Description

Write an endpoint that returns the WhoColor or WikiWho API response from the mobile-ios-experiments.wmflabs.org labs instance.
The caller supplies the latest revisionID and the endpoint pulls from it's cache and returns.
If the cache does not exist for supplied revisionID, endpoint will return an error and kick off background task of fetching from API and caching the response.

Event Timeline

Tsevener renamed this task from Create a cached labs instance that hits WhoColor/WikiWho to Create a caching labs instance that hits WhoColor/WikiWho.Dec 17 2020, 7:26 PM
Tsevener renamed this task from Create a caching labs instance that hits WhoColor/WikiWho to Create a caching labs endpoint that hits WhoColor/WikiWho.
Tsevener created this task.
JMinor removed a project: Epic.

Most of the initials on this are done to begin working against:

https://wikiwho-ios-experiments.wmflabs.org/whocolor/Among_Us/

Server will fail with a 500 status code (and a specific message) if article is not cached, and it will kick off fetching and caching if it isn't already in the middle of doing so. Also to get around some errors I was seeing, I am only annotating up to the first two sections of an article.

Things to wrap this up:

  • Right now the server is fetching the latest article revision ID from the MediaWiki revisions endpoint and linking the WhoColor result against that. Should we instead allow the client to pass in the particular revisionID it wants the attribution data against? I can see a situation where the client happens to display an older revision ID article content, but by the time the server gets the request and fetches, a new edit has come in and it returns the latest instead of the revision the client is actually displaying.
  • The server right now displays the log message WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. We probably ought to look into properly setting this up for production.
  • Code is located in https://github.com/tonisevener/WikiWho/tree/wikiwho-tinkering. This needs general code cleanup (i.e. remove WikiWho code since we never directly use it). Also consider making a new repo that forks WhoColor rather than WikiWho, so we can see a more accurate diff for code review. Most of the workings on this are WhoColor, but at this point the existing WhoColor files will show as new because this was originally forked against WikiWho.
  • Consider using a better HTTP status error code when the cache doesn’t exist, like "503 = service unavailable, usually temporary"

Cloud VPS instance for this endpoint has been reclaimed. Code is still located at https://github.com/tonisevener/WikiWho/tree/wikiwho-tinkering in case we decide to spin up this feature again.