summaryrefslogtreecommitdiff
path: root/pygerrit
Commit message (Collapse)AuthorAgeFilesLines
* Raise exception if the json content is invalidGeorge Peristerakis2016-02-291-2/+3
| | | | | | | | | If the json loads function raises, the return content is invalid. The function should log the error and raise the exception. Closes #32 Change-Id: I053b0169c8da47f2a4812cc30783f8a4776f9c2b
* Add missing docstring for Change#from_jsonDavid Pursehouse2016-02-291-0/+6
| | | | | | Closes #33 Change-Id: I57616a8b8fa513f0ce650613b1ed9ec31b0322b4
* Added from_json method for Change modelVasiliy Kleschov2016-02-291-0/+6
| | | | Change-Id: Idc5ae59b22a4fb21c434dc2dd9c7accc0bd5015e
* Updated add_comment() to support line rangesBenjamin Foster2015-08-191-5/+19
| | | | | | | | | | add_comment() now supports 'ranges' as described by the gerrit API, by using the keyword 'range' instead of 'line', and a dict with the four required keys. Closes #31 Change-Id: Iaa7004e4f94794df8546a153227375e7be4b06bb
* Add keepalive support to GerritSSHClientVineet Naik2015-06-302-3/+11
| | | | | | | This will allow keeping the SSH sessions alive for a duration of time longer than the timeout configured for the server. Change-Id: I9d86c0fc304783fab944ebae7bd0da8f3b1edd6c
* Don't use requests.session()0.2.10David Pursehouse2015-06-291-5/+4
| | | | | | | | | | | Workaround for requests issue 2409 [1] and Gerrit issue 3458 [2] where the Gerrit server returns HTTP 400 on subsequent requests via an existing session. [1] https://github.com/kennethreitz/requests/issues/2409 [2] http://code.google.com/p/gerrit/issues/detail?id=3458 Change-Id: I98428ec59fca7146c5587172b464e2e09b90782c
* Don't set Content-Type on PUT/POST if there is no bodyDavid Pursehouse2015-06-291-4/+6
| | | | | | Fixes #26 Change-Id: Ic4e0ba378fd61ed49a3ca9ea25ef2ccf21532af2
* Add debug log of response contentDavid Pursehouse2015-06-241-1/+2
| | | | Change-Id: If57c2f4443405a546d7aee796c8381c053e1b301
* Allow unicode characters in gerrit commandsNikki Heald2015-04-061-0/+6
| | | | | | | | | Trying to use pygerrit to submit reviews fails if there is a unicode character in the review comment. This change sees if the message is valid ascii, and if it's not, encodes as utf-8. Change-Id: Ia14d59d28b11a78bee9d89fd84fb09976015787f
* Fix incorrect docstringDavid Pursehouse2014-12-081-4/+1
| | | | Change-Id: Ic753786a01deef0270e3039c15a0ceabedfe3901
* Restructure docstrings for better html output.David Pursehouse2014-10-304-88/+161
| | | | Change-Id: Ic935e8f85e2ad333677770746c15648ae5bac339
* Bump pep8 to 1.5.7David Pursehouse2014-10-272-3/+3
| | | | | | And fix a couple of newly discovered warnings. Change-Id: I835d16ed94f2e20f003a2aa0b0370483d02e7926
* Add inline review support0.2.8Peter Theckanath2014-09-011-0/+85
| | | | | | Added API to send inline review Change-Id: Ifdcfbaea6ae4d8723d9566eaaf3c5dba5ff35617
* Add message formatter class0.2.7David Pursehouse2014-06-191-0/+85
| | | | | | | Add a new helper class that can be used to format the messages that are sent to Gerrit via the review command. Change-Id: Ib8684d60788c8f19054bca6cfc707b25079395d3
* Add support for ProxyCommand in GerritSSHClient0.2.6Alexander D. Kanevskiy2014-05-291-2/+6
| | | | Change-Id: I776a58b2cdac17e3eafc985ee727cd88e8294ccc
* Revert "Remove support for Gerrit over ssh"David Pursehouse2014-05-298-0/+910
| | | | | | | | | | | | | | | | | | | | | The ssh interface is still being used and patches are being contributed [1]. It's easier to revert the removal on master than attempt to keep the support in a separate branch. This reverts commit f0b77968389966cd7bad0cac1fe7f04526eafde1. [1] https://github.com/sonyxperiadev/pygerrit/pull/21 Conflicts: README.rst example.py requirements.txt setup.py unittests.py Change-Id: I9e02208c57cb2022ff39cff6650101ed40c0519d
* Set Content-Type header on PUT and POST requestsDavid Pursehouse2014-05-021-0/+4
| | | | | | | The Content-Type must be set to "application/json" for PUT and POST requests. Change-Id: I859e6cb18b981935b1788a943ec195955fb1e46d
* Set HTTP headers to reduce data transfer timeDavid Pursehouse2014-05-021-1/+4
| | | | | | | | | | | | Request compact JSON by setting: 'Accept: application/json' Request compressed response by setting: 'Accept-Encoding: gzip' Change-Id: Ie1b5169d43b164f0e06aa765cbf76cca25d629f3
* Migrate setup to pbrDavid Pursehouse2014-05-021-3/+0
| | | | | | | | pbr provides better version handling, and automates the release notes and list of authors. This means we have to spend less time manually updating things. Change-Id: Ie79d706ec7a177f437b6bb0e38a9bded8bc4bb9e
* Remove support for Gerrit over sshDavid Pursehouse2014-04-288-910/+0
| | | | | | | | | From now only the REST API is supported. This makes installation of the package a bit lighter as we no longer depend on paramiko and pycrypto Change-Id: Ieda773d596fd43047c05895f3304690ddf709094
* Version 0.2.50.2.5David Pursehouse2014-04-171-1/+1
| | | | Change-Id: I083eca93f4969fa9c2d157da39f342de62cf5fd6
* Fix for hanging connectionsJohannes Richter2014-04-031-0/+4
| | | | | | * client.stop_event_stream() was not closing Change-Id: Idf38565332a7865063caf614992ba376804da1a7
* Version 0.2.40.2.4David Pursehouse2014-03-171-1/+1
| | | | Change-Id: I65d45f11f3b467f4cf8bc34a4a63749406d78abf
* Accept kwargs for request functionsChristopher Zee2014-03-171-18/+8
| | | | | | | kwargs now made passable to request functions so that lower-level python-requests interface can be fully utilized. Change-Id: I38eff49314a3966546e0b272af2e58ed276269d9
* Version 0.2.30.2.3David Pursehouse2013-12-171-1/+1
| | | | Change-Id: I64f69dc544129772446f4995e6f148c388cb0f62
* Bump version to 0.2.20.2.2David Pursehouse2013-11-181-1/+1
| | | | Change-Id: I32b970452809d31037ad15783d2f50e894e530ed
* Add user in the Approval objectDavid Pursehouse2013-11-181-0/+1
| | | | | | | Include the account information for the user who gave the approval. Change-Id: I3857c9913c38a5c5223111274314e107f4c81090
* Add support for CurrentPatchSetDavid Pursehouse2013-11-181-0/+30
| | | | | | | The "currentPatchset" field of the query results includes information about the review label scores. Change-Id: I41d54225284e15b2b61b79bfaa309cd5c2b4b86a
* Include change status in Change objectDavid Pursehouse2013-11-181-0/+1
| | | | Change-Id: I188e4cc116878cdd6679e45bf3ee545b20ce974e
* Always set sortkey in Change objectDavid Pursehouse2013-11-181-2/+1
| | | | | | | | | | | The from_json method returns None if the key does not exist in the json data, so we don't need to check for existence of the key when constructing the object. This also ensures that the constructed object has a sortkey member. Change-Id: Ic342f8b25aeded0e999f93fa29190853354c57f0
* Simplify REST API error handlingDavid Pursehouse2013-11-072-30/+16
| | | | | | | Remove GerritRestAPIError. Raise requests.HTTPError when a request results in an HTTP Error. Raise ValueError in other places. Change-Id: I25188f64161a6ca8159e7777e3f288f775463c25
* Add username field in the account dataDavid Pursehouse2013-11-071-0/+1
| | | | Change-Id: I91b90d26fde775d5d58ee127fd9015757090a978
* Add method to run a gerrit command from the clientDavid Pursehouse2013-11-071-0/+6
| | | | Change-Id: If1863c06619a11f93efc7c25c7c33c749950d6a5
* Add method to get username and Gerrit versionDavid Pursehouse2013-11-072-0/+9
| | | | | | | | | | If the username is not given in the constructor, it is detected from the ssh config. Add a method that allows the client to get the detected username that was used to connect to Gerrit. Change-Id: I15747d1446b07ce6b250f294fe72842a1be50a6c
* Bump version to 0.2.00.2.0David Pursehouse2013-10-211-1/+1
| | | | Change-Id: I031b9293fd6ae3afe28e114b8d5ecc6de34f1bb3
* Suppress pylint warning about catching too general exceptionDavid Pursehouse2013-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | Commit 06c88c8 (merged with pull request #13) added exception handling: except Exception as e: which causes a pylint warning: W0703: Catching too general exception Exception However in this case we actually do want to catch all types of exception because the intention is to make sure pygerrit doesn't fall over when something unexpected happens. Add a suppression of this warning. The suppression is only effective on this particular line; the warning will be raised again if we do the same thing again somewhere else. Change-Id: If812d441c1dc625651db34c6d3763cedc98b68a9
* Merge pull request #13 from EnJens/masterDavid Pursehouse2013-10-171-8/+12
|\ | | | | Avoid busy loop when receiving incoming stream data.
| * Ensure errors in json parsing doesn't leave everything in a broken stateJens Andersen2013-10-171-8/+12
| |
| * Avoid busy loop when receiving incoming stream data.Jens Andersen2013-10-161-1/+1
| | | | | | | | | | Checking whether bytes are available is a non-blocking operation, causing the receive loop to become a busy loop.
* | Change abandoned and restored events don't have a patchset fieldDavid Pursehouse2013-10-181-8/+4
| | | | | | | | Change-Id: I16ef5fe0ba55902985c8cfec1d4845a3533ad82c
* | Merge branch 'master' into internalDavid Pursehouse2013-10-182-3/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Add myself to authors Add an authors list that contributors can add themselves to Fix indentation Reason is optional in abandon and restore changes Return sortKey from query result, to allow resuming query. Change-Id: I357d82fee44c47f960000b8db4f7c6d0d95a0993
| * \ Merge pull request #15 from EnJens/return-sortkey-from-queryDavid Pursehouse2013-10-171-0/+2
| |\ \ | | | | | | | | Return sortKey from query result, to allow resuming query.
| | * | Fix indentationJens Andersen2013-10-171-1/+1
| | | |
| | * | Return sortKey from query result, to allow resuming query.Jens Andersen2013-10-171-0/+2
| | |/ | | | | | | | | | This is required to be able to retrieve more than 500 changes using the query interface.
| * | Reason is optional in abandon and restore changesJens Andersen2013-10-171-3/+6
| |/
* | Allow client to disable SSL certificate verificationDavid Pursehouse2013-09-241-2/+6
|/ | | | Change-Id: I124054f2ba667f41ba5e916e3832e6a341b4ae96
* Refactor the authentication handlingDavid Pursehouse2013-09-182-35/+74
| | | | | | | | | | Instead of trying to abstract the authentication away from the client, allow the client to provide the authentication handler. Implement simple handlers for HTTP basic and digest authentication with credentials from netrc. Change-Id: Icd6c7d359ecbd441308bc6f67fd19c7f55ebcb8f
* Add method to build url from endpointDavid Pursehouse2013-09-131-4/+16
| | | | | | | Add a convenience method to construct the url to be passed to the server, from the base url and the given endpoint. Change-Id: I1725a371aa8a82c132039a9614bf20223af591f3
* Merge branch 'master' into internalDavid Pursehouse2013-09-136-90/+241
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Bump version to 0.1.1 Add changelog Fix #10: Allow to manually specify ssh username and port Completely refactor the stream event handling Add missing __repr__ methods on ErrorEvent and UnhandledEvent Fix initialisation of error event Fix #11: correct handling of `identityfile` in the ssh config Allow example script to continue if errors are received Fix #9: Add a bit more detail in the documentation Fix #8: Support the "topic-changed" stream event Fix #7: Support the "reviewer-added" stream event Fix #6: Support the "merge-failed" stream event Fix #5: Move json parsing and error handling into the event factory Improved logging in the example script Fix #3: Don't treat unhandled event types as errors Fix #4: Keep event's raw json data in the event object Add __repr__ methods on event and model classes Remove redundant `exec_command` method Fix #2: Establish SSH connection in a thread-safe way Fix #1: Use select.select() instead of select.poll() Change-Id: Ib91384b16acca30bfc5aadcdc1131c8bdecef583
| * Bump version to 0.1.10.1.1David Pursehouse2013-09-131-1/+1
| | | | | | | | Change-Id: Id2a68941ddfbeaee540406e821f1df09408c198f