{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/cfn-config/pulls/comments/169324978","pull_request_review_id":97831340,"id":169324978,"diff_hunk":"@@ -358,13 +359,26 @@ var operations = module.exports.operations = {\n     }\n \n     var diff = compare(context.oldParameters, context.newParameters);\n+\n     if (!diff) {\n       context.overrides.skipConfirmParameters = true;\n       return context.next();\n     }\n \n+    if (context.overrides.diffs && context.overrides.diffs.parameters) {\n+      var preapproved = context.overrides.diffs.parameters.filter(function(previous) {\n+        return previous === diff;","path":"lib/commands.js","position":39,"original_position":39,"commit_id":"4470f231bd16b8dc2c02eaf75203f0f838d97445","original_commit_id":"4470f231bd16b8dc2c02eaf75203f0f838d97445","user":{"login":"vsmart","id":2796920,"avatar_url":"https://avatars3.githubusercontent.com/u/2796920?v=4","gravatar_id":"","url":"https://api.github.com/users/vsmart","html_url":"https://github.com/vsmart","followers_url":"https://api.github.com/users/vsmart/followers","following_url":"https://api.github.com/users/vsmart/following{/other_user}","gists_url":"https://api.github.com/users/vsmart/gists{/gist_id}","starred_url":"https://api.github.com/users/vsmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsmart/subscriptions","organizations_url":"https://api.github.com/users/vsmart/orgs","repos_url":"https://api.github.com/users/vsmart/repos","events_url":"https://api.github.com/users/vsmart/events{/privacy}","received_events_url":"https://api.github.com/users/vsmart/received_events","type":"User","site_admin":false},"body":"Is order a concern here - if parameters are in a different order in overrides.diff, but the values are the same? Does `===` catch this? ","created_at":"2018-02-20T13:57:13Z","updated_at":"2018-02-20T13:57:13Z","html_url":"https://github.com/mapbox/cfn-config/pull/149#discussion_r169324978","pull_request_url":"https://api.github.com/repos/mapbox/cfn-config/pulls/149","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mapbox/cfn-config/pulls/comments/169324978"},"html":{"href":"https://github.com/mapbox/cfn-config/pull/149#discussion_r169324978"},"pull_request":{"href":"https://api.github.com/repos/mapbox/cfn-config/pulls/149"}}},"pull_request":{"url":"https://api.github.com/repos/mapbox/cfn-config/pulls/149","id":170030727,"html_url":"https://github.com/mapbox/cfn-config/pull/149","diff_url":"https://github.com/mapbox/cfn-config/pull/149.diff","patch_url":"https://github.com/mapbox/cfn-config/pull/149.patch","issue_url":"https://api.github.com/repos/mapbox/cfn-config/issues/149","number":149,"state":"open","locked":false,"title":"Mechanism for avoiding repeat template/parameter diff prompting","user":{"login":"rclark","id":515424,"avatar_url":"https://avatars0.githubusercontent.com/u/515424?v=4","gravatar_id":"","url":"https://api.github.com/users/rclark","html_url":"https://github.com/rclark","followers_url":"https://api.github.com/users/rclark/followers","following_url":"https://api.github.com/users/rclark/following{/other_user}","gists_url":"https://api.github.com/users/rclark/gists{/gist_id}","starred_url":"https://api.github.com/users/rclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rclark/subscriptions","organizations_url":"https://api.github.com/users/rclark/orgs","repos_url":"https://api.github.com/users/rclark/repos","events_url":"https://api.github.com/users/rclark/events{/privacy}","received_events_url":"https://api.github.com/users/rclark/received_events","type":"User","site_admin":false},"body":"The intention of this PR is to allow a higher-level program to call on cfn-config's `commands.update()` flow multiple successive times, yet avoid prompting the user to confirm template or parameter diffs that they've already confirmed.\r\n\r\nIn a situation where CloudFormation stacks based on a single template are being updated across several AWS accounts or regions, this would allow the user to avoid having to confirm the same set of changes for each account/region that they are impacting.\r\n\r\nThe way I'm thinking this works is:\r\n\r\n1. `commands.update()` will fire the provided callback function with a 3rd argument. This will be an object representing the diffs generated by the update. The object will look like:\r\n\r\n  ```\r\n  {\r\n    template: 'String value...',\r\n    parameters: 'String value...'\r\n  }\r\n  ```\r\n\r\n  ... where these strings represent the exact string that the user was asked to confirm.\r\n\r\n2. This will return the diffs themselves to a higher-level caller, where they can be aggregated across successive `commands.update()` calls.\r\n\r\n3. The caller then can provide a set of previously-approved diffs through the `overrides` object, like so:\r\n\r\n  ```\r\n  overrides: {\r\n    diffs: {\r\n      template: ['String value...', 'String value...', ...],\r\n      parameters: ['String value...', 'String value...', ...]\r\n    }\r\n  }\r\n  ```\r\n\r\n  ... where each array is a set of diff strings that the user should not be prompted to re-confirm.\r\n\r\n4. As the higher-level function steps through accounts/regions, it accumulates these arrays of diffs, and hands them to successive `commands.update()` calls via `overrides`. cfn-config then can avoid prompting the user to re-confirm a diff that's identical to one they've already seen.\r\n\r\ncc @kellyoung @vsmart cuz I know you've thought about this some.","created_at":"2018-02-19T18:44:35Z","updated_at":"2018-02-20T13:57:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4eebfef7743bbb38bd83c4ba1efde34cba852d47","assignee":null,"assignees":[],"requested_reviewers":[{"login":"arunasank","id":3166852,"avatar_url":"https://avatars1.githubusercontent.com/u/3166852?v=4","gravatar_id":"","url":"https://api.github.com/users/arunasank","html_url":"https://github.com/arunasank","followers_url":"https://api.github.com/users/arunasank/followers","following_url":"https://api.github.com/users/arunasank/following{/other_user}","gists_url":"https://api.github.com/users/arunasank/gists{/gist_id}","starred_url":"https://api.github.com/users/arunasank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunasank/subscriptions","organizations_url":"https://api.github.com/users/arunasank/orgs","repos_url":"https://api.github.com/users/arunasank/repos","events_url":"https://api.github.com/users/arunasank/events{/privacy}","received_events_url":"https://api.github.com/users/arunasank/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/cfn-config/pulls/149/commits","review_comments_url":"https://api.github.com/repos/mapbox/cfn-config/pulls/149/comments","review_comment_url":"https://api.github.com/repos/mapbox/cfn-config/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/cfn-config/issues/149/comments","statuses_url":"https://api.github.com/repos/mapbox/cfn-config/statuses/4470f231bd16b8dc2c02eaf75203f0f838d97445","head":{"label":"mapbox:less-repeat-prompting","ref":"less-repeat-prompting","sha":"4470f231bd16b8dc2c02eaf75203f0f838d97445","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16360371,"name":"cfn-config","full_name":"mapbox/cfn-config","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/cfn-config","description":"Quickly configure, start, and update AWS CloudFormation stacks.","fork":false,"url":"https://api.github.com/repos/mapbox/cfn-config","forks_url":"https://api.github.com/repos/mapbox/cfn-config/forks","keys_url":"https://api.github.com/repos/mapbox/cfn-config/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/cfn-config/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/cfn-config/teams","hooks_url":"https://api.github.com/repos/mapbox/cfn-config/hooks","issue_events_url":"https://api.github.com/repos/mapbox/cfn-config/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/cfn-config/events","assignees_url":"https://api.github.com/repos/mapbox/cfn-config/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/cfn-config/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/cfn-config/tags","blobs_url":"https://api.github.com/repos/mapbox/cfn-config/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/cfn-config/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/cfn-config/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/cfn-config/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/cfn-config/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/cfn-config/languages","stargazers_url":"https://api.github.com/repos/mapbox/cfn-config/stargazers","contributors_url":"https://api.github.com/repos/mapbox/cfn-config/contributors","subscribers_url":"https://api.github.com/repos/mapbox/cfn-config/subscribers","subscription_url":"https://api.github.com/repos/mapbox/cfn-config/subscription","commits_url":"https://api.github.com/repos/mapbox/cfn-config/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/cfn-config/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/cfn-config/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/cfn-config/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/cfn-config/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/cfn-config/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/cfn-config/merges","archive_url":"https://api.github.com/repos/mapbox/cfn-config/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/cfn-config/downloads","issues_url":"https://api.github.com/repos/mapbox/cfn-config/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/cfn-config/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/cfn-config/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/cfn-config/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/cfn-config/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/cfn-config/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/cfn-config/deployments","created_at":"2014-01-29T21:54:15Z","updated_at":"2017-11-03T21:30:24Z","pushed_at":"2018-02-20T00:46:32Z","git_url":"git://github.com/mapbox/cfn-config.git","ssh_url":"git@github.com:mapbox/cfn-config.git","clone_url":"https://github.com/mapbox/cfn-config.git","svn_url":"https://github.com/mapbox/cfn-config","homepage":null,"size":265,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":9,"open_issues":9,"watchers":35,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"72dcb36e069a62deadff2f0a8a66515f886afa46","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16360371,"name":"cfn-config","full_name":"mapbox/cfn-config","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/cfn-config","description":"Quickly configure, start, and update AWS CloudFormation stacks.","fork":false,"url":"https://api.github.com/repos/mapbox/cfn-config","forks_url":"https://api.github.com/repos/mapbox/cfn-config/forks","keys_url":"https://api.github.com/repos/mapbox/cfn-config/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/cfn-config/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/cfn-config/teams","hooks_url":"https://api.github.com/repos/mapbox/cfn-config/hooks","issue_events_url":"https://api.github.com/repos/mapbox/cfn-config/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/cfn-config/events","assignees_url":"https://api.github.com/repos/mapbox/cfn-config/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/cfn-config/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/cfn-config/tags","blobs_url":"https://api.github.com/repos/mapbox/cfn-config/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/cfn-config/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/cfn-config/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/cfn-config/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/cfn-config/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/cfn-config/languages","stargazers_url":"https://api.github.com/repos/mapbox/cfn-config/stargazers","contributors_url":"https://api.github.com/repos/mapbox/cfn-config/contributors","subscribers_url":"https://api.github.com/repos/mapbox/cfn-config/subscribers","subscription_url":"https://api.github.com/repos/mapbox/cfn-config/subscription","commits_url":"https://api.github.com/repos/mapbox/cfn-config/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/cfn-config/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/cfn-config/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/cfn-config/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/cfn-config/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/cfn-config/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/cfn-config/merges","archive_url":"https://api.github.com/repos/mapbox/cfn-config/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/cfn-config/downloads","issues_url":"https://api.github.com/repos/mapbox/cfn-config/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/cfn-config/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/cfn-config/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/cfn-config/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/cfn-config/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/cfn-config/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/cfn-config/deployments","created_at":"2014-01-29T21:54:15Z","updated_at":"2017-11-03T21:30:24Z","pushed_at":"2018-02-20T00:46:32Z","git_url":"git://github.com/mapbox/cfn-config.git","ssh_url":"git@github.com:mapbox/cfn-config.git","clone_url":"https://github.com/mapbox/cfn-config.git","svn_url":"https://github.com/mapbox/cfn-config","homepage":null,"size":265,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":9,"open_issues":9,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/cfn-config/pulls/149"},"html":{"href":"https://github.com/mapbox/cfn-config/pull/149"},"issue":{"href":"https://api.github.com/repos/mapbox/cfn-config/issues/149"},"comments":{"href":"https://api.github.com/repos/mapbox/cfn-config/issues/149/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/cfn-config/pulls/149/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/cfn-config/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/cfn-config/pulls/149/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/cfn-config/statuses/4470f231bd16b8dc2c02eaf75203f0f838d97445"}},"author_association":"OWNER"}}
{"actor":{"display_login":"vsmart"}}