122 Commits

Author SHA1 Message Date
Sorin Sbarnea
ffbc080f1a Updated list of Python versions in tox
Change-Id: I40118820d7eb0956dc012556aa1d5767f40d652e
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-01-27 14:50:51 +00:00
Clark Boylan
01a634014e Add group membership management functions
Add functions to list group members and add and remove users from
groups.

Change-Id: Id5d8915f2c0bf6f6057b414785b8ec1b18e810f2
0.8.0
2017-09-22 10:24:53 -07:00
Clark Boylan
eb6588734c Handle different gerrit versions with create-project
Gerrit < 2.12 used a --name argument on create-project. Newer Gerrit
simply takes the project name as an arg. Check the Gerrit version before
constructing the create-project command.

Change-Id: I59ca051627d54a11ef6524cce9b5a4414fd2193d
0.7.0
2017-09-19 16:25:39 -07:00
Khai Do
d9478fcc08 Remove pyflakes environment
There are no test jobs for flake8 so this is not neeeded.

Change-Id: I63c7ae85510a86d0667b96da6526fa0df5aa621a
2017-06-15 13:26:41 +00:00
Sorin Sbarnea
2c8298394f Removed pbr<2.0.0 to resolve depencency conflicts
Change-Id: Ia96cef693d82b42320561df80eb5a571085cda93
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2017-03-30 21:37:20 +01:00
Khai Do
4527edd4ad Remove deprecated create-project '--name' option
The create-project '--name' option was removed[1] in Gerrit 2.12.
Update gerritlib to match the command for Gerrit-2.12+. This is also
compatible with Gerrit 2.11

[1] https://gerrit-review.googlesource.com/#/c/69738/

Change-Id: Ie70d938501cbf88dbbb0e9ab22abcc921f89ccdc
2016-12-01 15:05:50 -08:00
Khai Do
33feeb837b Allow creating projects with spaces
Gerrit supports creating projects that contain spaces in it.
Quote the project name otherwise the command will fail when user
attempts to create a project with spaces in it.

Change-Id: Ie1db92812355b4d8f7603c3b4b8d20434ca54bb3
2016-12-01 15:04:50 -08:00
Jeremy Stanley
fba7102ae4 Specify testenv command for tox>=2.5
As of the tox 2.5.0 release, failure to specify a default commands
key in the fallback testenv section of tox.ini instantly fails with
"ERROR: Commands not specified. Please update relevant section of
.../tox.ini".

Copy the testenv.commands entry from the openstack/cookiecutter
repo's template. While at it, copy the boilerplate placeholder test
from the cookiecutter templates so that jobs don't freak out when
they discover (and then run) no tests.

Change-Id: Ifb8fcfbb6d76edd8c7dcf814a705ee7eff3a9819
2016-12-01 20:20:59 +00:00
Paul Belanger
11647ed384
Cap paramiko<2.0.0
Until we have a good migration plan for paramika, lets cap at <2.0.0.
Otherwise we need to install libffi-dev and other dependencies for the
version bump.

Change-Id: Iad29f93814c798fc2c4204e08e940011ad1428dc
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
0.6.0
2016-05-25 11:03:42 -04:00
Khai Do
cd183a4f43 Stop specifying requirements.txt in tox.ini
As PBR already injects the contents of requirements.txt into
setup_requires, there is no need for tox to explicitly install them.
http://lists.openstack.org/pipermail/openstack-dev/2015-July/069663.html

Change-Id: I5fc4de208e6c2f6926238f6942bf4ca9804748e4
2015-08-10 15:38:34 -07:00
Monty Taylor
24de1df8df Bump pbr and hacking version
Bumping pbr required a bump to hacking otherwise build will fail
with VersionConflict error.

Change-Id: I3d2a031c175dcd25b309bd3cbf15f5ebad0c4744
2015-08-02 14:00:44 -07:00
Khai Do
58ca447785 Update project docs
This change does the following:
  Update docs with more info
  Add an example usage of this library
  Add pbr versioning to docs
  Updates the requirements
  Rarrange the docs to look better on pypi

