{"action":"created","comment":{"url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/comments/165574519","pull_request_review_id":93531915,"id":165574519,"diff_hunk":"@@ -200,13 +211,36 @@ class SmvConfig(cmdLineArgs: Seq[String]) {\n     \"smv.class_dir\"   -> \"./target/classes\"\n   )\n \n-  // merge order is important here.  Highest priority comes last as it will override all previous\n-  private[smv] val mergedProps = defaultProps ++ appConfProps ++ homeConfProps ++ usrConfProps ++ cmdLineProps\n+  // ---------- Dynamic Run Config Parameters key/values ----------\n+  var dynamicRunConfig: Map[String, String] = Map.empty\n+\n+  // computeMergedProps() is used as a cache to avoid expensive IO if appDir is unchanged\n+  private[smv] def mergedProps = { computeMergedProps(doIO = false) ++ dynamicRunConfig }\n+\n+  // initially, the merged props cache should do the io to read app conf\n+  private var mergedPropsCache: Map[String,String] = ioBasedConf\n+\n+  /**\n+   * This function is implemented as a stupid-simple cache to avoid doing IO to obtain props every time\n+   */\n+  private def computeMergedProps(doIO: Boolean = false): Map[String,String] = {\n+    if (!doIO) return mergedPropsCache;\n+    // make the IO happen again\n+    mergedPropsCache = ioBasedConf\n+    mergedPropsCache\n+  }\n+\n+  // calling this performs the file io, hence the name\n+  private def ioBasedConf: Map[String, String] = {","path":"src/main/scala/org/tresamigos/smv/SmvConfig.scala","position":50,"original_position":50,"commit_id":"b67a71be77deef18e65f8ddad4ceee8f77f788bb","original_commit_id":"b67a71be77deef18e65f8ddad4ceee8f77f788bb","user":{"login":"laneb","id":8392543,"avatar_url":"https://avatars2.githubusercontent.com/u/8392543?v=4","gravatar_id":"","url":"https://api.github.com/users/laneb","html_url":"https://github.com/laneb","followers_url":"https://api.github.com/users/laneb/followers","following_url":"https://api.github.com/users/laneb/following{/other_user}","gists_url":"https://api.github.com/users/laneb/gists{/gist_id}","starred_url":"https://api.github.com/users/laneb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laneb/subscriptions","organizations_url":"https://api.github.com/users/laneb/orgs","repos_url":"https://api.github.com/users/laneb/repos","events_url":"https://api.github.com/users/laneb/events{/privacy}","received_events_url":"https://api.github.com/users/laneb/received_events","type":"User","site_admin":false},"body":"Can we call this something more specific, like `loadConfFromFile`? \"ioBased\" is pretty vague and there's no \"o\" involved.","created_at":"2018-02-02T07:34:16Z","updated_at":"2018-02-02T08:03:35Z","html_url":"https://github.com/TresAmigosSD/SMV/pull/1119#discussion_r165574519","pull_request_url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/comments/165574519"},"html":{"href":"https://github.com/TresAmigosSD/SMV/pull/1119#discussion_r165574519"},"pull_request":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119"}}},"pull_request":{"url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119","id":166628953,"html_url":"https://github.com/TresAmigosSD/SMV/pull/1119","diff_url":"https://github.com/TresAmigosSD/SMV/pull/1119.diff","patch_url":"https://github.com/TresAmigosSD/SMV/pull/1119.patch","issue_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues/1119","number":1119,"state":"open","locked":false,"title":"Smv Dynamic App Directory","user":{"login":"kmannislands","id":15148927,"avatar_url":"https://avatars2.githubusercontent.com/u/15148927?v=4","gravatar_id":"","url":"https://api.github.com/users/kmannislands","html_url":"https://github.com/kmannislands","followers_url":"https://api.github.com/users/kmannislands/followers","following_url":"https://api.github.com/users/kmannislands/following{/other_user}","gists_url":"https://api.github.com/users/kmannislands/gists{/gist_id}","starred_url":"https://api.github.com/users/kmannislands/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmannislands/subscriptions","organizations_url":"https://api.github.com/users/kmannislands/orgs","repos_url":"https://api.github.com/users/kmannislands/repos","events_url":"https://api.github.com/users/kmannislands/events{/privacy}","received_events_url":"https://api.github.com/users/kmannislands/received_events","type":"User","site_admin":false},"body":"Fixes #1084 with a few other (hopefully) useful additions\r\n- SMV's app directory can now be changed dynamically for python projects by calling `SmvApp.setAppDir('/foo/bar/')`. This will update all of the app's configuration properties as well as discoverable modules dynamically\r\n- The running final props can now be inspected with `SmvApp.mergedPropsJSON()` on py or scala sides or with simply `props()` from the shell\r\n\r\n**Caveat:** Providing the `runConfig` param to `runModule` or `runModuleByName` has the side effect of setting the dynamic config not just for that run, but going forward. I would prefer one of two options:\r\n  - `smvApp.setDynamicRunConfig` ought to be called separately by the caller of the run function first\r\n - Change our implementation of runConfig so that providing it as an arg to a `runModule` call only impacts that run, not any successive run","created_at":"2018-02-01T19:25:32Z","updated_at":"2018-02-02T08:03:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c34bfc9554575046262068a9fa0de005bf344e9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Kai-Chen","id":2219575,"avatar_url":"https://avatars0.githubusercontent.com/u/2219575?v=4","gravatar_id":"","url":"https://api.github.com/users/Kai-Chen","html_url":"https://github.com/Kai-Chen","followers_url":"https://api.github.com/users/Kai-Chen/followers","following_url":"https://api.github.com/users/Kai-Chen/following{/other_user}","gists_url":"https://api.github.com/users/Kai-Chen/gists{/gist_id}","starred_url":"https://api.github.com/users/Kai-Chen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kai-Chen/subscriptions","organizations_url":"https://api.github.com/users/Kai-Chen/orgs","repos_url":"https://api.github.com/users/Kai-Chen/repos","events_url":"https://api.github.com/users/Kai-Chen/events{/privacy}","received_events_url":"https://api.github.com/users/Kai-Chen/received_events","type":"User","site_admin":false},{"login":"AliTajeldin","id":2496103,"avatar_url":"https://avatars0.githubusercontent.com/u/2496103?v=4","gravatar_id":"","url":"https://api.github.com/users/AliTajeldin","html_url":"https://github.com/AliTajeldin","followers_url":"https://api.github.com/users/AliTajeldin/followers","following_url":"https://api.github.com/users/AliTajeldin/following{/other_user}","gists_url":"https://api.github.com/users/AliTajeldin/gists{/gist_id}","starred_url":"https://api.github.com/users/AliTajeldin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliTajeldin/subscriptions","organizations_url":"https://api.github.com/users/AliTajeldin/orgs","repos_url":"https://api.github.com/users/AliTajeldin/repos","events_url":"https://api.github.com/users/AliTajeldin/events{/privacy}","received_events_url":"https://api.github.com/users/AliTajeldin/received_events","type":"User","site_admin":false},{"login":"cloudysail","id":25990322,"avatar_url":"https://avatars2.githubusercontent.com/u/25990322?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudysail","html_url":"https://github.com/cloudysail","followers_url":"https://api.github.com/users/cloudysail/followers","following_url":"https://api.github.com/users/cloudysail/following{/other_user}","gists_url":"https://api.github.com/users/cloudysail/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudysail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudysail/subscriptions","organizations_url":"https://api.github.com/users/cloudysail/orgs","repos_url":"https://api.github.com/users/cloudysail/repos","events_url":"https://api.github.com/users/cloudysail/events{/privacy}","received_events_url":"https://api.github.com/users/cloudysail/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119/commits","review_comments_url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119/comments","review_comment_url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues/1119/comments","statuses_url":"https://api.github.com/repos/TresAmigosSD/SMV/statuses/b67a71be77deef18e65f8ddad4ceee8f77f788bb","head":{"label":"TresAmigosSD:i1084-separate-conf-setter","ref":"i1084-separate-conf-setter","sha":"b67a71be77deef18e65f8ddad4ceee8f77f788bb","user":{"login":"TresAmigosSD","id":8399020,"avatar_url":"https://avatars2.githubusercontent.com/u/8399020?v=4","gravatar_id":"","url":"https://api.github.com/users/TresAmigosSD","html_url":"https://github.com/TresAmigosSD","followers_url":"https://api.github.com/users/TresAmigosSD/followers","following_url":"https://api.github.com/users/TresAmigosSD/following{/other_user}","gists_url":"https://api.github.com/users/TresAmigosSD/gists{/gist_id}","starred_url":"https://api.github.com/users/TresAmigosSD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TresAmigosSD/subscriptions","organizations_url":"https://api.github.com/users/TresAmigosSD/orgs","repos_url":"https://api.github.com/users/TresAmigosSD/repos","events_url":"https://api.github.com/users/TresAmigosSD/events{/privacy}","received_events_url":"https://api.github.com/users/TresAmigosSD/received_events","type":"Organization","site_admin":false},"repo":{"id":22822910,"name":"SMV","full_name":"TresAmigosSD/SMV","owner":{"login":"TresAmigosSD","id":8399020,"avatar_url":"https://avatars2.githubusercontent.com/u/8399020?v=4","gravatar_id":"","url":"https://api.github.com/users/TresAmigosSD","html_url":"https://github.com/TresAmigosSD","followers_url":"https://api.github.com/users/TresAmigosSD/followers","following_url":"https://api.github.com/users/TresAmigosSD/following{/other_user}","gists_url":"https://api.github.com/users/TresAmigosSD/gists{/gist_id}","starred_url":"https://api.github.com/users/TresAmigosSD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TresAmigosSD/subscriptions","organizations_url":"https://api.github.com/users/TresAmigosSD/orgs","repos_url":"https://api.github.com/users/TresAmigosSD/repos","events_url":"https://api.github.com/users/TresAmigosSD/events{/privacy}","received_events_url":"https://api.github.com/users/TresAmigosSD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TresAmigosSD/SMV","description":"Spark Modularized View","fork":false,"url":"https://api.github.com/repos/TresAmigosSD/SMV","forks_url":"https://api.github.com/repos/TresAmigosSD/SMV/forks","keys_url":"https://api.github.com/repos/TresAmigosSD/SMV/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TresAmigosSD/SMV/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TresAmigosSD/SMV/teams","hooks_url":"https://api.github.com/repos/TresAmigosSD/SMV/hooks","issue_events_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues/events{/number}","events_url":"https://api.github.com/repos/TresAmigosSD/SMV/events","assignees_url":"https://api.github.com/repos/TresAmigosSD/SMV/assignees{/user}","branches_url":"https://api.github.com/repos/TresAmigosSD/SMV/branches{/branch}","tags_url":"https://api.github.com/repos/TresAmigosSD/SMV/tags","blobs_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/refs{/sha}","trees_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TresAmigosSD/SMV/statuses/{sha}","languages_url":"https://api.github.com/repos/TresAmigosSD/SMV/languages","stargazers_url":"https://api.github.com/repos/TresAmigosSD/SMV/stargazers","contributors_url":"https://api.github.com/repos/TresAmigosSD/SMV/contributors","subscribers_url":"https://api.github.com/repos/TresAmigosSD/SMV/subscribers","subscription_url":"https://api.github.com/repos/TresAmigosSD/SMV/subscription","commits_url":"https://api.github.com/repos/TresAmigosSD/SMV/commits{/sha}","git_commits_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/commits{/sha}","comments_url":"https://api.github.com/repos/TresAmigosSD/SMV/comments{/number}","issue_comment_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues/comments{/number}","contents_url":"https://api.github.com/repos/TresAmigosSD/SMV/contents/{+path}","compare_url":"https://api.github.com/repos/TresAmigosSD/SMV/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TresAmigosSD/SMV/merges","archive_url":"https://api.github.com/repos/TresAmigosSD/SMV/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TresAmigosSD/SMV/downloads","issues_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues{/number}","pulls_url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls{/number}","milestones_url":"https://api.github.com/repos/TresAmigosSD/SMV/milestones{/number}","notifications_url":"https://api.github.com/repos/TresAmigosSD/SMV/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TresAmigosSD/SMV/labels{/name}","releases_url":"https://api.github.com/repos/TresAmigosSD/SMV/releases{/id}","deployments_url":"https://api.github.com/repos/TresAmigosSD/SMV/deployments","created_at":"2014-08-11T01:19:27Z","updated_at":"2018-01-23T18:04:30Z","pushed_at":"2018-02-02T01:13:11Z","git_url":"git://github.com/TresAmigosSD/SMV.git","ssh_url":"git@github.com:TresAmigosSD/SMV.git","clone_url":"https://github.com/TresAmigosSD/SMV.git","svn_url":"https://github.com/TresAmigosSD/SMV","homepage":"","size":9856,"stargazers_count":31,"watchers_count":31,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":80,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":23,"open_issues":80,"watchers":31,"default_branch":"master"}},"base":{"label":"TresAmigosSD:master","ref":"master","sha":"f10612bbae4783a3935e167b3a12ccd6cbb9fdd8","user":{"login":"TresAmigosSD","id":8399020,"avatar_url":"https://avatars2.githubusercontent.com/u/8399020?v=4","gravatar_id":"","url":"https://api.github.com/users/TresAmigosSD","html_url":"https://github.com/TresAmigosSD","followers_url":"https://api.github.com/users/TresAmigosSD/followers","following_url":"https://api.github.com/users/TresAmigosSD/following{/other_user}","gists_url":"https://api.github.com/users/TresAmigosSD/gists{/gist_id}","starred_url":"https://api.github.com/users/TresAmigosSD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TresAmigosSD/subscriptions","organizations_url":"https://api.github.com/users/TresAmigosSD/orgs","repos_url":"https://api.github.com/users/TresAmigosSD/repos","events_url":"https://api.github.com/users/TresAmigosSD/events{/privacy}","received_events_url":"https://api.github.com/users/TresAmigosSD/received_events","type":"Organization","site_admin":false},"repo":{"id":22822910,"name":"SMV","full_name":"TresAmigosSD/SMV","owner":{"login":"TresAmigosSD","id":8399020,"avatar_url":"https://avatars2.githubusercontent.com/u/8399020?v=4","gravatar_id":"","url":"https://api.github.com/users/TresAmigosSD","html_url":"https://github.com/TresAmigosSD","followers_url":"https://api.github.com/users/TresAmigosSD/followers","following_url":"https://api.github.com/users/TresAmigosSD/following{/other_user}","gists_url":"https://api.github.com/users/TresAmigosSD/gists{/gist_id}","starred_url":"https://api.github.com/users/TresAmigosSD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TresAmigosSD/subscriptions","organizations_url":"https://api.github.com/users/TresAmigosSD/orgs","repos_url":"https://api.github.com/users/TresAmigosSD/repos","events_url":"https://api.github.com/users/TresAmigosSD/events{/privacy}","received_events_url":"https://api.github.com/users/TresAmigosSD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TresAmigosSD/SMV","description":"Spark Modularized View","fork":false,"url":"https://api.github.com/repos/TresAmigosSD/SMV","forks_url":"https://api.github.com/repos/TresAmigosSD/SMV/forks","keys_url":"https://api.github.com/repos/TresAmigosSD/SMV/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TresAmigosSD/SMV/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TresAmigosSD/SMV/teams","hooks_url":"https://api.github.com/repos/TresAmigosSD/SMV/hooks","issue_events_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues/events{/number}","events_url":"https://api.github.com/repos/TresAmigosSD/SMV/events","assignees_url":"https://api.github.com/repos/TresAmigosSD/SMV/assignees{/user}","branches_url":"https://api.github.com/repos/TresAmigosSD/SMV/branches{/branch}","tags_url":"https://api.github.com/repos/TresAmigosSD/SMV/tags","blobs_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/refs{/sha}","trees_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TresAmigosSD/SMV/statuses/{sha}","languages_url":"https://api.github.com/repos/TresAmigosSD/SMV/languages","stargazers_url":"https://api.github.com/repos/TresAmigosSD/SMV/stargazers","contributors_url":"https://api.github.com/repos/TresAmigosSD/SMV/contributors","subscribers_url":"https://api.github.com/repos/TresAmigosSD/SMV/subscribers","subscription_url":"https://api.github.com/repos/TresAmigosSD/SMV/subscription","commits_url":"https://api.github.com/repos/TresAmigosSD/SMV/commits{/sha}","git_commits_url":"https://api.github.com/repos/TresAmigosSD/SMV/git/commits{/sha}","comments_url":"https://api.github.com/repos/TresAmigosSD/SMV/comments{/number}","issue_comment_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues/comments{/number}","contents_url":"https://api.github.com/repos/TresAmigosSD/SMV/contents/{+path}","compare_url":"https://api.github.com/repos/TresAmigosSD/SMV/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TresAmigosSD/SMV/merges","archive_url":"https://api.github.com/repos/TresAmigosSD/SMV/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TresAmigosSD/SMV/downloads","issues_url":"https://api.github.com/repos/TresAmigosSD/SMV/issues{/number}","pulls_url":"https://api.github.com/repos/TresAmigosSD/SMV/pulls{/number}","milestones_url":"https://api.github.com/repos/TresAmigosSD/SMV/milestones{/number}","notifications_url":"https://api.github.com/repos/TresAmigosSD/SMV/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TresAmigosSD/SMV/labels{/name}","releases_url":"https://api.github.com/repos/TresAmigosSD/SMV/releases{/id}","deployments_url":"https://api.github.com/repos/TresAmigosSD/SMV/deployments","created_at":"2014-08-11T01:19:27Z","updated_at":"2018-01-23T18:04:30Z","pushed_at":"2018-02-02T01:13:11Z","git_url":"git://github.com/TresAmigosSD/SMV.git","ssh_url":"git@github.com:TresAmigosSD/SMV.git","clone_url":"https://github.com/TresAmigosSD/SMV.git","svn_url":"https://github.com/TresAmigosSD/SMV","homepage":"","size":9856,"stargazers_count":31,"watchers_count":31,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":80,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":23,"open_issues":80,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119"},"html":{"href":"https://github.com/TresAmigosSD/SMV/pull/1119"},"issue":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/issues/1119"},"comments":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/issues/1119/comments"},"review_comments":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119/comments"},"review_comment":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/pulls/1119/commits"},"statuses":{"href":"https://api.github.com/repos/TresAmigosSD/SMV/statuses/b67a71be77deef18e65f8ddad4ceee8f77f788bb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"laneb"}}