{"action":"created","comment":{"url":"https://api.github.com/repos/allenai/common/pulls/comments/46224950","id":46224950,"diff_hunk":"@@ -1,27 +1,33 @@\n package org.allenai.common.indexing\n \n-import com.typesafe.config.ConfigFactory\n+import com.typesafe.config.{ Config, ConfigFactory }\n+\n+import java.io.File\n \n /** Indexing main object. Configuration specified in indexing.conf in org.allenai.common.indexing.\n   * See common/Readme for details.\n   */\n object BuildCorpusIndexRunner extends App {\n \n-  case class IndexConfig(indexConfigName: String = null)\n+  case class IndexConfig(indexConfigName: String = null, configOverrideFile: Option[File] = None)\n \n   val parser = new scopt.OptionParser[IndexConfig](\"BuildCorpusIndexRunner\") {\n     head(\"BuildCorpusIndexRunner\")\n     note(\"See common/Readme for details on how to use this.\\n\")\n     help(\"help\") text (\"prints this usage text\")\n-    arg[String](\"<indexConfigName>...\") required () action { (x, c) =>\n+    opt[String](\"index-name\") required () valueName (\"<string>\") action { (x, c) =>\n       c.copy(indexConfigName = x)\n     } text (\"name of configuration to use\")\n+    opt[File](\"config-overrides-file\") valueName (\"<file>\") action { (x, c) =>\n+      c.copy(configOverrideFile = Some(x))\n+    } text (\"Config file with overrides if any\")\n   }\n \n   parser.parse(args, IndexConfig()).foreach(config => {\n     val rootConfig = ConfigFactory.parseResources(getClass, \"indexing.conf\").resolve()\n+    val configOverrides = config.configOverrideFile map { f => ConfigFactory.parseFile(f) }","path":"indexing/src/main/scala/org/allenai/common/indexing/BuildCorpusIndexRunner.scala","position":31,"original_position":31,"commit_id":"e48e0e30e155ae42b8f76c0f2627f95b4079b57a","original_commit_id":"e48e0e30e155ae42b8f76c0f2627f95b4079b57a","user":{"login":"row11","id":13628999,"avatar_url":"https://avatars.githubusercontent.com/u/13628999?v=3","gravatar_id":"","url":"https://api.github.com/users/row11","html_url":"https://github.com/row11","followers_url":"https://api.github.com/users/row11/followers","following_url":"https://api.github.com/users/row11/following{/other_user}","gists_url":"https://api.github.com/users/row11/gists{/gist_id}","starred_url":"https://api.github.com/users/row11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/row11/subscriptions","organizations_url":"https://api.github.com/users/row11/orgs","repos_url":"https://api.github.com/users/row11/repos","events_url":"https://api.github.com/users/row11/events{/privacy}","received_events_url":"https://api.github.com/users/row11/received_events","type":"User","site_admin":false},"body":"I would personally put the pattern matching here that way you don't have to change the signature for `BuildCorpusIndex`. I mean something like:\r\n```\r\nval originalConfig = rootConfig.getConfig(s\"org.allenai.common.indexing.${config.indexConfigName}\")\r\nval finalConfig = configOverrides match {\r\n    case Some(overrides) => overrides.withFallback(originalConfig)\r\n    case None => originalConfig\r\n}\r\nnew BuildCorpusIndex(finalConfig.resolve()).buildElasticSearchIndex()\r\n```\r\nBut up to you!","created_at":"2015-12-01T00:22:54Z","updated_at":"2015-12-01T00:22:54Z","html_url":"https://github.com/allenai/common/pull/164#discussion_r46224950","pull_request_url":"https://api.github.com/repos/allenai/common/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/allenai/common/pulls/comments/46224950"},"html":{"href":"https://github.com/allenai/common/pull/164#discussion_r46224950"},"pull_request":{"href":"https://api.github.com/repos/allenai/common/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/allenai/common/pulls/164","id":52197957,"html_url":"https://github.com/allenai/common/pull/164","diff_url":"https://github.com/allenai/common/pull/164.diff","patch_url":"https://github.com/allenai/common/pull/164.patch","issue_url":"https://api.github.com/repos/allenai/common/issues/164","number":164,"state":"open","locked":false,"title":"Take in optional Overrides to Index-builder Config parameters","user":{"login":"sbhaktha","id":5631150,"avatar_url":"https://avatars.githubusercontent.com/u/5631150?v=3","gravatar_id":"","url":"https://api.github.com/users/sbhaktha","html_url":"https://github.com/sbhaktha","followers_url":"https://api.github.com/users/sbhaktha/followers","following_url":"https://api.github.com/users/sbhaktha/following{/other_user}","gists_url":"https://api.github.com/users/sbhaktha/gists{/gist_id}","starred_url":"https://api.github.com/users/sbhaktha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbhaktha/subscriptions","organizations_url":"https://api.github.com/users/sbhaktha/orgs","repos_url":"https://api.github.com/users/sbhaktha/repos","events_url":"https://api.github.com/users/sbhaktha/events{/privacy}","received_events_url":"https://api.github.com/users/sbhaktha/received_events","type":"User","site_admin":false},"body":"@row11 : here it is.","created_at":"2015-12-01T00:01:14Z","updated_at":"2015-12-01T00:22:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5783ad1ca50fbe1ee2a5561987301860b908b58f","assignee":{"login":"row11","id":13628999,"avatar_url":"https://avatars.githubusercontent.com/u/13628999?v=3","gravatar_id":"","url":"https://api.github.com/users/row11","html_url":"https://github.com/row11","followers_url":"https://api.github.com/users/row11/followers","following_url":"https://api.github.com/users/row11/following{/other_user}","gists_url":"https://api.github.com/users/row11/gists{/gist_id}","starred_url":"https://api.github.com/users/row11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/row11/subscriptions","organizations_url":"https://api.github.com/users/row11/orgs","repos_url":"https://api.github.com/users/row11/repos","events_url":"https://api.github.com/users/row11/events{/privacy}","received_events_url":"https://api.github.com/users/row11/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/allenai/common/pulls/164/commits","review_comments_url":"https://api.github.com/repos/allenai/common/pulls/164/comments","review_comment_url":"https://api.github.com/repos/allenai/common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allenai/common/issues/164/comments","statuses_url":"https://api.github.com/repos/allenai/common/statuses/e48e0e30e155ae42b8f76c0f2627f95b4079b57a","head":{"label":"sbhaktha:addIndexConfigOverride","ref":"addIndexConfigOverride","sha":"e48e0e30e155ae42b8f76c0f2627f95b4079b57a","user":{"login":"sbhaktha","id":5631150,"avatar_url":"https://avatars.githubusercontent.com/u/5631150?v=3","gravatar_id":"","url":"https://api.github.com/users/sbhaktha","html_url":"https://github.com/sbhaktha","followers_url":"https://api.github.com/users/sbhaktha/followers","following_url":"https://api.github.com/users/sbhaktha/following{/other_user}","gists_url":"https://api.github.com/users/sbhaktha/gists{/gist_id}","starred_url":"https://api.github.com/users/sbhaktha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbhaktha/subscriptions","organizations_url":"https://api.github.com/users/sbhaktha/orgs","repos_url":"https://api.github.com/users/sbhaktha/repos","events_url":"https://api.github.com/users/sbhaktha/events{/privacy}","received_events_url":"https://api.github.com/users/sbhaktha/received_events","type":"User","site_admin":false},"repo":{"id":45942418,"name":"common","full_name":"sbhaktha/common","owner":{"login":"sbhaktha","id":5631150,"avatar_url":"https://avatars.githubusercontent.com/u/5631150?v=3","gravatar_id":"","url":"https://api.github.com/users/sbhaktha","html_url":"https://github.com/sbhaktha","followers_url":"https://api.github.com/users/sbhaktha/followers","following_url":"https://api.github.com/users/sbhaktha/following{/other_user}","gists_url":"https://api.github.com/users/sbhaktha/gists{/gist_id}","starred_url":"https://api.github.com/users/sbhaktha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbhaktha/subscriptions","organizations_url":"https://api.github.com/users/sbhaktha/orgs","repos_url":"https://api.github.com/users/sbhaktha/repos","events_url":"https://api.github.com/users/sbhaktha/events{/privacy}","received_events_url":"https://api.github.com/users/sbhaktha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sbhaktha/common","description":"A collection of useful utility classes and functions.","fork":true,"url":"https://api.github.com/repos/sbhaktha/common","forks_url":"https://api.github.com/repos/sbhaktha/common/forks","keys_url":"https://api.github.com/repos/sbhaktha/common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbhaktha/common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbhaktha/common/teams","hooks_url":"https://api.github.com/repos/sbhaktha/common/hooks","issue_events_url":"https://api.github.com/repos/sbhaktha/common/issues/events{/number}","events_url":"https://api.github.com/repos/sbhaktha/common/events","assignees_url":"https://api.github.com/repos/sbhaktha/common/assignees{/user}","branches_url":"https://api.github.com/repos/sbhaktha/common/branches{/branch}","tags_url":"https://api.github.com/repos/sbhaktha/common/tags","blobs_url":"https://api.github.com/repos/sbhaktha/common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbhaktha/common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbhaktha/common/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbhaktha/common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbhaktha/common/statuses/{sha}","languages_url":"https://api.github.com/repos/sbhaktha/common/languages","stargazers_url":"https://api.github.com/repos/sbhaktha/common/stargazers","contributors_url":"https://api.github.com/repos/sbhaktha/common/contributors","subscribers_url":"https://api.github.com/repos/sbhaktha/common/subscribers","subscription_url":"https://api.github.com/repos/sbhaktha/common/subscription","commits_url":"https://api.github.com/repos/sbhaktha/common/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbhaktha/common/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbhaktha/common/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbhaktha/common/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbhaktha/common/contents/{+path}","compare_url":"https://api.github.com/repos/sbhaktha/common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbhaktha/common/merges","archive_url":"https://api.github.com/repos/sbhaktha/common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbhaktha/common/downloads","issues_url":"https://api.github.com/repos/sbhaktha/common/issues{/number}","pulls_url":"https://api.github.com/repos/sbhaktha/common/pulls{/number}","milestones_url":"https://api.github.com/repos/sbhaktha/common/milestones{/number}","notifications_url":"https://api.github.com/repos/sbhaktha/common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbhaktha/common/labels{/name}","releases_url":"https://api.github.com/repos/sbhaktha/common/releases{/id}","created_at":"2015-11-10T21:48:27Z","updated_at":"2015-11-10T21:48:28Z","pushed_at":"2015-12-01T00:00:16Z","git_url":"git://github.com/sbhaktha/common.git","ssh_url":"git@github.com:sbhaktha/common.git","clone_url":"https://github.com/sbhaktha/common.git","svn_url":"https://github.com/sbhaktha/common","homepage":null,"size":23691,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"allenai:master","ref":"master","sha":"9c966101923526855dd750f4755238b420365bf8","user":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":15063788,"name":"common","full_name":"allenai/common","owner":{"login":"allenai","id":5667695,"avatar_url":"https://avatars.githubusercontent.com/u/5667695?v=3","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/common","description":"A collection of useful utility classes and functions.","fork":false,"url":"https://api.github.com/repos/allenai/common","forks_url":"https://api.github.com/repos/allenai/common/forks","keys_url":"https://api.github.com/repos/allenai/common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/common/teams","hooks_url":"https://api.github.com/repos/allenai/common/hooks","issue_events_url":"https://api.github.com/repos/allenai/common/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/common/events","assignees_url":"https://api.github.com/repos/allenai/common/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/common/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/common/tags","blobs_url":"https://api.github.com/repos/allenai/common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/common/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/common/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/common/languages","stargazers_url":"https://api.github.com/repos/allenai/common/stargazers","contributors_url":"https://api.github.com/repos/allenai/common/contributors","subscribers_url":"https://api.github.com/repos/allenai/common/subscribers","subscription_url":"https://api.github.com/repos/allenai/common/subscription","commits_url":"https://api.github.com/repos/allenai/common/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/common/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/common/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/common/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/common/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/common/merges","archive_url":"https://api.github.com/repos/allenai/common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/common/downloads","issues_url":"https://api.github.com/repos/allenai/common/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/common/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/common/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/common/labels{/name}","releases_url":"https://api.github.com/repos/allenai/common/releases{/id}","created_at":"2013-12-10T01:16:45Z","updated_at":"2015-04-30T23:34:32Z","pushed_at":"2015-12-01T00:01:14Z","git_url":"git://github.com/allenai/common.git","ssh_url":"git@github.com:allenai/common.git","clone_url":"https://github.com/allenai/common.git","svn_url":"https://github.com/allenai/common","homepage":null,"size":23709,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":11,"forks":10,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allenai/common/pulls/164"},"html":{"href":"https://github.com/allenai/common/pull/164"},"issue":{"href":"https://api.github.com/repos/allenai/common/issues/164"},"comments":{"href":"https://api.github.com/repos/allenai/common/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/allenai/common/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/allenai/common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allenai/common/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/allenai/common/statuses/e48e0e30e155ae42b8f76c0f2627f95b4079b57a"}}}}