{"action":"created","comment":{"url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/comments/75772822","id":75772822,"diff_hunk":"@@ -51,6 +55,49 @@ AmiSet.listAmiSets = async function () {\n };\n \n /**\n+ * Checks if the AMIs from the amiSet are valid or not.\n+ */\n+\n+async function checkAmi(ctx, region, ami, vtype) {","path":"src/ami-set.js","position":30,"original_position":23,"commit_id":"0ced5001ffbbfabdede63d5f280d5be1f2154171","original_commit_id":"0ced5001ffbbfabdede63d5f280d5be1f2154171","user":{"login":"jhford","id":607353,"avatar_url":"https://avatars.githubusercontent.com/u/607353?v=3","gravatar_id":"","url":"https://api.github.com/users/jhford","html_url":"https://github.com/jhford","followers_url":"https://api.github.com/users/jhford/followers","following_url":"https://api.github.com/users/jhford/following{/other_user}","gists_url":"https://api.github.com/users/jhford/gists{/gist_id}","starred_url":"https://api.github.com/users/jhford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhford/subscriptions","organizations_url":"https://api.github.com/users/jhford/orgs","repos_url":"https://api.github.com/users/jhford/repos","events_url":"https://api.github.com/users/jhford/events{/privacy}","received_events_url":"https://api.github.com/users/jhford/received_events","type":"User","site_admin":false},"body":"Actually, I see why you're doing it now.  It's similar to the `createLaunchSpec` method, since we have to have a non-instance method for doing the check before creating and modifying, and Constructor methods as I suggested wouldn't have access to context.  I think that doing the following would match what we have elsewhere:\r\n\r\n```javascript\r\n//Helper method\r\nAmiSet.__checkAmi = function (region, ami, vtype, ec2) { } \r\n\r\n// A constructor method available\r\nAmiSet.validate = function (region, ami, vtype, ec2) { } \r\n\r\n// An instance copy\r\nAmiSet.prototype.validate = function (region, ami, vtype) {\r\n  return AmiSet.validate(region, ami, vtype, this.ec2);\r\n} \r\n\r\n```","created_at":"2016-08-22T22:43:08Z","updated_at":"2016-08-22T22:43:08Z","html_url":"https://github.com/taskcluster/aws-provisioner/pull/113#discussion_r75772822","pull_request_url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/comments/75772822"},"html":{"href":"https://github.com/taskcluster/aws-provisioner/pull/113#discussion_r75772822"},"pull_request":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113","id":82213496,"html_url":"https://github.com/taskcluster/aws-provisioner/pull/113","diff_url":"https://github.com/taskcluster/aws-provisioner/pull/113.diff","patch_url":"https://github.com/taskcluster/aws-provisioner/pull/113.patch","issue_url":"https://api.github.com/repos/taskcluster/aws-provisioner/issues/113","number":113,"state":"open","locked":false,"title":"Add AMIs validation to AmiSets endpoints","user":{"login":"anarute","id":333447,"avatar_url":"https://avatars.githubusercontent.com/u/333447?v=3","gravatar_id":"","url":"https://api.github.com/users/anarute","html_url":"https://github.com/anarute","followers_url":"https://api.github.com/users/anarute/followers","following_url":"https://api.github.com/users/anarute/following{/other_user}","gists_url":"https://api.github.com/users/anarute/gists{/gist_id}","starred_url":"https://api.github.com/users/anarute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anarute/subscriptions","organizations_url":"https://api.github.com/users/anarute/orgs","repos_url":"https://api.github.com/users/anarute/repos","events_url":"https://api.github.com/users/anarute/events{/privacy}","received_events_url":"https://api.github.com/users/anarute/received_events","type":"User","site_admin":false},"body":"Create `Amiset.validate()` function that is called on create and update endpoints and will be used before applying an AmiSet to a WorkerType in the AmiSet management tool. \r\nThis function checks if all AMIs from a given AmiSet are valid and if they are stored with the right virtualization type - this validation is done using the new method called `getVirtualizationType()`.","created_at":"2016-08-22T15:37:52Z","updated_at":"2016-08-22T22:43:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67bf7fd4f44b9c00ee941102b69fc1ac92fa914c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113/commits","review_comments_url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113/comments","review_comment_url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/aws-provisioner/issues/113/comments","statuses_url":"https://api.github.com/repos/taskcluster/aws-provisioner/statuses/0ced5001ffbbfabdede63d5f280d5be1f2154171","head":{"label":"anarute:apply-ami-sets","ref":"apply-ami-sets","sha":"0ced5001ffbbfabdede63d5f280d5be1f2154171","user":{"login":"anarute","id":333447,"avatar_url":"https://avatars.githubusercontent.com/u/333447?v=3","gravatar_id":"","url":"https://api.github.com/users/anarute","html_url":"https://github.com/anarute","followers_url":"https://api.github.com/users/anarute/followers","following_url":"https://api.github.com/users/anarute/following{/other_user}","gists_url":"https://api.github.com/users/anarute/gists{/gist_id}","starred_url":"https://api.github.com/users/anarute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anarute/subscriptions","organizations_url":"https://api.github.com/users/anarute/orgs","repos_url":"https://api.github.com/users/anarute/repos","events_url":"https://api.github.com/users/anarute/events{/privacy}","received_events_url":"https://api.github.com/users/anarute/received_events","type":"User","site_admin":false},"repo":{"id":60178660,"name":"aws-provisioner","full_name":"anarute/aws-provisioner","owner":{"login":"anarute","id":333447,"avatar_url":"https://avatars.githubusercontent.com/u/333447?v=3","gravatar_id":"","url":"https://api.github.com/users/anarute","html_url":"https://github.com/anarute","followers_url":"https://api.github.com/users/anarute/followers","following_url":"https://api.github.com/users/anarute/following{/other_user}","gists_url":"https://api.github.com/users/anarute/gists{/gist_id}","starred_url":"https://api.github.com/users/anarute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anarute/subscriptions","organizations_url":"https://api.github.com/users/anarute/orgs","repos_url":"https://api.github.com/users/anarute/repos","events_url":"https://api.github.com/users/anarute/events{/privacy}","received_events_url":"https://api.github.com/users/anarute/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anarute/aws-provisioner","description":"AWS Provisioner for the TaskCluster","fork":true,"url":"https://api.github.com/repos/anarute/aws-provisioner","forks_url":"https://api.github.com/repos/anarute/aws-provisioner/forks","keys_url":"https://api.github.com/repos/anarute/aws-provisioner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anarute/aws-provisioner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anarute/aws-provisioner/teams","hooks_url":"https://api.github.com/repos/anarute/aws-provisioner/hooks","issue_events_url":"https://api.github.com/repos/anarute/aws-provisioner/issues/events{/number}","events_url":"https://api.github.com/repos/anarute/aws-provisioner/events","assignees_url":"https://api.github.com/repos/anarute/aws-provisioner/assignees{/user}","branches_url":"https://api.github.com/repos/anarute/aws-provisioner/branches{/branch}","tags_url":"https://api.github.com/repos/anarute/aws-provisioner/tags","blobs_url":"https://api.github.com/repos/anarute/aws-provisioner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anarute/aws-provisioner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anarute/aws-provisioner/git/refs{/sha}","trees_url":"https://api.github.com/repos/anarute/aws-provisioner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anarute/aws-provisioner/statuses/{sha}","languages_url":"https://api.github.com/repos/anarute/aws-provisioner/languages","stargazers_url":"https://api.github.com/repos/anarute/aws-provisioner/stargazers","contributors_url":"https://api.github.com/repos/anarute/aws-provisioner/contributors","subscribers_url":"https://api.github.com/repos/anarute/aws-provisioner/subscribers","subscription_url":"https://api.github.com/repos/anarute/aws-provisioner/subscription","commits_url":"https://api.github.com/repos/anarute/aws-provisioner/commits{/sha}","git_commits_url":"https://api.github.com/repos/anarute/aws-provisioner/git/commits{/sha}","comments_url":"https://api.github.com/repos/anarute/aws-provisioner/comments{/number}","issue_comment_url":"https://api.github.com/repos/anarute/aws-provisioner/issues/comments{/number}","contents_url":"https://api.github.com/repos/anarute/aws-provisioner/contents/{+path}","compare_url":"https://api.github.com/repos/anarute/aws-provisioner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anarute/aws-provisioner/merges","archive_url":"https://api.github.com/repos/anarute/aws-provisioner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anarute/aws-provisioner/downloads","issues_url":"https://api.github.com/repos/anarute/aws-provisioner/issues{/number}","pulls_url":"https://api.github.com/repos/anarute/aws-provisioner/pulls{/number}","milestones_url":"https://api.github.com/repos/anarute/aws-provisioner/milestones{/number}","notifications_url":"https://api.github.com/repos/anarute/aws-provisioner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anarute/aws-provisioner/labels{/name}","releases_url":"https://api.github.com/repos/anarute/aws-provisioner/releases{/id}","deployments_url":"https://api.github.com/repos/anarute/aws-provisioner/deployments","created_at":"2016-06-01T13:20:14Z","updated_at":"2016-06-01T13:20:15Z","pushed_at":"2016-08-22T15:29:00Z","git_url":"git://github.com/anarute/aws-provisioner.git","ssh_url":"git@github.com:anarute/aws-provisioner.git","clone_url":"https://github.com/anarute/aws-provisioner.git","svn_url":"https://github.com/anarute/aws-provisioner","homepage":null,"size":11676,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"taskcluster:master","ref":"master","sha":"4b9dc6e6a650fffd184be29c87609e741de93a92","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":16123958,"name":"aws-provisioner","full_name":"taskcluster/aws-provisioner","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/aws-provisioner","description":"AWS Provisioner for the TaskCluster","fork":false,"url":"https://api.github.com/repos/taskcluster/aws-provisioner","forks_url":"https://api.github.com/repos/taskcluster/aws-provisioner/forks","keys_url":"https://api.github.com/repos/taskcluster/aws-provisioner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/aws-provisioner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/aws-provisioner/teams","hooks_url":"https://api.github.com/repos/taskcluster/aws-provisioner/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/aws-provisioner/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/aws-provisioner/events","assignees_url":"https://api.github.com/repos/taskcluster/aws-provisioner/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/aws-provisioner/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/aws-provisioner/tags","blobs_url":"https://api.github.com/repos/taskcluster/aws-provisioner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/aws-provisioner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/aws-provisioner/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/aws-provisioner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/aws-provisioner/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/aws-provisioner/languages","stargazers_url":"https://api.github.com/repos/taskcluster/aws-provisioner/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/aws-provisioner/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/aws-provisioner/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/aws-provisioner/subscription","commits_url":"https://api.github.com/repos/taskcluster/aws-provisioner/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/aws-provisioner/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/aws-provisioner/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/aws-provisioner/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/aws-provisioner/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/aws-provisioner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/aws-provisioner/merges","archive_url":"https://api.github.com/repos/taskcluster/aws-provisioner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/aws-provisioner/downloads","issues_url":"https://api.github.com/repos/taskcluster/aws-provisioner/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/aws-provisioner/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/aws-provisioner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/aws-provisioner/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/aws-provisioner/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/aws-provisioner/deployments","created_at":"2014-01-22T00:44:52Z","updated_at":"2016-05-30T20:56:35Z","pushed_at":"2016-08-22T22:12:23Z","git_url":"git://github.com/taskcluster/aws-provisioner.git","ssh_url":"git@github.com:taskcluster/aws-provisioner.git","clone_url":"https://github.com/taskcluster/aws-provisioner.git","svn_url":"https://github.com/taskcluster/aws-provisioner","homepage":null,"size":11967,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":10,"forks":8,"open_issues":10,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113"},"html":{"href":"https://github.com/taskcluster/aws-provisioner/pull/113"},"issue":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/issues/113"},"comments":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/aws-provisioner/statuses/0ced5001ffbbfabdede63d5f280d5be1f2154171"}}}}
{"actor":{"display_login":"jhford"}}