{"action":"created","comment":{"url":"https://api.github.com/repos/serverless/serverless/pulls/comments/125924734","pull_request_review_id":48361455,"id":125924734,"diff_hunk":"@@ -142,47 +150,24 @@ function excludeNodeDevDependencies(servicePath) {\n       return !isNodeModulesDir;\n     });\n \n-    return BbPromise.map(packageJsonPaths, (packageJsonPath) => {\n+    // NOTE: using mapSeries here for a sequential computation (w/o race conditions)\n+    return BbPromise.mapSeries(packageJsonPaths, (packageJsonPath) => {\n       // the path where the package.json file lives\n       const fullPath = path.join(servicePath, packageJsonPath);\n       const dirWithPackageJson = fullPath.replace(path.join(path.sep, 'package.json'), '');\n \n-      const childProc = childProcess.spawn('npm',\n-        ['ls', '--dev=true', '--parseable=true', '--silent'],\n+      return childProcess.execAsync(\n+        `npm ls --dev=true --parseable=true --silent >> ${nodeDevDepFile}`,","path":"lib/plugins/package/lib/zipService.js","position":null,"original_position":44,"commit_id":"ec5459d4e5da10cf37cdb47aa4e4c1b40c5892d2","original_commit_id":"ec5459d4e5da10cf37cdb47aa4e4c1b40c5892d2","user":{"login":"arabold","id":1548229,"avatar_url":"https://avatars2.githubusercontent.com/u/1548229?v=3","gravatar_id":"","url":"https://api.github.com/users/arabold","html_url":"https://github.com/arabold","followers_url":"https://api.github.com/users/arabold/followers","following_url":"https://api.github.com/users/arabold/following{/other_user}","gists_url":"https://api.github.com/users/arabold/gists{/gist_id}","starred_url":"https://api.github.com/users/arabold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arabold/subscriptions","organizations_url":"https://api.github.com/users/arabold/orgs","repos_url":"https://api.github.com/users/arabold/repos","events_url":"https://api.github.com/users/arabold/events{/privacy}","received_events_url":"https://api.github.com/users/arabold/received_events","type":"User","site_admin":false},"body":"If you append to `${nodeDevDepFile}` then you should make sure to delete it before the `BbPromise.mapSeries()` above . Otherwise it might have some surprises in store for you. Why not put it in the artifacts folder (i.e. `.serverless` or whatever is provided in the `--package` command line) though? I think that folder is cleaned and recreated on every packaging?","created_at":"2017-07-06T14:56:40Z","updated_at":"2017-07-06T14:56:40Z","html_url":"https://github.com/serverless/serverless/pull/3889#discussion_r125924734","pull_request_url":"https://api.github.com/repos/serverless/serverless/pulls/3889","_links":{"self":{"href":"https://api.github.com/repos/serverless/serverless/pulls/comments/125924734"},"html":{"href":"https://github.com/serverless/serverless/pull/3889#discussion_r125924734"},"pull_request":{"href":"https://api.github.com/repos/serverless/serverless/pulls/3889"}}},"pull_request":{"url":"https://api.github.com/repos/serverless/serverless/pulls/3889","id":128636716,"html_url":"https://github.com/serverless/serverless/pull/3889","diff_url":"https://github.com/serverless/serverless/pull/3889.diff","patch_url":"https://github.com/serverless/serverless/pull/3889.patch","issue_url":"https://api.github.com/repos/serverless/serverless/issues/3889","number":3889,"state":"open","locked":false,"title":"Fix dev dependency exclusion bug","user":{"login":"pmuens","id":1606004,"avatar_url":"https://avatars0.githubusercontent.com/u/1606004?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuens","html_url":"https://github.com/pmuens","followers_url":"https://api.github.com/users/pmuens/followers","following_url":"https://api.github.com/users/pmuens/following{/other_user}","gists_url":"https://api.github.com/users/pmuens/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuens/subscriptions","organizations_url":"https://api.github.com/users/pmuens/orgs","repos_url":"https://api.github.com/users/pmuens/repos","events_url":"https://api.github.com/users/pmuens/events{/privacy}","received_events_url":"https://api.github.com/users/pmuens/received_events","type":"User","site_admin":false},"body":"## What did you implement:\r\n\r\nCloses #3827\r\nCloses #3874\r\nCloses #3869\r\n\r\nFixes a bug where the dev dependency exclusion errors out due to a large number of dependencies (and string capacity limitations).\r\n\r\nAlso fixes the error where exclusion is not working anymore.\r\n\r\nSpeed is increased due to async operations ran concurrently.\r\n\r\n## How did you implement it:\r\n\r\n1. Switch from sync to async calls and compute them in a `Bluebird Promise.map`\r\n2. Switched from `execSync` to `spawn` to get a stream (mitigates the buffer limit `execSync` introduces where the packages for exclusion are capped)\r\n3. Switch from `npm ls --prod=true` to `npm ls --dev=true` so that we exclude only the `dev` dependencies rather than excluding all `node_modules` and then re-including the prod dependencies. This should avoid side-effects when the exclusion of dev dependencies fails.\r\n\r\n## How can we verify it:\r\n\r\nTake the steps described here: https://github.com/serverless/serverless/pull/3737#issue-233860537\r\n\r\n## Todos:\r\n\r\n- [ ] Write tests\r\n- [ ] Write documentation\r\n- [ ] Fix linting errors\r\n- [ ] Make sure code coverage hasn't dropped\r\n- [x] Provide verification config / commands / resources\r\n- [ ] Update the messages below\r\n\r\n***Is this ready for review?:*** NO\r\n***Is it a breaking change?:*** NO","created_at":"2017-07-03T14:08:01Z","updated_at":"2017-07-06T14:56:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee8f7a0dd0b07955269ef579f15fb790beabbc83","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/serverless/serverless/milestones/33","html_url":"https://github.com/serverless/serverless/milestone/33","labels_url":"https://api.github.com/repos/serverless/serverless/milestones/33/labels","id":2595305,"number":33,"title":"1.18","description":"","creator":{"login":"pmuens","id":1606004,"avatar_url":"https://avatars0.githubusercontent.com/u/1606004?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuens","html_url":"https://github.com/pmuens","followers_url":"https://api.github.com/users/pmuens/followers","following_url":"https://api.github.com/users/pmuens/following{/other_user}","gists_url":"https://api.github.com/users/pmuens/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuens/subscriptions","organizations_url":"https://api.github.com/users/pmuens/orgs","repos_url":"https://api.github.com/users/pmuens/repos","events_url":"https://api.github.com/users/pmuens/events{/privacy}","received_events_url":"https://api.github.com/users/pmuens/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":3,"state":"open","created_at":"2017-06-21T07:25:08Z","updated_at":"2017-07-06T10:53:47Z","due_on":"2017-07-19T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/serverless/serverless/pulls/3889/commits","review_comments_url":"https://api.github.com/repos/serverless/serverless/pulls/3889/comments","review_comment_url":"https://api.github.com/repos/serverless/serverless/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/3889/comments","statuses_url":"https://api.github.com/repos/serverless/serverless/statuses/ec5459d4e5da10cf37cdb47aa4e4c1b40c5892d2","head":{"label":"serverless:fix-dev-dependency-exclusion-bug","ref":"fix-dev-dependency-exclusion-bug","sha":"ec5459d4e5da10cf37cdb47aa4e4c1b40c5892d2","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars3.githubusercontent.com/u/13742415?v=3","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":34302698,"name":"serverless","full_name":"serverless/serverless","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars3.githubusercontent.com/u/13742415?v=3","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/serverless","description":"Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! – ","fork":false,"url":"https://api.github.com/repos/serverless/serverless","forks_url":"https://api.github.com/repos/serverless/serverless/forks","keys_url":"https://api.github.com/repos/serverless/serverless/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/serverless/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/serverless/teams","hooks_url":"https://api.github.com/repos/serverless/serverless/hooks","issue_events_url":"https://api.github.com/repos/serverless/serverless/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/serverless/events","assignees_url":"https://api.github.com/repos/serverless/serverless/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/serverless/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/serverless/tags","blobs_url":"https://api.github.com/repos/serverless/serverless/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/serverless/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/serverless/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/serverless/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/serverless/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/serverless/languages","stargazers_url":"https://api.github.com/repos/serverless/serverless/stargazers","contributors_url":"https://api.github.com/repos/serverless/serverless/contributors","subscribers_url":"https://api.github.com/repos/serverless/serverless/subscribers","subscription_url":"https://api.github.com/repos/serverless/serverless/subscription","commits_url":"https://api.github.com/repos/serverless/serverless/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/serverless/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/serverless/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/serverless/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/serverless/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/serverless/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/serverless/merges","archive_url":"https://api.github.com/repos/serverless/serverless/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/serverless/downloads","issues_url":"https://api.github.com/repos/serverless/serverless/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/serverless/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/serverless/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/serverless/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/serverless/labels{/name}","releases_url":"https://api.github.com/repos/serverless/serverless/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/serverless/deployments","created_at":"2015-04-21T03:48:40Z","updated_at":"2017-07-06T14:41:33Z","pushed_at":"2017-07-06T13:59:26Z","git_url":"git://github.com/serverless/serverless.git","ssh_url":"git@github.com:serverless/serverless.git","clone_url":"https://github.com/serverless/serverless.git","svn_url":"https://github.com/serverless/serverless","homepage":"http://www.serverless.com","size":74937,"stargazers_count":17559,"watchers_count":17559,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1700,"mirror_url":null,"open_issues_count":281,"forks":1700,"open_issues":281,"watchers":17559,"default_branch":"master"}},"base":{"label":"serverless:master","ref":"master","sha":"b7b775efecfb3fa59aaac8ee25a628e13017160f","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars3.githubusercontent.com/u/13742415?v=3","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":34302698,"name":"serverless","full_name":"serverless/serverless","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars3.githubusercontent.com/u/13742415?v=3","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/serverless","description":"Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! – ","fork":false,"url":"https://api.github.com/repos/serverless/serverless","forks_url":"https://api.github.com/repos/serverless/serverless/forks","keys_url":"https://api.github.com/repos/serverless/serverless/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/serverless/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/serverless/teams","hooks_url":"https://api.github.com/repos/serverless/serverless/hooks","issue_events_url":"https://api.github.com/repos/serverless/serverless/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/serverless/events","assignees_url":"https://api.github.com/repos/serverless/serverless/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/serverless/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/serverless/tags","blobs_url":"https://api.github.com/repos/serverless/serverless/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/serverless/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/serverless/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/serverless/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/serverless/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/serverless/languages","stargazers_url":"https://api.github.com/repos/serverless/serverless/stargazers","contributors_url":"https://api.github.com/repos/serverless/serverless/contributors","subscribers_url":"https://api.github.com/repos/serverless/serverless/subscribers","subscription_url":"https://api.github.com/repos/serverless/serverless/subscription","commits_url":"https://api.github.com/repos/serverless/serverless/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/serverless/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/serverless/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/serverless/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/serverless/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/serverless/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/serverless/merges","archive_url":"https://api.github.com/repos/serverless/serverless/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/serverless/downloads","issues_url":"https://api.github.com/repos/serverless/serverless/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/serverless/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/serverless/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/serverless/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/serverless/labels{/name}","releases_url":"https://api.github.com/repos/serverless/serverless/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/serverless/deployments","created_at":"2015-04-21T03:48:40Z","updated_at":"2017-07-06T14:41:33Z","pushed_at":"2017-07-06T13:59:26Z","git_url":"git://github.com/serverless/serverless.git","ssh_url":"git@github.com:serverless/serverless.git","clone_url":"https://github.com/serverless/serverless.git","svn_url":"https://github.com/serverless/serverless","homepage":"http://www.serverless.com","size":74937,"stargazers_count":17559,"watchers_count":17559,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1700,"mirror_url":null,"open_issues_count":281,"forks":1700,"open_issues":281,"watchers":17559,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serverless/serverless/pulls/3889"},"html":{"href":"https://github.com/serverless/serverless/pull/3889"},"issue":{"href":"https://api.github.com/repos/serverless/serverless/issues/3889"},"comments":{"href":"https://api.github.com/repos/serverless/serverless/issues/3889/comments"},"review_comments":{"href":"https://api.github.com/repos/serverless/serverless/pulls/3889/comments"},"review_comment":{"href":"https://api.github.com/repos/serverless/serverless/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serverless/serverless/pulls/3889/commits"},"statuses":{"href":"https://api.github.com/repos/serverless/serverless/statuses/ec5459d4e5da10cf37cdb47aa4e4c1b40c5892d2"}}}}
{"actor":{"display_login":"arabold"}}