Lots of the elements to do above were borrowed from
python-jenkins and jenkins-job-builder projects.

Change-Id: Idc7dfc88cc26e1147b027fd55d41229c4bf3910f
0.5.0
2015-04-20 13:10:34 -07:00
Jenkins
0a3531b432 Merge "Doc generation support" 2015-03-13 02:42:04 +00:00
Antoine Musso
207357ea9e Doc generation support
Based on cookiecutter and slightly tweaked afterward.

* conf.py has autoclass_content = 'both' to generate the __init__
  documentation.
* bumped doc copyright to 2015.
* adds in tox environement 'docs' as a convenience

Change-Id: I69bb4179be343ab7c8a44f6fb80d5a428fe30e17
2015-02-11 10:09:59 +01:00
Jeremy Stanley
60269be836 Workflow documentation is now in infra-manual
Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.

Change-Id: I25f5dbee234b6d6121beb9ffcf97809dd1a41bb1
2014-12-05 11:51:53 -08:00
Michael Krotscheck
10a9ca52bc Switched documentation to point to storyboard
We've migrated this project to storyboard, I'm updating the documentation links.

Change-Id: I07227f271adc46e21c727c9bbf0ec2dc3b162140
2014-11-11 23:49:13 +00:00
Jenkins
8366b574ed Merge "Add functionality to Gerritlib to set project descriptions" 2014-10-12 17:13:21 +00:00
Andrey Nikitin
7125e80a08 Update listGroups function in gerrit.py
Added ability to view extended information about the groups to obtain information about the uuid.
Function listGroups will be used in jeepyb (in file manage-project.py) for checking
and creating groups in gerrit database if groups does not exist.

Change-Id: Id11e358141d3802026bc7e531146e2d84546463d
2014-09-11 16:51:59 +04:00
Jenkins
a515657196 Merge "Python3 support" 2014-09-07 18:46:47 +00:00
Jenkins
11418147ca Merge "Changed home-page used in setup.cfg" 2014-09-07 18:44:41 +00:00
Chmouel Boudjnah
bedb0439f9 Python3 support
Change-Id: Icf60ab88682aeda1fee73b35cfe9d3ca3f2ca2be
2014-08-11 09:23:40 +02:00
Yolanda Robla
0425620240 Add functionality to Gerritlib to set project descriptions
Enabled functionality into gerritlib for setting descriptions
when creating a project, or have the ability to update
existing projects to update their descriptions.

This will allow jeepyb to create projects into Gerrit
having proper descriptions.

Change-Id: Id7fdef1599e8632edbdd8af5255207c18c9da7e0
Closes-Bug: #1349372
2014-07-28 16:26:07 +02:00
Christian Berendt
15de277da9 Changed home-page used in setup.cfg
I think the home-page should reference the repository instead
of http://ci.openstack.org. I cannot find a reference on gerritlib
on http://ci.openstack.org/ or http://ci.openstack.org/gerrit.html.

Change-Id: I9563e9d97965c3217fd9960255ec1a98ca2ed5c0
2014-07-01 12:38:38 +02:00
StephenSun
60fc983cf2 Update pbr version
Matches Global Requirements. In the gerritlib project pbr version
does not match the global requirements.

Change-Id: I8d598635916ce2f2659139c90ac31330e158740d
2014-06-26 18:39:41 +08:00
Antoine Musso
ee4d151ade Apply cookiecutter defaults
Launchpad points to https://launchpad.net/openstack-ci which I assume is
a catch all.

[setup.cfg]
* skipped files.packages section which is unneeded
* removed obsolete pbr global.setup-hooks

Change-Id: I26bddf6a1bb1ce7a10ea0f8d9f40a916dcba0c90
2014-06-02 18:22:04 +02:00
Jenkins
9809fbe25f Merge "add getVersion and listPlugin commands and update replicate command" 0.4.0 2014-04-03 00:13:29 +00:00
Anita Kuno
ed6a6c2b67 Add empty-commit flag when creating a project with no commits
When creating a new project, if you pass the --empty-commit
flag, a sha is created for the master branch allowing for
cloning and other subsequent actions on the repo. If the project
has no commits and is created without the --empty-commit flag,
the repo is created with no sha for the master branch creating
problems with any subsequent actions on the repo.

