| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This initial version implements wrappers for GET, PUT, POST
and DELETE requests.
Authentication is not implemented. All requests are sent
anonymously.
Handling of error responses is not implemented.
This change introduces a dependency on python-requests.
Change-Id: I579f9f02be8afbb4e720daf97ca873d77cd54a77
|
| |
|
|
| |
Change-Id: I09fcd52a9eb0f7aab7fa82f276187af6704af899
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the copyright and license headers are in module docstrings, they
appear in the generated API documentation pages and it looks crappy.
Instead, put the headers in regular Python comments. Thus each file
still has the required copyright and license notice, but it is not
included everywhere in the generated documentation.
The documentation still includes an automatically generated copyright
notice at the bottom of each page.
Change-Id: Ibc5f4ca221c0a6de26f04f3b4511d8991e28b663
|
| |
|
|
|
|
|
|
|
|
| |
Documentation is generated in html format into the docs folder.
The idea is that with further commits we can automatically generate
and package the documentation into a zip file that can be published
to the package index.
Change-Id: Ia5719bda59b6224fc05e2021e9054e29990ad22a
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add missing docstrings that the PEP-257 checker did not report.
- Add explicit parameters on `GerritSSHClient.exec_command` method
overridden from `paramiko.SSHClient.exec_command`.
- Disable warning that the `GerritEvent` class does not have a member
named `name`. This member is initialised by the event factory when
a derived class is instantiated.
- Capitalise constant `REQUIRES`.
Change-Id: I8880e061b51e12145ee55e0cd86dab930970cde5
|
| |
|
|
| |
Change-Id: I6bc8d92ed1055959f1c24128b8beace814eaf998
|
| |
|
|
| |
Change-Id: Ie595ac7125323677ad478655c33b21a00302007c
|
| |
|
|
| |
Change-Id: I850978039ca10162a5ae2ab0a4f79374183107ba
|
| |
|
|
|
|
|
|
|
|
| |
We're currently only using the version number in the setup
script, but in future we might need it in other places too.
Define the version number in the module itself and import
it in setup.
Change-Id: Idbf246d3a9777f6de710cb01fa05f8fbf031d192
|
| |
|
|
|
|
|
| |
Include the name of the command that was run in the result
object.
Change-Id: I93c27ed937d27942428f561dc50d84b5ea25591a
|
| |
|
|
|
|
|
|
|
|
| |
Instead of opening the ssh connection in the constructor, only
connect when actually needed.
This improves performance of the unit tests. Running the test
suite now takes less than 1 second rather than 22 seconds.
Change-Id: I03a49d74db8c045740a85201c02c492d175e0d6c
|
| |
|
|
|
|
|
|
| |
When the stream-event command fails, for example due to bad
host name, the result is not initialised. However the code
was accessing the result variable which caused an exception.
Change-Id: I6c649dba447e33733dfaea6e742152277fa7374f
|
| |
|
|
| |
Change-Id: If06f1ea17740a796142db63e7086f80445f4c6e1
|
| |
|
|
|
|
|
| |
Catch socket error raised when connecting to the server over SSH
and raise a GerritError.
Change-Id: I140a26be4bc04ec229d95faaa80b94477cf96645
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Handle exceptions with the syntax:
except Exception as e
rather than:
except Exception, e
Change-Id: I883fdc1db541b9d2699712bfd2bd328261635005
|
| |
|
|
|
|
| |
This reverts commit 42272ffdb1541cf96f13466446e07c24d8e7febb.
Change-Id: Ie00d75579231873db98bc3a84caef408152f3d81
|
| |
|
|
|
|
|
|
| |
Add a new class GerritSSHCommandResult to encapsulate the stdin,
stdout, and stderr streams that are returned from running a
command over SSH.
Change-Id: Ic851c195ac63e530e62198eb7e0af62c2fbd73d5
|
| |
|
|
|
|
|
|
|
| |
In version 0.26 of pylint the message enable/disable options are
changed. Update the configuration to reflect this.
Also remove redundant suppressions.
Change-Id: Ia6e4c6c79cd573dfc91aec53b32c58930fbbde55
|
| |
|
|
|
|
|
|
| |
Only add JSON lines in the results if they contain "project".
Otherwise the "rowCount" line, and anything else, will be included
in the results as an empty Change object.
Change-Id: Ia4de4ed7970c8f5ba87f5e12dd42ff45b459b047
|
| |
|
|
| |
Change-Id: Iadced9142673f1a5f277462bc6d9027db4a53e2d
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Move the functionality to get the Gerrit version from the main
client into the SSH client and reimplement it.
First attempt to get the version from the underlying Paramiko SSH
client. If that fails, fall back to using the `gerrit version`
command as before.
Get and print the version in the example script.
Change-Id: Ia79853f80f898b43c301fcecee61fdfdb75e9811
|
| |
|
|
| |
Change-Id: I283773fb6b68da1878ede9001d18b5b7d0aff569
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle IOError and ValueError separately from GerritError when
processing the steam. In this case GerritError is raised if
there is a problem adding an event to the queue; it makes no
sense to then try to add an error event on the same queue.
Add separate handling of GerritError when running the gerrit
stream-events command.
Move the creation of the error event out to a utility method.
Change-Id: Iac5aa8db5ad1a444fd0e6217c32d1800f727276e
|
| |
|
|
|
|
|
| |
Also make sure the lock is released when an exception
occurs.
Change-Id: Id4af1d4950f604f47b11fdd7d84f94f769aecd4d
|
| |
|
|
| |
Change-Id: I7ad27a83d5af3eaca7a188e01cbef392c9ff1b6b
|
| |
|
|
|
|
| |
Add a lock around calls to the run_gerrit_command method.
Change-Id: I9429ed880e14a4248b08937969f8faebc2240f79
|
| |
|
|
|
|
|
| |
Handle IOError that can occur when reading from the stream,
and ValueError that can be raised by the JSON parser.
Change-Id: Ic9dc60e048f0f747daf8b34c7b6d8d90c11bb1e0
|
| |
|
|
|
|
|
|
| |
Later the client might have functionality that only works on
certain versions of Gerrit. Store the Gerrit version during
initialisation.
Change-Id: Idcd35baf00d6cd583f6f85b68c4b0a0c3653344b
|
| |
|
|
|
|
|
| |
Add a method that calls `gerrit query` and returns the results as
a list of Change objects.
Change-Id: Ie58a61e569d457c56109e34041e9db95147de91c
|
| |
|
|
| |
Change-Id: I26f1c11223b4271c3e5a74c9333a1f7513c5acab
|
| |
|
|
|
|
|
| |
So it can be reused in query functionality that will be added
later.
Change-Id: I361aaf8fe8aa9107a94757606a3a1837b6a448ab
|
| |
|
|
| |
Change-Id: I25ce3fafe7a51d0221f66fe30b2fb7cc8115c4aa
|
| |
|
|
| |
Change-Id: I19eac2b83fc0fd6771c703de087b94de372f45af
|
| |
|
|
|
|
|
|
| |
When setting up and reading the gerrit event stream, catch
errors and dispatch them to the gerrit client as a new error
event type, `GerritStreamErrorEvent`.
Change-Id: Ide51dc4882450dca67ee419f3702aa4fb415cf09
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose of the `register` decorator in the event factory is
to allow client scripts to define their own event classes and
have them dispatched when monitoring the event stream.
The current implementation does not work when an event class is
registered from another module, because it uses globals() which
only returns the symbols defined in the event module, so trying
to instantiate the object causes an exception.
Change the implementation to also store the module name when
registering, and then use that when instantiating the event
object.
Add unit tests to cover the event registration functionality.
Change-Id: I1af901621b07fc9236bc95a81956269507994871
|
| |
|
|
| |
Change-Id: I4953be92719fddeb7c23c2559ffe954c452cc131
|
| |
|
|
|
|
|
| |
Raise an exception if the ssh config specifies an invalid ssh
port number.
Change-Id: I64fae04c91838a0f9c478ac9de19973e1499ed7e
|
| |
|
|
|
|
|
|
|
|
| |
Add initial version of GerritSSHClient, which is a wrapper for
paramiko's SSHClient.
The class derives from SSHClient and configures the ssh
connection from the user's ssh config file.
Change-Id: I54a193e41356de272c95c5288ed2c9e50a776cdf
|
| |
|
|
|
|
|
|
|
|
|
| |
The Gerrit client class will be used as an interface to the
Gerrit events stream and query functionality.
This is the intial stub. More functionality will be added,
and existing stream functionality refactored, in later
commits.
Change-Id: If4ef838c2d3f3e5afaad2a553af49b1c66ad4278
|
| |
|
|
|
|
|
| |
Use the event factory's register decorator to inject the
name of the event into the event class.
Change-Id: Ia40568bc3dd226f4fe250dccd394a79334255319
|
| |
|
|
|
|
| |
Actually, no, it shouldn't.
This reverts commit 66c505985742d8472d236f493ac1139a9ae287ca.
|
| |
|
|
|
|
|
| |
Make the event factory a singleton, and add unit tests to verify
that it is.
Change-Id: Ieee026b9f7e1d408ade47106b71c352e7bfabdd4
|
| |
|
|
|
|
|
|
|
|
|
| |
Refactor so that the input stream is passed into the constructor,
instead of as a parameter to the "stream" method. Rename the
"stream" method to "read".
Add a check that the given input stream has a read() method and
raise exception if not.
Change-Id: I5ff917847a6abde124f64cc808a68ec05e5a1c2b
|
| |
|
|
|
|
|
| |
Change attributes can include a "topic" field. Add support for
this in the Change model.
Change-Id: I31f0c19f92505bf4976f6d0008a94e06d30a48bb
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new static class GerritEventFactory which provides:
- Decorator method to register event names to classes
- Method to instantiate an event class based on event name
The stream implementation is refactored to use the factory to
generate the events.
With this change it will be possible to add new event classes
without having to modify the stream handler implementation.
Change-Id: If1fd0b4f77ead320e98a56301d8266d66dcc8aca
|
| |
|
|
|
|
|
|
| |
Added helper methods to initialise model member variables. Now
the models' constructors will not throw exception if a value is
missing, but instead just initialise the variable to None.
Change-Id: I7473ec9bb471f95ea0142067af4750c7e26a0339
|
| |
|
|
|
|
| |
http://www.python.org/dev/peps/pep-0257/
Change-Id: I1469a94f01660ef00aac196a5ca8995b3803a4bd
|
|
|
Data models, events, errors, and stream handler are split from the
single module into submodules.
Change-Id: I03537c5e268135966c6b6e77ecaca1cb579a5fde
|