{"action":"created","comment":{"url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/comments/24956183","id":24956183,"diff_hunk":"@@ -174,7 +174,14 @@ def create\n \n       action(\"Creating #{addon['name'].downcase}\") {}\n       action(\"Adding #{addon['name'].downcase} to #{app}\") {}\n-      action(\"Setting #{addon['config_vars'].join(', ')} and restarting #{app}\") do\n+\n+      if addon.has_key? 'config_vars' && addon['config_vars']","path":"lib/ext/heroku/command/addons.rb","position":6,"original_position":6,"commit_id":"c9985b530d3f1a843f986f2d6d3506b7e28b4e5e","original_commit_id":"c9985b530d3f1a843f986f2d6d3506b7e28b4e5e","user":{"login":"bjeanes","id":2560,"avatar_url":"https://avatars.githubusercontent.com/u/2560?v=3","gravatar_id":"","url":"https://api.github.com/users/bjeanes","html_url":"https://github.com/bjeanes","followers_url":"https://api.github.com/users/bjeanes/followers","following_url":"https://api.github.com/users/bjeanes/following{/other_user}","gists_url":"https://api.github.com/users/bjeanes/gists{/gist_id}","starred_url":"https://api.github.com/users/bjeanes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjeanes/subscriptions","organizations_url":"https://api.github.com/users/bjeanes/orgs","repos_url":"https://api.github.com/users/bjeanes/repos","events_url":"https://api.github.com/users/bjeanes/events{/privacy}","received_events_url":"https://api.github.com/users/bjeanes/received_events","type":"User","site_admin":false},"body":"These all lose a check for the value being present (which [it will be](https://github.com/heroku/api/blob/f53c73994b7a116c97ef9f82830e253662bccc28/lib/api/serializers/addon_resource_serializer.rb#L12-L18)) vs being empty.\r\n\r\n`if !addon['config_vars'].empty?` should be sufficient, `if !addon.fetch('config_vars', []).empty?` if you really want to be defensive.\r\n\r\nIn any case, the `config_vars` portion of the *resource* representation shouldn't be used, as it only ever shows config vars on the billing app. It is circumstantially OK in this context because we're only creating the initial attachment (i.e. to the billing app), though.","created_at":"2015-02-19T00:30:28Z","updated_at":"2015-02-19T00:30:28Z","html_url":"https://github.com/heroku/heroku-addon-attachments/pull/27#discussion_r24956183","pull_request_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/comments/24956183"},"html":{"href":"https://github.com/heroku/heroku-addon-attachments/pull/27#discussion_r24956183"},"pull_request":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27","id":29533841,"html_url":"https://github.com/heroku/heroku-addon-attachments/pull/27","diff_url":"https://github.com/heroku/heroku-addon-attachments/pull/27.diff","patch_url":"https://github.com/heroku/heroku-addon-attachments/pull/27.patch","issue_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/27","number":27,"state":"open","locked":false,"title":"Don't show empty config vars list being set when add-on has no config vars","user":{"login":"mathias","id":3340,"avatar_url":"https://avatars.githubusercontent.com/u/3340?v=3","gravatar_id":"","url":"https://api.github.com/users/mathias","html_url":"https://github.com/mathias","followers_url":"https://api.github.com/users/mathias/followers","following_url":"https://api.github.com/users/mathias/following{/other_user}","gists_url":"https://api.github.com/users/mathias/gists{/gist_id}","starred_url":"https://api.github.com/users/mathias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathias/subscriptions","organizations_url":"https://api.github.com/users/mathias/orgs","repos_url":"https://api.github.com/users/mathias/repos","events_url":"https://api.github.com/users/mathias/events{/privacy}","received_events_url":"https://api.github.com/users/mathias/received_events","type":"User","site_admin":false},"body":"Fixes #22","created_at":"2015-02-18T15:27:01Z","updated_at":"2015-02-19T00:30:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37427d174e56f71fc8a53bc4dfdc37f57a45e7b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27/commits","review_comments_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27/comments","review_comment_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/comments/{number}","comments_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/27/comments","statuses_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/statuses/c9985b530d3f1a843f986f2d6d3506b7e28b4e5e","head":{"label":"heroku:mathias-not-all-addons-have-config-vars","ref":"mathias-not-all-addons-have-config-vars","sha":"c9985b530d3f1a843f986f2d6d3506b7e28b4e5e","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","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":23580955,"name":"heroku-addon-attachments","full_name":"heroku/heroku-addon-attachments","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","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-addon-attachments","description":"plugin to provide addon attachments functionality","fork":false,"url":"https://api.github.com/repos/heroku/heroku-addon-attachments","forks_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/forks","keys_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/events","assignees_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/comments/{number}","contents_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/merges","archive_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/releases{/id}","created_at":"2014-09-02T14:05:49Z","updated_at":"2015-02-12T02:06:47Z","pushed_at":"2015-02-18T15:26:44Z","git_url":"git://github.com/heroku/heroku-addon-attachments.git","ssh_url":"git@github.com:heroku/heroku-addon-attachments.git","clone_url":"https://github.com/heroku/heroku-addon-attachments.git","svn_url":"https://github.com/heroku/heroku-addon-attachments","homepage":"","size":601,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":5,"default_branch":"master"}},"base":{"label":"heroku:master","ref":"master","sha":"c1380d08f9738e26ee563d67ed5efcde10f44235","user":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","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":23580955,"name":"heroku-addon-attachments","full_name":"heroku/heroku-addon-attachments","owner":{"login":"heroku","id":23211,"avatar_url":"https://avatars.githubusercontent.com/u/23211?v=3","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-addon-attachments","description":"plugin to provide addon attachments functionality","fork":false,"url":"https://api.github.com/repos/heroku/heroku-addon-attachments","forks_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/forks","keys_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/events","assignees_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/comments/{number}","contents_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/merges","archive_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-addon-attachments/releases{/id}","created_at":"2014-09-02T14:05:49Z","updated_at":"2015-02-12T02:06:47Z","pushed_at":"2015-02-18T15:26:44Z","git_url":"git://github.com/heroku/heroku-addon-attachments.git","ssh_url":"git@github.com:heroku/heroku-addon-attachments.git","clone_url":"https://github.com/heroku/heroku-addon-attachments.git","svn_url":"https://github.com/heroku/heroku-addon-attachments","homepage":"","size":601,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27"},"html":{"href":"https://github.com/heroku/heroku-addon-attachments/pull/27"},"issue":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/27"},"comments":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/heroku/heroku-addon-attachments/statuses/c9985b530d3f1a843f986f2d6d3506b7e28b4e5e"}}}}