GitHub PullRequestEvent at 2014-10-15 23:40:40
Repository: ruby-net-ldap
Actor: mtodd
Payload: {"action":"opened","number":131,"pull_request":{"url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/131","id":22823812,"html_url":"https://github.com/ruby-ldap/ruby-net-ldap/pull/131","diff_url":"https://github.com/ruby-ldap/ruby-net-ldap/pull/131.diff","patch_url":"https://github.com/ruby-ldap/ruby-net-ldap/pull/131.patch","issue_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/131","number":131,"state":"open","locked":false,"title":"Parse Net::LDAP::PDU when calling Net::LDAP::Connection#read, instrument PDU parsing","user":{"login":"mtodd","id":182,"avatar_url":"https://avatars.githubusercontent.com/u/182?v=2","gravatar_id":"","url":"https://api.github.com/users/mtodd","html_url":"https://github.com/mtodd","followers_url":"https://api.github.com/users/mtodd/followers","following_url":"https://api.github.com/users/mtodd/following{/other_user}","gists_url":"https://api.github.com/users/mtodd/gists{/gist_id}","starred_url":"https://api.github.com/users/mtodd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtodd/subscriptions","organizations_url":"https://api.github.com/users/mtodd/orgs","repos_url":"https://api.github.com/users/mtodd/repos","events_url":"https://api.github.com/users/mtodd/events{/privacy}","received_events_url":"https://api.github.com/users/mtodd/received_events","type":"User","site_admin":true},"body":"This PR reduces the duplication by moving the PDU parsing into the `Net::LDAP::Connection#read` method and instruments PDU parsing to give more visibility into the messages being sent from the server.\r\n\r\nShould not result in any behavior change.\r\n\r\nI believe this is along similar lines to #116, though not exactly the same.\r\n\r\nFor what it's worth, I looked at instrumenting the `Net::LDAP::PDU.new` method from the inside but there's no reference to the `instrumentation_service` object to service the instrumentation events (and I didn't want to go the route of a global default handler). This seemed like a good balance and a needed refactoring anyway.\r\n\r\nStill to do:\r\n\r\n- [ ] unit tests\r\n- [ ] integration tests (optional)\r\n- [ ] cleanup/refactoring of `Net::LDAP::Connection#read` callsites\r\n\r\nMany of the `read` callsites look like this:\r\n``` ruby\r\n(pdu = read) or raise Net::LDAP::LdapError, \"no bind result\"\r\n```\r\n\r\nThis should be cleaned up, and this PR is a good opportunity to do so.\r\n\r\ncc @jch @schaary ","created_at":"2014-10-15T23:40:39Z","updated_at":"2014-10-15T23:40:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/131/commits","review_comments_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/131/comments","review_comment_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/131/comments","statuses_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/statuses/1068fa9165365a5e1738c9ebb2b62fc20f081371","head":{"label":"ruby-ldap:instrument-messages","ref":"instrument-messages","sha":"1068fa9165365a5e1738c9ebb2b62fc20f081371","user":{"login":"ruby-ldap","id":676122,"avatar_url":"https://avatars.githubusercontent.com/u/676122?v=2","gravatar_id":"","url":"https://api.github.com/users/ruby-ldap","html_url":"https://github.com/ruby-ldap","followers_url":"https://api.github.com/users/ruby-ldap/followers","following_url":"https://api.github.com/users/ruby-ldap/following{/other_user}","gists_url":"https://api.github.com/users/ruby-ldap/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-ldap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-ldap/subscriptions","organizations_url":"https://api.github.com/users/ruby-ldap/orgs","repos_url":"https://api.github.com/users/ruby-ldap/repos","events_url":"https://api.github.com/users/ruby-ldap/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-ldap/received_events","type":"Organization","site_admin":false},"repo":{"id":1509861,"name":"ruby-net-ldap","full_name":"ruby-ldap/ruby-net-ldap","owner":{"login":"ruby-ldap","id":676122,"avatar_url":"https://avatars.githubusercontent.com/u/676122?v=2","gravatar_id":"","url":"https://api.github.com/users/ruby-ldap","html_url":"https://github.com/ruby-ldap","followers_url":"https://api.github.com/users/ruby-ldap/followers","following_url":"https://api.github.com/users/ruby-ldap/following{/other_user}","gists_url":"https://api.github.com/users/ruby-ldap/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-ldap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-ldap/subscriptions","organizations_url":"https://api.github.com/users/ruby-ldap/orgs","repos_url":"https://api.github.com/users/ruby-ldap/repos","events_url":"https://api.github.com/users/ruby-ldap/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-ldap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-ldap/ruby-net-ldap","description":"Pure Ruby LDAP library ","fork":false,"url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap","forks_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/forks","keys_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/teams","hooks_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/hooks","issue_events_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/events","assignees_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/tags","blobs_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/languages","stargazers_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/stargazers","contributors_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/contributors","subscribers_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/subscribers","subscription_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/subscription","commits_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/comments/{number}","contents_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/merges","archive_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/downloads","issues_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/labels{/name}","releases_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/releases{/id}","created_at":"2011-03-22T03:52:14Z","updated_at":"2014-10-15T21:28:30Z","pushed_at":"2014-10-15T23:33:24Z","git_url":"git://github.com/ruby-ldap/ruby-net-ldap.git","ssh_url":"git@github.com:ruby-ldap/ruby-net-ldap.git","clone_url":"https://github.com/ruby-ldap/ruby-net-ldap.git","svn_url":"https://github.com/ruby-ldap/ruby-net-ldap","homepage":"https://github.com/ruby-ldap/ruby-net-ldap","size":1983,"stargazers_count":165,"watchers_count":165,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":37,"forks":130,"open_issues":37,"watchers":165,"default_branch":"master"}},"base":{"label":"ruby-ldap:master","ref":"master","sha":"ec909d9bd14e8c78beb174fc3b77e6e4a26d75c1","user":{"login":"ruby-ldap","id":676122,"avatar_url":"https://avatars.githubusercontent.com/u/676122?v=2","gravatar_id":"","url":"https://api.github.com/users/ruby-ldap","html_url":"https://github.com/ruby-ldap","followers_url":"https://api.github.com/users/ruby-ldap/followers","following_url":"https://api.github.com/users/ruby-ldap/following{/other_user}","gists_url":"https://api.github.com/users/ruby-ldap/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-ldap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-ldap/subscriptions","organizations_url":"https://api.github.com/users/ruby-ldap/orgs","repos_url":"https://api.github.com/users/ruby-ldap/repos","events_url":"https://api.github.com/users/ruby-ldap/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-ldap/received_events","type":"Organization","site_admin":false},"repo":{"id":1509861,"name":"ruby-net-ldap","full_name":"ruby-ldap/ruby-net-ldap","owner":{"login":"ruby-ldap","id":676122,"avatar_url":"https://avatars.githubusercontent.com/u/676122?v=2","gravatar_id":"","url":"https://api.github.com/users/ruby-ldap","html_url":"https://github.com/ruby-ldap","followers_url":"https://api.github.com/users/ruby-ldap/followers","following_url":"https://api.github.com/users/ruby-ldap/following{/other_user}","gists_url":"https://api.github.com/users/ruby-ldap/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-ldap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-ldap/subscriptions","organizations_url":"https://api.github.com/users/ruby-ldap/orgs","repos_url":"https://api.github.com/users/ruby-ldap/repos","events_url":"https://api.github.com/users/ruby-ldap/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-ldap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-ldap/ruby-net-ldap","description":"Pure Ruby LDAP library ","fork":false,"url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap","forks_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/forks","keys_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/teams","hooks_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/hooks","issue_events_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/events","assignees_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/tags","blobs_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/languages","stargazers_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/stargazers","contributors_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/contributors","subscribers_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/subscribers","subscription_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/subscription","commits_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/comments/{number}","contents_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/merges","archive_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/downloads","issues_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/labels{/name}","releases_url":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/releases{/id}","created_at":"2011-03-22T03:52:14Z","updated_at":"2014-10-15T21:28:30Z","pushed_at":"2014-10-15T23:33:24Z","git_url":"git://github.com/ruby-ldap/ruby-net-ldap.git","ssh_url":"git@github.com:ruby-ldap/ruby-net-ldap.git","clone_url":"https://github.com/ruby-ldap/ruby-net-ldap.git","svn_url":"https://github.com/ruby-ldap/ruby-net-ldap","homepage":"https://github.com/ruby-ldap/ruby-net-ldap","size":1983,"stargazers_count":165,"watchers_count":165,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":37,"forks":130,"open_issues":37,"watchers":165,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/131"},"html":{"href":"https://github.com/ruby-ldap/ruby-net-ldap/pull/131"},"issue":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/131"},"comments":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-ldap/ruby-net-ldap/statuses/1068fa9165365a5e1738c9ebb2b62fc20f081371"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":26,"deletions":17,"changed_files":1}}