{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Universe/pulls/comments/55107951","id":55107951,"diff_hunk":"@@ -780,4 +841,138 @@ functions\n \n             return reposToBuild.ToList();\n         }\n+\n+        static IEnumerable<IGrouping<int, RepositoryInfo>> BatchReporties()\n+        {\n+            var repositoryLookup = new List<RepositoryInfo>();\n+            foreach (var repo in GetRepositoriesToBuild())\n+            {\n+                var info = new RepositoryInfo { Name = repo };\n+                var srcDir = Path.Combine(repo, \"src\");\n+\n+                if (Directory.Exists(srcDir))\n+                {\n+                    foreach (var directory in Directory.EnumerateDirectories(srcDir))\n+                    {\n+                        info.RepositoryNames.Add(Path.GetFileName(directory));\n+                        var projectJson = Path.Combine(directory, \"project.json\");\n+                        if (File.Exists(projectJson))\n+                        {\n+                            GetDependencies(projectJson, info.DependencyNames);\n+                        }\n+                    }\n+                }\n+\n+                var otherDirs = new[] { \"test\", \"samples\" };\n+                for (var i = 0; i < otherDirs.Length; i++)\n+                {\n+                    var otherDir = Path.Combine(repo, otherDirs[i]);\n+                    if (Directory.Exists(otherDir))\n+                    {\n+                        foreach (var directory in Directory.EnumerateDirectories(otherDir))\n+                        {\n+                            var projectJson = Path.Combine(directory, \"project.json\");\n+                            if (File.Exists(projectJson))\n+                            {\n+                                GetDependencies(projectJson, info.DependencyNames);\n+                            }\n+                        }\n+                    }\n+                }\n+\n+                info.DependencyNames.ExceptWith(info.RepositoryNames);\n+                repositoryLookup.Add(info);\n+            }\n+\n+            foreach (var info in repositoryLookup)\n+            {\n+                foreach (var item in info.DependencyNames)\n+                {\n+                    var dependency = repositoryLookup.Find(r => r.RepositoryNames.Contains(item));\n+                    if (dependency != null)\n+                    {\n+                        // Testing has odd cyclic dependencies\n+                        if (string.Equals(info.Name, \"Testing\", StringComparison.OrdinalIgnoreCase) &&\n+                            string.Equals(dependency.Name, \"aspnet.xunit\", StringComparison.OrdinalIgnoreCase))\n+                        {\n+                            continue;\n+                        }\n+\n+                        if (string.Equals(dependency.Name, \"Testing\", StringComparison.OrdinalIgnoreCase) &&\n+                            (string.Equals(info.Name, \"Common\", StringComparison.OrdinalIgnoreCase) ||\n+                            string.Equals(info.Name, \"PlatformAbstractions\", StringComparison.OrdinalIgnoreCase) ||\n+                            string.Equals(info.Name, \"Logging\", StringComparison.OrdinalIgnoreCase)))\n+                        {\n+                            continue;\n+                        }\n+\n+                        info.Dependencies.Add(dependency);\n+                    }\n+                }\n+            }\n+\n+            return repositoryLookup.GroupBy(r => r.Order).OrderBy(r => r.Key);\n+        }\n+\n+        static IEnumerable<string> GetDependencies(string projectJsonPath, HashSet<string> dependencies)\n+        {\n+            var project = (JsonObject)Json.Deserialize(File.ReadAllText(projectJsonPath));\n+            var dependenciesNode = project.ValueAsJsonObject(\"dependencies\");\n+\n+            if (dependenciesNode != null)\n+            {\n+                foreach (var key in dependenciesNode.Keys)\n+                {\n+                    dependencies.Add(key);\n+                }\n+            }\n+\n+            var frameworkNodes = project.ValueAsJsonObject(\"frameworks\");\n+            if (frameworkNodes != null)\n+            {\n+                foreach (var framework in frameworkNodes.Keys)\n+                {\n+                    dependenciesNode = frameworkNodes.ValueAsJsonObject(framework).ValueAsJsonObject(\"dependencies\");\n+                    if (dependenciesNode != null)\n+                    {\n+                        foreach (var key in dependenciesNode.Keys)\n+                        {\n+                            dependencies.Add(key);\n+                        }\n+                    }\n+                }\n+            }\n+\n+            return dependencies;\n+        }\n+\n+        private class RepositoryInfo\n+        {\n+            public string Name { get; set; }\n+\n+            public HashSet<string> RepositoryNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);\n+\n+            public HashSet<string> DependencyNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);\n+\n+            public HashSet<RepositoryInfo> Dependencies = new HashSet<RepositoryInfo>();\n+\n+            public int Order\n+            {\n+                get\n+                {\n+                    if (string.Equals(\"Testing\", Name, StringComparison.OrdinalIgnoreCase))","path":"makefile.shade","position":236,"original_position":236,"commit_id":"fa6a584a84d2f69fbbd8020e682c7bc74d08b635","original_commit_id":"fa6a584a84d2f69fbbd8020e682c7bc74d08b635","user":{"login":"victorhurdugaci","id":5921642,"avatar_url":"https://avatars.githubusercontent.com/u/5921642?v=3","gravatar_id":"","url":"https://api.github.com/users/victorhurdugaci","html_url":"https://github.com/victorhurdugaci","followers_url":"https://api.github.com/users/victorhurdugaci/followers","following_url":"https://api.github.com/users/victorhurdugaci/following{/other_user}","gists_url":"https://api.github.com/users/victorhurdugaci/gists{/gist_id}","starred_url":"https://api.github.com/users/victorhurdugaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorhurdugaci/subscriptions","organizations_url":"https://api.github.com/users/victorhurdugaci/orgs","repos_url":"https://api.github.com/users/victorhurdugaci/repos","events_url":"https://api.github.com/users/victorhurdugaci/events{/privacy}","received_events_url":"https://api.github.com/users/victorhurdugaci/received_events","type":"User","site_admin":false},"body":"Don't hardcode this","created_at":"2016-03-05T00:15:22Z","updated_at":"2016-03-05T00:15:22Z","html_url":"https://github.com/aspnet/Universe/pull/411#discussion_r55107951","pull_request_url":"https://api.github.com/repos/aspnet/Universe/pulls/411","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/comments/55107951"},"html":{"href":"https://github.com/aspnet/Universe/pull/411#discussion_r55107951"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/411"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Universe/pulls/411","id":61789712,"html_url":"https://github.com/aspnet/Universe/pull/411","diff_url":"https://github.com/aspnet/Universe/pull/411.diff","patch_url":"https://github.com/aspnet/Universe/pull/411.patch","issue_url":"https://api.github.com/repos/aspnet/Universe/issues/411","number":411,"state":"open","locked":false,"title":"Batch build on the CI","user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-05T00:00:27Z","updated_at":"2016-03-05T00:15:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3da330263e2bad46ff41031748365206cb14dc7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Universe/pulls/411/commits","review_comments_url":"https://api.github.com/repos/aspnet/Universe/pulls/411/comments","review_comment_url":"https://api.github.com/repos/aspnet/Universe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Universe/issues/411/comments","statuses_url":"https://api.github.com/repos/aspnet/Universe/statuses/fa6a584a84d2f69fbbd8020e682c7bc74d08b635","head":{"label":"aspnet:prkrishn/ci-build","ref":"prkrishn/ci-build","sha":"fa6a584a84d2f69fbbd8020e682c7bc74d08b635","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":16185172,"name":"Universe","full_name":"aspnet/Universe","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Universe","description":"Repo for building the entire ASP.NET and Entity Framework stack.","fork":false,"url":"https://api.github.com/repos/aspnet/Universe","forks_url":"https://api.github.com/repos/aspnet/Universe/forks","keys_url":"https://api.github.com/repos/aspnet/Universe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Universe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Universe/teams","hooks_url":"https://api.github.com/repos/aspnet/Universe/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Universe/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Universe/events","assignees_url":"https://api.github.com/repos/aspnet/Universe/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Universe/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Universe/tags","blobs_url":"https://api.github.com/repos/aspnet/Universe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Universe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Universe/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Universe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Universe/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Universe/languages","stargazers_url":"https://api.github.com/repos/aspnet/Universe/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Universe/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Universe/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Universe/subscription","commits_url":"https://api.github.com/repos/aspnet/Universe/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Universe/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Universe/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Universe/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Universe/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Universe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Universe/merges","archive_url":"https://api.github.com/repos/aspnet/Universe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Universe/downloads","issues_url":"https://api.github.com/repos/aspnet/Universe/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Universe/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Universe/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Universe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Universe/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Universe/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/Universe/deployments","created_at":"2014-01-23T20:46:48Z","updated_at":"2016-02-29T09:18:07Z","pushed_at":"2016-03-05T00:00:27Z","git_url":"git://github.com/aspnet/Universe.git","ssh_url":"git@github.com:aspnet/Universe.git","clone_url":"https://github.com/aspnet/Universe.git","svn_url":"https://github.com/aspnet/Universe","homepage":"","size":1269,"stargazers_count":93,"watchers_count":93,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":35,"forks":59,"open_issues":35,"watchers":93,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"cb73debd4daf361a3ff30c8a9dbfecb1c3fee044","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":16185172,"name":"Universe","full_name":"aspnet/Universe","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Universe","description":"Repo for building the entire ASP.NET and Entity Framework stack.","fork":false,"url":"https://api.github.com/repos/aspnet/Universe","forks_url":"https://api.github.com/repos/aspnet/Universe/forks","keys_url":"https://api.github.com/repos/aspnet/Universe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Universe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Universe/teams","hooks_url":"https://api.github.com/repos/aspnet/Universe/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Universe/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Universe/events","assignees_url":"https://api.github.com/repos/aspnet/Universe/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Universe/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Universe/tags","blobs_url":"https://api.github.com/repos/aspnet/Universe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Universe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Universe/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Universe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Universe/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Universe/languages","stargazers_url":"https://api.github.com/repos/aspnet/Universe/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Universe/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Universe/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Universe/subscription","commits_url":"https://api.github.com/repos/aspnet/Universe/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Universe/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Universe/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Universe/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Universe/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Universe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Universe/merges","archive_url":"https://api.github.com/repos/aspnet/Universe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Universe/downloads","issues_url":"https://api.github.com/repos/aspnet/Universe/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Universe/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Universe/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Universe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Universe/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Universe/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/Universe/deployments","created_at":"2014-01-23T20:46:48Z","updated_at":"2016-02-29T09:18:07Z","pushed_at":"2016-03-05T00:00:27Z","git_url":"git://github.com/aspnet/Universe.git","ssh_url":"git@github.com:aspnet/Universe.git","clone_url":"https://github.com/aspnet/Universe.git","svn_url":"https://github.com/aspnet/Universe","homepage":"","size":1269,"stargazers_count":93,"watchers_count":93,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":35,"forks":59,"open_issues":35,"watchers":93,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/411"},"html":{"href":"https://github.com/aspnet/Universe/pull/411"},"issue":{"href":"https://api.github.com/repos/aspnet/Universe/issues/411"},"comments":{"href":"https://api.github.com/repos/aspnet/Universe/issues/411/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/411/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/411/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Universe/statuses/fa6a584a84d2f69fbbd8020e682c7bc74d08b635"}}}}