{"action":"created","comment":{"url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/comments/175175341","pull_request_review_id":104669714,"id":175175341,"diff_hunk":"@@ -0,0 +1,109 @@\n+const cli = require('heroku-cli-util')\n+const nock = require('nock')\n+const expect = require('chai').expect\n+const cmd = require('../../../commands/review_apps/disable')\n+\n+describe('reviewapps:disable', function () {\n+\n+  let pipeline, repo, app, kolkrabbiAccount\n+  let api, kolkrabbi, github\n+\n+  function nockDone() {\n+    api.done()\n+    github.done()\n+    kolkrabbi.done()\n+  }\n+\n+  beforeEach(function () {\n+\n+    cli.mockConsole()\n+    nock.disableNetConnect()\n+\n+    kolkrabbiAccount = {\n+      github: {\n+        token: '123-abc'\n+      }\n+    }\n+\n+    pipeline = {\n+      id: '123-pipeline',\n+      name: 'my-pipeline'\n+    }\n+\n+    repo = {\n+      id: 123,\n+      default_branch: 'master',\n+      name: 'my-org/my-repo'\n+    }\n+\n+    app = {\n+      id: '123-prod-app',\n+      name: pipeline.name\n+    }\n+\n+    kolkrabbi = nock('https://kolkrabbi.heroku.com')\n+    kolkrabbi.get('/account/github/token').reply(200, kolkrabbiAccount)\n+    kolkrabbi.patch(`/apps/${app.id}/github`).reply(200, {})\n+\n+    github = nock('https://api.github.com')\n+\n+    api = nock('https://api.heroku.com')\n+    api.get(`/apps/${app.name}`).reply(200, app)\n+  })\n+\n+  afterEach(function () {\n+    nock.cleanAll()\n+  })\n+\n+  it('it succeeds with defaults', function () {\n+\n+    return cmd.run({\n+      flags: {\n+        pipeline: pipeline.name,\n+        app: app.name\n+      }\n+    }).then(() => {\n+      expect(cli.stderr).to.include('Configuring pipeline')\n+    })\n+  })\n+\n+  it('it disables autodeploys', function* () {\n+\n+    return cmd.run({\n+      flags: {\n+        pipeline: pipeline.name,\n+        app: app.name,\n+        autodeploy: true\n+      }\n+    }).then(() => {\n+      expect(cli.stderr).to.include('Configuring pipeline')\n+    })\n+  })\n+\n+  it('it disables autodestroy', function* () {\n+\n+    return cmd.run({\n+      flags: {\n+        pipeline: pipeline.name,\n+        app: app.name,\n+        autodestroy: true\n+      }\n+    }).then(() => {\n+      expect(cli.stderr).to.include('Configuring pipeline')\n+    })\n+  })\n+\n+  it('it succeeds with autodeploy and autodestroy', function* () {\n+","path":"test/commands/review_apps/disable.js","position":97,"original_position":97,"commit_id":"34cf4063b767f28d73c1087114536e45b3d2a5ed","original_commit_id":"34cf4063b767f28d73c1087114536e45b3d2a5ed","user":{"login":"raulb","id":306015,"avatar_url":"https://avatars2.githubusercontent.com/u/306015?v=4","gravatar_id":"","url":"https://api.github.com/users/raulb","html_url":"https://github.com/raulb","followers_url":"https://api.github.com/users/raulb/followers","following_url":"https://api.github.com/users/raulb/following{/other_user}","gists_url":"https://api.github.com/users/raulb/gists{/gist_id}","starred_url":"https://api.github.com/users/raulb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raulb/subscriptions","organizations_url":"https://api.github.com/users/raulb/orgs","repos_url":"https://api.github.com/users/raulb/repos","events_url":"https://api.github.com/users/raulb/events{/privacy}","received_events_url":"https://api.github.com/users/raulb/received_events","type":"User","site_admin":false},"body":"Remove empty line","created_at":"2018-03-16T18:16:42Z","updated_at":"2018-03-16T18:35:16Z","html_url":"https://github.com/heroku/heroku-pipelines/pull/95#discussion_r175175341","pull_request_url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/comments/175175341"},"html":{"href":"https://github.com/heroku/heroku-pipelines/pull/95#discussion_r175175341"},"pull_request":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95","id":174221137,"html_url":"https://github.com/heroku/heroku-pipelines/pull/95","diff_url":"https://github.com/heroku/heroku-pipelines/pull/95.diff","patch_url":"https://github.com/heroku/heroku-pipelines/pull/95.patch","issue_url":"https://api.github.com/repos/heroku/heroku-pipelines/issues/95","number":95,"state":"open","locked":false,"title":"Add repo connect","user":{"login":"wadewegner","id":746259,"avatar_url":"https://avatars2.githubusercontent.com/u/746259?v=4","gravatar_id":"","url":"https://api.github.com/users/wadewegner","html_url":"https://github.com/wadewegner","followers_url":"https://api.github.com/users/wadewegner/followers","following_url":"https://api.github.com/users/wadewegner/following{/other_user}","gists_url":"https://api.github.com/users/wadewegner/gists{/gist_id}","starred_url":"https://api.github.com/users/wadewegner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wadewegner/subscriptions","organizations_url":"https://api.github.com/users/wadewegner/orgs","repos_url":"https://api.github.com/users/wadewegner/repos","events_url":"https://api.github.com/users/wadewegner/events{/privacy}","received_events_url":"https://api.github.com/users/wadewegner/received_events","type":"User","site_admin":false},"body":"## Checklist\r\n\r\n- [x] Implement feature\r\n- [x] Write tests\r\n- [ ] Update yarn.lock\r\n- [x] Update [CHANGELOG.md](https://github.com/heroku/heroku-pipelines/blob/master/CHANGELOG.md)\r\n- [ ] Update Dev Center Docs\r\n- [ ] Publish a new entry to [Heroku Changelog](https://devcenter.heroku.com/changelog)\r\n\r\n## Why\r\nToday it's impossible to fully script the setup of a Heroku Pipeline with existing Heroku Apps using the Heroku CLI (the APIs exist). `heroku pipelines:setup` is naive at best, and creates two Heroku Apps for the pipeline; if the repo includes an `app.json` of any complexity (e.g. required config vars) it will fail. There need to be more granular commands that enable you to connect a github repo and setup review apps on an existing Pipeline. \r\n\r\n## What are the acceptance criteria for the change?\r\n- [ ] I hope [DevEx](https://github.com/heroku/devex) gives a :+1:\r\n- [ ] I hope @raulb provides a :+1: that this PR yields the desired results\r\n\r\n## How can the change be tested\r\n- Run tests: `mocha test/commands/pipelines/connect.js test/commands/review_apps`\r\n- Setup steps:\r\n  1. Create a pipeline name `mypipeline`.\r\n  2. Create a new app `mypipeline-staging` and add to staging.\r\n- Connect it to a github repo you're authorized to use: `heroku pipelines:connect mypipeline githubusername/yourrepo`\r\n- Enable review apps: `heroku reviewapps:enable -p mypipeline -a mypipeline-staging`\r\n- Enable review apps w/ autodeploy: `heroku reviewapps:enable -p mypipeline -a mypipeline-staging --autodeploy`\r\n- Enable review apps w/ autodestroy: `heroku reviewapps:enable -p mypipeline -a mypipeline-staging --autodestroy`\r\n- Disable review apps: `heroku reviewapps:disable -p mypipeline -a mypipeline-staging`\r\n- Disable auto-deploy on review apps: `heroku reviewapps:disable -p mypipeline -a mypipeline-staging --autodeploy`\r\n- Disable auto-destroy on review apps: `heroku reviewapps:disable -p mypipeline -a mypipeline-staging --autodestroy`\r\n\r\n## Demonstration\r\n\r\n(Not updated for new commands.)\r\n\r\n![pipelines](https://user-images.githubusercontent.com/746259/37253906-2e80db76-24f5-11e8-90f7-5ea324484a73.gif)\r\n\r\n## Who's Affected\r\nThese are two brand new commands so no users will be affected.\r\n\r\n## Blockers & upstream dependencies\r\nN/A","created_at":"2018-03-11T13:29:02Z","updated_at":"2018-03-16T18:35:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69d74b9a917c65d0e4c41e1eec5147a61f84fd11","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95/commits","review_comments_url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95/comments","review_comment_url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heroku/heroku-pipelines/issues/95/comments","statuses_url":"https://api.github.com/repos/heroku/heroku-pipelines/statuses/34cf4063b767f28d73c1087114536e45b3d2a5ed","head":{"label":"wadewegner:AddRepoConnect","ref":"AddRepoConnect","sha":"34cf4063b767f28d73c1087114536e45b3d2a5ed","user":{"login":"wadewegner","id":746259,"avatar_url":"https://avatars2.githubusercontent.com/u/746259?v=4","gravatar_id":"","url":"https://api.github.com/users/wadewegner","html_url":"https://github.com/wadewegner","followers_url":"https://api.github.com/users/wadewegner/followers","following_url":"https://api.github.com/users/wadewegner/following{/other_user}","gists_url":"https://api.github.com/users/wadewegner/gists{/gist_id}","starred_url":"https://api.github.com/users/wadewegner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wadewegner/subscriptions","organizations_url":"https://api.github.com/users/wadewegner/orgs","repos_url":"https://api.github.com/users/wadewegner/repos","events_url":"https://api.github.com/users/wadewegner/events{/privacy}","received_events_url":"https://api.github.com/users/wadewegner/received_events","type":"User","site_admin":false},"repo":{"id":124550804,"name":"heroku-pipelines","full_name":"wadewegner/heroku-pipelines","owner":{"login":"wadewegner","id":746259,"avatar_url":"https://avatars2.githubusercontent.com/u/746259?v=4","gravatar_id":"","url":"https://api.github.com/users/wadewegner","html_url":"https://github.com/wadewegner","followers_url":"https://api.github.com/users/wadewegner/followers","following_url":"https://api.github.com/users/wadewegner/following{/other_user}","gists_url":"https://api.github.com/users/wadewegner/gists{/gist_id}","starred_url":"https://api.github.com/users/wadewegner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wadewegner/subscriptions","organizations_url":"https://api.github.com/users/wadewegner/orgs","repos_url":"https://api.github.com/users/wadewegner/repos","events_url":"https://api.github.com/users/wadewegner/events{/privacy}","received_events_url":"https://api.github.com/users/wadewegner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wadewegner/heroku-pipelines","description":"Heroku Pipelines Plugin for Heroku Toolbelt","fork":true,"url":"https://api.github.com/repos/wadewegner/heroku-pipelines","forks_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/forks","keys_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/teams","hooks_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/hooks","issue_events_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/issues/events{/number}","events_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/events","assignees_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/assignees{/user}","branches_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/branches{/branch}","tags_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/tags","blobs_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/git/refs{/sha}","trees_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/statuses/{sha}","languages_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/languages","stargazers_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/stargazers","contributors_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/contributors","subscribers_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/subscribers","subscription_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/subscription","commits_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/commits{/sha}","git_commits_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/git/commits{/sha}","comments_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/comments{/number}","issue_comment_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/issues/comments{/number}","contents_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/contents/{+path}","compare_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/merges","archive_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/downloads","issues_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/issues{/number}","pulls_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/pulls{/number}","milestones_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/milestones{/number}","notifications_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/labels{/name}","releases_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/releases{/id}","deployments_url":"https://api.github.com/repos/wadewegner/heroku-pipelines/deployments","created_at":"2018-03-09T14:28:16Z","updated_at":"2018-03-09T14:28:18Z","pushed_at":"2018-03-15T14:43:08Z","git_url":"git://github.com/wadewegner/heroku-pipelines.git","ssh_url":"git@github.com:wadewegner/heroku-pipelines.git","clone_url":"https://github.com/wadewegner/heroku-pipelines.git","svn_url":"https://github.com/wadewegner/heroku-pipelines","homepage":"","size":477,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"heroku:master","ref":"master","sha":"4e37cc5b3f06c7790eab00bac177dafdb21240bd","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars3.githubusercontent.com/u/23211?v=4","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":37674401,"name":"heroku-pipelines","full_name":"heroku/heroku-pipelines","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars3.githubusercontent.com/u/23211?v=4","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/heroku-pipelines","description":"Heroku Pipelines Plugin for Heroku Toolbelt","fork":false,"url":"https://api.github.com/repos/heroku/heroku-pipelines","forks_url":"https://api.github.com/repos/heroku/heroku-pipelines/forks","keys_url":"https://api.github.com/repos/heroku/heroku-pipelines/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-pipelines/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-pipelines/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-pipelines/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-pipelines/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-pipelines/events","assignees_url":"https://api.github.com/repos/heroku/heroku-pipelines/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-pipelines/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-pipelines/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-pipelines/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-pipelines/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-pipelines/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-pipelines/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-pipelines/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-pipelines/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-pipelines/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-pipelines/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-pipelines/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-pipelines/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-pipelines/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-pipelines/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-pipelines/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-pipelines/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/heroku-pipelines/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-pipelines/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-pipelines/merges","archive_url":"https://api.github.com/repos/heroku/heroku-pipelines/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-pipelines/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-pipelines/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-pipelines/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-pipelines/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-pipelines/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-pipelines/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-pipelines/releases{/id}","deployments_url":"https://api.github.com/repos/heroku/heroku-pipelines/deployments","created_at":"2015-06-18T17:32:39Z","updated_at":"2018-03-13T09:02:42Z","pushed_at":"2018-03-15T14:43:10Z","git_url":"git://github.com/heroku/heroku-pipelines.git","ssh_url":"git@github.com:heroku/heroku-pipelines.git","clone_url":"https://github.com/heroku/heroku-pipelines.git","svn_url":"https://github.com/heroku/heroku-pipelines","homepage":"https://www.npmjs.com/package/@heroku-cli/plugin-pipelines","size":586,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":19,"license":null,"forks":15,"open_issues":19,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95"},"html":{"href":"https://github.com/heroku/heroku-pipelines/pull/95"},"issue":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/issues/95"},"comments":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/heroku/heroku-pipelines/statuses/34cf4063b767f28d73c1087114536e45b3d2a5ed"}},"author_association":"NONE"}}
{"actor":{"display_login":"raulb"}}