GitHub PullRequestReviewCommentEvent at 2014-07-10 13:04:43
Repository: elasticsearch
Actor: karmi
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/14763840","id":14763840,"diff_hunk":"@@ -28,91 +132,341 @@ def initialize(directory)\n     @directory = directory\n   end\n \n-  # get selection of available jdks from jenkins automatic install directory\n+  # get selection of available JDKs from Jenkins automatic install directory\n   def get_jdk\n-    @jdk_list = Dir.entries(directory).select do |x| \n-      x.chars.first == 'J' \n+    @jdk_list = Dir.entries(directory).select do |x|\n+      x.chars.first == 'J'\n     end.map do |y|\n       File.join(directory, y)\n     end\n     self\n   end\n \n-  # do ranomize selection from a given array\n+  def filter_java_6(files)\n+    files.select{ |i| File.basename(i).split(/[^0-9]/)[-1].to_i > 6 }\n+  end\n+\n+  # do randomized selection from a given array\n   def select_one(selection_array = nil)\n     selection_array = filter_java_6(selection_array || @jdk_list)\n-    selection_array[rand(selection_array.size)]\n+    Randomizer.new(selection_array).get_random_one\n+  end\n \n-    get_random_one(selection_array)\n+  def JDKSelector.generate_jdk_hash(jdk_choice)\n+    file_separator = if Gem.win_platform?\n+                       File::ALT_SEPARATOR\n+                     else\n+                       File::SEPARATOR\n+                     end\n+    {\n+      :PATH => [jdk_choice, 'bin'].join(file_separator) + File::PATH_SEPARATOR + ENV['PATH'],\n+      :JAVA_HOME => jdk_choice\n+    }\n   end\n end\n \n-def get_random_one(data_array)\n-  data_array[rand(data_array.size)]\n+#\n+# Fix argument JDK selector\n+#\n+class FixedJDKSelector < JDKSelector\n+\n+  def initialize(directory)\n+    @directory = [*directory] #selection of directories to pick from\n+  end\n+\n+  def get_jdk\n+    #since JDK selection is already specified..jdk list is the @directory\n+    @jdk_list = @directory\n+    self\n+  end\n+\n+  def select_one(selection_array = nil)\n+    #bypass filtering since this is not automatic\n+    selection_array ||= @jdk_list\n+    Randomizer.new(selection_array).get_random_one\n+  end\n end\n \n-def filter_java_6(files)\n-  files.select{ |i| File.basename(i).split(/[^0-9]/)[-1].to_i > 6 }\n+#\n+# Property file writer\n+# \n+class PropertyWriter\n+  attr_reader :working_directory\n+\n+  def initialize(mworking_directory)\n+    @working_directory = mworking_directory\n+  end  \n+\n+  # # pick first element out of array of hashes, generate write java property file\n+  def generate_property_file(data)\n+\n+    directory = working_directory\n+\n+    #array transformation\n+    content = data.to_a.map do |x|\n+      x.join('=')\n+    end.sort\n+    file_name = (ENV['BUILD_ID'] + ENV['BUILD_NUMBER']) || 'prop' rescue 'prop'\n+    file_name = file_name.split(File::SEPARATOR).first + '.txt'\n+    L.debug \"Property file name is %s\"%file_name\n+    File.open(File.join(directory, file_name), 'w') do |file|\n+      file.write(content.join(\"\\n\"))\n+    end\n+  end\n end\n \n-# given a jdk directory selection, generate relevant environment variables\n-def get_env_matrix(data_array)\n+#\n+# Execute randomization logics\n+#\n+class RandomizeRunner\n+  attr_reader :random_choices, :jdk, :p_writer\n+\n+  def initialize(mrandom_choices, mjdk, mwriter)\n+    @random_choices = mrandom_choices\n+    @jdk = mjdk\n+    @p_writer = mwriter\n+  end\n+\n+  def generate_selections \n+","path":"dev-tools/build_randomization.rb","position":236,"original_position":236,"commit_id":"650906e394bf863da8b8ad0ad4144c8820392f35","original_commit_id":"650906e394bf863da8b8ad0ad4144c8820392f35","user":{"login":"karmi","id":4790,"avatar_url":"https://avatars.githubusercontent.com/u/4790?","gravatar_id":"4e515deb518e9195f0dc45ec2af6a541","url":"https://api.github.com/users/karmi","html_url":"https://github.com/karmi","followers_url":"https://api.github.com/users/karmi/followers","following_url":"https://api.github.com/users/karmi/following{/other_user}","gists_url":"https://api.github.com/users/karmi/gists{/gist_id}","starred_url":"https://api.github.com/users/karmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karmi/subscriptions","organizations_url":"https://api.github.com/users/karmi/orgs","repos_url":"https://api.github.com/users/karmi/repos","events_url":"https://api.github.com/users/karmi/events{/privacy}","received_events_url":"https://api.github.com/users/karmi/received_events","type":"User","site_admin":false},"body":"Empty line...","created_at":"2014-07-10T13:04:43Z","updated_at":"2014-07-10T13:04:43Z","html_url":"https://github.com/elasticsearch/elasticsearch/pull/5914#discussion_r14763840","pull_request_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/14763840"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/5914#discussion_r14763840"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914","id":15036749,"html_url":"https://github.com/elasticsearch/elasticsearch/pull/5914","diff_url":"https://github.com/elasticsearch/elasticsearch/pull/5914.diff","patch_url":"https://github.com/elasticsearch/elasticsearch/pull/5914.patch","issue_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/5914","number":5914,"state":"open","title":"[BUILD] Randomization script refactoring","user":{"login":"mrsolo","id":96771,"avatar_url":"https://avatars.githubusercontent.com/u/96771?","gravatar_id":"2789e6a4af99aeb95d3e44680da04df0","url":"https://api.github.com/users/mrsolo","html_url":"https://github.com/mrsolo","followers_url":"https://api.github.com/users/mrsolo/followers","following_url":"https://api.github.com/users/mrsolo/following{/other_user}","gists_url":"https://api.github.com/users/mrsolo/gists{/gist_id}","starred_url":"https://api.github.com/users/mrsolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrsolo/subscriptions","organizations_url":"https://api.github.com/users/mrsolo/orgs","repos_url":"https://api.github.com/users/mrsolo/repos","events_url":"https://api.github.com/users/mrsolo/events{/privacy}","received_events_url":"https://api.github.com/users/mrsolo/received_events","type":"User","site_admin":false},"body":"1) Refactored randomization logic to the top\r\n2) Add logics to support window platforms","created_at":"2014-04-22T21:16:39Z","updated_at":"2014-07-10T13:04:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df6af5a9292cfb0fc50132e10c21084d33623be8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914/commits","review_comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914/comments","review_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/5914/comments","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/650906e394bf863da8b8ad0ad4144c8820392f35","head":{"label":"mrsolo:enhance/randomizer","ref":"enhance/randomizer","sha":"650906e394bf863da8b8ad0ad4144c8820392f35","user":{"login":"mrsolo","id":96771,"avatar_url":"https://avatars.githubusercontent.com/u/96771?","gravatar_id":"2789e6a4af99aeb95d3e44680da04df0","url":"https://api.github.com/users/mrsolo","html_url":"https://github.com/mrsolo","followers_url":"https://api.github.com/users/mrsolo/followers","following_url":"https://api.github.com/users/mrsolo/following{/other_user}","gists_url":"https://api.github.com/users/mrsolo/gists{/gist_id}","starred_url":"https://api.github.com/users/mrsolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrsolo/subscriptions","organizations_url":"https://api.github.com/users/mrsolo/orgs","repos_url":"https://api.github.com/users/mrsolo/repos","events_url":"https://api.github.com/users/mrsolo/events{/privacy}","received_events_url":"https://api.github.com/users/mrsolo/received_events","type":"User","site_admin":false},"repo":{"id":15880788,"name":"elasticsearch","full_name":"mrsolo/elasticsearch","owner":{"login":"mrsolo","id":96771,"avatar_url":"https://avatars.githubusercontent.com/u/96771?","gravatar_id":"2789e6a4af99aeb95d3e44680da04df0","url":"https://api.github.com/users/mrsolo","html_url":"https://github.com/mrsolo","followers_url":"https://api.github.com/users/mrsolo/followers","following_url":"https://api.github.com/users/mrsolo/following{/other_user}","gists_url":"https://api.github.com/users/mrsolo/gists{/gist_id}","starred_url":"https://api.github.com/users/mrsolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrsolo/subscriptions","organizations_url":"https://api.github.com/users/mrsolo/orgs","repos_url":"https://api.github.com/users/mrsolo/repos","events_url":"https://api.github.com/users/mrsolo/events{/privacy}","received_events_url":"https://api.github.com/users/mrsolo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrsolo/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/mrsolo/elasticsearch","forks_url":"https://api.github.com/repos/mrsolo/elasticsearch/forks","keys_url":"https://api.github.com/repos/mrsolo/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrsolo/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrsolo/elasticsearch/teams","hooks_url":"https://api.github.com/repos/mrsolo/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/mrsolo/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/mrsolo/elasticsearch/events","assignees_url":"https://api.github.com/repos/mrsolo/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/mrsolo/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/mrsolo/elasticsearch/tags","blobs_url":"https://api.github.com/repos/mrsolo/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrsolo/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrsolo/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrsolo/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrsolo/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/mrsolo/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/mrsolo/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/mrsolo/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/mrsolo/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/mrsolo/elasticsearch/subscription","commits_url":"https://api.github.com/repos/mrsolo/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrsolo/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrsolo/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrsolo/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/mrsolo/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/mrsolo/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrsolo/elasticsearch/merges","archive_url":"https://api.github.com/repos/mrsolo/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrsolo/elasticsearch/downloads","issues_url":"https://api.github.com/repos/mrsolo/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/mrsolo/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/mrsolo/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/mrsolo/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrsolo/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/mrsolo/elasticsearch/releases{/id}","created_at":"2014-01-13T20:30:15Z","updated_at":"2014-06-16T18:10:44Z","pushed_at":"2014-06-16T18:10:43Z","git_url":"git://github.com/mrsolo/elasticsearch.git","ssh_url":"git@github.com:mrsolo/elasticsearch.git","clone_url":"https://github.com/mrsolo/elasticsearch.git","svn_url":"https://github.com/mrsolo/elasticsearch","homepage":"http://elasticsearch.org","size":55800,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elasticsearch:master","ref":"master","sha":"7fb16c783dd8717f6bd82459ac3158dc088f1e89","user":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?","gravatar_id":"1aecf795625bbc7251068cfbc39800ab","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elasticsearch/elasticsearch","owner":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?","gravatar_id":"1aecf795625bbc7251068cfbc39800ab","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elasticsearch/elasticsearch","forks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/forks","keys_url":"https://api.github.com/repos/elasticsearch/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/events","assignees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch/elasticsearch/merges","archive_url":"https://api.github.com/repos/elasticsearch/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2014-07-10T10:24:54Z","pushed_at":"2014-07-10T13:04:42Z","git_url":"git://github.com/elasticsearch/elasticsearch.git","ssh_url":"git@github.com:elasticsearch/elasticsearch.git","clone_url":"https://github.com/elasticsearch/elasticsearch.git","svn_url":"https://github.com/elasticsearch/elasticsearch","homepage":"http://elasticsearch.org","size":213659,"stargazers_count":7577,"watchers_count":7577,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":2134,"mirror_url":null,"open_issues_count":965,"forks":2134,"open_issues":965,"watchers":7577,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/5914"},"issue":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/5914"},"comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/5914/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/5914/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/650906e394bf863da8b8ad0ad4144c8820392f35"}}}}