{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/51493265","id":51493265,"diff_hunk":"@@ -259,73 +251,13 @@\n   \"Make the request mutable.  This is required by the ruby layer.\"\n   (HashMap. request))\n \n-(defn bad-request?\n-  [x]\n-  \"Determine if the supplied slingshot message is for a 'bad request'\"\n-  (when (map? x)\n-    (= (:type x)\n-       :puppetlabs.services.request-handler.request-handler-core/bad-request)))\n-\n-(defn service-unavailable?\n-  [x]\n-  \"Determine if the supplied slingshot message is for a 'service unavailable'\"\n-  (when (map? x)\n-    (= (:type x)\n-       :puppetlabs.services.jruby.jruby-puppet-service/service-unavailable)))\n-\n-(defn jruby-timeout?\n-  \"Determine if the supplied slingshot message is for a JRuby borrow timeout.\"\n-  [x]\n-  (when (map? x)\n-    (= (:type x)\n-       :puppetlabs.services.jruby.jruby-puppet-service/jruby-timeout)))\n-\n-(defn output-error\n-  [{:keys [uri]} {:keys [message]} http-status]\n-  (log/errorf \"Error %d on SERVER at %s: %s\" http-status uri message)\n-  (-> (ring-response/response message)\n-      (ring-response/status http-status)\n-      (ring-response/content-type \"text/plain\")))\n-\n-(defn wrap-with-error-handling\n-  \"Middleware that wraps a JRuby request with some error handling to return\n-  the appropriate http status codes, etc.\"\n-  [f]\n-  (fn [request]\n-    (sling/try+\n-      (f request)\n-      (catch bad-request? e\n-        (output-error request e 400))\n-      (catch jruby-timeout? e\n-        (output-error request e 503))\n-      (catch service-unavailable? e\n-        (output-error request e 503)))))\n-\n-(defn wrap-with-jruby-instance\n-  \"Middleware fn that borrows a jruby instance from the `jruby-service` and makes\n-  it available in the request as `:jruby-instance`\"\n-  [f jruby-service]\n-  (fn [request]\n-    (jruby/with-jruby-puppet\n-      jruby-instance\n-      jruby-service\n-      {:request (dissoc request :ssl-client-cert)}\n-      \n-      (f (assoc request :jruby-instance jruby-instance)))))","path":"src/clj/puppetlabs/services/request_handler/request_handler_core.clj","position":112,"original_position":112,"commit_id":"6fb9bfe5974d3e4b18601c7c8c06735f4e7073fd","original_commit_id":"6fb9bfe5974d3e4b18601c7c8c06735f4e7073fd","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":"Ah, yep, this fn did indeed exist before.  It seems like kind of a scary function to me, but, I guess that's not relevant to this PR.","created_at":"2016-02-01T22:39:28Z","updated_at":"2016-02-01T22:39:28Z","html_url":"https://github.com/puppetlabs/puppet-server/pull/895#discussion_r51493265","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/51493265"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/895#discussion_r51493265"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895","id":57874842,"html_url":"https://github.com/puppetlabs/puppet-server/pull/895","diff_url":"https://github.com/puppetlabs/puppet-server/pull/895.diff","patch_url":"https://github.com/puppetlabs/puppet-server/pull/895.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/895","number":895,"state":"open","locked":false,"title":"(SERVER-1110) Introduce environment_classes endpoint","user":{"login":"camlow325","id":5652737,"avatar_url":"https://avatars.githubusercontent.com/u/5652737?v=3","gravatar_id":"","url":"https://api.github.com/users/camlow325","html_url":"https://github.com/camlow325","followers_url":"https://api.github.com/users/camlow325/followers","following_url":"https://api.github.com/users/camlow325/following{/other_user}","gists_url":"https://api.github.com/users/camlow325/gists{/gist_id}","starred_url":"https://api.github.com/users/camlow325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlow325/subscriptions","organizations_url":"https://api.github.com/users/camlow325/orgs","repos_url":"https://api.github.com/users/camlow325/repos","events_url":"https://api.github.com/users/camlow325/events{/privacy}","received_events_url":"https://api.github.com/users/camlow325/received_events","type":"User","site_admin":false},"body":"This PR introduces a new HTTP endpoint, environment_classes, which\r\nreturns information about the available classes on a per environment\r\nbasis, including the names of the classes, associated parameter names\r\nand types, and the default values for any parameters, where applicable.\r\n\r\nThis PR also moves some of the JRuby request handling helper\r\nfunctions from the request-handler-core namespace into a new namespace,\r\njruby-request, so that the backend implementation of the new\r\nenvironment_classes endpoint can reuse some of those same functions\r\nwithout having to be processed by the request-handler-service.\r\n\r\nThis PR also removes some code that had been added in previous tickets --\r\nSERVER-815 and PE-11124 -- in anticipation of what the environment_classes\r\nendpoint would need.  That code no longer seemed to be appropriate, so it\r\nseemed best to just remove it.\r\n\r\n","created_at":"2016-02-01T17:51:08Z","updated_at":"2016-02-01T22:39:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d83cf98c99ac0bef8bb549ef25c2188874d38254","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895/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/895/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/6fb9bfe5974d3e4b18601c7c8c06735f4e7073fd","head":{"label":"camlow325:feature/master/SERVER-1110-initial-environment-classes-endpoint","ref":"feature/master/SERVER-1110-initial-environment-classes-endpoint","sha":"6fb9bfe5974d3e4b18601c7c8c06735f4e7073fd","user":{"login":"camlow325","id":5652737,"avatar_url":"https://avatars.githubusercontent.com/u/5652737?v=3","gravatar_id":"","url":"https://api.github.com/users/camlow325","html_url":"https://github.com/camlow325","followers_url":"https://api.github.com/users/camlow325/followers","following_url":"https://api.github.com/users/camlow325/following{/other_user}","gists_url":"https://api.github.com/users/camlow325/gists{/gist_id}","starred_url":"https://api.github.com/users/camlow325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlow325/subscriptions","organizations_url":"https://api.github.com/users/camlow325/orgs","repos_url":"https://api.github.com/users/camlow325/repos","events_url":"https://api.github.com/users/camlow325/events{/privacy}","received_events_url":"https://api.github.com/users/camlow325/received_events","type":"User","site_admin":false},"repo":{"id":24697001,"name":"puppet-server","full_name":"camlow325/puppet-server","owner":{"login":"camlow325","id":5652737,"avatar_url":"https://avatars.githubusercontent.com/u/5652737?v=3","gravatar_id":"","url":"https://api.github.com/users/camlow325","html_url":"https://github.com/camlow325","followers_url":"https://api.github.com/users/camlow325/followers","following_url":"https://api.github.com/users/camlow325/following{/other_user}","gists_url":"https://api.github.com/users/camlow325/gists{/gist_id}","starred_url":"https://api.github.com/users/camlow325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlow325/subscriptions","organizations_url":"https://api.github.com/users/camlow325/orgs","repos_url":"https://api.github.com/users/camlow325/repos","events_url":"https://api.github.com/users/camlow325/events{/privacy}","received_events_url":"https://api.github.com/users/camlow325/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camlow325/puppet-server","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/camlow325/puppet-server","forks_url":"https://api.github.com/repos/camlow325/puppet-server/forks","keys_url":"https://api.github.com/repos/camlow325/puppet-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camlow325/puppet-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camlow325/puppet-server/teams","hooks_url":"https://api.github.com/repos/camlow325/puppet-server/hooks","issue_events_url":"https://api.github.com/repos/camlow325/puppet-server/issues/events{/number}","events_url":"https://api.github.com/repos/camlow325/puppet-server/events","assignees_url":"https://api.github.com/repos/camlow325/puppet-server/assignees{/user}","branches_url":"https://api.github.com/repos/camlow325/puppet-server/branches{/branch}","tags_url":"https://api.github.com/repos/camlow325/puppet-server/tags","blobs_url":"https://api.github.com/repos/camlow325/puppet-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camlow325/puppet-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camlow325/puppet-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/camlow325/puppet-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camlow325/puppet-server/statuses/{sha}","languages_url":"https://api.github.com/repos/camlow325/puppet-server/languages","stargazers_url":"https://api.github.com/repos/camlow325/puppet-server/stargazers","contributors_url":"https://api.github.com/repos/camlow325/puppet-server/contributors","subscribers_url":"https://api.github.com/repos/camlow325/puppet-server/subscribers","subscription_url":"https://api.github.com/repos/camlow325/puppet-server/subscription","commits_url":"https://api.github.com/repos/camlow325/puppet-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/camlow325/puppet-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/camlow325/puppet-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/camlow325/puppet-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/camlow325/puppet-server/contents/{+path}","compare_url":"https://api.github.com/repos/camlow325/puppet-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camlow325/puppet-server/merges","archive_url":"https://api.github.com/repos/camlow325/puppet-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camlow325/puppet-server/downloads","issues_url":"https://api.github.com/repos/camlow325/puppet-server/issues{/number}","pulls_url":"https://api.github.com/repos/camlow325/puppet-server/pulls{/number}","milestones_url":"https://api.github.com/repos/camlow325/puppet-server/milestones{/number}","notifications_url":"https://api.github.com/repos/camlow325/puppet-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camlow325/puppet-server/labels{/name}","releases_url":"https://api.github.com/repos/camlow325/puppet-server/releases{/id}","deployments_url":"https://api.github.com/repos/camlow325/puppet-server/deployments","created_at":"2014-10-01T21:59:27Z","updated_at":"2016-01-14T21:34:15Z","pushed_at":"2016-02-01T17:36:03Z","git_url":"git://github.com/camlow325/puppet-server.git","ssh_url":"git@github.com:camlow325/puppet-server.git","clone_url":"https://github.com/camlow325/puppet-server.git","svn_url":"https://github.com/camlow325/puppet-server","homepage":"https://tickets.puppetlabs.com/browse/SERVER","size":3163,"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":"71ebbff66b2fefec6d700a405a5a8de64e9a1d39","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}","deployments_url":"https://api.github.com/repos/puppetlabs/puppet-server/deployments","created_at":"2014-05-07T19:00:24Z","updated_at":"2016-01-25T19:22:48Z","pushed_at":"2016-02-01T17:51:08Z","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":5101,"stargazers_count":126,"watchers_count":126,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":9,"forks":81,"open_issues":9,"watchers":126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/895"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/895"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/895/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/895/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/895/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/6fb9bfe5974d3e4b18601c7c8c06735f4e7073fd"}}}}