{"action":"created","comment":{"url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments/191780718","pull_request_review_id":124420349,"id":191780718,"diff_hunk":"@@ -398,4 +400,63 @@ class ClusterComponentSpec extends TestComponent with FlatSpecLike with CommonTe\n     dbFutureValue { _.clusterQuery.getByGoogleId(c1.googleId) } shouldBe Some(updatedC1Again)\n   }\n \n+  it should \"get list of clusters to auto freeze\" in isolatedDbTest {\n+    val c1 = Cluster(\n+      clusterName = name1,\n+      googleId = UUID.randomUUID(),\n+      googleProject = project,\n+      serviceAccountInfo = ServiceAccountInfo(Some(serviceAccountEmail), Some(serviceAccountEmail)),\n+      machineConfig = MachineConfig(Some(0), Some(\"\"), Some(500)),\n+      clusterUrl = Cluster.getClusterUrl(project, name1, clusterUrlBase),\n+      operationName = OperationName(\"op1\"),\n+      status = ClusterStatus.Running,\n+      hostIp = Some(IP(\"numbers.and.dots\")),\n+      creator = userEmail,\n+      createdDate = Instant.now(),\n+      destroyedDate = None,\n+      labels = Map(\"bam\" -> \"yes\", \"vcf\" -> \"no\"),\n+      jupyterExtensionUri = None,\n+      jupyterUserScriptUri = None,\n+      Some(GcsBucketName(\"testStagingBucket1\")),\n+      List.empty,\n+      Set(masterInstance),\n+      None,\n+      Instant.now()\n+    )\n+\n+    val c2 = Cluster(\n+      clusterName = name2,\n+      googleId = UUID.randomUUID(),\n+      googleProject = project,\n+      serviceAccountInfo = ServiceAccountInfo(None, Some(serviceAccountEmail)),\n+      machineConfig = MachineConfig(Some(0),Some(\"\"), Some(500)),\n+      clusterUrl = Cluster.getClusterUrl(project, name2, clusterUrlBase),\n+      operationName = OperationName(\"op2\"),\n+      status = ClusterStatus.Stopped,\n+      hostIp = None,\n+      creator = userEmail,\n+      createdDate = Instant.now(),\n+      destroyedDate = None,\n+      labels = Map.empty,\n+      jupyterExtensionUri = Some(jupyterExtensionUri),\n+      jupyterUserScriptUri = Some(jupyterUserScriptUri),\n+      Some(GcsBucketName(\"testStagingBucket2\")),\n+      List.empty,\n+      Set.empty,\n+      None,\n+      Instant.now()\n+    )\n+\n+    dbFutureValue { _.clusterQuery.save(c1, gcsPath(\"gs://bucket1\"), Some(serviceAccountKey.id)) } shouldEqual c1\n+    dbFutureValue { _.clusterQuery.save(c2, gcsPath(\"gs://bucket1\"), Some(serviceAccountKey.id)) } shouldEqual c2\n+\n+    dbFutureValue { _.clusterQuery.getClustersReadyToAutoFreeze(autoFreezeconfig.autoFreezeAfter) } shouldBe List.empty\n+\n+    eventually(timeout(Span(30, Seconds))) {\n+      val autoFreezeList = dbFutureValue { _.clusterQuery.getClustersReadyToAutoFreeze(autoFreezeconfig.autoFreezeAfter) }\n+      autoFreezeList should contain (c1)\n+      //c2 is already stopped\n+      autoFreezeList should not contain c2","path":"src/test/scala/org/broadinstitute/dsde/workbench/leonardo/db/ClusterComponentSpec.scala","position":null,"original_position":69,"commit_id":"592287a1d13a04eb24410dc5229d030cf89a8ff3","original_commit_id":"a57104a319c25815f12bbf683862362afeeec215","user":{"login":"vkumra-broad","id":30244225,"avatar_url":"https://avatars1.githubusercontent.com/u/30244225?v=4","gravatar_id":"","url":"https://api.github.com/users/vkumra-broad","html_url":"https://github.com/vkumra-broad","followers_url":"https://api.github.com/users/vkumra-broad/followers","following_url":"https://api.github.com/users/vkumra-broad/following{/other_user}","gists_url":"https://api.github.com/users/vkumra-broad/gists{/gist_id}","starred_url":"https://api.github.com/users/vkumra-broad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkumra-broad/subscriptions","organizations_url":"https://api.github.com/users/vkumra-broad/orgs","repos_url":"https://api.github.com/users/vkumra-broad/repos","events_url":"https://api.github.com/users/vkumra-broad/events{/privacy}","received_events_url":"https://api.github.com/users/vkumra-broad/received_events","type":"User","site_admin":false},"body":"https://github.com/DataBiosphere/leonardo/issues/394","created_at":"2018-05-30T14:06:27Z","updated_at":"2018-05-30T14:06:28Z","html_url":"https://github.com/DataBiosphere/leonardo/pull/390#discussion_r191780718","pull_request_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments/191780718"},"html":{"href":"https://github.com/DataBiosphere/leonardo/pull/390#discussion_r191780718"},"pull_request":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390"}},"in_reply_to_id":191573970},"pull_request":{"url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390","id":190666668,"html_url":"https://github.com/DataBiosphere/leonardo/pull/390","diff_url":"https://github.com/DataBiosphere/leonardo/pull/390.diff","patch_url":"https://github.com/DataBiosphere/leonardo/pull/390.patch","issue_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/390","number":390,"state":"open","locked":false,"title":"Issue 369: Auto Freeze Phase 3","user":{"login":"vkumra-broad","id":30244225,"avatar_url":"https://avatars1.githubusercontent.com/u/30244225?v=4","gravatar_id":"","url":"https://api.github.com/users/vkumra-broad","html_url":"https://github.com/vkumra-broad","followers_url":"https://api.github.com/users/vkumra-broad/followers","following_url":"https://api.github.com/users/vkumra-broad/following{/other_user}","gists_url":"https://api.github.com/users/vkumra-broad/gists{/gist_id}","starred_url":"https://api.github.com/users/vkumra-broad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkumra-broad/subscriptions","organizations_url":"https://api.github.com/users/vkumra-broad/orgs","repos_url":"https://api.github.com/users/vkumra-broad/repos","events_url":"https://api.github.com/users/vkumra-broad/events{/privacy}","received_events_url":"https://api.github.com/users/vkumra-broad/received_events","type":"User","site_admin":false},"body":"Auto Freeze Phase 3\r\n\r\nHave you read [CONTRIBUTING.md](../CONTRIBUTING.md) lately? If not, do that first.\r\n\r\nI, the developer opening this PR, do solemnly pinky swear that:\r\n\r\n- [ ] I've documented my API changes in Swagger\r\n\r\nIn all cases:\r\n\r\n- [ ] Get two thumbsworth of review and PO signoff if necessary\r\n- [ ] Verify all tests go green\r\n- [ ] Squash and merge; you can delete your branch after this\r\n- [ ] Test this change deployed correctly and works on dev environment after deployment\r\n","created_at":"2018-05-25T18:42:46Z","updated_at":"2018-05-30T14:06:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"627835f3d83eafe5d487b0eacddf4a862f7d3cf0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390/commits","review_comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390/comments","review_comment_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/390/comments","statuses_url":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/592287a1d13a04eb24410dc5229d030cf89a8ff3","head":{"label":"DataBiosphere:vk-issue-369","ref":"vk-issue-369","sha":"592287a1d13a04eb24410dc5229d030cf89a8ff3","user":{"login":"DataBiosphere","id":32805087,"avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":96942484,"name":"leonardo","full_name":"DataBiosphere/leonardo","owner":{"login":"DataBiosphere","id":32805087,"avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataBiosphere/leonardo","description":"Notebook service","fork":false,"url":"https://api.github.com/repos/DataBiosphere/leonardo","forks_url":"https://api.github.com/repos/DataBiosphere/leonardo/forks","keys_url":"https://api.github.com/repos/DataBiosphere/leonardo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataBiosphere/leonardo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataBiosphere/leonardo/teams","hooks_url":"https://api.github.com/repos/DataBiosphere/leonardo/hooks","issue_events_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/events{/number}","events_url":"https://api.github.com/repos/DataBiosphere/leonardo/events","assignees_url":"https://api.github.com/repos/DataBiosphere/leonardo/assignees{/user}","branches_url":"https://api.github.com/repos/DataBiosphere/leonardo/branches{/branch}","tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/tags","blobs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/{sha}","languages_url":"https://api.github.com/repos/DataBiosphere/leonardo/languages","stargazers_url":"https://api.github.com/repos/DataBiosphere/leonardo/stargazers","contributors_url":"https://api.github.com/repos/DataBiosphere/leonardo/contributors","subscribers_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscribers","subscription_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscription","commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataBiosphere/leonardo/contents/{+path}","compare_url":"https://api.github.com/repos/DataBiosphere/leonardo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataBiosphere/leonardo/merges","archive_url":"https://api.github.com/repos/DataBiosphere/leonardo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataBiosphere/leonardo/downloads","issues_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues{/number}","pulls_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls{/number}","milestones_url":"https://api.github.com/repos/DataBiosphere/leonardo/milestones{/number}","notifications_url":"https://api.github.com/repos/DataBiosphere/leonardo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataBiosphere/leonardo/labels{/name}","releases_url":"https://api.github.com/repos/DataBiosphere/leonardo/releases{/id}","deployments_url":"https://api.github.com/repos/DataBiosphere/leonardo/deployments","created_at":"2017-07-11T22:29:16Z","updated_at":"2018-05-27T18:21:41Z","pushed_at":"2018-05-30T01:19:33Z","git_url":"git://github.com/DataBiosphere/leonardo.git","ssh_url":"git@github.com:DataBiosphere/leonardo.git","clone_url":"https://github.com/DataBiosphere/leonardo.git","svn_url":"https://github.com/DataBiosphere/leonardo","homepage":null,"size":1935,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":72,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4,"open_issues":72,"watchers":5,"default_branch":"develop"}},"base":{"label":"DataBiosphere:develop","ref":"develop","sha":"a7196359822b2b09880e1fa6210d292348fe73e7","user":{"login":"DataBiosphere","id":32805087,"avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":96942484,"name":"leonardo","full_name":"DataBiosphere/leonardo","owner":{"login":"DataBiosphere","id":32805087,"avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataBiosphere/leonardo","description":"Notebook service","fork":false,"url":"https://api.github.com/repos/DataBiosphere/leonardo","forks_url":"https://api.github.com/repos/DataBiosphere/leonardo/forks","keys_url":"https://api.github.com/repos/DataBiosphere/leonardo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataBiosphere/leonardo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataBiosphere/leonardo/teams","hooks_url":"https://api.github.com/repos/DataBiosphere/leonardo/hooks","issue_events_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/events{/number}","events_url":"https://api.github.com/repos/DataBiosphere/leonardo/events","assignees_url":"https://api.github.com/repos/DataBiosphere/leonardo/assignees{/user}","branches_url":"https://api.github.com/repos/DataBiosphere/leonardo/branches{/branch}","tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/tags","blobs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/{sha}","languages_url":"https://api.github.com/repos/DataBiosphere/leonardo/languages","stargazers_url":"https://api.github.com/repos/DataBiosphere/leonardo/stargazers","contributors_url":"https://api.github.com/repos/DataBiosphere/leonardo/contributors","subscribers_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscribers","subscription_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscription","commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataBiosphere/leonardo/contents/{+path}","compare_url":"https://api.github.com/repos/DataBiosphere/leonardo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataBiosphere/leonardo/merges","archive_url":"https://api.github.com/repos/DataBiosphere/leonardo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataBiosphere/leonardo/downloads","issues_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues{/number}","pulls_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls{/number}","milestones_url":"https://api.github.com/repos/DataBiosphere/leonardo/milestones{/number}","notifications_url":"https://api.github.com/repos/DataBiosphere/leonardo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataBiosphere/leonardo/labels{/name}","releases_url":"https://api.github.com/repos/DataBiosphere/leonardo/releases{/id}","deployments_url":"https://api.github.com/repos/DataBiosphere/leonardo/deployments","created_at":"2017-07-11T22:29:16Z","updated_at":"2018-05-27T18:21:41Z","pushed_at":"2018-05-30T01:19:33Z","git_url":"git://github.com/DataBiosphere/leonardo.git","ssh_url":"git@github.com:DataBiosphere/leonardo.git","clone_url":"https://github.com/DataBiosphere/leonardo.git","svn_url":"https://github.com/DataBiosphere/leonardo","homepage":null,"size":1935,"stargazers_count":5,"watchers_count":5,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":72,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4,"open_issues":72,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390"},"html":{"href":"https://github.com/DataBiosphere/leonardo/pull/390"},"issue":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/issues/390"},"comments":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/issues/390/comments"},"review_comments":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390/comments"},"review_comment":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/390/commits"},"statuses":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/592287a1d13a04eb24410dc5229d030cf89a8ff3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vkumra-broad"}}