Change-Id: Ic233057c2503b7fd9fc234d97d71431520ea70b8
2014-03-27 20:57:20 -04:00
Jenkins
5c85312837 Merge "Expose the gerrit watcher as a thread with defined transitions" 2014-03-17 16:29:54 +00:00
Khai Do
d0bca22df9 add getVersion and listPlugin commands and update replicate command
The replication command string changed after replication became a plugin in gerrit.
This patch adds a getVersion[1] and a listPlugins[2] command to gerritlib.  The listPlugin
command is used to determine the correct replication string to execute in the replication
command.

[1] Only available on gerrit version >= 2.6
[2] Only available on gerrit version >= 2.5
Closes-Bug: #1273891
Partial-Bug: #1082781

Change-Id: I966037851b3f27536f415230edd1ae4e710321fb
2014-02-25 21:30:56 -05:00
Jenkins
996a04dbf6 Merge "remove extra item from listGroups and listProjects methods" 2014-02-21 01:28:32 +00:00
Khai Do
8f24b9651c remove extra item from listGroups and listProjects methods
On gerrit 2.4.x and gerrit 2.8 the list returned by the listGroups and listProjects
methods always contains one extra item at the end of the list for example listGroups
returns something like.. ['Administrators', 'Anonymous Users', 'Non-Interactive Users',
'Project Owners','Registered Users', '']

This change removes the last item from the returned list.

Change-Id: I2af52a35ef5bc7fd300b12911fce18faab474222
2014-02-14 15:12:23 -08:00
Jeremy Stanley
82df224c39 Quote group names in case of spaces
* gerritlib/gerrit.py(Gerrit.createGroup): Quote the group name in
the API call so that Gerrit won't get confused by spaces.

Change-Id: Iad7110bedc2b5b4090313fd70679f0552292a807
2014-02-09 23:43:07 +00:00
Joshua Harlow
a68b5972f5 Expose the gerrit watcher as a thread with defined transitions
Instead of just maintaining a simple boolean that denotes
whether the thread is connected or not, expose a more rich
set of state transitions that can be used by external users
to know exactly the state the thread is currently in.

This new list is:

* IDLE (not initialized/started running)
* DISCONNECTED (not connected to gerrit)
* CONNECTING (attempting to connect)
* CONNECTED (connected to gerrit)
* CONSUMING (consuming events from gerrit)
* DEAD (thread has exited its run method)

The state transitions are the following:

IDLE -> DISCONNECTED
DISCONNECTED -> CONNECTING
CONNECTING -> CONNECTED
CONNECTED -> CONSUMING
CONSUMING -> DISCONNECTED (on consuming failure)
CONNECTING -> DEAD (if no more retries)

Change-Id: Ib4ecef4f093b6d6925bc4b553020e15111248617
2014-02-01 22:10:26 -08:00
Jenkins
996343b115 Merge "Allow startWatching to take in watcher connection limits" 2014-01-31 18:10:36 +00:00
Jenkins
f1544a182c Merge "Add connection attempt limit" 2014-01-31 18:07:56 +00:00
Joshua Harlow
de4cbc8141 Allow startWatching to take in watcher connection limits
In order to allow the GerritWatcher new features for connection
limits and retry limits to be used we need to have a way to
pass those parameters to the watcher when it is constructed.

Change-Id: I199e515e7105b267acbff55a74e03cb117752bab
2013-12-28 20:22:58 -08:00
Joshua Harlow
c1ea16e0b3 Add connection attempt limit
Add a connect() function that connects
to the ssh server, if this fails it
does a retry algorithm until that fails
and then the thread dies.

If that works, consume from the given client
and if that fails, allow for retrying using
a new client (after a given consume_retry_delay
delay).

