{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Universe/pulls/comments/30065395","id":30065395,"diff_hunk":"@@ -203,15 +204,104 @@ var buildTarget = \"compile\"\n             CloneOrUpdate(repo);\n \n             GitCommand(repo, \"checkout origin/release -B master\");\n-            File.Copy(Path.Combine(\"build-template\", \"NuGet.master.config\"),\n+\n+            if(File.Exists(Path.Combine(repo, \"NuGet.config\")))\n+            {\n+                File.Copy(Path.Combine(\"build-template\", \"NuGet.master.config\"),\n                       Path.Combine(repo, \"NuGet.config\"),\n                       overwrite: true);\n-            GitCommand(repo, \"commit -am \\\"Updating NuGet.config\\\"\");\n+                GitCommand(repo, \"commit -am \\\"Updating NuGet.config\\\"\");\n+            }\n \n             GitCommand(repo, \"push origin master:master -f\");\n         }\n     }\n \n+#pin-version\n+    @{\n+        // NOTE: Before running update the below monikers as needed\n+        // TODO: Should these be taken from environmental variable ?\n+        var branch = \"master\";\n+        var stableBranches = new[] {\"master\"};\n+\n+        var oldPreRelease = \"\";\n+        var newPreRelease = \"\";\n+        var excludeReposForJson = new[]\n+            {\n+              \"Coherence\",\n+              \"Coherence-Signed\",\n+              \"dnvm\",\n+              \"Entropy\"\n+            };\n+\n+        foreach (var repo in GetAllRepos().Except(excludeReposForJson))\n+        {\n+            CloneOrUpdate(repo);\n+\n+            GitCommand(repo, string.Format(\"checkout {0}\", branch));\n+\n+            if(File.Exists(Path.Combine(repo, \"build.cmd\")))\n+            {\n+                File.Copy(Path.Combine(\"build-template\", \"build.cmd\"),\n+                      Path.Combine(repo, \"build.cmd\"),\n+                      overwrite: true);\n+                GitCommand(repo, \"commit -am \\\"Updating build.cmd to pin KoreBuild and DNX\\\"\");\n+            }\n+\n+            // Process project.json files to pin version numbers\n+            // Replace version in project.json\n+            foreach(var file in Directory.GetFiles(repo,\"project.json\",SearchOption.AllDirectories))\n+            {\n+                var builder = new StringBuilder();\n+                var contents = File.ReadAllLines(file);\n+\n+                foreach(var jsonEntry in contents)\n+                {\n+                    if(!jsonEntry.Contains(\"\\\"System.\"))\n+                    {\n+                        var oldSearchExp = string.IsNullOrEmpty(oldPreRelease) ? \"0.0-*\" : string.Format(\"0.0-{0}-*\" , oldPreRelease);\n+                        var newReplaceExp = string.IsNullOrEmpty(newPreRelease) ? \"0.0-*\" : string.Format(\"0.0-{0}\" , newPreRelease);\n+                        newReplaceExp = stableBranches.Contains(branch) ? newReplaceExp : newReplaceExp + \"-*\";\n+\n+                        var newEntry = ProcessExcludesForPackages(jsonEntry);\n+\n+                        builder.AppendLine(newEntry.Replace(oldSearchExp, newReplaceExp));\n+                    }\n+                    else\n+                    {\n+                        builder.AppendLine(jsonEntry);\n+                    }\n+                }\n+\n+                File.WriteAllText(file,builder.ToString());\n+            }\n+\n+            // Build projects to produce project.lock.json\n+            Exec(\"build.cmd\", \"compile\", repo);\n+\n+            // Replace lock=true in project.lock.json\n+            foreach(var file in Directory.GetFiles(repo,\"project.lock.json\",SearchOption.AllDirectories))\n+            {\n+                var contents = File.ReadAllText(file);\n+                var newContents = contents.Replace(\"\\\"locked\\\": false\", \"\\\"locked\\\": true\");\n+                File.WriteAllText(file,newContents);","path":"makefile.shade","position":94,"original_position":94,"commit_id":"c82f0e3d37da8d77a0e8b6d3ea3f97772ec85b99","original_commit_id":"c82f0e3d37da8d77a0e8b6d3ea3f97772ec85b99","user":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"body":"Can sprinkle a few spaces after the commas here...","created_at":"2015-05-11T18:08:17Z","updated_at":"2015-05-11T18:08:17Z","html_url":"https://github.com/aspnet/Universe/pull/216#discussion_r30065395","pull_request_url":"https://api.github.com/repos/aspnet/Universe/pulls/216","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/comments/30065395"},"html":{"href":"https://github.com/aspnet/Universe/pull/216#discussion_r30065395"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/216"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Universe/pulls/216","id":34869734,"html_url":"https://github.com/aspnet/Universe/pull/216","diff_url":"https://github.com/aspnet/Universe/pull/216.diff","patch_url":"https://github.com/aspnet/Universe/pull/216.patch","issue_url":"https://api.github.com/repos/aspnet/Universe/issues/216","number":216,"state":"open","locked":false,"title":"Adding support to pin version","user":{"login":"suhasj","id":1919946,"avatar_url":"https://avatars.githubusercontent.com/u/1919946?v=3","gravatar_id":"","url":"https://api.github.com/users/suhasj","html_url":"https://github.com/suhasj","followers_url":"https://api.github.com/users/suhasj/followers","following_url":"https://api.github.com/users/suhasj/following{/other_user}","gists_url":"https://api.github.com/users/suhasj/gists{/gist_id}","starred_url":"https://api.github.com/users/suhasj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suhasj/subscriptions","organizations_url":"https://api.github.com/users/suhasj/orgs","repos_url":"https://api.github.com/users/suhasj/repos","events_url":"https://api.github.com/users/suhasj/events{/privacy}","received_events_url":"https://api.github.com/users/suhasj/received_events","type":"User","site_admin":false},"body":"@davidfowl @pranavkm @Eilon \r\n\r\nChanges\r\n- For existing `update-master` target added check to edit Nuget.config only if Nuget.config present in the repo. This for Coherence-Signed\r\n- Updated Nuget.config files to have `<clear/>` tag\r\n- Added a new target `pin-version` that\r\n  * Checks out the needed branch\r\n  * Replaces version with required expression for non coreclr packages which is mostly once shipped us\r\n  * The additional method `ProcessExcludesForPackages` is for certain packages that are not latest.\r\n  * Run `build compile` to create lock files.\r\n  * Set `lock=true`\r\n  * Push to the branch\r\n\r\nQuestions\r\n- Should I read the branch name from env variable or the current experience of editing the file is ok \r\n ?\r\n- Should the default branch be master or empty ?\r\n- Should I run `build compile` or `build verify` to run tests as well to verify sanity ? If we plan to run master branch once we push, this would seem unnecessary \r\n- Should I create an intermittent branch and push to that and merge later ?\r\n","created_at":"2015-05-06T23:08:46Z","updated_at":"2015-05-11T18:08:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67be68e08c1209ae3ff6784bba0b769bd508c4af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Universe/pulls/216/commits","review_comments_url":"https://api.github.com/repos/aspnet/Universe/pulls/216/comments","review_comment_url":"https://api.github.com/repos/aspnet/Universe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Universe/issues/216/comments","statuses_url":"https://api.github.com/repos/aspnet/Universe/statuses/c82f0e3d37da8d77a0e8b6d3ea3f97772ec85b99","head":{"label":"aspnet:suhasj/ReleaseChanges","ref":"suhasj/ReleaseChanges","sha":"c82f0e3d37da8d77a0e8b6d3ea3f97772ec85b99","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}","created_at":"2014-01-23T20:46:48Z","updated_at":"2015-05-06T18:05:43Z","pushed_at":"2015-05-11T17:24:02Z","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":3262,"stargazers_count":61,"watchers_count":61,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":56,"forks":32,"open_issues":56,"watchers":61,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"789544a1e80c7ef0e011b1bf9b8a3ec9fd501939","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}","created_at":"2014-01-23T20:46:48Z","updated_at":"2015-05-06T18:05:43Z","pushed_at":"2015-05-11T17:24:02Z","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":3262,"stargazers_count":61,"watchers_count":61,"language":"PowerShell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":56,"forks":32,"open_issues":56,"watchers":61,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/216"},"html":{"href":"https://github.com/aspnet/Universe/pull/216"},"issue":{"href":"https://api.github.com/repos/aspnet/Universe/issues/216"},"comments":{"href":"https://api.github.com/repos/aspnet/Universe/issues/216/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/216/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Universe/pulls/216/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Universe/statuses/c82f0e3d37da8d77a0e8b6d3ea3f97772ec85b99"}}}}