)]}'
{"jenkins/__init__.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"57967293893d05325fb7f4842ad67fc3b0a85213","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        for k, v in self.get_job_info(job_name).items():"},{"line_number":222,"context_line":"            print(k, v)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def jenkins_open(self, req, add_crumb\u003dTrue, timeout\u003dDEFAULT_TIMEOUT):"},{"line_number":225,"context_line":"        \u0027\u0027\u0027Utility routine for opening an HTTP request to a Jenkins server."},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        This should only be used to extends the :class:`Jenkins` API."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_104ccb41","line":224,"updated":"2014-12-10 19:09:57.000000000","message":"5 minutes seems like a long time.  Also, I\u0027d rather the default for the timeout come from some attribute on the object, so that it can be adjusted by the caller.  In the ideal case, the class constructor would take timeout as a keyword argument…","commit_id":"95faaa741ca84644c60ed006f9da45cc98c2db02"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"641486132c2a91c25854a2e88ea8547d22e5b9b9","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        for k, v in self.get_job_info(job_name).items():"},{"line_number":222,"context_line":"            print(k, v)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def jenkins_open(self, req, add_crumb\u003dTrue, timeout\u003dDEFAULT_TIMEOUT):"},{"line_number":225,"context_line":"        \u0027\u0027\u0027Utility routine for opening an HTTP request to a Jenkins server."},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        This should only be used to extends the :class:`Jenkins` API."}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_a58ad418","line":224,"in_reply_to":"3a961159_104ccb41","updated":"2014-12-10 23:01:57.000000000","message":"the selection of 5 mins is pretty arbitrary.  I changed it to 2 mins.  \n\nGood point about setting the timeout in the constructor,  I have made that change.","commit_id":"95faaa741ca84644c60ed006f9da45cc98c2db02"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"57967293893d05325fb7f4842ad67fc3b0a85213","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        try:"},{"line_number":354,"context_line":"            request \u003d Request(self.server)"},{"line_number":355,"context_line":"            request.add_header(\u0027X-Jenkins\u0027, \u00270.0\u0027)"},{"line_number":356,"context_line":"            response \u003d urlopen(request, timeout\u003dDEFAULT_TIMEOUT)"},{"line_number":357,"context_line":"            return response.info().getheader(\u0027X-Jenkins\u0027)"},{"line_number":358,"context_line":"        except HTTPError:"},{"line_number":359,"context_line":"            raise JenkinsException(\"Error communicating with server[%s]\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_50bf33fb","line":356,"updated":"2014-12-10 19:09:57.000000000","message":"This seems redundant.  Did you intend to allow a different timeout to be specified to the get_version() method?","commit_id":"95faaa741ca84644c60ed006f9da45cc98c2db02"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"641486132c2a91c25854a2e88ea8547d22e5b9b9","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        try:"},{"line_number":354,"context_line":"            request \u003d Request(self.server)"},{"line_number":355,"context_line":"            request.add_header(\u0027X-Jenkins\u0027, \u00270.0\u0027)"},{"line_number":356,"context_line":"            response \u003d urlopen(request, timeout\u003dDEFAULT_TIMEOUT)"},{"line_number":357,"context_line":"            return response.info().getheader(\u0027X-Jenkins\u0027)"},{"line_number":358,"context_line":"        except HTTPError:"},{"line_number":359,"context_line":"            raise JenkinsException(\"Error communicating with server[%s]\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_65746c36","line":356,"in_reply_to":"3a961159_50bf33fb","updated":"2014-12-10 23:01:57.000000000","message":"that was just a mistake. good catch, thanks.","commit_id":"95faaa741ca84644c60ed006f9da45cc98c2db02"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"fa9af3cc7de2e8153570914ebc1b157c9aee9a69","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                req.add_header(\u0027Authorization\u0027, self.auth)"},{"line_number":234,"context_line":"            if add_crumb:"},{"line_number":235,"context_line":"                self.maybe_add_crumb(req)"},{"line_number":236,"context_line":"            return urlopen(req, self.timeout).read()"},{"line_number":237,"context_line":"        except HTTPError as e:"},{"line_number":238,"context_line":"            # Jenkins\u0027s funky authentication means its nigh impossible to"},{"line_number":239,"context_line":"            # distinguish errors."}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_a5d5741d","line":236,"updated":"2014-12-10 22:48:59.000000000","message":"I think this needs to be \"timeout\u003dself.timeout\"; otherwise, self.timeout becomes bound to the \"data\" parameter of urlopen().","commit_id":"9ac1dc34c2c06f661e55e6c7537a5c3dfa93e5cd"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"6119e955a058a74116064b19eb692fc85e4190eb","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                req.add_header(\u0027Authorization\u0027, self.auth)"},{"line_number":234,"context_line":"            if add_crumb:"},{"line_number":235,"context_line":"                self.maybe_add_crumb(req)"},{"line_number":236,"context_line":"            return urlopen(req, self.timeout).read()"},{"line_number":237,"context_line":"        except HTTPError as e:"},{"line_number":238,"context_line":"            # Jenkins\u0027s funky authentication means its nigh impossible to"},{"line_number":239,"context_line":"            # distinguish errors."}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_4524d0c4","line":236,"in_reply_to":"3a961159_a5d5741d","updated":"2014-12-10 23:05:59.000000000","message":"thanks.  Done.","commit_id":"9ac1dc34c2c06f661e55e6c7537a5c3dfa93e5cd"},{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"d3b0df079f8a41c930c41b12f85376ba5412f728","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                req.add_header(\u0027Authorization\u0027, self.auth)"},{"line_number":234,"context_line":"            if add_crumb:"},{"line_number":235,"context_line":"                self.maybe_add_crumb(req)"},{"line_number":236,"context_line":"            return urlopen(req, timeout\u003dself.timeout).read()"},{"line_number":237,"context_line":"        except HTTPError as e:"},{"line_number":238,"context_line":"            # Jenkins\u0027s funky authentication means its nigh impossible to"},{"line_number":239,"context_line":"            # distinguish errors."}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_4c68b687","line":236,"updated":"2015-01-22 14:58:42.000000000","message":"If this timeout fires, do we want to catch it, check we got a socket timeout and raise a JenkinsException?\n\nAdded a snippet to to the test code for how to mock this, though I don\u0027t have an easy way to confirm that the behaviour on python 2 \u0026 3 is the same.","commit_id":"7abc9a065b39387f01709b02bdee83e5331ad6f7"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"69a75cd23f27c9b06cdd7a63d9fa945b1c4a7b48","unresolved":false,"context_lines":[{"line_number":233,"context_line":"                req.add_header(\u0027Authorization\u0027, self.auth)"},{"line_number":234,"context_line":"            if add_crumb:"},{"line_number":235,"context_line":"                self.maybe_add_crumb(req)"},{"line_number":236,"context_line":"            return urlopen(req, timeout\u003dself.timeout).read()"},{"line_number":237,"context_line":"        except HTTPError as e:"},{"line_number":238,"context_line":"            # Jenkins\u0027s funky authentication means its nigh impossible to"},{"line_number":239,"context_line":"            # distinguish errors."}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_7b550b4f","line":236,"in_reply_to":"1a930d6b_4c68b687","updated":"2015-01-23 07:15:16.000000000","message":"Good call.  Done.","commit_id":"7abc9a065b39387f01709b02bdee83e5331ad6f7"}],"tests/test_jenkins.py":[{"author":{"_account_id":1054,"name":"Darragh Bailey","email":"daragh.bailey@gmail.com","username":"dbailey-k"},"change_message_id":"d3b0df079f8a41c930c41b12f85376ba5412f728","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    def test_constructor_custom_timeout(self):"},{"line_number":85,"context_line":"        j \u003d jenkins.Jenkins(\u0027http://example.com\u0027, timeout\u003d300)"},{"line_number":86,"context_line":"        self.assertEqual(j.timeout, 300)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @patch.object(jenkins.Jenkins, \u0027jenkins_open\u0027)"},{"line_number":89,"context_line":"    def test_get_job_config_encodes_job_name(self, jenkins_mock):"},{"line_number":90,"context_line":"        j \u003d jenkins.Jenkins(\u0027http://example.com/\u0027, \u0027test\u0027, \u0027test\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_6cbbb2e5","line":87,"updated":"2015-01-22 14:58:42.000000000","message":"Suggested additional test if it\u0027s decided it\u0027s worth handing the URLError raised for a timeout:\n\n     @patch(\u0027jenkins.urlopen\u0027)\n     def test_timeout_fires(self, mock_urlopen):\n         j \u003d jenkins.Jenkins(\u0027http://example.com\u0027)\n         from socket import timeout\n         mock_urlopen.side_effect \u003d timeout()\n         with self.assertRaises(timeout):\n             j.get_job_config(u\u0027Timeout\u0027)\n\nThough I\u0027m not sure it\u0027s possible to detect a timeout in the same way across multiple versions of python. I can trigger one with python2 in messing with my proxy, but python3 results in a 503 returned in that case.","commit_id":"7abc9a065b39387f01709b02bdee83e5331ad6f7"},{"author":{"_account_id":6987,"name":"Khai Do","email":"zaro0508@gmail.com","username":"zaro0508"},"change_message_id":"69a75cd23f27c9b06cdd7a63d9fa945b1c4a7b48","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    def test_constructor_custom_timeout(self):"},{"line_number":85,"context_line":"        j \u003d jenkins.Jenkins(\u0027http://example.com\u0027, timeout\u003d300)"},{"line_number":86,"context_line":"        self.assertEqual(j.timeout, 300)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @patch.object(jenkins.Jenkins, \u0027jenkins_open\u0027)"},{"line_number":89,"context_line":"    def test_get_job_config_encodes_job_name(self, jenkins_mock):"},{"line_number":90,"context_line":"        j \u003d jenkins.Jenkins(\u0027http://example.com/\u0027, \u0027test\u0027, \u0027test\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a930d6b_5bbbef71","line":87,"in_reply_to":"1a930d6b_6cbbb2e5","updated":"2015-01-23 07:15:16.000000000","message":"Thanks, You probably just didn\u0027t notice that there are already existing tests to validate jenkins_open request errors.  I added a test using the same pattern as HTTPError ones.","commit_id":"7abc9a065b39387f01709b02bdee83e5331ad6f7"}]}
