summaryrefslogtreecommitdiff
path: root/pygerrit
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * Fix #10: Allow to manually specify ssh username and portDavid Pursehouse2013-09-122-12/+22
| | | | | | | | | | | | | | | | | | | | | | If the username and port are specified when constructing the client, they will be used instead of attempting to fetch from the ssh config file. In this case the full hostname of the server is required, rather than only the name as listed in the ssh config. Change-Id: I82b8638d99922c9b40a54a8275ffc085f505696f
| * Completely refactor the stream event handlingDavid Pursehouse2013-09-122-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using select.select() to wait for input, use the methods provided by paramiko's client channel object. Read from both stdout and stderr, and send ErrorEvent if anything is received on stderr. Ref #1 Fix #12 Change-Id: Ic67392cb9d689a1f457f5d02eb17a5432112a0c0
| * Add missing __repr__ methods on ErrorEvent and UnhandledEventDavid Pursehouse2013-09-121-1/+7
| | | | | | | | | | | | Also fix a minor coding style issue. Change-Id: Ib366a816e5cf979eb94c7ce545d1c87c6c3984c8
| * Fix initialisation of error eventDavid Pursehouse2013-09-111-0/+1
| | | | | | | | Change-Id: I19e955c3ca7c84600ec89ff24d5c7458202ff609
| * Fix #11: correct handling of `identityfile` in the ssh configDavid Pursehouse2013-09-111-1/+1
| | | | | | | | | | | | | | | | The `identityfile` element of the result returned by SSHConfig.lookup() is a list, not a string, therefore calling `expanduser` on it results in a crash. Change-Id: I8673295d66cac9ca3b522867735b1211f0556d21
| * Fix #8: Support the "topic-changed" stream eventDavid Pursehouse2013-09-111-0/+23
| | | | | | | | Change-Id: I70b9cbea1da20a1434eea39e3d8e85e94357b792
| * Fix #7: Support the "reviewer-added" stream eventDavid Pursehouse2013-09-111-0/+20
| | | | | | | | Change-Id: I72ece72c08ddc6da31c14db35dd84f35d61d39ed
| * Fix #6: Support the "merge-failed" stream eventDavid Pursehouse2013-09-111-0/+21
| | | | | | | | Change-Id: I3308b44dc1bbfcaa70e38cb4857c2241c551cfa4
| * Fix #5: Move json parsing and error handling into the event factoryDavid Pursehouse2013-09-113-27/+40
| | | | | | | | | | | | | | | | | | | | Pass the raw string into the event factory and parse it to a json object there. If the string is not valid json, generate an error event. Add a unit test for handling of invalid json on the event stream. Change-Id: I209a89fd28c3a594b71443fc106e25d58c5cc1ea
| * Fix #3: Don't treat unhandled event types as errorsDavid Pursehouse2013-09-111-3/+11
| | | | | | | | | | | | | | | | If an unknown event is received on the event stream, for example if a new event has been added in a later version of Gerrit, do not raise an error. Instead, generate an "UnhandledEvent" event. Change-Id: Ia1902bf4a54883011b7ad3e004f58a2ba8739b21
| * Fix #4: Keep event's raw json data in the event objectDavid Pursehouse2013-09-111-9/+9
| | | | | | | | | | | | | | | | If any future versions of Gerrit add data elements that are not encapsulated by the event class, clients will be able to access them via the raw json data. Change-Id: Ia689acb808f9d200f53b86c60f024e865dd12a18
| * Add __repr__ methods on event and model classesDavid Pursehouse2013-09-112-3/+50
| | | | | | | | | | | | | | | | | | | | This gives more meaningful output when doing: print(event) and means it's not necessary to use str(event). Change-Id: I3c1546ab89c481bec24fbc4445ed7f33aa05eff8
| * Remove redundant `exec_command` methodDavid Pursehouse2013-09-111-15/+10
| | | | | | | | | | | | | | | | | | | | The `exec_command` overrides the method of the same name from the parent class unnecessarily. Remove it and call the parent `exec_command` method directly from the `run_gerrit_command` method. Change-Id: I977000a372c9b6e9143ca0e740b971a606a83146
| * Fix #2: Establish SSH connection in a thread-safe wayDavid Pursehouse2013-09-111-6/+20
| | | | | | | | | | | | | | | | | | Use an Event(), rather than a boolean, to determine whether or not the remote is connected. Protect the connection logic with a Lock(). Change-Id: Ifc5888894a90b7e3a11e21ec3f9bf69f0a7608a8
| * Fix #1: Use select.select() instead of select.poll()David Pursehouse2013-09-101-14/+12
| | | | | | | | | | | | | | | | select.poll() does not work on all platforms. Replace it with select.select(). Change-Id: Iadd09127c99b5b47ebc28f6f4e57fcc1eb4c8710
* | Make get, put, post and delete REST methods publicDavid Pursehouse2013-09-121-4/+4
| | | | | | | | | | | | | | | | | | | | The initial intention was for these to only be used internally, and add wrapper methods to be used by clients. Instead, we now make them public, allowing the API to be used as a basic REST client before any wrappers are added. Change-Id: Icfa92125466b9b798ac30fb865d2d15a2892f552
* | Fix authentication setupDavid Pursehouse2013-08-271-5/+5
| | | | | | | | Change-Id: I8a7557818cd3c207035ef627e6912ee945c083c6
* | Add handling of HTTP error status codes in responsesDavid Pursehouse2013-08-271-0/+24
| | | | | | | | Change-Id: I9cdb6b7ff2bf6ea20925c5b2eac68ef454a6ea23
* | Add support for HTTP digest authenticationDavid Pursehouse2013-08-261-1/+41
| | | | | | | | | | | | | | If the username and password are given, pass them to the request with HTTP digest authentication. Change-Id: If15628262a4ef6b370c3d0794dbc9ecd3a0be624