{"action":"created","comment":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/91580542","pull_request_review_id":12089446,"id":91580542,"diff_hunk":"@@ -125,53 +125,50 @@ options(connectionViewer = list(\n    NULL\n })\n \n+.rs.addJsonRpcHandler(\"get_new_connection_context\", function() {\n+  context <- list()\n \n-.rs.addJsonRpcHandler(\"get_new_spark_connection_context\", function() {\n+  context\n+})\n \n-  context <- list()\n+.rs.addFunction(\"launchEmbeddedShinyConnectionUI\", function(package)\n+{\n+   shiny::runGadget(sparklyr::connection_spark_shinyapp(), viewer = function(url) {\n+      .rs.enqueClientEvent(\"navigate_shiny_frame\", list(\n+         \"url\" = .rs.scalar(url)\n+      ))\n+   });\n \n-  # all previously connected to remote servers\n-  context$remote_servers <- .Call(\"rs_availableRemoteServers\")\n-\n-  # is there a spark home option\n-  context$spark_home <- sparklyr:::spark_home()\n-\n-  # can we install new versions\n-  canInstall <- sparklyr:::spark_can_install()\n-  context$can_install_spark_versions <- .rs.scalar(canInstall)\n-\n-  # available spark versions (filter by installed if we can't install\n-  # new versions of spark)\n-  spark_versions <- sparklyr:::spark_versions()\n-  if (!context$can_install_spark_versions)\n-    spark_versions <- subset(spark_versions, spark_versions$installed)\n-  context$spark_versions <- spark_versions\n-\n-  # default spark and hadoop version\n-  defaultVersion <- sparklyr:::spark_default_version()\n-  context$spark_default <- .rs.scalar(defaultVersion$spark);\n-  context$hadoop_default <- .rs.scalar(defaultVersion$hadoop);\n-\n-  # option defining what connections are supported\n-  defaultConnections <- c(\"local\", \"cluster\")\n-  context$connections_option <- tryCatch({\n-      connections <- getOption(\"rstudio.spark.connections\", defaultConnections)\n-      if (is.character(connections))\n-         connections\n-      else\n-         defaultConnections\n-    },\n-    error = function(e) defaultConnections\n-  )\n-\n-  # default spark cluster url\n-  context$default_cluster_url <- .rs.scalar(.Call(\"rs_defaultSparkClusterUrl\"))\n-\n-  # is java installed?\n-  context$java_installed <- .rs.scalar(sparklyr:::is_java_available())\n-  context$java_install_url <- .rs.scalar(sparklyr:::java_install_url())\n+   NULL\n+})\n \n-  context\n+.rs.addJsonRpcHandler(\"launch_embedded_shiny_connection_ui\", function(package)\n+{\n+   if (package == \"sparklyr\" & packageVersion(\"sparklyr\") < \"0.5\") {\n+      return(.rs.error(\n+         \"sparklyr \", packageVersion(\"sparklyr\"), \" does not support this functionality. \",\n+         \"Please upgrade to sparklyr 0.5.1 or newer.\"\n+      ))\n+   }\n+\n+   consoleCommand <- quote(.rs.launchEmbeddedShinyConnectionUI(package = package))\n+\n+   .rs.enqueClientEvent(\"send_to_console\", list(","path":"src/cpp/session/modules/SessionConnections.R","position":75,"original_position":75,"commit_id":"71157f9208be80099fb0a184fa63e3cb92eb0c2e","original_commit_id":"71157f9208be80099fb0a184fa63e3cb92eb0c2e","user":{"login":"jmcphers","id":470418,"avatar_url":"https://avatars.githubusercontent.com/u/470418?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcphers","html_url":"https://github.com/jmcphers","followers_url":"https://api.github.com/users/jmcphers/followers","following_url":"https://api.github.com/users/jmcphers/following{/other_user}","gists_url":"https://api.github.com/users/jmcphers/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcphers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcphers/subscriptions","organizations_url":"https://api.github.com/users/jmcphers/orgs","repos_url":"https://api.github.com/users/jmcphers/repos","events_url":"https://api.github.com/users/jmcphers/events{/privacy}","received_events_url":"https://api.github.com/users/jmcphers/received_events","type":"User","site_admin":false},"body":"(Okay with this as-is for now, just thinking about how we want this to work in the final state)","created_at":"2016-12-08T18:50:28Z","updated_at":"2016-12-08T18:50:48Z","html_url":"https://github.com/rstudio/rstudio/pull/921#discussion_r91580542","pull_request_url":"https://api.github.com/repos/rstudio/rstudio/pulls/921","_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/91580542"},"html":{"href":"https://github.com/rstudio/rstudio/pull/921#discussion_r91580542"},"pull_request":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/921"}}},"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/921","id":97032212,"html_url":"https://github.com/rstudio/rstudio/pull/921","diff_url":"https://github.com/rstudio/rstudio/pull/921.diff","patch_url":"https://github.com/rstudio/rstudio/pull/921.patch","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/921","number":921,"state":"open","locked":false,"title":"Generalize new connections dialog to use shiny app","user":{"login":"javierluraschi","id":3478847,"avatar_url":"https://avatars.githubusercontent.com/u/3478847?v=3","gravatar_id":"","url":"https://api.github.com/users/javierluraschi","html_url":"https://github.com/javierluraschi","followers_url":"https://api.github.com/users/javierluraschi/followers","following_url":"https://api.github.com/users/javierluraschi/following{/other_user}","gists_url":"https://api.github.com/users/javierluraschi/gists{/gist_id}","starred_url":"https://api.github.com/users/javierluraschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javierluraschi/subscriptions","organizations_url":"https://api.github.com/users/javierluraschi/orgs","repos_url":"https://api.github.com/users/javierluraschi/repos","events_url":"https://api.github.com/users/javierluraschi/events{/privacy}","received_events_url":"https://api.github.com/users/javierluraschi/received_events","type":"User","site_admin":false},"body":"I believe this is ready for merge, with a few caveats worth noting:\r\n\r\n 1. This will break `sparklyr` create new connections. The plan would be to push to CRAN `sparklyr` next week and then merge this [branch](https://github.com/rstudio/sparklyr/commits/feature/create-connection-ui) back to master. Older versions of sparklyr will remain broken with the following error. Once `sparklyr` releases to CRAN, we can recommend users to install the devel branch of `sparklyr`:\r\n\r\n<img width=\"505\" alt=\"screen shot 2016-12-07 at 2 52 15 pm\" src=\"https://cloud.githubusercontent.com/assets/3478847/20990444/9d852896-bc8d-11e6-8dbd-89fec64ddfed.png\">\r\n\r\n(( Just changed the dialog to read \"Please upgrade to sparklyr 0.5.1 or newer.\" since \"0.5\" will be the CRAN version which won't have support for this yet. ))\r\n\r\n 2. There is more work to do in `sparklyr` to handle displaying `hadoop_versions` in sync with `spark_versions`, warnings, allow to select master, etc. However, those changes don't need to be performed with the IDE, necessarily.\r\n\r\nIn order to get the ui back today, one can install `sparklyr` from this branch:\r\n\r\n```{r}\r\ndevtools::install_github(\"rstudio/sparklyr\", ref = \"feature/create-connection-ui\")\r\n```\r\n\r\nThen we should get this functionality back as expected but running as a shiny app:\r\n\r\n<img width=\"590\" alt=\"screen shot 2016-12-07 at 3 46 05 pm\" src=\"https://cloud.githubusercontent.com/assets/3478847/20991622/4e85fb38-bc94-11e6-8804-d8e6953f1118.png\">\r\n\r\n\r\n","created_at":"2016-12-07T23:48:29Z","updated_at":"2016-12-08T18:50:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de688777301b8bac85d339ed1169ff4e15630ed3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/rstudio/pulls/921/commits","review_comments_url":"https://api.github.com/repos/rstudio/rstudio/pulls/921/comments","review_comment_url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/921/comments","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/71157f9208be80099fb0a184fa63e3cb92eb0c2e","head":{"label":"rstudio:feature/connections-pane","ref":"feature/connections-pane","sha":"71157f9208be80099fb0a184fa63e3cb92eb0c2e","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/rstudio/deployments","created_at":"2010-12-07T19:10:25Z","updated_at":"2016-12-08T17:39:39Z","pushed_at":"2016-12-08T05:04:10Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":100687,"stargazers_count":1553,"watchers_count":1553,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":395,"mirror_url":null,"open_issues_count":7,"forks":395,"open_issues":7,"watchers":1553,"default_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"c3b4527cf174dfcc351ba81d06a436ebf00809ac","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars.githubusercontent.com/u/513560?v=3","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/rstudio/deployments","created_at":"2010-12-07T19:10:25Z","updated_at":"2016-12-08T17:39:39Z","pushed_at":"2016-12-08T05:04:10Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"http://www.rstudio.org","size":100687,"stargazers_count":1553,"watchers_count":1553,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":395,"mirror_url":null,"open_issues_count":7,"forks":395,"open_issues":7,"watchers":1553,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/921"},"html":{"href":"https://github.com/rstudio/rstudio/pull/921"},"issue":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/921"},"comments":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/921/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/921/comments"},"review_comment":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/921/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/rstudio/statuses/71157f9208be80099fb0a184fa63e3cb92eb0c2e"}}}}
{"actor":{"display_login":"jmcphers"}}