Page MenuHomePhabricator

Add support for Commons as a project on the backend
Closed, ResolvedPublic5 Estimated Story Points

Description

This ticket is for adding support for querying commons on the backend in Grant metrics.

This would involve adding the necessary queries to commons database for calculating metrics and modifying the backend to query wikipedias/commons/both when the organizer clicks "Update data".

Metrics required:

  • # of Participants: Same as before
  • # of New editors: Same as before
  • 7 day retention: Same as before
  • Files uploaded: Number of files uploaded by the participants during the event duration
  • Files in use: Number of files in use on other projects at the time of the query

Event Timeline

@MusikAnimal What do you think of this as one of the tasks I split from T189916?

I've been thinking about whether we should do category tracking first or commons support first. Doing commons support first (looking for any file uploaded by any participant) seems like a logical first step. Opinions?

Looks good! I agree Commons support is a good first step. This task as defined shouldn't be terribly hard.

Cool. I'll create one for the frontend next.

Niharika set the point value for this task to 5.Apr 24 2018, 11:27 PM

I think this (backend and existing frontend design) can for the most part be considered ready for review. There is one noticeable issue: When you create an event, the stats shown on the event page (all blank) include both pages created/improved and files uploaded/used. Once you generate the stats, only relevant things are shown, though. Fixing this will require some reworking that isn't specific to adding support for Commons, so I will do this with a different commit.

Pull request at https://github.com/wikimedia/grantmetrics/pull/70

When you create an event, the stats shown on the event page (all blank) include both pages created/improved and files uploaded/used.

This should now be fixed. Committed to the same PR: https://github.com/wikimedia/grantmetrics/pull/70/commits/61f3711526d9fa0487e0ebc08ef28d39897f1af5

Looks like this works nicely. @MusikAnimal is there anything left to do in order to have backend support for Commons?

I don't think so! It's entirely possible I missed something, or there are bugs, but we're used to that :) I really wanted to get some proper test coverage for this but that means not only doing T186917, but setting up a shared common resource wiki, which seems to be a bit complicated. Probably at least a 5-pointer on it's own.

I'm content with deploying what we have, monitoring the error logs, and hoping for the best.

Yeah, I think we're good with what we've got for now, I do see some failed checks on the PR though. Important?

I do see some failed checks on the PR though. Important?

The most recent failure is because of Scrutinizer nonsense, but I did have to change the allowed file/method ratings to D or better :( Code quality and test coverage is slowly getting worse. I'm trying to stay strong and accept this as reality.

Niharika moved this task from Needs Review/Feedback to Q1 2018-19 on the Community-Tech-Sprint board.

On a scale of A to Z, a D is pretty awesome! (Don't tell me that's not the scale :P)