GitHub PullRequestReviewCommentEvent at 2014-11-12 22:39:37
Repository: puppet-server
Actor: cprice404
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/20257962","id":20257962,"diff_hunk":"@@ -0,0 +1,33 @@\n+(ns puppetlabs.services.jruby.puppet-environments\n+  (:import (com.puppetlabs.puppetserver EnvironmentRegistry))\n+  (:require [clojure.tools.logging :as log]))\n+\n+(defprotocol EnvironmentStateContainer\n+  (environment-state [this])\n+  (mark-all-environments-stale [this]))\n+\n+(defn environment-registry\n+  []\n+  (let [state          (atom {})\n+        mark-stale     (fn [acc env-name]\n+                         (assoc-in acc [env-name :stale] true))\n+        mark-all-stale (fn [m]\n+                         (reduce mark-stale m (keys m)))]\n+    (reify\n+      EnvironmentRegistry\n+      (registerEnvironment [this env-name]\n+        (log/debugf \"Registering environment '%s'\" env-name)\n+        (swap! state assoc-in [(keyword env-name) :stale] false)\n+        nil)\n+      (isExpired [this env-name]","path":"src/clj/puppetlabs/services/jruby/puppet_environments.clj","position":22,"original_position":22,"commit_id":"47b9ad3cb20f576acf1333cfcd354a60c185089f","original_commit_id":"47b9ad3cb20f576acf1333cfcd354a60c185089f","user":{"login":"cprice404","id":1341071,"avatar_url":"https://avatars.githubusercontent.com/u/1341071?v=3","gravatar_id":"","url":"https://api.github.com/users/cprice404","html_url":"https://github.com/cprice404","followers_url":"https://api.github.com/users/cprice404/followers","following_url":"https://api.github.com/users/cprice404/following{/other_user}","gists_url":"https://api.github.com/users/cprice404/gists{/gist_id}","starred_url":"https://api.github.com/users/cprice404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprice404/subscriptions","organizations_url":"https://api.github.com/users/cprice404/orgs","repos_url":"https://api.github.com/users/cprice404/repos","events_url":"https://api.github.com/users/cprice404/events{/privacy}","received_events_url":"https://api.github.com/users/cprice404/received_events","type":"User","site_admin":false},"body":"If that happened, it would indicate a bug in either our code or the ruby code.  I was thinking about using a precond or something, but you can't really do that inside a reify I don't think.  I could just add an explicit `if` to check for that and throw an error?","created_at":"2014-11-12T22:39:37Z","updated_at":"2014-11-12T22:39:37Z","html_url":"https://github.com/puppetlabs/puppet-server/pull/270#discussion_r20257962","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/20257962"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/270#discussion_r20257962"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270","id":24258229,"html_url":"https://github.com/puppetlabs/puppet-server/pull/270","diff_url":"https://github.com/puppetlabs/puppet-server/pull/270.diff","patch_url":"https://github.com/puppetlabs/puppet-server/pull/270.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/270","number":270,"state":"open","locked":false,"title":"(SERVER-112) Add support for flushing environment cache","user":{"login":"cprice404","id":1341071,"avatar_url":"https://avatars.githubusercontent.com/u/1341071?v=3","gravatar_id":"","url":"https://api.github.com/users/cprice404","html_url":"https://github.com/cprice404","followers_url":"https://api.github.com/users/cprice404/followers","following_url":"https://api.github.com/users/cprice404/following{/other_user}","gists_url":"https://api.github.com/users/cprice404/gists{/gist_id}","starred_url":"https://api.github.com/users/cprice404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprice404/subscriptions","organizations_url":"https://api.github.com/users/cprice404/orgs","repos_url":"https://api.github.com/users/cprice404/repos","events_url":"https://api.github.com/users/cprice404/events{/privacy}","received_events_url":"https://api.github.com/users/cprice404/received_events","type":"User","site_admin":false},"body":"This commit introduces a new class that we can plug in to the\r\nrecently-added Puppet extension point for controlling the\r\neviction of entries from the directory environment cache.\r\n\r\nIt also introduces all of the corresponding plumbing that\r\nwe need on the clojure side in order to make it work.  This\r\nincludes some additional state that we need to track on each\r\nJRuby instance to keep track of the staleness of individual\r\nenvironments.\r\n\r\nLastly, it introduces some integration tests that actually\r\nset up the puppet code on disk and make catalog requests\r\nagainst the server to validate the caching behavior.","created_at":"2014-11-11T23:15:23Z","updated_at":"2014-11-12T22:39:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"231ae66316020826cada371770e5c0809e9d427a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/{number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/270/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/47b9ad3cb20f576acf1333cfcd354a60c185089f","head":{"label":"cprice404:feature/master/SERVER-112-env-cache-flush-service","ref":"feature/master/SERVER-112-env-cache-flush-service","sha":"47b9ad3cb20f576acf1333cfcd354a60c185089f","user":{"login":"cprice404","id":1341071,"avatar_url":"https://avatars.githubusercontent.com/u/1341071?v=3","gravatar_id":"","url":"https://api.github.com/users/cprice404","html_url":"https://github.com/cprice404","followers_url":"https://api.github.com/users/cprice404/followers","following_url":"https://api.github.com/users/cprice404/following{/other_user}","gists_url":"https://api.github.com/users/cprice404/gists{/gist_id}","starred_url":"https://api.github.com/users/cprice404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprice404/subscriptions","organizations_url":"https://api.github.com/users/cprice404/orgs","repos_url":"https://api.github.com/users/cprice404/repos","events_url":"https://api.github.com/users/cprice404/events{/privacy}","received_events_url":"https://api.github.com/users/cprice404/received_events","type":"User","site_admin":false},"repo":{"id":24339614,"name":"puppet-server","full_name":"cprice404/puppet-server","owner":{"login":"cprice404","id":1341071,"avatar_url":"https://avatars.githubusercontent.com/u/1341071?v=3","gravatar_id":"","url":"https://api.github.com/users/cprice404","html_url":"https://github.com/cprice404","followers_url":"https://api.github.com/users/cprice404/followers","following_url":"https://api.github.com/users/cprice404/following{/other_user}","gists_url":"https://api.github.com/users/cprice404/gists{/gist_id}","starred_url":"https://api.github.com/users/cprice404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprice404/subscriptions","organizations_url":"https://api.github.com/users/cprice404/orgs","repos_url":"https://api.github.com/users/cprice404/repos","events_url":"https://api.github.com/users/cprice404/events{/privacy}","received_events_url":"https://api.github.com/users/cprice404/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cprice404/puppet-server","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/cprice404/puppet-server","forks_url":"https://api.github.com/repos/cprice404/puppet-server/forks","keys_url":"https://api.github.com/repos/cprice404/puppet-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cprice404/puppet-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cprice404/puppet-server/teams","hooks_url":"https://api.github.com/repos/cprice404/puppet-server/hooks","issue_events_url":"https://api.github.com/repos/cprice404/puppet-server/issues/events{/number}","events_url":"https://api.github.com/repos/cprice404/puppet-server/events","assignees_url":"https://api.github.com/repos/cprice404/puppet-server/assignees{/user}","branches_url":"https://api.github.com/repos/cprice404/puppet-server/branches{/branch}","tags_url":"https://api.github.com/repos/cprice404/puppet-server/tags","blobs_url":"https://api.github.com/repos/cprice404/puppet-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cprice404/puppet-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cprice404/puppet-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/cprice404/puppet-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cprice404/puppet-server/statuses/{sha}","languages_url":"https://api.github.com/repos/cprice404/puppet-server/languages","stargazers_url":"https://api.github.com/repos/cprice404/puppet-server/stargazers","contributors_url":"https://api.github.com/repos/cprice404/puppet-server/contributors","subscribers_url":"https://api.github.com/repos/cprice404/puppet-server/subscribers","subscription_url":"https://api.github.com/repos/cprice404/puppet-server/subscription","commits_url":"https://api.github.com/repos/cprice404/puppet-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/cprice404/puppet-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/cprice404/puppet-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/cprice404/puppet-server/issues/comments/{number}","contents_url":"https://api.github.com/repos/cprice404/puppet-server/contents/{+path}","compare_url":"https://api.github.com/repos/cprice404/puppet-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cprice404/puppet-server/merges","archive_url":"https://api.github.com/repos/cprice404/puppet-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cprice404/puppet-server/downloads","issues_url":"https://api.github.com/repos/cprice404/puppet-server/issues{/number}","pulls_url":"https://api.github.com/repos/cprice404/puppet-server/pulls{/number}","milestones_url":"https://api.github.com/repos/cprice404/puppet-server/milestones{/number}","notifications_url":"https://api.github.com/repos/cprice404/puppet-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cprice404/puppet-server/labels{/name}","releases_url":"https://api.github.com/repos/cprice404/puppet-server/releases{/id}","created_at":"2014-09-22T18:11:20Z","updated_at":"2014-10-31T01:03:41Z","pushed_at":"2014-11-11T23:11:35Z","git_url":"git://github.com/cprice404/puppet-server.git","ssh_url":"git@github.com:cprice404/puppet-server.git","clone_url":"https://github.com/cprice404/puppet-server.git","svn_url":"https://github.com/cprice404/puppet-server","homepage":"","size":1523,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"1ae13f1158e865ddc7c33f116ffdbd281caae718","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":19546488,"name":"puppet-server","full_name":"puppetlabs/puppet-server","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet-server","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet-server","forks_url":"https://api.github.com/repos/puppetlabs/puppet-server/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet-server/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet-server/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet-server/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet-server/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet-server/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet-server/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet-server/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet-server/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet-server/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet-server/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet-server/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/comments/{number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet-server/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet-server/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet-server/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet-server/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet-server/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet-server/releases{/id}","created_at":"2014-05-07T19:00:24Z","updated_at":"2014-11-06T14:04:59Z","pushed_at":"2014-11-12T20:02:21Z","git_url":"git://github.com/puppetlabs/puppet-server.git","ssh_url":"git@github.com:puppetlabs/puppet-server.git","clone_url":"https://github.com/puppetlabs/puppet-server.git","svn_url":"https://github.com/puppetlabs/puppet-server","homepage":"https://tickets.puppetlabs.com/browse/SERVER","size":6152,"stargazers_count":68,"watchers_count":68,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":2,"forks":24,"open_issues":2,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/270"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/270"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/47b9ad3cb20f576acf1333cfcd354a60c185089f"}}}}