{"action":"created","comment":{"url":"https://api.github.com/repos/zendesk/samson/pulls/comments/74175385","id":74175385,"diff_hunk":"@@ -0,0 +1,42 @@\n+class Api::StagesController < Api::BaseController\n+  include CurrentProject\n+\n+  before_action :require_project\n+\n+  def index\n+    render json: @project.stages\n+  end\n+\n+  def clone\n+    new_stage = Stage.build_clone(old_stage)\n+    new_stage.name = stage_name\n+    if new_stage.save\n+      if deploy_group_ids.any? && deploy_groups.any?\n+        new_stage.deploy_groups = deploy_groups\n+        new_stage.save\n+      end\n+\n+      render json: new_stage, status: 201\n+    else\n+      render json: new_stage.errors, status: 422","path":"app/controllers/api/stages_controller.rb","position":null,"original_position":21,"commit_id":"6a30daee6badd0134e3bb597be4bff8944377179","original_commit_id":"ec9176e57ff6e9773ea877bdef9761f323850b46","user":{"login":"grosser","id":11367,"avatar_url":"https://avatars.githubusercontent.com/u/11367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"body":"yeah ... was thinking that we might need this general rescue workflow\nanyway ... either way is fine\n\nOn Tue, Aug 9, 2016 at 11:06 AM, Adam Panzer <notifications@github.com>\nwrote:\n\n> In app/controllers/api/stages_controller.rb\n> <https://github.com/zendesk/samson/pull/1163#discussion_r74112565>:\n>\n> > +  def index\n> > +    render json: @project.stages\n> > +  end\n> > +\n> > +  def clone\n> > +    new_stage = Stage.build_clone(old_stage)\n> > +    new_stage.name = stage_name\n> > +    if new_stage.save\n> > +      if deploy_group_ids.any? && deploy_groups.any?\n> > +        new_stage.deploy_groups = deploy_groups\n> > +        new_stage.save\n> > +      end\n> > +\n> > +      render json: new_stage, status: 201\n> > +    else\n> > +      render json: new_stage.errors, status: 422\n>\n> why? that seems more expensive. I've always been told that rescuing costs.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/zendesk/samson/pull/1163/files/ec9176e57ff6e9773ea877bdef9761f323850b46#r74112565>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAAsZ5-3oled_yRAOWXL_Jf4NfSj1H00ks5qeMGggaJpZM4JVi_g>\n> .\n>\n","created_at":"2016-08-10T02:01:02Z","updated_at":"2016-08-10T02:01:02Z","html_url":"https://github.com/zendesk/samson/pull/1163#discussion_r74175385","pull_request_url":"https://api.github.com/repos/zendesk/samson/pulls/1163","_links":{"self":{"href":"https://api.github.com/repos/zendesk/samson/pulls/comments/74175385"},"html":{"href":"https://github.com/zendesk/samson/pull/1163#discussion_r74175385"},"pull_request":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1163"}}},"pull_request":{"url":"https://api.github.com/repos/zendesk/samson/pulls/1163","id":78918059,"html_url":"https://github.com/zendesk/samson/pull/1163","diff_url":"https://github.com/zendesk/samson/pull/1163.diff","patch_url":"https://github.com/zendesk/samson/pull/1163.patch","issue_url":"https://api.github.com/repos/zendesk/samson/issues/1163","number":1163,"state":"open","locked":false,"title":"OAuth w/ DoorKeeper and First Class API","user":{"login":"apanzerj","id":1709515,"avatar_url":"https://avatars.githubusercontent.com/u/1709515?v=3","gravatar_id":"","url":"https://api.github.com/users/apanzerj","html_url":"https://github.com/apanzerj","followers_url":"https://api.github.com/users/apanzerj/followers","following_url":"https://api.github.com/users/apanzerj/following{/other_user}","gists_url":"https://api.github.com/users/apanzerj/gists{/gist_id}","starred_url":"https://api.github.com/users/apanzerj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apanzerj/subscriptions","organizations_url":"https://api.github.com/users/apanzerj/orgs","repos_url":"https://api.github.com/users/apanzerj/repos","events_url":"https://api.github.com/users/apanzerj/events{/privacy}","received_events_url":"https://api.github.com/users/apanzerj/received_events","type":"User","site_admin":false},"body":"### Description\r\nThis adds [Doorkeeper](https://github.com/doorkeeper-gem/doorkeeper) to Samson along with an integration with warden called [warden-doorkeeper](https://github.com/kolorahl/warden-doorkeeper). This will allow Samson to be an OAuth provider. In addition, I moved 1 API endpoint as a MVP. Next PR should start porting over as many API/JSON routes.\r\n\r\n/cc @zendesk/samson\r\n\r\n\r\n### Screenshots\r\nNew menu items:\r\n\r\n![screenshot 2016-08-01 12 35 04](https://cloud.githubusercontent.com/assets/1709515/17306361/9953ad50-57e4-11e6-95a4-55ddaf072e58.png)\r\n\r\nApplications List:\r\n\r\n![screenshot 2016-08-01 12 36 58](https://cloud.githubusercontent.com/assets/1709515/17306373/aecd620c-57e4-11e6-9db6-dcec0dacba2b.png)\r\n\r\nApplication Detail Page:\r\n\r\n![screenshot 2016-08-01 12 38 09](https://cloud.githubusercontent.com/assets/1709515/17306424/d5e20e24-57e4-11e6-82c8-d689b32667d4.png)\r\n\r\n\r\n### Tasks\r\n - [x] Restrict token generation to SuperAdmin\r\n - [x] Restyle pages to look like samson\r\n - [ ] :+1: from team\r\n\r\n### Risks\r\n- Level: Medium\r\nAuthentication might not work\r\n\r\n","created_at":"2016-07-26T20:18:11Z","updated_at":"2016-08-10T02:01:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ff378f3d3450162d0add4357d73fe9ba4e14c9c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zendesk/samson/pulls/1163/commits","review_comments_url":"https://api.github.com/repos/zendesk/samson/pulls/1163/comments","review_comment_url":"https://api.github.com/repos/zendesk/samson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zendesk/samson/issues/1163/comments","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/6a30daee6badd0134e3bb597be4bff8944377179","head":{"label":"zendesk:apanzerj/oauth_doorkeeper","ref":"apanzerj/oauth_doorkeeper","sha":"6a30daee6badd0134e3bb597be4bff8944377179","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":20208662,"name":"samson","full_name":"zendesk/samson","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/samson","description":"Web interface for deployments","fork":false,"url":"https://api.github.com/repos/zendesk/samson","forks_url":"https://api.github.com/repos/zendesk/samson/forks","keys_url":"https://api.github.com/repos/zendesk/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/samson/teams","hooks_url":"https://api.github.com/repos/zendesk/samson/hooks","issue_events_url":"https://api.github.com/repos/zendesk/samson/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/samson/events","assignees_url":"https://api.github.com/repos/zendesk/samson/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/samson/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/samson/tags","blobs_url":"https://api.github.com/repos/zendesk/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/samson/languages","stargazers_url":"https://api.github.com/repos/zendesk/samson/stargazers","contributors_url":"https://api.github.com/repos/zendesk/samson/contributors","subscribers_url":"https://api.github.com/repos/zendesk/samson/subscribers","subscription_url":"https://api.github.com/repos/zendesk/samson/subscription","commits_url":"https://api.github.com/repos/zendesk/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/samson/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/samson/merges","archive_url":"https://api.github.com/repos/zendesk/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/samson/downloads","issues_url":"https://api.github.com/repos/zendesk/samson/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/samson/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/samson/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/samson/deployments","created_at":"2014-05-27T05:55:57Z","updated_at":"2016-08-08T08:23:12Z","pushed_at":"2016-08-09T20:03:52Z","git_url":"git://github.com/zendesk/samson.git","ssh_url":"git@github.com:zendesk/samson.git","clone_url":"https://github.com/zendesk/samson.git","svn_url":"https://github.com/zendesk/samson","homepage":null,"size":202010,"stargazers_count":718,"watchers_count":718,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":54,"forks":134,"open_issues":54,"watchers":718,"default_branch":"master"}},"base":{"label":"zendesk:master","ref":"master","sha":"8e074ee4190b740ce37afbdec0f8eeb66b72cec6","user":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"repo":{"id":20208662,"name":"samson","full_name":"zendesk/samson","owner":{"login":"zendesk","id":11525,"avatar_url":"https://avatars.githubusercontent.com/u/11525?v=3","gravatar_id":"","url":"https://api.github.com/users/zendesk","html_url":"https://github.com/zendesk","followers_url":"https://api.github.com/users/zendesk/followers","following_url":"https://api.github.com/users/zendesk/following{/other_user}","gists_url":"https://api.github.com/users/zendesk/gists{/gist_id}","starred_url":"https://api.github.com/users/zendesk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zendesk/subscriptions","organizations_url":"https://api.github.com/users/zendesk/orgs","repos_url":"https://api.github.com/users/zendesk/repos","events_url":"https://api.github.com/users/zendesk/events{/privacy}","received_events_url":"https://api.github.com/users/zendesk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zendesk/samson","description":"Web interface for deployments","fork":false,"url":"https://api.github.com/repos/zendesk/samson","forks_url":"https://api.github.com/repos/zendesk/samson/forks","keys_url":"https://api.github.com/repos/zendesk/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zendesk/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zendesk/samson/teams","hooks_url":"https://api.github.com/repos/zendesk/samson/hooks","issue_events_url":"https://api.github.com/repos/zendesk/samson/issues/events{/number}","events_url":"https://api.github.com/repos/zendesk/samson/events","assignees_url":"https://api.github.com/repos/zendesk/samson/assignees{/user}","branches_url":"https://api.github.com/repos/zendesk/samson/branches{/branch}","tags_url":"https://api.github.com/repos/zendesk/samson/tags","blobs_url":"https://api.github.com/repos/zendesk/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zendesk/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zendesk/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/zendesk/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zendesk/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/zendesk/samson/languages","stargazers_url":"https://api.github.com/repos/zendesk/samson/stargazers","contributors_url":"https://api.github.com/repos/zendesk/samson/contributors","subscribers_url":"https://api.github.com/repos/zendesk/samson/subscribers","subscription_url":"https://api.github.com/repos/zendesk/samson/subscription","commits_url":"https://api.github.com/repos/zendesk/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/zendesk/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/zendesk/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/zendesk/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/zendesk/samson/contents/{+path}","compare_url":"https://api.github.com/repos/zendesk/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zendesk/samson/merges","archive_url":"https://api.github.com/repos/zendesk/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zendesk/samson/downloads","issues_url":"https://api.github.com/repos/zendesk/samson/issues{/number}","pulls_url":"https://api.github.com/repos/zendesk/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/zendesk/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/zendesk/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zendesk/samson/labels{/name}","releases_url":"https://api.github.com/repos/zendesk/samson/releases{/id}","deployments_url":"https://api.github.com/repos/zendesk/samson/deployments","created_at":"2014-05-27T05:55:57Z","updated_at":"2016-08-08T08:23:12Z","pushed_at":"2016-08-09T20:03:52Z","git_url":"git://github.com/zendesk/samson.git","ssh_url":"git@github.com:zendesk/samson.git","clone_url":"https://github.com/zendesk/samson.git","svn_url":"https://github.com/zendesk/samson","homepage":null,"size":202010,"stargazers_count":718,"watchers_count":718,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":54,"forks":134,"open_issues":54,"watchers":718,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1163"},"html":{"href":"https://github.com/zendesk/samson/pull/1163"},"issue":{"href":"https://api.github.com/repos/zendesk/samson/issues/1163"},"comments":{"href":"https://api.github.com/repos/zendesk/samson/issues/1163/comments"},"review_comments":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1163/comments"},"review_comment":{"href":"https://api.github.com/repos/zendesk/samson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zendesk/samson/pulls/1163/commits"},"statuses":{"href":"https://api.github.com/repos/zendesk/samson/statuses/6a30daee6badd0134e3bb597be4bff8944377179"}}}}
{"actor":{"display_login":"grosser"}}