{"action":"created","comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/comments/177940402","pull_request_review_id":107909910,"id":177940402,"diff_hunk":"@@ -35,9 +35,15 @@ class AddonsFactory {\n     logger.info('     addon names are:', Object.keys(addonPackages));\n \n     for (let name in addonPackages) {\n+      console.log(`### factory.initAddons for '${name}'`);\n       addonInfo = addonPackages[name];\n       emberAddonConfig = addonInfo.pkg['ember-addon'];\n \n+      if (!emberAddonConfig) {","path":"lib/models/addons-factory.js","position":8,"original_position":8,"commit_id":"c39aa14c53fb70802fb87521fdb7064a82c265e2","original_commit_id":"c39aa14c53fb70802fb87521fdb7064a82c265e2","user":{"login":"dcombslinkedin","id":34755123,"avatar_url":"https://avatars3.githubusercontent.com/u/34755123?v=4","gravatar_id":"","url":"https://api.github.com/users/dcombslinkedin","html_url":"https://github.com/dcombslinkedin","followers_url":"https://api.github.com/users/dcombslinkedin/followers","following_url":"https://api.github.com/users/dcombslinkedin/following{/other_user}","gists_url":"https://api.github.com/users/dcombslinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/dcombslinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcombslinkedin/subscriptions","organizations_url":"https://api.github.com/users/dcombslinkedin/orgs","repos_url":"https://api.github.com/users/dcombslinkedin/repos","events_url":"https://api.github.com/users/dcombslinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/dcombslinkedin/received_events","type":"User","site_admin":false},"body":"Oops - I forgot to remove that. Good catch! \r\n\r\nAt one point I'd missed a step in the previous version of addon-discovery where it sets the 'ember-addon' field to {} if it wasn't present. This resulted in an NPE here. I added the check to see what was going on. Then I fixed PackageInfo to do the relevant setting during the ctor so the check isn't needed anymore. I've removed it and will check in the fix.","created_at":"2018-03-29T02:37:48Z","updated_at":"2018-03-29T02:37:48Z","html_url":"https://github.com/ember-cli/ember-cli/pull/7707#discussion_r177940402","pull_request_url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ember-cli/ember-cli/pulls/comments/177940402"},"html":{"href":"https://github.com/ember-cli/ember-cli/pull/7707#discussion_r177940402"},"pull_request":{"href":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707"}},"in_reply_to_id":177938674},"pull_request":{"url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707","id":178209934,"html_url":"https://github.com/ember-cli/ember-cli/pull/7707","diff_url":"https://github.com/ember-cli/ember-cli/pull/7707.diff","patch_url":"https://github.com/ember-cli/ember-cli/pull/7707.patch","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/7707","number":7707,"state":"open","locked":false,"title":"WIP: added package-info-cache (fast package caching)","user":{"login":"dcombslinkedin","id":34755123,"avatar_url":"https://avatars3.githubusercontent.com/u/34755123?v=4","gravatar_id":"","url":"https://api.github.com/users/dcombslinkedin","html_url":"https://github.com/dcombslinkedin","followers_url":"https://api.github.com/users/dcombslinkedin/followers","following_url":"https://api.github.com/users/dcombslinkedin/following{/other_user}","gists_url":"https://api.github.com/users/dcombslinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/dcombslinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcombslinkedin/subscriptions","organizations_url":"https://api.github.com/users/dcombslinkedin/orgs","repos_url":"https://api.github.com/users/dcombslinkedin/repos","events_url":"https://api.github.com/users/dcombslinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/dcombslinkedin/received_events","type":"User","site_admin":false},"body":"This is near completion, but I wanted to get a WIP version in before the final attempt so that @stefanpenner and @rwjblue could take a look and suggest improvements. (NOTE: this is being entered against master, but original development was against 3.0.1.) Here's the feature description:\r\n\r\nDoing profiling of build time processing for a large project at LinkedIn found that the addon discovery process was taking over 50 seconds just to determine all where all the addon packages were on disk and read and parse their package.json files. I found that much of this was due to repeated validation of the path to the addon package.json and index.js files (fs.realpathSync turns out to be fairly expensive when done a lot, and the project was calling it something like 80K times). The implementation was already re-reading the package information and then throwing it away many times.\r\n\r\nThis PR creates a new PackageInfoCache class, with a singleton instance added to either CLI (if the build is being done through the CLI or an individual project (if the build is done on a single project but not through the CLI). If a build, like ours here at LinkedIn, includes multiple projects, the fact the instance is in CLI means they all take advantage of the same cache (I'll call it PIC from here out) and don't need to rediscover any packages.\r\n\r\nWhen a Project (ember-cli/lib/models/project) is constructed, a reference to a local or CLI version of PIC is made and PIC.loadProject(projectPath) is called. loadProject then creates an internal instance of a PackageInfo class for the project. It parses the package.json file, then creates separate ProjectInfo instances for all internal addons, all CLI in-repo addons and all 'dependency' and 'devDependency' entries. In the process of that it does the same thing that the node resolution algorithm does to find package.json files, but tries as much as possible to not use 'fs.realpathSync' more than once per file path, caching the result of each path resolution for speed. \r\n\r\nBecause of the cache, reading all the dependencies, parsing their package.json files, determining the addons and collecting information about them (prior to addon-instantiation), current performance on my Mac Pro machine (new 2017 model) has gone from 54 seconds down to 900 milliseconds. Obviously the precise performance will differ based on machine size, but overall it's about a 60x increase.\r\n\r\nThe result of all the above processing is that the PackageInfoCache contains a number of entries, one per package for each real file path (i.e. its cache entries are keyed on the real path for a package's root directory--all symlinks and .. entries are resolved). A PackageInfo object contains the following fields of interest:\r\n\r\n* pkg - the object resulting from the package.json file\r\n* realPath - (string) the resolved path for the package's root directory\r\n* cache - a reference to the PIC object that contains the packageInfo instance\r\n* errors - an ErrorList object containing ErrorEntry objects, one per error discovered during the processing of the package and all its various dependencies. When a packageInfo object is being created, if the package itself is bad (e.g. no or malformed package.json file) the error is created and put in the parent. If the package is generally constructed correctly, anything wrong with the contents of the object itself (e.g. one of its dependencies cannot be found), the error is registered with the object. The PIC has a method 'showErrors' to dump a list of all the errors in all the PackageInfo objects. The caller could then decide if any of those errors is enough to fail the build.\r\n\r\nVarious types of PackageInfo objects can have other fields:\r\n* addonConstructor - filled out but not yet used, this would replace part of addons-factory so that constructing an instance of an addon would be done through the PIC/PackageInfo, simplifying the code\r\n* addonMainPath - for an addon package, the real path to the package's 'main' file\r\n* inRepoAddons - an array of PackageInfo objects, one per in-repo package definition (note that the in-repo addon definition is included in the PIC-level cache by its file path already, this is just a reference to that same set of objects)\r\n* internalAddons - same as above, but for internal addons (project only)\r\n* cliInfo - same as above, but for the package that corresponds to the path <pkg>.cli.root\r\n* dependencyPackages - a JS object keyed by dependency name of references to PackageInfo objects, one per entry in the package's 'dependency' attribute list)\r\n* devDependencyPackages - similar, but for the 'devDependency' attribute list\r\n* nodeModules - a NodeModulesList object (basically contains an array of PackageInfo and other NodeModulesList objects) of all packages and subdirectories in a node_modules directory.","created_at":"2018-03-29T02:09:19Z","updated_at":"2018-03-29T02:37:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"103f6ffb0be3577992f592c7db63c2f68eaa07e3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707/commits","review_comments_url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707/comments","review_comment_url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/7707/comments","statuses_url":"https://api.github.com/repos/ember-cli/ember-cli/statuses/c39aa14c53fb70802fb87521fdb7064a82c265e2","head":{"label":"dcombslinkedin:dave_3_0_1","ref":"dave_3_0_1","sha":"c39aa14c53fb70802fb87521fdb7064a82c265e2","user":{"login":"dcombslinkedin","id":34755123,"avatar_url":"https://avatars3.githubusercontent.com/u/34755123?v=4","gravatar_id":"","url":"https://api.github.com/users/dcombslinkedin","html_url":"https://github.com/dcombslinkedin","followers_url":"https://api.github.com/users/dcombslinkedin/followers","following_url":"https://api.github.com/users/dcombslinkedin/following{/other_user}","gists_url":"https://api.github.com/users/dcombslinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/dcombslinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcombslinkedin/subscriptions","organizations_url":"https://api.github.com/users/dcombslinkedin/orgs","repos_url":"https://api.github.com/users/dcombslinkedin/repos","events_url":"https://api.github.com/users/dcombslinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/dcombslinkedin/received_events","type":"User","site_admin":false},"repo":{"id":116295140,"name":"ember-cli","full_name":"dcombslinkedin/ember-cli","owner":{"login":"dcombslinkedin","id":34755123,"avatar_url":"https://avatars3.githubusercontent.com/u/34755123?v=4","gravatar_id":"","url":"https://api.github.com/users/dcombslinkedin","html_url":"https://github.com/dcombslinkedin","followers_url":"https://api.github.com/users/dcombslinkedin/followers","following_url":"https://api.github.com/users/dcombslinkedin/following{/other_user}","gists_url":"https://api.github.com/users/dcombslinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/dcombslinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcombslinkedin/subscriptions","organizations_url":"https://api.github.com/users/dcombslinkedin/orgs","repos_url":"https://api.github.com/users/dcombslinkedin/repos","events_url":"https://api.github.com/users/dcombslinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/dcombslinkedin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcombslinkedin/ember-cli","description":"The Ember.js command line utility","fork":true,"url":"https://api.github.com/repos/dcombslinkedin/ember-cli","forks_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/forks","keys_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/teams","hooks_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/hooks","issue_events_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/issues/events{/number}","events_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/events","assignees_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/assignees{/user}","branches_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/branches{/branch}","tags_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/tags","blobs_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/languages","stargazers_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/stargazers","contributors_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/contributors","subscribers_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/subscribers","subscription_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/subscription","commits_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/contents/{+path}","compare_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/merges","archive_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/downloads","issues_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/issues{/number}","pulls_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/labels{/name}","releases_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/releases{/id}","deployments_url":"https://api.github.com/repos/dcombslinkedin/ember-cli/deployments","created_at":"2018-01-04T18:44:58Z","updated_at":"2018-03-26T20:25:59Z","pushed_at":"2018-03-29T01:35:11Z","git_url":"git://github.com/dcombslinkedin/ember-cli.git","ssh_url":"git@github.com:dcombslinkedin/ember-cli.git","clone_url":"https://github.com/dcombslinkedin/ember-cli.git","svn_url":"https://github.com/dcombslinkedin/ember-cli","homepage":"http://ember-cli.com/","size":12357,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ember-cli:master","ref":"master","sha":"758d269cc7f885183eac3aab948b8561574b19bd","user":{"login":"ember-cli","id":10262982,"avatar_url":"https://avatars3.githubusercontent.com/u/10262982?v=4","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"repo":{"id":14089735,"name":"ember-cli","full_name":"ember-cli/ember-cli","owner":{"login":"ember-cli","id":10262982,"avatar_url":"https://avatars3.githubusercontent.com/u/10262982?v=4","gravatar_id":"","url":"https://api.github.com/users/ember-cli","html_url":"https://github.com/ember-cli","followers_url":"https://api.github.com/users/ember-cli/followers","following_url":"https://api.github.com/users/ember-cli/following{/other_user}","gists_url":"https://api.github.com/users/ember-cli/gists{/gist_id}","starred_url":"https://api.github.com/users/ember-cli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ember-cli/subscriptions","organizations_url":"https://api.github.com/users/ember-cli/orgs","repos_url":"https://api.github.com/users/ember-cli/repos","events_url":"https://api.github.com/users/ember-cli/events{/privacy}","received_events_url":"https://api.github.com/users/ember-cli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ember-cli/ember-cli","description":"The Ember.js command line utility","fork":false,"url":"https://api.github.com/repos/ember-cli/ember-cli","forks_url":"https://api.github.com/repos/ember-cli/ember-cli/forks","keys_url":"https://api.github.com/repos/ember-cli/ember-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ember-cli/ember-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ember-cli/ember-cli/teams","hooks_url":"https://api.github.com/repos/ember-cli/ember-cli/hooks","issue_events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/events{/number}","events_url":"https://api.github.com/repos/ember-cli/ember-cli/events","assignees_url":"https://api.github.com/repos/ember-cli/ember-cli/assignees{/user}","branches_url":"https://api.github.com/repos/ember-cli/ember-cli/branches{/branch}","tags_url":"https://api.github.com/repos/ember-cli/ember-cli/tags","blobs_url":"https://api.github.com/repos/ember-cli/ember-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ember-cli/ember-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ember-cli/ember-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/ember-cli/ember-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ember-cli/ember-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/ember-cli/ember-cli/languages","stargazers_url":"https://api.github.com/repos/ember-cli/ember-cli/stargazers","contributors_url":"https://api.github.com/repos/ember-cli/ember-cli/contributors","subscribers_url":"https://api.github.com/repos/ember-cli/ember-cli/subscribers","subscription_url":"https://api.github.com/repos/ember-cli/ember-cli/subscription","commits_url":"https://api.github.com/repos/ember-cli/ember-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/ember-cli/ember-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/ember-cli/ember-cli/contents/{+path}","compare_url":"https://api.github.com/repos/ember-cli/ember-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ember-cli/ember-cli/merges","archive_url":"https://api.github.com/repos/ember-cli/ember-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ember-cli/ember-cli/downloads","issues_url":"https://api.github.com/repos/ember-cli/ember-cli/issues{/number}","pulls_url":"https://api.github.com/repos/ember-cli/ember-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/ember-cli/ember-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/ember-cli/ember-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/labels{/name}","releases_url":"https://api.github.com/repos/ember-cli/ember-cli/releases{/id}","deployments_url":"https://api.github.com/repos/ember-cli/ember-cli/deployments","created_at":"2013-11-03T17:34:43Z","updated_at":"2018-03-29T00:15:00Z","pushed_at":"2018-03-29T02:09:20Z","git_url":"git://github.com/ember-cli/ember-cli.git","ssh_url":"git@github.com:ember-cli/ember-cli.git","clone_url":"https://github.com/ember-cli/ember-cli.git","svn_url":"https://github.com/ember-cli/ember-cli","homepage":"http://ember-cli.com/","size":12348,"stargazers_count":3205,"watchers_count":3205,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1030,"mirror_url":null,"archived":false,"open_issues_count":254,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1030,"open_issues":254,"watchers":3205,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707"},"html":{"href":"https://github.com/ember-cli/ember-cli/pull/7707"},"issue":{"href":"https://api.github.com/repos/ember-cli/ember-cli/issues/7707"},"comments":{"href":"https://api.github.com/repos/ember-cli/ember-cli/issues/7707/comments"},"review_comments":{"href":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707/comments"},"review_comment":{"href":"https://api.github.com/repos/ember-cli/ember-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ember-cli/ember-cli/pulls/7707/commits"},"statuses":{"href":"https://api.github.com/repos/ember-cli/ember-cli/statuses/c39aa14c53fb70802fb87521fdb7064a82c265e2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dcombslinkedin"}}