To maintain previous behavior the default of
attempting to connect forever is provided when the
number of connection_attempts is <= 0.

Change-Id: I1a2cb764c7cef04b8137a7e4b05d9a4cc45498b0
2013-12-28 20:21:23 -08:00
Monty Taylor
ac865aa175 Add replicate command
In order to trigger a replication in jeepyb, we need a replicate command
in gerritlib.

Change-Id: Icaea639f9f7a17b1697b573788665bff638ac695
0.3.0
2013-12-02 12:56:12 -05:00
Monty Taylor
13d4204d98 Remove erroneous comment
The sync script from openstack/requirements was used to write the
setup.py, but we're not REALLY going to sync automatically from o/r.

Remove the comment.

Change-Id: I91cd745010fa8358f8e93e537cc325d94bd9daca
2013-10-27 18:36:33 -04:00
Monty Taylor
bc11bb419f Remove use of d2to1
Update with the global OpenStack requirements in the process.

Change-Id: I18ae9cc78e1af8842b74cedac3ba262d733e4289
2013-10-19 10:51:20 -04:00
Robert Collins
edb43f70f4 Allow ctrl-Cing gerritlib programs.
If the GerritWatcher thread is not set as daemon, the program won't
exit when the main thread exits. This is usually undesirable.

As part of making the thread be a daemon, I've moved the ownership of
threading logic to the gerrit startWatching method, decoupling
GerritWatcher's logic from the implementation detail of being a thread
(vs a co-process etc).

Change-Id: Ib28d5bfec47d2c4c88b99e07dec50ee4dd0104bf
2013-10-08 09:13:10 +13:00
Robert Collins
738bb57c2b Ignore editor files.
Change-Id: Icbf58813c202dacdde56a18a895b7ea7b44f0f55
2013-10-03 10:45:10 +13:00
Robert Collins
6f44bad47d Simplify GerritWatcher creation.
We have all the parameters as public attributes, and never want them
to be different so splitting them out is undesirable.

Change-Id: Ie2826af31100fbc287813e2968a126ff2af50f1f
2013-10-03 10:45:09 +13:00
Clark Boylan
6d58714528 Add method to list Gerrit Groups.
* gerritlib/gerrit.py: Add listGroups() method that will run `gerrit
ls-groups` and return the result as a python list.

Change-Id: I2cb6b7b6a23f3efdb81f90b492c07075c4606c38
0.2.7
2013-09-25 11:04:28 -07:00
Sean Dague
d16c93bece fix param ordering to fix review function
the change id needs to come before the args, otherwise it can't
parse the change id.

Change-Id: I2d83fa3000cd4739f0d8ec5524aa3ca2391506de
0.2.6
2013-09-23 07:58:31 -04:00
Matthew Treinish
139c168bb3 Add comments option to query
This commit adds a new option to the query function for returning
comments for the commit.

Change-Id: I67d52f64a92cedc8ca449f0e54c2d1da2766c0a2
2013-09-19 11:03:22 -04:00
Yegor Minin
e652bf2a60 Add option to query commit messages
Change-Id: If232c326525f516931b885c55f549049ad470b8d
2013-08-14 18:49:16 +03:00
Monty Taylor
aca4ab605d Remove dependency on distribute
Change-Id: Iccd5834a675c4beea147a6765b686ce6f21e4ed1
2013-07-05 21:15:26 -04:00
Sean Dague
5dd2df5eb8 add a bulk_query method to let us get back more than one item
extend gerritlib so that we have a query method to get more
complicated query sets. Would rather use gerritlib than raw ssh
commands for this, and this makes it possible.

Change-Id: I467011f027cfc3d594db5f95bb7a5ff46e79b1a8
2013-06-19 16:53:24 -04:00
Monty Taylor
81a0066752 Modernize build requirements.
Switch to pbr and flake8. Make hacking clean. Remove unneeded/unused
libraries. Rename requirements files. Add a README file.

Change-Id: I70408d785331dc97737ab0ab1b0caa255b683efe
2013-06-02 10:46:12 -04:00