{"action":"created","comment":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/comments/225266695","pull_request_review_id":164832728,"id":225266695,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTI2NjY5NQ==","diff_hunk":"@@ -134,23 +134,47 @@ def resolve_target(self, node_task, target, results_dir, node_paths, resolve_loc\n           raise TaskError('Failed to resolve dependencies for {}:\\n\\t{} failed with exit code {}'\n                           .format(target.address.reference(), command, result))\n         if source_deps:\n-          self._link_source_dependencies(target, results_dir, node_paths, source_deps)\n-\n-  def _link_source_dependencies(self, target, results_dir, node_paths, source_deps):\n+          self._link_source_dependencies(node_task, target, results_dir, node_paths, source_deps)\n \n+  def _link_source_dependencies(self, node_task, target, results_dir, node_paths, source_deps):\n     for package_name, file_path in source_deps.items():\n       # Package name should always the same as the target name\n       dep = self._get_target_from_package_name(target, package_name, file_path)\n+\n+      # Apply node-scoping rules if applicable\n+      node_scope = dep.payload.node_scope or node_task.node_distribution.node_scope","path":"contrib/node/src/python/pants/contrib/node/subsystems/resolvers/npm_resolver.py","position":15,"original_position":15,"commit_id":"e6bd7aa2768487396d406a3c6329721f6d057e54","original_commit_id":"e6bd7aa2768487396d406a3c6329721f6d057e54","user":{"login":"nsaechao","id":19673210,"node_id":"MDQ6VXNlcjE5NjczMjEw","avatar_url":"https://avatars3.githubusercontent.com/u/19673210?v=4","gravatar_id":"","url":"https://api.github.com/users/nsaechao","html_url":"https://github.com/nsaechao","followers_url":"https://api.github.com/users/nsaechao/followers","following_url":"https://api.github.com/users/nsaechao/following{/other_user}","gists_url":"https://api.github.com/users/nsaechao/gists{/gist_id}","starred_url":"https://api.github.com/users/nsaechao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsaechao/subscriptions","organizations_url":"https://api.github.com/users/nsaechao/orgs","repos_url":"https://api.github.com/users/nsaechao/repos","events_url":"https://api.github.com/users/nsaechao/events{/privacy}","received_events_url":"https://api.github.com/users/nsaechao/received_events","type":"User","site_admin":false},"body":"I'll need to look into why we scope NodeDistribution at the task-level, but it does seem more reasonable to have it at the global level. I believe this may stem from some old history to support multiple versions of Node.js within the same repo. ","created_at":"2018-10-15T18:15:37Z","updated_at":"2018-10-15T18:15:37Z","html_url":"https://github.com/pantsbuild/pants/pull/6616#discussion_r225266695","pull_request_url":"https://api.github.com/repos/pantsbuild/pants/pulls/6616","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/comments/225266695"},"html":{"href":"https://github.com/pantsbuild/pants/pull/6616#discussion_r225266695"},"pull_request":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/6616"}},"in_reply_to_id":225251822},"pull_request":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/6616","id":221924364,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxOTI0MzY0","html_url":"https://github.com/pantsbuild/pants/pull/6616","diff_url":"https://github.com/pantsbuild/pants/pull/6616.diff","patch_url":"https://github.com/pantsbuild/pants/pull/6616.patch","issue_url":"https://api.github.com/repos/pantsbuild/pants/issues/6616","number":6616,"state":"open","locked":false,"title":"Add a node_scope option to node_module targets to support package-scopes","user":{"login":"nsaechao","id":19673210,"node_id":"MDQ6VXNlcjE5NjczMjEw","avatar_url":"https://avatars3.githubusercontent.com/u/19673210?v=4","gravatar_id":"","url":"https://api.github.com/users/nsaechao","html_url":"https://github.com/nsaechao","followers_url":"https://api.github.com/users/nsaechao/followers","following_url":"https://api.github.com/users/nsaechao/following{/other_user}","gists_url":"https://api.github.com/users/nsaechao/gists{/gist_id}","starred_url":"https://api.github.com/users/nsaechao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsaechao/subscriptions","organizations_url":"https://api.github.com/users/nsaechao/orgs","repos_url":"https://api.github.com/users/nsaechao/repos","events_url":"https://api.github.com/users/nsaechao/events{/privacy}","received_events_url":"https://api.github.com/users/nsaechao/received_events","type":"User","site_admin":false},"body":"This is the implementation of #6540.\r\n\r\n### Problem\r\nPants source-level dependencies for Node.js targets does not support [node-scopes](https://docs.npmjs.com/misc/scope).\r\n\r\n### Solution\r\nAdd a `node_scope` config to `node_module` targets and a repo-level `node_scope` to `node-distribution`.\r\n\r\n### Result\r\nThe repo-owner may specify a target-level and/or global node-scope that will resolve all Node.js source-level dependencies under the correct node-scope rules.\r\n\r\nFor example, if you have a target dependency on **src/node/pants/custom/web-package:web-package** with a package name of `web-package`, the installed path under the `node_modules` directory would be `*/node_modules/web-package`.\r\n\r\nIf a node_scope=pants is defined for `src/node/pants/custom/web-package:web-package`. Then the installed directory would be `*/node_modules/@pants/web-package`.\r\n\r\nTarget-level `node_scope` overrides repo-level `node_scope`.\r\n\r\n### Defining scope in package.json\r\n\r\nWhen dep inference is ready, a potential update to this implementation is to be able to infer the node_scope from the name defined in package.json.\r\n","created_at":"2018-10-10T20:35:08Z","updated_at":"2018-10-15T18:15:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34b197025a5bbe47c552959374ffa863ebbe431d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/pantsbuild/pants/milestones/19","html_url":"https://github.com/pantsbuild/pants/milestone/19","labels_url":"https://api.github.com/repos/pantsbuild/pants/milestones/19/labels","id":3740577,"node_id":"MDk6TWlsZXN0b25lMzc0MDU3Nw==","number":19,"title":"1.11.x","description":"","creator":{"login":"stuhood","id":46740,"node_id":"MDQ6VXNlcjQ2NzQw","avatar_url":"https://avatars1.githubusercontent.com/u/46740?v=4","gravatar_id":"","url":"https://api.github.com/users/stuhood","html_url":"https://github.com/stuhood","followers_url":"https://api.github.com/users/stuhood/followers","following_url":"https://api.github.com/users/stuhood/following{/other_user}","gists_url":"https://api.github.com/users/stuhood/gists{/gist_id}","starred_url":"https://api.github.com/users/stuhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuhood/subscriptions","organizations_url":"https://api.github.com/users/stuhood/orgs","repos_url":"https://api.github.com/users/stuhood/repos","events_url":"https://api.github.com/users/stuhood/events{/privacy}","received_events_url":"https://api.github.com/users/stuhood/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2018-10-15T17:35:25Z","updated_at":"2018-10-15T17:35:33Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/pantsbuild/pants/pulls/6616/commits","review_comments_url":"https://api.github.com/repos/pantsbuild/pants/pulls/6616/comments","review_comment_url":"https://api.github.com/repos/pantsbuild/pants/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pantsbuild/pants/issues/6616/comments","statuses_url":"https://api.github.com/repos/pantsbuild/pants/statuses/e6bd7aa2768487396d406a3c6329721f6d057e54","head":{"label":"nsaechao:nsaechao/issue-6540_add_node_scope","ref":"nsaechao/issue-6540_add_node_scope","sha":"e6bd7aa2768487396d406a3c6329721f6d057e54","user":{"login":"nsaechao","id":19673210,"node_id":"MDQ6VXNlcjE5NjczMjEw","avatar_url":"https://avatars3.githubusercontent.com/u/19673210?v=4","gravatar_id":"","url":"https://api.github.com/users/nsaechao","html_url":"https://github.com/nsaechao","followers_url":"https://api.github.com/users/nsaechao/followers","following_url":"https://api.github.com/users/nsaechao/following{/other_user}","gists_url":"https://api.github.com/users/nsaechao/gists{/gist_id}","starred_url":"https://api.github.com/users/nsaechao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsaechao/subscriptions","organizations_url":"https://api.github.com/users/nsaechao/orgs","repos_url":"https://api.github.com/users/nsaechao/repos","events_url":"https://api.github.com/users/nsaechao/events{/privacy}","received_events_url":"https://api.github.com/users/nsaechao/received_events","type":"User","site_admin":false},"repo":{"id":66316042,"node_id":"MDEwOlJlcG9zaXRvcnk2NjMxNjA0Mg==","name":"pants","full_name":"nsaechao/pants","private":false,"owner":{"login":"nsaechao","id":19673210,"node_id":"MDQ6VXNlcjE5NjczMjEw","avatar_url":"https://avatars3.githubusercontent.com/u/19673210?v=4","gravatar_id":"","url":"https://api.github.com/users/nsaechao","html_url":"https://github.com/nsaechao","followers_url":"https://api.github.com/users/nsaechao/followers","following_url":"https://api.github.com/users/nsaechao/following{/other_user}","gists_url":"https://api.github.com/users/nsaechao/gists{/gist_id}","starred_url":"https://api.github.com/users/nsaechao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsaechao/subscriptions","organizations_url":"https://api.github.com/users/nsaechao/orgs","repos_url":"https://api.github.com/users/nsaechao/repos","events_url":"https://api.github.com/users/nsaechao/events{/privacy}","received_events_url":"https://api.github.com/users/nsaechao/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nsaechao/pants","description":"Pants Build System","fork":true,"url":"https://api.github.com/repos/nsaechao/pants","forks_url":"https://api.github.com/repos/nsaechao/pants/forks","keys_url":"https://api.github.com/repos/nsaechao/pants/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nsaechao/pants/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nsaechao/pants/teams","hooks_url":"https://api.github.com/repos/nsaechao/pants/hooks","issue_events_url":"https://api.github.com/repos/nsaechao/pants/issues/events{/number}","events_url":"https://api.github.com/repos/nsaechao/pants/events","assignees_url":"https://api.github.com/repos/nsaechao/pants/assignees{/user}","branches_url":"https://api.github.com/repos/nsaechao/pants/branches{/branch}","tags_url":"https://api.github.com/repos/nsaechao/pants/tags","blobs_url":"https://api.github.com/repos/nsaechao/pants/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nsaechao/pants/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nsaechao/pants/git/refs{/sha}","trees_url":"https://api.github.com/repos/nsaechao/pants/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nsaechao/pants/statuses/{sha}","languages_url":"https://api.github.com/repos/nsaechao/pants/languages","stargazers_url":"https://api.github.com/repos/nsaechao/pants/stargazers","contributors_url":"https://api.github.com/repos/nsaechao/pants/contributors","subscribers_url":"https://api.github.com/repos/nsaechao/pants/subscribers","subscription_url":"https://api.github.com/repos/nsaechao/pants/subscription","commits_url":"https://api.github.com/repos/nsaechao/pants/commits{/sha}","git_commits_url":"https://api.github.com/repos/nsaechao/pants/git/commits{/sha}","comments_url":"https://api.github.com/repos/nsaechao/pants/comments{/number}","issue_comment_url":"https://api.github.com/repos/nsaechao/pants/issues/comments{/number}","contents_url":"https://api.github.com/repos/nsaechao/pants/contents/{+path}","compare_url":"https://api.github.com/repos/nsaechao/pants/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nsaechao/pants/merges","archive_url":"https://api.github.com/repos/nsaechao/pants/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nsaechao/pants/downloads","issues_url":"https://api.github.com/repos/nsaechao/pants/issues{/number}","pulls_url":"https://api.github.com/repos/nsaechao/pants/pulls{/number}","milestones_url":"https://api.github.com/repos/nsaechao/pants/milestones{/number}","notifications_url":"https://api.github.com/repos/nsaechao/pants/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nsaechao/pants/labels{/name}","releases_url":"https://api.github.com/repos/nsaechao/pants/releases{/id}","deployments_url":"https://api.github.com/repos/nsaechao/pants/deployments","created_at":"2016-08-22T23:38:10Z","updated_at":"2018-04-18T19:10:56Z","pushed_at":"2018-10-10T20:23:18Z","git_url":"git://github.com/nsaechao/pants.git","ssh_url":"git@github.com:nsaechao/pants.git","clone_url":"https://github.com/nsaechao/pants.git","svn_url":"https://github.com/nsaechao/pants","homepage":"http://pantsbuild.github.io/","size":87899,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"pantsbuild:master","ref":"master","sha":"7205bc1806bbc085c01e40fa04fce68dcff0ae71","user":{"login":"pantsbuild","id":3065172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNjUxNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/3065172?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk3MjA5MDc1","name":"pants","full_name":"pantsbuild/pants","private":false,"owner":{"login":"pantsbuild","id":3065172,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNjUxNzI=","avatar_url":"https://avatars0.githubusercontent.com/u/3065172?v=4","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},"html_url":"https://github.com/pantsbuild/pants","description":"The 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}","deployments_url":"https://api.github.com/repos/pantsbuild/pants/deployments","created_at":"2012-12-17T17:39:04Z","updated_at":"2018-10-15T16:04:06Z","pushed_at":"2018-10-15T16:03:53Z","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.org/","size":88394,"stargazers_count":1033,"watchers_count":1033,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":300,"mirror_url":null,"archived":false,"open_issues_count":719,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":300,"open_issues":719,"watchers":1033,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/6616"},"html":{"href":"https://github.com/pantsbuild/pants/pull/6616"},"issue":{"href":"https://api.github.com/repos/pantsbuild/pants/issues/6616"},"comments":{"href":"https://api.github.com/repos/pantsbuild/pants/issues/6616/comments"},"review_comments":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/6616/comments"},"review_comment":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pantsbuild/pants/pulls/6616/commits"},"statuses":{"href":"https://api.github.com/repos/pantsbuild/pants/statuses/e6bd7aa2768487396d406a3c6329721f6d057e54"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"nsaechao"}}