{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/24284577","id":24284577,"diff_hunk":"@@ -3,8 +3,10 @@\n require \"active_support/core_ext/object/with_options\"\n \n class GithubApi\n-  SERVICES_TEAM_NAME = \"Services\"\n+  ORGANIZATION_TYPE = \"Organization\"\n   PREVIEW_MEDIA_TYPE = \"application/vnd.github.moondragon-preview+json\"\n+  SERVICES_TEAM_NAME = \"Services\"","path":"lib/github_api.rb","position":7,"original_position":7,"commit_id":"94c22f6b8eb421f9eb973eca158504ea4a1d2472","original_commit_id":"3340b552091f01d4b1fcda98d350e101e246a26f","user":{"login":"srt32","id":2181356,"avatar_url":"https://avatars.githubusercontent.com/u/2181356?v=3","gravatar_id":"","url":"https://api.github.com/users/srt32","html_url":"https://github.com/srt32","followers_url":"https://api.github.com/users/srt32/followers","following_url":"https://api.github.com/users/srt32/following{/other_user}","gists_url":"https://api.github.com/users/srt32/gists{/gist_id}","starred_url":"https://api.github.com/users/srt32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srt32/subscriptions","organizations_url":"https://api.github.com/users/srt32/orgs","repos_url":"https://api.github.com/users/srt32/repos","events_url":"https://api.github.com/users/srt32/events{/privacy}","received_events_url":"https://api.github.com/users/srt32/received_events","type":"User","site_admin":false},"body":"I was just moving things around here. Looks like it's in `add_hound_to_repo` and 'github_api` (https://github.com/thoughtbot/hound/search?utf8=%E2%9C%93&q=SERVICES_TEAM_NAME). Perhaps keep it in `GithubApi`?","created_at":"2015-02-07T01:19:48Z","updated_at":"2015-02-07T01:19:48Z","html_url":"https://github.com/thoughtbot/hound/pull/586#discussion_r24284577","pull_request_url":"https://api.github.com/repos/thoughtbot/hound/pulls/586","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/24284577"},"html":{"href":"https://github.com/thoughtbot/hound/pull/586#discussion_r24284577"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/586"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/hound/pulls/586","id":28078430,"html_url":"https://github.com/thoughtbot/hound/pull/586","diff_url":"https://github.com/thoughtbot/hound/pull/586.diff","patch_url":"https://github.com/thoughtbot/hound/pull/586.patch","issue_url":"https://api.github.com/repos/thoughtbot/hound/issues/586","number":586,"state":"open","locked":false,"title":"Adds owners tables and \tassigns owner in repo creation / update","user":{"login":"srt32","id":2181356,"avatar_url":"https://avatars.githubusercontent.com/u/2181356?v=3","gravatar_id":"","url":"https://api.github.com/users/srt32","html_url":"https://github.com/srt32","followers_url":"https://api.github.com/users/srt32/followers","following_url":"https://api.github.com/users/srt32/following{/other_user}","gists_url":"https://api.github.com/users/srt32/gists{/gist_id}","starred_url":"https://api.github.com/users/srt32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srt32/subscriptions","organizations_url":"https://api.github.com/users/srt32/orgs","repos_url":"https://api.github.com/users/srt32/repos","events_url":"https://api.github.com/users/srt32/events{/privacy}","received_events_url":"https://api.github.com/users/srt32/received_events","type":"User","site_admin":false},"body":"This PR updates the `RepoSynchronization` process and `Build`'s to assign the\r\n`repo` to its parent `owner` (which is either a user or an organization). Tying\r\nthe `repo` to the `owner` is a preliminary step to having `owner` level\r\nconfiguration.\r\n\r\nNew `repo`'s and updated `repo`'s (updated via the user clicking 'Refresh Repo\r\nList' or via a build) will have their `owner`s populated.  We'll need to\r\nbackfill the `repo`'s that are not new and are not refreshed. I propose we merge\r\nthis PR as is and then have follow up work that adds an idempotent rake task\r\n(which requires calls to GitHub) that will backfill `repo`'s missing\r\n`owner_id`'s. Once the data is backfilled, we can apply a `null: false`\r\nconstraint to `repos.owner_id`.\r\n\r\nPart of\r\nhttps://trello.com/c/V0jY5LWs/452-migrate-existing-config-files-into-database","created_at":"2015-01-27T02:12:36Z","updated_at":"2015-02-07T01:19:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8be9b6736a0d831e1ce47c2cf12a60477a4fa3f7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/hound/pulls/586/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/hound/pulls/586/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thoughtbot/hound/issues/586/comments","statuses_url":"https://api.github.com/repos/thoughtbot/hound/statuses/94c22f6b8eb421f9eb973eca158504ea4a1d2472","head":{"label":"thoughtbot:st-jc-add-owners","ref":"st-jc-add-owners","sha":"94c22f6b8eb421f9eb973eca158504ea4a1d2472","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":7411076,"name":"hound","full_name":"thoughtbot/hound","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/hound","description":"Review your Ruby, JavaScript, CoffeeScript, and SCSS code for style guide violations with a trusty hound.","fork":false,"url":"https://api.github.com/repos/thoughtbot/hound","forks_url":"https://api.github.com/repos/thoughtbot/hound/forks","keys_url":"https://api.github.com/repos/thoughtbot/hound/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/hound/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/hound/teams","hooks_url":"https://api.github.com/repos/thoughtbot/hound/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/hound/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/hound/events","assignees_url":"https://api.github.com/repos/thoughtbot/hound/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/hound/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/hound/tags","blobs_url":"https://api.github.com/repos/thoughtbot/hound/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/hound/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/hound/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/hound/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/hound/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/hound/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/hound/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/hound/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/hound/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/hound/subscription","commits_url":"https://api.github.com/repos/thoughtbot/hound/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/hound/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/hound/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/hound/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/hound/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/hound/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/hound/merges","archive_url":"https://api.github.com/repos/thoughtbot/hound/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/hound/downloads","issues_url":"https://api.github.com/repos/thoughtbot/hound/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/hound/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/hound/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/hound/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/hound/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/hound/releases{/id}","created_at":"2013-01-02T18:12:40Z","updated_at":"2015-02-06T09:26:50Z","pushed_at":"2015-02-07T01:16:05Z","git_url":"git://github.com/thoughtbot/hound.git","ssh_url":"git@github.com:thoughtbot/hound.git","clone_url":"https://github.com/thoughtbot/hound.git","svn_url":"https://github.com/thoughtbot/hound","homepage":"houndci.com","size":11592,"stargazers_count":754,"watchers_count":754,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":31,"forks":137,"open_issues":31,"watchers":754,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"91391e7b17ee61149b02ed2ac14e9c5e05624b68","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":7411076,"name":"hound","full_name":"thoughtbot/hound","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/hound","description":"Review your Ruby, JavaScript, CoffeeScript, and SCSS code for style guide violations with a trusty hound.","fork":false,"url":"https://api.github.com/repos/thoughtbot/hound","forks_url":"https://api.github.com/repos/thoughtbot/hound/forks","keys_url":"https://api.github.com/repos/thoughtbot/hound/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/hound/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/hound/teams","hooks_url":"https://api.github.com/repos/thoughtbot/hound/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/hound/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/hound/events","assignees_url":"https://api.github.com/repos/thoughtbot/hound/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/hound/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/hound/tags","blobs_url":"https://api.github.com/repos/thoughtbot/hound/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/hound/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/hound/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/hound/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/hound/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/hound/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/hound/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/hound/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/hound/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/hound/subscription","commits_url":"https://api.github.com/repos/thoughtbot/hound/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/hound/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/hound/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/hound/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/hound/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/hound/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/hound/merges","archive_url":"https://api.github.com/repos/thoughtbot/hound/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/hound/downloads","issues_url":"https://api.github.com/repos/thoughtbot/hound/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/hound/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/hound/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/hound/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/hound/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/hound/releases{/id}","created_at":"2013-01-02T18:12:40Z","updated_at":"2015-02-06T09:26:50Z","pushed_at":"2015-02-07T01:16:05Z","git_url":"git://github.com/thoughtbot/hound.git","ssh_url":"git@github.com:thoughtbot/hound.git","clone_url":"https://github.com/thoughtbot/hound.git","svn_url":"https://github.com/thoughtbot/hound","homepage":"houndci.com","size":11592,"stargazers_count":754,"watchers_count":754,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":137,"mirror_url":null,"open_issues_count":31,"forks":137,"open_issues":31,"watchers":754,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/586"},"html":{"href":"https://github.com/thoughtbot/hound/pull/586"},"issue":{"href":"https://api.github.com/repos/thoughtbot/hound/issues/586"},"comments":{"href":"https://api.github.com/repos/thoughtbot/hound/issues/586/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/586/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/hound/pulls/586/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/hound/statuses/94c22f6b8eb421f9eb973eca158504ea4a1d2472"}}}}