{"action":"created","issue":{"url":"https://api.github.com/repos/codeforamerica/cfapi/issues/245","repository_url":"https://api.github.com/repos/codeforamerica/cfapi","labels_url":"https://api.github.com/repos/codeforamerica/cfapi/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/codeforamerica/cfapi/issues/245/comments","events_url":"https://api.github.com/repos/codeforamerica/cfapi/issues/245/events","html_url":"https://github.com/codeforamerica/cfapi/issues/245","id":104786883,"number":245,"title":"Change our source of the Project last_updated attribute","user":{"login":"ondrae","id":595778,"avatar_url":"https://avatars.githubusercontent.com/u/595778?v=3","gravatar_id":"","url":"https://api.github.com/users/ondrae","html_url":"https://github.com/ondrae","followers_url":"https://api.github.com/users/ondrae/followers","following_url":"https://api.github.com/users/ondrae/following{/other_user}","gists_url":"https://api.github.com/users/ondrae/gists{/gist_id}","starred_url":"https://api.github.com/users/ondrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondrae/subscriptions","organizations_url":"https://api.github.com/users/ondrae/orgs","repos_url":"https://api.github.com/users/ondrae/repos","events_url":"https://api.github.com/users/ondrae/events{/privacy}","received_events_url":"https://api.github.com/users/ondrae/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/codeforamerica/cfapi/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/codeforamerica/cfapi/milestones/12","html_url":"https://github.com/codeforamerica/cfapi/milestones/Stability","labels_url":"https://api.github.com/repos/codeforamerica/cfapi/milestones/12/labels","id":1272246,"number":12,"title":"Stability","description":"Fix issues that break the network platform for people who rely on the Brigade website and the CfAPI.","creator":{"login":"ondrae","id":595778,"avatar_url":"https://avatars.githubusercontent.com/u/595778?v=3","gravatar_id":"","url":"https://api.github.com/users/ondrae","html_url":"https://github.com/ondrae","followers_url":"https://api.github.com/users/ondrae/followers","following_url":"https://api.github.com/users/ondrae/following{/other_user}","gists_url":"https://api.github.com/users/ondrae/gists{/gist_id}","starred_url":"https://api.github.com/users/ondrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ondrae/subscriptions","organizations_url":"https://api.github.com/users/ondrae/orgs","repos_url":"https://api.github.com/users/ondrae/repos","events_url":"https://api.github.com/users/ondrae/events{/privacy}","received_events_url":"https://api.github.com/users/ondrae/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":7,"state":"closed","created_at":"2015-08-25T20:30:56Z","updated_at":"2015-11-16T20:52:03Z","due_on":null,"closed_at":"2015-11-16T20:52:03Z"},"comments":2,"created_at":"2015-09-03T21:38:32Z","updated_at":"2016-07-06T04:53:50Z","closed_at":"2015-10-12T21:45:38Z","body":"#### Description\r\n@judy5000 noticed that a difference between our publish timestamp from the cfapi\r\n![screen shot 2015-09-03 at 2 24 37 pm](https://cloud.githubusercontent.com/assets/595778/9671411/9676f20c-5247-11e5-90c2-9b0de72c0b5b.png)\r\n\r\nand the timestamp from Github\r\n![screen shot 2015-09-03 at 2 25 28 pm](https://cloud.githubusercontent.com/assets/595778/9671423/a7ed2b82-5247-11e5-9e5e-7dde7a4baa71.png)\r\n\r\nA little assistance from @prashtx led to http://stackoverflow.com/questions/15918588/github-api-v3-what-is-the-difference-between-pushed-at-and-updated-at which describes the difference. `updated_at` refers to the repository object, while `pushed_to` means a commit.\r\n\r\nFor the CfAPI, we want whatever is the most recent.\r\n\r\nWe're using the [Last-Modified header attribute](https://developer.github.com/v3/#conditional-requests) from Github's API to supply the time stamp for our Project's `last_updated` value. As far as I can tell, this is the same as the `updated_at` attribute, meaning when was the repo object last updated.\r\n\r\nWe should switch that to use either `pushed_at` or `updated_at`, whichever is more recent. Then our `last_updated` will include either kind of updates.\r\n\r\n#### Files\r\nrun_update.py\r\n\r\n#### Tasks\r\n- [x] Add a new function to find the most recent of the two timestamps, `updated_at` or `pushed_at`\r\n- [x] Replace the source of our `last_updated` attribute with that new function at https://github.com/codeforamerica/cfapi/blob/master/run_update.py#L437\r\n- [x] Write tests in run_update_tests.py to check it all"},"comment":{"url":"https://api.github.com/repos/codeforamerica/cfapi/issues/comments/230670710","html_url":"https://github.com/codeforamerica/cfapi/issues/245#issuecomment-230670710","issue_url":"https://api.github.com/repos/codeforamerica/cfapi/issues/245","id":230670710,"user":{"login":"DaleMcGrew","id":7756031,"avatar_url":"https://avatars.githubusercontent.com/u/7756031?v=3","gravatar_id":"","url":"https://api.github.com/users/DaleMcGrew","html_url":"https://github.com/DaleMcGrew","followers_url":"https://api.github.com/users/DaleMcGrew/followers","following_url":"https://api.github.com/users/DaleMcGrew/following{/other_user}","gists_url":"https://api.github.com/users/DaleMcGrew/gists{/gist_id}","starred_url":"https://api.github.com/users/DaleMcGrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaleMcGrew/subscriptions","organizations_url":"https://api.github.com/users/DaleMcGrew/orgs","repos_url":"https://api.github.com/users/DaleMcGrew/repos","events_url":"https://api.github.com/users/DaleMcGrew/events{/privacy}","received_events_url":"https://api.github.com/users/DaleMcGrew/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T04:53:50Z","updated_at":"2016-07-06T04:53:50Z","body":"Hello @RandyMoore, @judy5000 and @ondrae, the problem still exists on http://codeforsanfrancisco.org/projects/ Projects (like \"We Vote San Francisco\") that have approved pull requests in the last 3 days (https://github.com/wevote/WeVoteServer) show up on the projects page has being last updated 4 months ago. Thank you."}}
{"actor":{"display_login":"DaleMcGrew"}}