andymeneely / chromium-history

Scripts and data related Chromium's history
11 stars 4 forks source link

Integrate Sheriff Rotation data #115

Closed andymeneely closed 10 years ago

andymeneely commented 10 years ago

Now that we have the excel file for the Sherriff Rotation, let's get this data into the database and into our models. Ultimately, I would like to be able to have the following work:

> Developer.take.sheriff?(DateTime.new(2011,01,01))
> CodeReview.take.sheriffs
#returns an ActiveRecord::Relation of the people who were at one point sheriffs
> CodeReview.joins(participants: :sheriffs).group(:issue)
#returns all code reviews with the number of people who were at one point sheriffs (this might be wrong, but hopefully you get the idea)

The excel sheet is a little rough around the edges. Let's move it into a Google Spreadsheet with the following things:

Then, download our Google Spreadsheet as a csv and write a loader for that csv.

Once we get this data parsing properly, we need:

So it's the full treatment and we'll soon have sheriff data as a first-class citizen in the product. I can help out with this but I'll give you first crack at it.

andymeneely commented 10 years ago

@dani5447 I've written this one up. Want to take this one?

dani5447 commented 10 years ago

Sure!

dani5447 commented 10 years ago

Completed the first steps of this endeavor - transferring only the calendar events we care about into a google sheet. I have some comments on that data:

andymeneely commented 10 years ago

Random event - just ignore it/delete it from our sheets. Looks like a red herring.

As for the dates - yes let's just work with what we have. Maybe they added that rotation partway through.

As for the names, let's process only emails but keep the names in our data in case we ever do start disambiguating by full names. For now, just go with emails and we'll state that limitation.

dani5447 commented 10 years ago

Alright I'm still working on the loader, but I created a Sheriff model taking care of the first two points in your last section:

That leaves these points still to be done:

dani5447 commented 10 years ago

I was doing a comparison of the events as listed on the google calendars and as they're downloaded in the excel sheets and I think gcal2excel might have done some sort of automatic conversion from email to a user name where it could find the user.

So to try to fix this, I made a Google Apps Script to get calendar events data and put it in an excel sheet. This way I can make sure that I get the emails. And this bypasses the whole issue I had earlier with the OAuth, because the script is already inside the google drive system!

It seems to work pretty well! I'll do a bit more testing and then put the script in our system and download the new data.

I'll put the script in our Google Drive and copy the script to a .txt file and put it into our files under the "data" folder. It'll be called "SheriffCalendarScraperGAppScript.txt"

In the new data I took the liberty of removing the event descriptions, and only get the attendees (not the 'owner' of the event as the gcal2excel did, because that was just a generic owner)

dani5447 commented 10 years ago

The old excel sheet, google sheet, and instructions are still in the Google Drive. I can leave them there now for comparison purposes if you guys want to compare the data sheets. (same with the csv files in our github filesystem)

kaylaerdmann commented 10 years ago

Working on the sheriffs now and just saw that we've been having failing builds. I think it might have something to do with this issue: https://www.ruby-forum.com/topic/64428. It's the closest problem I've found so far and can't figure out why else it's erroring like this.