{"action":"created","comment":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/comments/31616516","id":31616516,"diff_hunk":"@@ -78,6 +103,31 @@ def codegen_targets(self):\n     \"\"\"\n     return self.context.targets(self.is_gentarget)\n \n+  @classmethod\n+  def _codegen_strategy_for_name(cls, name):\n+    return {\n+      'global': SimpleCodegenTask.GlobalCodegenStrategy,\n+      'isolated': SimpleCodegenTask.IsolatedCodegenStrategy,\n+    }[name]\n+\n+  @property\n+  def codegen_strategy(self):\n+    \"\"\"Returns the codegen strategy object used by this codegen.\n+\n+    This is controlled first by the forced_codegen_strategy property, then by user-specified\n+    options if the former returns None.\n+\n+    If you just want the name ('global' or 'isolated') of the strategy, use codegen_strategy.name.\n+\n+    :return SimpleCodegenTask.CodegenStrategy: the codegen strategy object.\n+    \"\"\"\n+    strategy = self.forced_codegen_strategy\n+    if strategy is None:\n+      strategy = self.get_options().strategy\n+    if self._codegen_strategy is None or self._codegen_strategy.name != strategy:","path":"src/python/pants/backend/codegen/tasks/simple_codegen_task.py","position":83,"original_position":83,"commit_id":"055ff666757b8bce54a2d1612df2833615a52ef1","original_commit_id":"055ff666757b8bce54a2d1612df2833615a52ef1","user":{"login":"ericzundel","id":119728,"avatar_url":"https://avatars.githubusercontent.com/u/119728?v=3","gravatar_id":"","url":"https://api.github.com/users/ericzundel","html_url":"https://github.com/ericzundel","followers_url":"https://api.github.com/users/ericzundel/followers","following_url":"https://api.github.com/users/ericzundel/following{/other_user}","gists_url":"https://api.github.com/users/ericzundel/gists{/gist_id}","starred_url":"https://api.github.com/users/ericzundel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericzundel/subscriptions","organizations_url":"https://api.github.com/users/ericzundel/orgs","repos_url":"https://api.github.com/users/ericzundel/repos","events_url":"https://api.github.com/users/ericzundel/events{/privacy}","received_events_url":"https://api.github.com/users/ericzundel/received_events","type":"User","site_admin":false},"body":"I don't think there's much point in memoizing the result of a dict lookup.  You could just dispense with the `self._codegen_strategy` field and simplify this method a lot.","created_at":"2015-06-03T12:16:27Z","updated_at":"2015-06-03T12:16:27Z","html_url":"https://github.com/pantsbuild/pants/pull/1609#discussion_r31616516","pull_request_url":"https://api.github.com/repos/pantsbuild/pants/pulls/1609","_links":{"self":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/comments/31616516"},"html":{"href":"https://github.com/pantsbuild/pants/pull/1609#discussion_r31616516"},"pull_request":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/1609"}}},"pull_request":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/1609","id":36537678,"html_url":"https://github.com/pantsbuild/pants/pull/1609","diff_url":"https://github.com/pantsbuild/pants/pull/1609.diff","patch_url":"https://github.com/pantsbuild/pants/pull/1609.patch","issue_url":"https://api.github.com/repos/pantsbuild/pants/issues/1609","number":1609,"state":"open","locked":false,"title":"Implemented isolated code-generation strategy for simple_codegen_task.","user":{"login":"gmalmquist","id":3391199,"avatar_url":"https://avatars.githubusercontent.com/u/3391199?v=3","gravatar_id":"","url":"https://api.github.com/users/gmalmquist","html_url":"https://github.com/gmalmquist","followers_url":"https://api.github.com/users/gmalmquist/followers","following_url":"https://api.github.com/users/gmalmquist/following{/other_user}","gists_url":"https://api.github.com/users/gmalmquist/gists{/gist_id}","starred_url":"https://api.github.com/users/gmalmquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmalmquist/subscriptions","organizations_url":"https://api.github.com/users/gmalmquist/orgs","repos_url":"https://api.github.com/users/gmalmquist/repos","events_url":"https://api.github.com/users/gmalmquist/events{/privacy}","received_events_url":"https://api.github.com/users/gmalmquist/received_events","type":"User","site_admin":false},"body":"Test-cases were added test test simple_code_gen, and integration tests for\r\nprotobuf and wire gen were updated to accomodate the modified file paths\r\ndue to the isolation strategy.","created_at":"2015-05-29T19:32:38Z","updated_at":"2015-06-03T12:16:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ca9a79c914de5d31fc97b4c08a8f6767a453957","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pantsbuild/pants/pulls/1609/commits","review_comments_url":"https://api.github.com/repos/pantsbuild/pants/pulls/1609/comments","review_comment_url":"https://api.github.com/repos/pantsbuild/pants/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pantsbuild/pants/issues/1609/comments","statuses_url":"https://api.github.com/repos/pantsbuild/pants/statuses/055ff666757b8bce54a2d1612df2833615a52ef1","head":{"label":"gmalmquist:gmalmquist/isolated-codegen-strategy","ref":"gmalmquist/isolated-codegen-strategy","sha":"055ff666757b8bce54a2d1612df2833615a52ef1","user":{"login":"gmalmquist","id":3391199,"avatar_url":"https://avatars.githubusercontent.com/u/3391199?v=3","gravatar_id":"","url":"https://api.github.com/users/gmalmquist","html_url":"https://github.com/gmalmquist","followers_url":"https://api.github.com/users/gmalmquist/followers","following_url":"https://api.github.com/users/gmalmquist/following{/other_user}","gists_url":"https://api.github.com/users/gmalmquist/gists{/gist_id}","starred_url":"https://api.github.com/users/gmalmquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmalmquist/subscriptions","organizations_url":"https://api.github.com/users/gmalmquist/orgs","repos_url":"https://api.github.com/users/gmalmquist/repos","events_url":"https://api.github.com/users/gmalmquist/events{/privacy}","received_events_url":"https://api.github.com/users/gmalmquist/received_events","type":"User","site_admin":false},"repo":{"id":35914751,"name":"pants","full_name":"gmalmquist/pants","owner":{"login":"gmalmquist","id":3391199,"avatar_url":"https://avatars.githubusercontent.com/u/3391199?v=3","gravatar_id":"","url":"https://api.github.com/users/gmalmquist","html_url":"https://github.com/gmalmquist","followers_url":"https://api.github.com/users/gmalmquist/followers","following_url":"https://api.github.com/users/gmalmquist/following{/other_user}","gists_url":"https://api.github.com/users/gmalmquist/gists{/gist_id}","starred_url":"https://api.github.com/users/gmalmquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmalmquist/subscriptions","organizations_url":"https://api.github.com/users/gmalmquist/orgs","repos_url":"https://api.github.com/users/gmalmquist/repos","events_url":"https://api.github.com/users/gmalmquist/events{/privacy}","received_events_url":"https://api.github.com/users/gmalmquist/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmalmquist/pants","description":"Pants Build System","fork":true,"url":"https://api.github.com/repos/gmalmquist/pants","forks_url":"https://api.github.com/repos/gmalmquist/pants/forks","keys_url":"https://api.github.com/repos/gmalmquist/pants/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmalmquist/pants/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmalmquist/pants/teams","hooks_url":"https://api.github.com/repos/gmalmquist/pants/hooks","issue_events_url":"https://api.github.com/repos/gmalmquist/pants/issues/events{/number}","events_url":"https://api.github.com/repos/gmalmquist/pants/events","assignees_url":"https://api.github.com/repos/gmalmquist/pants/assignees{/user}","branches_url":"https://api.github.com/repos/gmalmquist/pants/branches{/branch}","tags_url":"https://api.github.com/repos/gmalmquist/pants/tags","blobs_url":"https://api.github.com/repos/gmalmquist/pants/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmalmquist/pants/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmalmquist/pants/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmalmquist/pants/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmalmquist/pants/statuses/{sha}","languages_url":"https://api.github.com/repos/gmalmquist/pants/languages","stargazers_url":"https://api.github.com/repos/gmalmquist/pants/stargazers","contributors_url":"https://api.github.com/repos/gmalmquist/pants/contributors","subscribers_url":"https://api.github.com/repos/gmalmquist/pants/subscribers","subscription_url":"https://api.github.com/repos/gmalmquist/pants/subscription","commits_url":"https://api.github.com/repos/gmalmquist/pants/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmalmquist/pants/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmalmquist/pants/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmalmquist/pants/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmalmquist/pants/contents/{+path}","compare_url":"https://api.github.com/repos/gmalmquist/pants/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmalmquist/pants/merges","archive_url":"https://api.github.com/repos/gmalmquist/pants/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmalmquist/pants/downloads","issues_url":"https://api.github.com/repos/gmalmquist/pants/issues{/number}","pulls_url":"https://api.github.com/repos/gmalmquist/pants/pulls{/number}","milestones_url":"https://api.github.com/repos/gmalmquist/pants/milestones{/number}","notifications_url":"https://api.github.com/repos/gmalmquist/pants/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmalmquist/pants/labels{/name}","releases_url":"https://api.github.com/repos/gmalmquist/pants/releases{/id}","created_at":"2015-05-19T23:45:51Z","updated_at":"2015-05-19T23:45:54Z","pushed_at":"2015-06-02T21:23:11Z","git_url":"git://github.com/gmalmquist/pants.git","ssh_url":"git@github.com:gmalmquist/pants.git","clone_url":"https://github.com/gmalmquist/pants.git","svn_url":"https://github.com/gmalmquist/pants","homepage":"http://pantsbuild.github.io/","size":52967,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"pantsbuild:master","ref":"master","sha":"45b49e7e06998307a06c363bf9af95d999e6fc94","user":{"login":"pantsbuild","id":3065172,"avatar_url":"https://avatars.githubusercontent.com/u/3065172?v=3","gravatar_id":"","url":"https://api.github.com/users/pantsbuild","html_url":"https://github.com/pantsbuild","followers_url":"https://api.github.com/users/pantsbuild/followers","following_url":"https://api.github.com/users/pantsbuild/following{/other_user}","gists_url":"https://api.github.com/users/pantsbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/pantsbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pantsbuild/subscriptions","organizations_url":"https://api.github.com/users/pantsbuild/orgs","repos_url":"https://api.github.com/users/pantsbuild/repos","events_url":"https://api.github.com/users/pantsbuild/events{/privacy}","received_events_url":"https://api.github.com/users/pantsbuild/received_events","type":"Organization","site_admin":false},"repo":{"id":7209075,"name":"pants","full_name":"pantsbuild/pants","owner":{"login":"pantsbuild","id":3065172,"avatar_url":"https://avatars.githubusercontent.com/u/3065172?v=3","gravatar_id":"","url":"https://api.github.com/users/pantsbuild","html_url":"https://github.com/pantsbuild","followers_url":"https://api.github.com/users/pantsbuild/followers","following_url":"https://api.github.com/users/pantsbuild/following{/other_user}","gists_url":"https://api.github.com/users/pantsbuild/gists{/gist_id}","starred_url":"https://api.github.com/users/pantsbuild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pantsbuild/subscriptions","organizations_url":"https://api.github.com/users/pantsbuild/orgs","repos_url":"https://api.github.com/users/pantsbuild/repos","events_url":"https://api.github.com/users/pantsbuild/events{/privacy}","received_events_url":"https://api.github.com/users/pantsbuild/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pantsbuild/pants","description":"Pants Build System","fork":false,"url":"https://api.github.com/repos/pantsbuild/pants","forks_url":"https://api.github.com/repos/pantsbuild/pants/forks","keys_url":"https://api.github.com/repos/pantsbuild/pants/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pantsbuild/pants/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pantsbuild/pants/teams","hooks_url":"https://api.github.com/repos/pantsbuild/pants/hooks","issue_events_url":"https://api.github.com/repos/pantsbuild/pants/issues/events{/number}","events_url":"https://api.github.com/repos/pantsbuild/pants/events","assignees_url":"https://api.github.com/repos/pantsbuild/pants/assignees{/user}","branches_url":"https://api.github.com/repos/pantsbuild/pants/branches{/branch}","tags_url":"https://api.github.com/repos/pantsbuild/pants/tags","blobs_url":"https://api.github.com/repos/pantsbuild/pants/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pantsbuild/pants/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pantsbuild/pants/git/refs{/sha}","trees_url":"https://api.github.com/repos/pantsbuild/pants/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pantsbuild/pants/statuses/{sha}","languages_url":"https://api.github.com/repos/pantsbuild/pants/languages","stargazers_url":"https://api.github.com/repos/pantsbuild/pants/stargazers","contributors_url":"https://api.github.com/repos/pantsbuild/pants/contributors","subscribers_url":"https://api.github.com/repos/pantsbuild/pants/subscribers","subscription_url":"https://api.github.com/repos/pantsbuild/pants/subscription","commits_url":"https://api.github.com/repos/pantsbuild/pants/commits{/sha}","git_commits_url":"https://api.github.com/repos/pantsbuild/pants/git/commits{/sha}","comments_url":"https://api.github.com/repos/pantsbuild/pants/comments{/number}","issue_comment_url":"https://api.github.com/repos/pantsbuild/pants/issues/comments{/number}","contents_url":"https://api.github.com/repos/pantsbuild/pants/contents/{+path}","compare_url":"https://api.github.com/repos/pantsbuild/pants/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pantsbuild/pants/merges","archive_url":"https://api.github.com/repos/pantsbuild/pants/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pantsbuild/pants/downloads","issues_url":"https://api.github.com/repos/pantsbuild/pants/issues{/number}","pulls_url":"https://api.github.com/repos/pantsbuild/pants/pulls{/number}","milestones_url":"https://api.github.com/repos/pantsbuild/pants/milestones{/number}","notifications_url":"https://api.github.com/repos/pantsbuild/pants/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pantsbuild/pants/labels{/name}","releases_url":"https://api.github.com/repos/pantsbuild/pants/releases{/id}","created_at":"2012-12-17T17:39:04Z","updated_at":"2015-05-26T07:41:51Z","pushed_at":"2015-06-03T11:59:03Z","git_url":"git://github.com/pantsbuild/pants.git","ssh_url":"git@github.com:pantsbuild/pants.git","clone_url":"https://github.com/pantsbuild/pants.git","svn_url":"https://github.com/pantsbuild/pants","homepage":"http://pantsbuild.github.io/","size":76767,"stargazers_count":363,"watchers_count":363,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":258,"forks":92,"open_issues":258,"watchers":363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/1609"},"html":{"href":"https://github.com/pantsbuild/pants/pull/1609"},"issue":{"href":"https://api.github.com/repos/pantsbuild/pants/issues/1609"},"comments":{"href":"https://api.github.com/repos/pantsbuild/pants/issues/1609/comments"},"review_comments":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/1609/comments"},"review_comment":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/1609/commits"},"statuses":{"href":"https://api.github.com/repos/pantsbuild/pants/statuses/055ff666757b8bce54a2d1612df2833615a52ef1"}}}}