{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel/pulls/comments/34492226","id":34492226,"diff_hunk":"@@ -70,6 +70,15 @@ func NewContext(timeout time.Duration) (Context, context.CancelFunc) {\n \t}, cancel\n }\n \n+// WrapContextForTest returns a Context that is associated with the call.\n+// This should be used in units test only.\n+func WrapContextForTest(ctx context.Context, call tchannel.IncomingCall) Context {","path":"golang/thrift/context.go","position":null,"original_position":6,"commit_id":"148777c722439930d8611e17fa2837da9db738da","original_commit_id":"bab7719eb61cd821d5c7a3f5245766582b1af60e","user":{"login":"pengzhai","id":2194327,"avatar_url":"https://avatars.githubusercontent.com/u/2194327?v=3","gravatar_id":"","url":"https://api.github.com/users/pengzhai","html_url":"https://github.com/pengzhai","followers_url":"https://api.github.com/users/pengzhai/followers","following_url":"https://api.github.com/users/pengzhai/following{/other_user}","gists_url":"https://api.github.com/users/pengzhai/gists{/gist_id}","starred_url":"https://api.github.com/users/pengzhai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengzhai/subscriptions","organizations_url":"https://api.github.com/users/pengzhai/orgs","repos_url":"https://api.github.com/users/pengzhai/repos","events_url":"https://api.github.com/users/pengzhai/events{/privacy}","received_events_url":"https://api.github.com/users/pengzhai/received_events","type":"User","site_admin":false},"body":"Really good point. My previous approach felt a bit weird as I had 'wrap...test' at two different places which were not that different...\r\n\r\nFixed.","created_at":"2015-07-13T18:05:33Z","updated_at":"2015-07-13T18:05:33Z","html_url":"https://github.com/uber/tchannel/pull/908#discussion_r34492226","pull_request_url":"https://api.github.com/repos/uber/tchannel/pulls/908","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel/pulls/comments/34492226"},"html":{"href":"https://github.com/uber/tchannel/pull/908#discussion_r34492226"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel/pulls/908"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel/pulls/908","id":39730000,"html_url":"https://github.com/uber/tchannel/pull/908","diff_url":"https://github.com/uber/tchannel/pull/908.diff","patch_url":"https://github.com/uber/tchannel/pull/908.patch","issue_url":"https://api.github.com/repos/uber/tchannel/issues/908","number":908,"state":"open","locked":false,"title":"Allow pulling out new IncomingCall object by a custom key.","user":{"login":"pengzhai","id":2194327,"avatar_url":"https://avatars.githubusercontent.com/u/2194327?v=3","gravatar_id":"","url":"https://api.github.com/users/pengzhai","html_url":"https://github.com/pengzhai","followers_url":"https://api.github.com/users/pengzhai/followers","following_url":"https://api.github.com/users/pengzhai/following{/other_user}","gists_url":"https://api.github.com/users/pengzhai/gists{/gist_id}","starred_url":"https://api.github.com/users/pengzhai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengzhai/subscriptions","organizations_url":"https://api.github.com/users/pengzhai/orgs","repos_url":"https://api.github.com/users/pengzhai/repos","events_url":"https://api.github.com/users/pengzhai/events{/privacy}","received_events_url":"https://api.github.com/users/pengzhai/received_events","type":"User","site_admin":false},"body":"The main purpose is to provide a way to stub out the IncomingCall object in unit tests.\r\n\r\nMain changes include:\r\n- Add a new method to allow custom key for pulling out the IncomingCall object.\r\n- Add unit tests.","created_at":"2015-07-10T22:21:50Z","updated_at":"2015-07-13T18:05:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8874cd1b56d4512e3ab556267bcb308a5f6361c9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel/pulls/908/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel/pulls/908/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel/issues/908/comments","statuses_url":"https://api.github.com/repos/uber/tchannel/statuses/148777c722439930d8611e17fa2837da9db738da","head":{"label":"uber:current-call-with-key","ref":"current-call-with-key","sha":"148777c722439930d8611e17fa2837da9db738da","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":28419663,"name":"tchannel","full_name":"uber/tchannel","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel","description":"network multiplexing and framing protocol for RPC","fork":false,"url":"https://api.github.com/repos/uber/tchannel","forks_url":"https://api.github.com/repos/uber/tchannel/forks","keys_url":"https://api.github.com/repos/uber/tchannel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel/teams","hooks_url":"https://api.github.com/repos/uber/tchannel/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel/events","assignees_url":"https://api.github.com/repos/uber/tchannel/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel/tags","blobs_url":"https://api.github.com/repos/uber/tchannel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel/subscription","commits_url":"https://api.github.com/repos/uber/tchannel/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel/merges","archive_url":"https://api.github.com/repos/uber/tchannel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel/downloads","issues_url":"https://api.github.com/repos/uber/tchannel/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel/releases{/id}","created_at":"2014-12-23T21:06:57Z","updated_at":"2015-07-13T11:37:38Z","pushed_at":"2015-07-13T18:02:38Z","git_url":"git://github.com/uber/tchannel.git","ssh_url":"git@github.com:uber/tchannel.git","clone_url":"https://github.com/uber/tchannel.git","svn_url":"https://github.com/uber/tchannel","homepage":"","size":17016,"stargazers_count":88,"watchers_count":88,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":53,"forks":9,"open_issues":53,"watchers":88,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"751daeb5e6b628374c0800e51b199262d43f8961","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":28419663,"name":"tchannel","full_name":"uber/tchannel","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel","description":"network multiplexing and framing protocol for RPC","fork":false,"url":"https://api.github.com/repos/uber/tchannel","forks_url":"https://api.github.com/repos/uber/tchannel/forks","keys_url":"https://api.github.com/repos/uber/tchannel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel/teams","hooks_url":"https://api.github.com/repos/uber/tchannel/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel/events","assignees_url":"https://api.github.com/repos/uber/tchannel/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel/tags","blobs_url":"https://api.github.com/repos/uber/tchannel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel/subscription","commits_url":"https://api.github.com/repos/uber/tchannel/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel/merges","archive_url":"https://api.github.com/repos/uber/tchannel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel/downloads","issues_url":"https://api.github.com/repos/uber/tchannel/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel/releases{/id}","created_at":"2014-12-23T21:06:57Z","updated_at":"2015-07-13T11:37:38Z","pushed_at":"2015-07-13T18:02:38Z","git_url":"git://github.com/uber/tchannel.git","ssh_url":"git@github.com:uber/tchannel.git","clone_url":"https://github.com/uber/tchannel.git","svn_url":"https://github.com/uber/tchannel","homepage":"","size":17016,"stargazers_count":88,"watchers_count":88,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":53,"forks":9,"open_issues":53,"watchers":88,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel/pulls/908"},"html":{"href":"https://github.com/uber/tchannel/pull/908"},"issue":{"href":"https://api.github.com/repos/uber/tchannel/issues/908"},"comments":{"href":"https://api.github.com/repos/uber/tchannel/issues/908/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel/pulls/908/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel/pulls/908/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel/statuses/148777c722439930d8611e17fa2837da9db738da"}}}}