Page MenuHomePhabricator

GCI admins to find a way how to make sure GCI mentors have 'enough' tasks published
Closed, ResolvedPublic

Description

From https://www.mediawiki.org/wiki/Google_Code-in/Lessons_learned#2017 but we can only sort that out once we have the website and UI again (or discuss at the GSoC 2018 Mentor summit in a GCI session, whoever will attend that).

Nikerabbit: "For multiple times I was wondering and almost going to ask some admin whether there was enough tasks or should I put effort in creating more. Some more insight into that status would be nice."
AKlapper: "Find some way how to make sure mentors have "enough" tasks published, so mentors don't have to ping "please publish more tasks of mine; I'm running out"."

Event Timeline

Aklapper changed the task status from Open to Stalled.
Aklapper triaged this task as Lowest priority.
Aklapper changed the task status from Stalled to Open.Oct 8 2018, 12:02 PM
Aklapper raised the priority of this task from Lowest to Low.

I proposed a session about this at Google Summer of Code Mentor Summit 2018.

No specific session for this but from the general GCI session I'm in:

Request for help: Could someone give this a shot?: https://developers.google.com/open-source/gci/api (https://code.googlesource.com/codein/api seems to be outdated)

Could someone give this a shot?

Srishti offered Python help (thanks!); I felt like wanting to parse JSON myself. Srishti's probably righter. ¯\_(ツ)_/¯

  1. curl -X GET -H 'content-type: application/json;' -H 'Authorization: Bearer 1234apikey1234' https://codein.withgoogle.com/api/program/current/tasks/ > foo1
  2. Then something like cat foo1 | jq -r '.results[] | select((.available_count > 0) and (.status == 2)).mentors[]' > foo2 would list all mentor email addresses (dups!) for each published task which has more than 0 instances still claimable. status == 1 would be non-published draft tasks.
  3. Then sort foo2 | uniq -c | sort -rn > foo3 sorts by mentor && number. (Less bash'y might be learning how to already use group_by in jq.)

TODO: Combine the two queries (low number of published tasks for mentor X && number of draft tasks higher than 0 for mentor X). Somehow.
TODO: Support pagination in step 1.

Quick'n'dirty, works for me:

#!/bin/sh
# Quick and dirty Google Code-in per-mentors stats for admins: Should I publish more tasks for a mentor?
# This code is licensed under CC0 1.0 Universal: https://creativecommons.org/publicdomain/zero/1.0/legalcode
# Author: Andre Klapper
FILENAME="tasks"
curl -s -X GET -H 'content-type: application/json;' -H 'Authorization: Bearer 123456apikey123456 https://codein.withgoogle.com/api/program/current/tasks/?page_size=5000 > $FILENAME
echo "=== Number of unpublished tasks per GCI mentor:"
cat $FILENAME | jq -r '.results[] | select(.status == 1).mentors[]' | sort | uniq -c | sort -rn
echo "=== Number of remaining published available tasks per GCI mentor:"
cat $FILENAME |  jq -r '.results[] | select((.available_count > 0) and (.status == 2)).mentors[]' | sort | uniq -c | sort -rn
rm $FILENAME

(Org admins find the API key in their user profile.)

Works for me and I'm using this script, so let's resolve this task (purrfect is the enemy of good).

It's also documented in https://www.mediawiki.org/wiki/Google_Code-in/Admins#Weekly_tasks_while_running