{"action":"created","comment":{"url":"https://api.github.com/repos/lerna/lerna/pulls/comments/86198408","pull_request_review_id":6868268,"id":86198408,"diff_hunk":"@@ -43,7 +44,34 @@ export default class Repository {\n     return this.lernaJson && this.lernaJson.bootstrapConfig || {};\n   }\n \n+  get packages() {\n+    if (!this._packages) {\n+      this.buildPackageGraph();\n+    }\n+    return this._packages;\n+  }\n+\n+  get filteredPackages() {\n+    if (!this._filteredPackages) {\n+      this.buildPackageGraph();\n+    }\n+    return this._filteredPackages;\n+  }\n+\n+  get packageGraph() {\n+    if (!this._packageGraph) {\n+      this.buildPackageGraph();","path":"src/Repository.js","position":27,"original_position":27,"commit_id":"d11fff8b29c2c14347fe5751e1a6135fb5e5e468","original_commit_id":"d11fff8b29c2c14347fe5751e1a6135fb5e5e468","user":{"login":"seansfkelley","id":2101409,"avatar_url":"https://avatars.githubusercontent.com/u/2101409?v=3","gravatar_id":"","url":"https://api.github.com/users/seansfkelley","html_url":"https://github.com/seansfkelley","followers_url":"https://api.github.com/users/seansfkelley/followers","following_url":"https://api.github.com/users/seansfkelley/following{/other_user}","gists_url":"https://api.github.com/users/seansfkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/seansfkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seansfkelley/subscriptions","organizations_url":"https://api.github.com/users/seansfkelley/orgs","repos_url":"https://api.github.com/users/seansfkelley/repos","events_url":"https://api.github.com/users/seansfkelley/events{/privacy}","received_events_url":"https://api.github.com/users/seansfkelley/received_events","type":"User","site_admin":false},"body":"So the big argument against this structure is that these are getters, but depending on the order that you invoke `repository.packageGraph` and `repository.buildPackageGraph(...)`, you can end up with permanently different values for `packageGraph` (or one of the other fields controlled by this). Spooky! \r\n\r\nThere's also a hand-wavier argument about who should be _responsible_ for filtering; I figured that the \"Repository\" class should probably be a predictable, consistent, immutable representation of the state of the repo, and filtering should be applied elsewhere, namely, in the commands themselves. If you just pulled out the filtering behavior of `buildPackageGraph` to the root `Command` you should still get it across commands, yeah?\r\n\r\nLastly, you can't pass arguments to getters!","created_at":"2016-11-02T17:30:56Z","updated_at":"2016-11-02T17:30:56Z","html_url":"https://github.com/lerna/lerna/pull/386#discussion_r86198408","pull_request_url":"https://api.github.com/repos/lerna/lerna/pulls/386","_links":{"self":{"href":"https://api.github.com/repos/lerna/lerna/pulls/comments/86198408"},"html":{"href":"https://github.com/lerna/lerna/pull/386#discussion_r86198408"},"pull_request":{"href":"https://api.github.com/repos/lerna/lerna/pulls/386"}}},"pull_request":{"url":"https://api.github.com/repos/lerna/lerna/pulls/386","id":90323917,"html_url":"https://github.com/lerna/lerna/pull/386","diff_url":"https://github.com/lerna/lerna/pull/386.diff","patch_url":"https://github.com/lerna/lerna/pull/386.patch","issue_url":"https://api.github.com/repos/lerna/lerna/issues/386","number":386,"state":"open","locked":false,"title":"Adds --scope and --ignore support for bootstrap, exec, run, clean and ls","user":{"login":"lukebatchelor","id":18694878,"avatar_url":"https://avatars.githubusercontent.com/u/18694878?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebatchelor","html_url":"https://github.com/lukebatchelor","followers_url":"https://api.github.com/users/lukebatchelor/followers","following_url":"https://api.github.com/users/lukebatchelor/following{/other_user}","gists_url":"https://api.github.com/users/lukebatchelor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebatchelor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebatchelor/subscriptions","organizations_url":"https://api.github.com/users/lukebatchelor/orgs","repos_url":"https://api.github.com/users/lukebatchelor/repos","events_url":"https://api.github.com/users/lukebatchelor/events{/privacy}","received_events_url":"https://api.github.com/users/lukebatchelor/received_events","type":"User","site_admin":false},"body":"Some refactoring to make --scope and --ignore more consistent across commands.\n\nFixes #383 \n","created_at":"2016-10-21T05:14:31Z","updated_at":"2016-11-02T17:30:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"574d5bf8dfa27b538bf8da55fb6f5d7ddbe0d474","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lerna/lerna/pulls/386/commits","review_comments_url":"https://api.github.com/repos/lerna/lerna/pulls/386/comments","review_comment_url":"https://api.github.com/repos/lerna/lerna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/386/comments","statuses_url":"https://api.github.com/repos/lerna/lerna/statuses/d11fff8b29c2c14347fe5751e1a6135fb5e5e468","head":{"label":"lukebatchelor:spike-scope-bootsrap","ref":"spike-scope-bootsrap","sha":"d11fff8b29c2c14347fe5751e1a6135fb5e5e468","user":{"login":"lukebatchelor","id":18694878,"avatar_url":"https://avatars.githubusercontent.com/u/18694878?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebatchelor","html_url":"https://github.com/lukebatchelor","followers_url":"https://api.github.com/users/lukebatchelor/followers","following_url":"https://api.github.com/users/lukebatchelor/following{/other_user}","gists_url":"https://api.github.com/users/lukebatchelor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebatchelor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebatchelor/subscriptions","organizations_url":"https://api.github.com/users/lukebatchelor/orgs","repos_url":"https://api.github.com/users/lukebatchelor/repos","events_url":"https://api.github.com/users/lukebatchelor/events{/privacy}","received_events_url":"https://api.github.com/users/lukebatchelor/received_events","type":"User","site_admin":false},"repo":{"id":71406073,"name":"lerna","full_name":"lukebatchelor/lerna","owner":{"login":"lukebatchelor","id":18694878,"avatar_url":"https://avatars.githubusercontent.com/u/18694878?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebatchelor","html_url":"https://github.com/lukebatchelor","followers_url":"https://api.github.com/users/lukebatchelor/followers","following_url":"https://api.github.com/users/lukebatchelor/following{/other_user}","gists_url":"https://api.github.com/users/lukebatchelor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebatchelor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebatchelor/subscriptions","organizations_url":"https://api.github.com/users/lukebatchelor/orgs","repos_url":"https://api.github.com/users/lukebatchelor/repos","events_url":"https://api.github.com/users/lukebatchelor/events{/privacy}","received_events_url":"https://api.github.com/users/lukebatchelor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukebatchelor/lerna","description":":dragon: A tool for managing JavaScript projects with multiple packages.","fork":true,"url":"https://api.github.com/repos/lukebatchelor/lerna","forks_url":"https://api.github.com/repos/lukebatchelor/lerna/forks","keys_url":"https://api.github.com/repos/lukebatchelor/lerna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukebatchelor/lerna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukebatchelor/lerna/teams","hooks_url":"https://api.github.com/repos/lukebatchelor/lerna/hooks","issue_events_url":"https://api.github.com/repos/lukebatchelor/lerna/issues/events{/number}","events_url":"https://api.github.com/repos/lukebatchelor/lerna/events","assignees_url":"https://api.github.com/repos/lukebatchelor/lerna/assignees{/user}","branches_url":"https://api.github.com/repos/lukebatchelor/lerna/branches{/branch}","tags_url":"https://api.github.com/repos/lukebatchelor/lerna/tags","blobs_url":"https://api.github.com/repos/lukebatchelor/lerna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukebatchelor/lerna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukebatchelor/lerna/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukebatchelor/lerna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukebatchelor/lerna/statuses/{sha}","languages_url":"https://api.github.com/repos/lukebatchelor/lerna/languages","stargazers_url":"https://api.github.com/repos/lukebatchelor/lerna/stargazers","contributors_url":"https://api.github.com/repos/lukebatchelor/lerna/contributors","subscribers_url":"https://api.github.com/repos/lukebatchelor/lerna/subscribers","subscription_url":"https://api.github.com/repos/lukebatchelor/lerna/subscription","commits_url":"https://api.github.com/repos/lukebatchelor/lerna/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukebatchelor/lerna/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukebatchelor/lerna/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukebatchelor/lerna/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukebatchelor/lerna/contents/{+path}","compare_url":"https://api.github.com/repos/lukebatchelor/lerna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukebatchelor/lerna/merges","archive_url":"https://api.github.com/repos/lukebatchelor/lerna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukebatchelor/lerna/downloads","issues_url":"https://api.github.com/repos/lukebatchelor/lerna/issues{/number}","pulls_url":"https://api.github.com/repos/lukebatchelor/lerna/pulls{/number}","milestones_url":"https://api.github.com/repos/lukebatchelor/lerna/milestones{/number}","notifications_url":"https://api.github.com/repos/lukebatchelor/lerna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukebatchelor/lerna/labels{/name}","releases_url":"https://api.github.com/repos/lukebatchelor/lerna/releases{/id}","deployments_url":"https://api.github.com/repos/lukebatchelor/lerna/deployments","created_at":"2016-10-19T22:55:34Z","updated_at":"2016-10-19T22:55:35Z","pushed_at":"2016-10-25T02:30:18Z","git_url":"git://github.com/lukebatchelor/lerna.git","ssh_url":"git@github.com:lukebatchelor/lerna.git","clone_url":"https://github.com/lukebatchelor/lerna.git","svn_url":"https://github.com/lukebatchelor/lerna","homepage":"https://lernajs.io","size":408,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"lerna:master","ref":"master","sha":"cc9b48725f89ad94a2fa2b5cd7f984da199cd5a1","user":{"login":"lerna","id":19333396,"avatar_url":"https://avatars.githubusercontent.com/u/19333396?v=3","gravatar_id":"","url":"https://api.github.com/users/lerna","html_url":"https://github.com/lerna","followers_url":"https://api.github.com/users/lerna/followers","following_url":"https://api.github.com/users/lerna/following{/other_user}","gists_url":"https://api.github.com/users/lerna/gists{/gist_id}","starred_url":"https://api.github.com/users/lerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerna/subscriptions","organizations_url":"https://api.github.com/users/lerna/orgs","repos_url":"https://api.github.com/users/lerna/repos","events_url":"https://api.github.com/users/lerna/events{/privacy}","received_events_url":"https://api.github.com/users/lerna/received_events","type":"Organization","site_admin":false},"repo":{"id":47394776,"name":"lerna","full_name":"lerna/lerna","owner":{"login":"lerna","id":19333396,"avatar_url":"https://avatars.githubusercontent.com/u/19333396?v=3","gravatar_id":"","url":"https://api.github.com/users/lerna","html_url":"https://github.com/lerna","followers_url":"https://api.github.com/users/lerna/followers","following_url":"https://api.github.com/users/lerna/following{/other_user}","gists_url":"https://api.github.com/users/lerna/gists{/gist_id}","starred_url":"https://api.github.com/users/lerna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerna/subscriptions","organizations_url":"https://api.github.com/users/lerna/orgs","repos_url":"https://api.github.com/users/lerna/repos","events_url":"https://api.github.com/users/lerna/events{/privacy}","received_events_url":"https://api.github.com/users/lerna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lerna/lerna","description":":dragon: A tool for managing JavaScript projects with multiple packages.","fork":false,"url":"https://api.github.com/repos/lerna/lerna","forks_url":"https://api.github.com/repos/lerna/lerna/forks","keys_url":"https://api.github.com/repos/lerna/lerna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lerna/lerna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lerna/lerna/teams","hooks_url":"https://api.github.com/repos/lerna/lerna/hooks","issue_events_url":"https://api.github.com/repos/lerna/lerna/issues/events{/number}","events_url":"https://api.github.com/repos/lerna/lerna/events","assignees_url":"https://api.github.com/repos/lerna/lerna/assignees{/user}","branches_url":"https://api.github.com/repos/lerna/lerna/branches{/branch}","tags_url":"https://api.github.com/repos/lerna/lerna/tags","blobs_url":"https://api.github.com/repos/lerna/lerna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lerna/lerna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lerna/lerna/git/refs{/sha}","trees_url":"https://api.github.com/repos/lerna/lerna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lerna/lerna/statuses/{sha}","languages_url":"https://api.github.com/repos/lerna/lerna/languages","stargazers_url":"https://api.github.com/repos/lerna/lerna/stargazers","contributors_url":"https://api.github.com/repos/lerna/lerna/contributors","subscribers_url":"https://api.github.com/repos/lerna/lerna/subscribers","subscription_url":"https://api.github.com/repos/lerna/lerna/subscription","commits_url":"https://api.github.com/repos/lerna/lerna/commits{/sha}","git_commits_url":"https://api.github.com/repos/lerna/lerna/git/commits{/sha}","comments_url":"https://api.github.com/repos/lerna/lerna/comments{/number}","issue_comment_url":"https://api.github.com/repos/lerna/lerna/issues/comments{/number}","contents_url":"https://api.github.com/repos/lerna/lerna/contents/{+path}","compare_url":"https://api.github.com/repos/lerna/lerna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lerna/lerna/merges","archive_url":"https://api.github.com/repos/lerna/lerna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lerna/lerna/downloads","issues_url":"https://api.github.com/repos/lerna/lerna/issues{/number}","pulls_url":"https://api.github.com/repos/lerna/lerna/pulls{/number}","milestones_url":"https://api.github.com/repos/lerna/lerna/milestones{/number}","notifications_url":"https://api.github.com/repos/lerna/lerna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lerna/lerna/labels{/name}","releases_url":"https://api.github.com/repos/lerna/lerna/releases{/id}","deployments_url":"https://api.github.com/repos/lerna/lerna/deployments","created_at":"2015-12-04T09:36:55Z","updated_at":"2016-11-02T16:53:24Z","pushed_at":"2016-11-02T15:36:25Z","git_url":"git://github.com/lerna/lerna.git","ssh_url":"git@github.com:lerna/lerna.git","clone_url":"https://github.com/lerna/lerna.git","svn_url":"https://github.com/lerna/lerna","homepage":"https://lernajs.io","size":635,"stargazers_count":2273,"watchers_count":2273,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":132,"mirror_url":null,"open_issues_count":112,"forks":132,"open_issues":112,"watchers":2273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lerna/lerna/pulls/386"},"html":{"href":"https://github.com/lerna/lerna/pull/386"},"issue":{"href":"https://api.github.com/repos/lerna/lerna/issues/386"},"comments":{"href":"https://api.github.com/repos/lerna/lerna/issues/386/comments"},"review_comments":{"href":"https://api.github.com/repos/lerna/lerna/pulls/386/comments"},"review_comment":{"href":"https://api.github.com/repos/lerna/lerna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lerna/lerna/pulls/386/commits"},"statuses":{"href":"https://api.github.com/repos/lerna/lerna/statuses/d11fff8b29c2c14347fe5751e1a6135fb5e5e468"}}}}
{"actor":{"display_login":"seansfkelley"}}