{"action":"created","comment":{"url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments/42094335","id":42094335,"diff_hunk":"@@ -72,16 +57,13 @@ public String getBrooklynType(String serviceType) {\n         String imageName = Iterables.get(parts, 0);\n         String imageTag = Iterables.get(parts, 1, \"latest\");\n         log.debug(\"Creating Docker service entity with image {} and tag {}\", imageName, imageTag);\n+\n+        EntitySpec<VanillaDockerApplication> spec = EntitySpec.create(VanillaDockerApplication.class);\n         spec.configure(DockerAttributes.DOCKER_IMAGE_NAME, imageName);\n         if (parts.size() == 2) {\n             spec.configure(DockerAttributes.DOCKER_IMAGE_TAG, imageTag);\n         }\n-        if (resolver.getAttrs().containsKey(\"id\")) {","path":"docker/src/main/java/brooklyn/entity/container/docker/application/DockerServiceTypeResolver.java","position":74,"original_position":74,"commit_id":"e63ce5afd942edd6c8a46d28cf4d5004abbc4f1c","original_commit_id":"e63ce5afd942edd6c8a46d28cf4d5004abbc4f1c","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"body":"Leaving out the attributes makes the resolvers independent of the parser using them. It's up to the parser to decide how to configure the EntitySpec based on the plan. We can still add them if there's a good reason, but in this particular case (and all other usages) it's not needed. The logic already in place in [`DockerUtils.getContainerName`](https://github.com/brooklyncentral/clocker/blob/master/docker/src/main/java/brooklyn/entity/container/DockerUtils.java#L169) will still populate `DOCKER_CONTAINER_NAME` from `BrooklynCampConstants.PLAN_ID` (which is `id` attribute) so the existing behaviour is preserved.","created_at":"2015-10-15T08:17:04Z","updated_at":"2015-10-15T08:17:04Z","html_url":"https://github.com/brooklyncentral/clocker/pull/178#discussion_r42094335","pull_request_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments/42094335"},"html":{"href":"https://github.com/brooklyncentral/clocker/pull/178#discussion_r42094335"},"pull_request":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178","id":47678005,"html_url":"https://github.com/brooklyncentral/clocker/pull/178","diff_url":"https://github.com/brooklyncentral/clocker/pull/178.diff","patch_url":"https://github.com/brooklyncentral/clocker/pull/178.patch","issue_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/178","number":178,"state":"open","locked":false,"title":"Move away from the deprecated ServiceTypeResolver","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"body":"The changes in https://github.com/apache/incubator-brooklyn/pull/955 deprecate `ServiceTypeResolver` in favour of ServiceSpecResolver, BrooklynServiceTypeResolver is replaced by AbstractServiceSpecResolver. Update the code correspondingly.\r\n\r\nThe existing implementation will continue to work after the brooklyn PR is merged - there's a fallback for the deprecated interface.","created_at":"2015-10-14T15:53:15Z","updated_at":"2015-10-15T08:17:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24b2c9fbd28f6cd955a3011b94b06d6ab34c413e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178/commits","review_comments_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178/comments","review_comment_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/178/comments","statuses_url":"https://api.github.com/repos/brooklyncentral/clocker/statuses/e63ce5afd942edd6c8a46d28cf4d5004abbc4f1c","head":{"label":"neykov:servicespecresolver","ref":"servicespecresolver","sha":"e63ce5afd942edd6c8a46d28cf4d5004abbc4f1c","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"repo":{"id":28186888,"name":"clocker","full_name":"neykov/clocker","owner":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neykov/clocker","description":"Brooklyn managed Docker containers","fork":true,"url":"https://api.github.com/repos/neykov/clocker","forks_url":"https://api.github.com/repos/neykov/clocker/forks","keys_url":"https://api.github.com/repos/neykov/clocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neykov/clocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neykov/clocker/teams","hooks_url":"https://api.github.com/repos/neykov/clocker/hooks","issue_events_url":"https://api.github.com/repos/neykov/clocker/issues/events{/number}","events_url":"https://api.github.com/repos/neykov/clocker/events","assignees_url":"https://api.github.com/repos/neykov/clocker/assignees{/user}","branches_url":"https://api.github.com/repos/neykov/clocker/branches{/branch}","tags_url":"https://api.github.com/repos/neykov/clocker/tags","blobs_url":"https://api.github.com/repos/neykov/clocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neykov/clocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neykov/clocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/neykov/clocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neykov/clocker/statuses/{sha}","languages_url":"https://api.github.com/repos/neykov/clocker/languages","stargazers_url":"https://api.github.com/repos/neykov/clocker/stargazers","contributors_url":"https://api.github.com/repos/neykov/clocker/contributors","subscribers_url":"https://api.github.com/repos/neykov/clocker/subscribers","subscription_url":"https://api.github.com/repos/neykov/clocker/subscription","commits_url":"https://api.github.com/repos/neykov/clocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/neykov/clocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/neykov/clocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/neykov/clocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/neykov/clocker/contents/{+path}","compare_url":"https://api.github.com/repos/neykov/clocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neykov/clocker/merges","archive_url":"https://api.github.com/repos/neykov/clocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neykov/clocker/downloads","issues_url":"https://api.github.com/repos/neykov/clocker/issues{/number}","pulls_url":"https://api.github.com/repos/neykov/clocker/pulls{/number}","milestones_url":"https://api.github.com/repos/neykov/clocker/milestones{/number}","notifications_url":"https://api.github.com/repos/neykov/clocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neykov/clocker/labels{/name}","releases_url":"https://api.github.com/repos/neykov/clocker/releases{/id}","created_at":"2014-12-18T14:33:14Z","updated_at":"2014-12-18T15:16:06Z","pushed_at":"2015-10-14T15:51:17Z","git_url":"git://github.com/neykov/clocker.git","ssh_url":"git@github.com:neykov/clocker.git","clone_url":"https://github.com/neykov/clocker.git","svn_url":"https://github.com/neykov/clocker","homepage":null,"size":2464,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"brooklyncentral:master","ref":"master","sha":"fa5bff704ac3ec488be47928393048deff9d0e5f","user":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"repo":{"id":17784299,"name":"clocker","full_name":"brooklyncentral/clocker","owner":{"login":"brooklyncentral","id":1587357,"avatar_url":"https://avatars.githubusercontent.com/u/1587357?v=3","gravatar_id":"","url":"https://api.github.com/users/brooklyncentral","html_url":"https://github.com/brooklyncentral","followers_url":"https://api.github.com/users/brooklyncentral/followers","following_url":"https://api.github.com/users/brooklyncentral/following{/other_user}","gists_url":"https://api.github.com/users/brooklyncentral/gists{/gist_id}","starred_url":"https://api.github.com/users/brooklyncentral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooklyncentral/subscriptions","organizations_url":"https://api.github.com/users/brooklyncentral/orgs","repos_url":"https://api.github.com/users/brooklyncentral/repos","events_url":"https://api.github.com/users/brooklyncentral/events{/privacy}","received_events_url":"https://api.github.com/users/brooklyncentral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brooklyncentral/clocker","description":"Brooklyn managed Docker containers","fork":false,"url":"https://api.github.com/repos/brooklyncentral/clocker","forks_url":"https://api.github.com/repos/brooklyncentral/clocker/forks","keys_url":"https://api.github.com/repos/brooklyncentral/clocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brooklyncentral/clocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brooklyncentral/clocker/teams","hooks_url":"https://api.github.com/repos/brooklyncentral/clocker/hooks","issue_events_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/events{/number}","events_url":"https://api.github.com/repos/brooklyncentral/clocker/events","assignees_url":"https://api.github.com/repos/brooklyncentral/clocker/assignees{/user}","branches_url":"https://api.github.com/repos/brooklyncentral/clocker/branches{/branch}","tags_url":"https://api.github.com/repos/brooklyncentral/clocker/tags","blobs_url":"https://api.github.com/repos/brooklyncentral/clocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brooklyncentral/clocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brooklyncentral/clocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/brooklyncentral/clocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brooklyncentral/clocker/statuses/{sha}","languages_url":"https://api.github.com/repos/brooklyncentral/clocker/languages","stargazers_url":"https://api.github.com/repos/brooklyncentral/clocker/stargazers","contributors_url":"https://api.github.com/repos/brooklyncentral/clocker/contributors","subscribers_url":"https://api.github.com/repos/brooklyncentral/clocker/subscribers","subscription_url":"https://api.github.com/repos/brooklyncentral/clocker/subscription","commits_url":"https://api.github.com/repos/brooklyncentral/clocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/brooklyncentral/clocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/brooklyncentral/clocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/brooklyncentral/clocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/brooklyncentral/clocker/contents/{+path}","compare_url":"https://api.github.com/repos/brooklyncentral/clocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brooklyncentral/clocker/merges","archive_url":"https://api.github.com/repos/brooklyncentral/clocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brooklyncentral/clocker/downloads","issues_url":"https://api.github.com/repos/brooklyncentral/clocker/issues{/number}","pulls_url":"https://api.github.com/repos/brooklyncentral/clocker/pulls{/number}","milestones_url":"https://api.github.com/repos/brooklyncentral/clocker/milestones{/number}","notifications_url":"https://api.github.com/repos/brooklyncentral/clocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brooklyncentral/clocker/labels{/name}","releases_url":"https://api.github.com/repos/brooklyncentral/clocker/releases{/id}","created_at":"2014-03-15T20:03:57Z","updated_at":"2015-10-14T23:29:31Z","pushed_at":"2015-10-14T15:53:15Z","git_url":"git://github.com/brooklyncentral/clocker.git","ssh_url":"git@github.com:brooklyncentral/clocker.git","clone_url":"https://github.com/brooklyncentral/clocker.git","svn_url":"https://github.com/brooklyncentral/clocker","homepage":null,"size":9009,"stargazers_count":356,"watchers_count":356,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":35,"forks":49,"open_issues":35,"watchers":356,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178"},"html":{"href":"https://github.com/brooklyncentral/clocker/pull/178"},"issue":{"href":"https://api.github.com/repos/brooklyncentral/clocker/issues/178"},"comments":{"href":"https://api.github.com/repos/brooklyncentral/clocker/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brooklyncentral/clocker/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/brooklyncentral/clocker/statuses/e63ce5afd942edd6c8a46d28cf4d5004abbc4f1c"}}}}