{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/50351850","id":50351850,"diff_hunk":"@@ -63,6 +65,35 @@\n           (is (= \"something-crazy/for-content-type\"\n                  (get-in resp [:request :content-type]))))))))\n \n+(deftest code-id-injection-test\n+  (testing \"code_id is calculated and added to the catalog request.\"\n+    (let [handler (fn ([req] {:request req}))\n+          app     (build-ring-handler handler \"1.2.3\" (constantly \"foo-is-my-codeid\"))\n+          resp    (app {:request-method :get\n+                        :uri            \"/v3/catalog/bar\"})]\n+      (is (= \"foo-is-my-codeid\" (get-in resp [:request :params \"code_id\"])))))\n+  (testing \"code_id is not added to non-catalog requests\"\n+    (let [handler (fn ([req] {:request req}))\n+          app (build-ring-handler handler \"1.2.3\" (constantly \"foo-is-my-codeid\"))\n+          request (fn r ([path] (r :get path))\n+                    ([method path] (app (mock/request method path))))]","path":"test/unit/puppetlabs/services/master/master_core_test.clj","position":32,"original_position":32,"commit_id":"d6ce96a80174b6f36066b360d649381b266d173a","original_commit_id":"d6ce96a80174b6f36066b360d649381b266d173a","user":{"login":"KevinCorcoran","id":2945462,"avatar_url":"https://avatars.githubusercontent.com/u/2945462?v=3","gravatar_id":"","url":"https://api.github.com/users/KevinCorcoran","html_url":"https://github.com/KevinCorcoran","followers_url":"https://api.github.com/users/KevinCorcoran/followers","following_url":"https://api.github.com/users/KevinCorcoran/following{/other_user}","gists_url":"https://api.github.com/users/KevinCorcoran/gists{/gist_id}","starred_url":"https://api.github.com/users/KevinCorcoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KevinCorcoran/subscriptions","organizations_url":"https://api.github.com/users/KevinCorcoran/orgs","repos_url":"https://api.github.com/users/KevinCorcoran/repos","events_url":"https://api.github.com/users/KevinCorcoran/events{/privacy}","received_events_url":"https://api.github.com/users/KevinCorcoran/received_events","type":"User","site_admin":false},"body":"I think `r` is unnecessary here.\r\n\r\nIt's also really weird to see an anonymous function with multiple arities ... don't think I've ever seen that.  Maybe that's why you named it `r`?  I'd probably just pull this out to a top-level function.","created_at":"2016-01-21T02:03:05Z","updated_at":"2016-01-21T02:03:05Z","html_url":"https://github.com/puppetlabs/puppet-server/pull/870#discussion_r50351850","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/50351850"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/870#discussion_r50351850"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870","id":56679147,"html_url":"https://github.com/puppetlabs/puppet-server/pull/870","diff_url":"https://github.com/puppetlabs/puppet-server/pull/870.diff","patch_url":"https://github.com/puppetlabs/puppet-server/pull/870.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/870","number":870,"state":"open","locked":false,"title":"[Do not merge] (SERVER-876) Add code_id to catalog requests","user":{"login":"haus","id":98408,"avatar_url":"https://avatars.githubusercontent.com/u/98408?v=3","gravatar_id":"","url":"https://api.github.com/users/haus","html_url":"https://github.com/haus","followers_url":"https://api.github.com/users/haus/followers","following_url":"https://api.github.com/users/haus/following{/other_user}","gists_url":"https://api.github.com/users/haus/gists{/gist_id}","starred_url":"https://api.github.com/users/haus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haus/subscriptions","organizations_url":"https://api.github.com/users/haus/orgs","repos_url":"https://api.github.com/users/haus/repos","events_url":"https://api.github.com/users/haus/events{/privacy}","received_events_url":"https://api.github.com/users/haus/received_events","type":"User","site_admin":false},"body":"This commit leverages the code-id-command in the versioned-code-service\r\nto calculate and add the code-id to the catalog request. This is done by\r\nadding a special handler for catalog requests that first gets the\r\nenvironment out of the request and then uses that to calculate the code\r\nid.","created_at":"2016-01-20T22:45:05Z","updated_at":"2016-01-21T02:03:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f81bce159e233059d9b85bc774e2915f03899704","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870/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/870/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/d6ce96a80174b6f36066b360d649381b266d173a","head":{"label":"haus:ticket/master/server-876-add-code-id-to-catalog-request","ref":"ticket/master/server-876-add-code-id-to-catalog-request","sha":"d6ce96a80174b6f36066b360d649381b266d173a","user":{"login":"haus","id":98408,"avatar_url":"https://avatars.githubusercontent.com/u/98408?v=3","gravatar_id":"","url":"https://api.github.com/users/haus","html_url":"https://github.com/haus","followers_url":"https://api.github.com/users/haus/followers","following_url":"https://api.github.com/users/haus/following{/other_user}","gists_url":"https://api.github.com/users/haus/gists{/gist_id}","starred_url":"https://api.github.com/users/haus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haus/subscriptions","organizations_url":"https://api.github.com/users/haus/orgs","repos_url":"https://api.github.com/users/haus/repos","events_url":"https://api.github.com/users/haus/events{/privacy}","received_events_url":"https://api.github.com/users/haus/received_events","type":"User","site_admin":false},"repo":{"id":24339675,"name":"puppet-server","full_name":"haus/puppet-server","owner":{"login":"haus","id":98408,"avatar_url":"https://avatars.githubusercontent.com/u/98408?v=3","gravatar_id":"","url":"https://api.github.com/users/haus","html_url":"https://github.com/haus","followers_url":"https://api.github.com/users/haus/followers","following_url":"https://api.github.com/users/haus/following{/other_user}","gists_url":"https://api.github.com/users/haus/gists{/gist_id}","starred_url":"https://api.github.com/users/haus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haus/subscriptions","organizations_url":"https://api.github.com/users/haus/orgs","repos_url":"https://api.github.com/users/haus/repos","events_url":"https://api.github.com/users/haus/events{/privacy}","received_events_url":"https://api.github.com/users/haus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haus/puppet-server","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/haus/puppet-server","forks_url":"https://api.github.com/repos/haus/puppet-server/forks","keys_url":"https://api.github.com/repos/haus/puppet-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haus/puppet-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haus/puppet-server/teams","hooks_url":"https://api.github.com/repos/haus/puppet-server/hooks","issue_events_url":"https://api.github.com/repos/haus/puppet-server/issues/events{/number}","events_url":"https://api.github.com/repos/haus/puppet-server/events","assignees_url":"https://api.github.com/repos/haus/puppet-server/assignees{/user}","branches_url":"https://api.github.com/repos/haus/puppet-server/branches{/branch}","tags_url":"https://api.github.com/repos/haus/puppet-server/tags","blobs_url":"https://api.github.com/repos/haus/puppet-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haus/puppet-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haus/puppet-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/haus/puppet-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haus/puppet-server/statuses/{sha}","languages_url":"https://api.github.com/repos/haus/puppet-server/languages","stargazers_url":"https://api.github.com/repos/haus/puppet-server/stargazers","contributors_url":"https://api.github.com/repos/haus/puppet-server/contributors","subscribers_url":"https://api.github.com/repos/haus/puppet-server/subscribers","subscription_url":"https://api.github.com/repos/haus/puppet-server/subscription","commits_url":"https://api.github.com/repos/haus/puppet-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/haus/puppet-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/haus/puppet-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/haus/puppet-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/haus/puppet-server/contents/{+path}","compare_url":"https://api.github.com/repos/haus/puppet-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haus/puppet-server/merges","archive_url":"https://api.github.com/repos/haus/puppet-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haus/puppet-server/downloads","issues_url":"https://api.github.com/repos/haus/puppet-server/issues{/number}","pulls_url":"https://api.github.com/repos/haus/puppet-server/pulls{/number}","milestones_url":"https://api.github.com/repos/haus/puppet-server/milestones{/number}","notifications_url":"https://api.github.com/repos/haus/puppet-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haus/puppet-server/labels{/name}","releases_url":"https://api.github.com/repos/haus/puppet-server/releases{/id}","created_at":"2014-09-22T18:12:37Z","updated_at":"2014-09-22T18:07:22Z","pushed_at":"2016-01-21T01:29:39Z","git_url":"git://github.com/haus/puppet-server.git","ssh_url":"git@github.com:haus/puppet-server.git","clone_url":"https://github.com/haus/puppet-server.git","svn_url":"https://github.com/haus/puppet-server","homepage":"","size":2987,"stargazers_count":0,"watchers_count":0,"language":null,"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":"1709101eba61b597690ef4e6693646b3c3cd0b07","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":"2016-01-21T02:00:05Z","pushed_at":"2016-01-21T01:29:39Z","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":4982,"stargazers_count":125,"watchers_count":125,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":5,"forks":80,"open_issues":5,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/870"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/870"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/870/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/870/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/870/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/d6ce96a80174b6f36066b360d649381b266d173a"}}}}