84 Commits

Author SHA1 Message Date
Jeremy Stanley
fe35df9605 Add a fake contactstore CGI.
This is useful for testing Gerrit's contactstore features if you
don't have a real contact store server set up already.

* modules/gerrit/files/fakestore.cgi: An extremely trivial shell
script which returns the content Gerrit expects from a successful
submission to a contactstore server. Note this does not check the
application security key or store any of the post variables--it is
simply a black hole for contact updates.

* modules/gerrit/manifests/init.pp: If the contactstore feature is
enabled in Gerrit, install the fakestore.cgi script so it can be
available for testing.

* modules/gerrit/templates/gerrit.vhost.erb: If the contactstore
feature is enabled, ScriptAlias the /fakestore URL to the
fakestore.cgi script.

Change-Id: Ifa0f80bab9e8b8e207f0ffd83f01c8a3d904618e
Reviewed-on: https://review.openstack.org/19939
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-01-18 20:11:32 +00:00
Monty Taylor
52db16762b Consume jeepyb.
Instead of keeping many of these files directly in the tree, use them
from the out-of-tree jeepyb project, which makes them easier to consume
for other people who are not us.

Change-Id: Id704f2e17dd80709ef63cbbf2c5475a08a835f91
Reviewed-on: https://review.openstack.org/16777
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-11-30 18:02:30 +00:00
James E. Blair
b9509a038e Remove blueprint diversion to openstack-ci.
The blueprint script used openstack-ci instead of the actual project
for any non-openstack/ project.  This is counter-productive now that
we have more than one org in gerrit.

Change-Id: Id06fdd89751a62c6da400adefcc84791a030d1b8
Reviewed-on: https://review.openstack.org/16994
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-11-27 20:28:25 +00:00
Clark Boylan
e6d25c33c9 Change diff command used by manage_projects.py.
manage_projects.py was running `git diff-index --quiet HEAD --`
previously to check if project.config had changed. This apparently
returns an exit code of 1 in some cases where a diff was not expected.
Switch to using `git diff --quiet HEAD` to check if any differences are
found. This appears to be more reliable in some manual testing.

Change-Id: I253423e41f80d71a5f2389bfc421e799f00f6fd9
Reviewed-on: https://review.openstack.org/16236
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-17 01:32:19 +00:00
Clark Boylan
65e61f5fb8 Add security impact email notifications.
Fixes bug #1070577

Make the notify_impact script generic so that it can handle different
types of notifications. Then add a SecurityImpact notification.

Change-Id: Id4bbf7db29e36dde783328e31685079e79d0b1e9
Reviewed-on: https://review.openstack.org/14856
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2012-11-16 18:13:21 +00:00
Thierry Carrez
1f50d5391b Do not reopen closed bugs due to bug mentions
Do not let update_bug.py reopen a FixCommitted or FixReleased bug just
because the bug number was mentioned in a commit message. In most cases
that mention is just a simple reference to a closed bug. In the rare
cases the committer actually wanted to reopen a closed bug, he should
rather have open a specific bug about it anyway.

Fixes bug 1078745

Change-Id: I513e6fc73d6bab02de21628e55a5d28189834632
Reviewed-on: https://review.openstack.org/16080
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-11-16 16:08:48 +00:00
Monty Taylor
be0fcea382 Push everything - not just master.
Change-Id: If10bd25e71f321a7b3ea1cbbe42ab5ec764d62b0
Reviewed-on: https://review.openstack.org/16215
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-11-15 19:38:51 +00:00
Clark Boylan
99a160120d Fix fetch remotes script post projects.yaml update
The format of the projects.yaml file has been updated and
fetch_remotes.py could not parse it. Correct this by making
fetch_remotes.py aware of the format changes.

Change-Id: Ic0680d02c0e9ce31aae805ac2495957f106acb0a
Reviewed-on: https://review.openstack.org/16098
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-15 17:06:16 +00:00
Clark Boylan
0d5361bb49 Fix manage_projects.py group regex and str format.
manage_projects.py was unable to find groups in the ACL files because it
was looking for lines that began with tabs but we normalized to lines
beginning with 8 spaces. Also the git clone command string formatting
was not correct.

Change-Id: Ib65d7ad0ca3861d61d7557be72a7c6d6d6e21265
Reviewed-on: https://review.openstack.org/16144
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-11-15 14:52:41 +00:00
Clark Boylan
02bc8fe635 Print git output when git push fails.
In the manage_projects.py script print the captured git output when git
push fails.

Change-Id: I77d8b7e926b6b23b4727a1856a79146daa9d6381
Reviewed-on: https://review.openstack.org/16137
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-11-14 23:56:25 +00:00
Clark Boylan
848fefd19a Ignore projects whose org we do not control.
In the manage_projects.py script ignore any project whose Github org we
do not control. Do not create a Github project, gerrit project, or
manage any ACLs.

Change-Id: I0d4595c49ffa7762976a433bf9b16fc6fcaf73e5
Reviewed-on: https://review.openstack.org/16102
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2012-11-14 18:21:04 +00:00
Clark Boylan
9e4702a3b4 Make manage project commit author consistent.
Set Openstack Project Creator as the commit author for all commits in
the manage_projects.py script.

Change-Id: I994ee0a43e783415d0976143509497a71187b9ab
Reviewed-on: https://review.openstack.org/16094
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-14 18:01:18 +00:00
Monty Taylor
d76f051d22 Attempt to more fully manage project creation.
Manage project creation via yaml files. Also,
Modify the manage_projects scripts to configure Gerrit project ACLs.
This change expects the project yaml to exist. The change will clone the
project for the localhost Gerrit install. It will then checkout the
meta/config ref, copy the ACL config file into the repo, commit, and
push to the origin. The ACL config location should be specified in the
projects.yaml file with the acl_config key.

For this to work the ACLs will need to be copied by Puppet from Puppet
to the Gerrit host. Add the file resource to do this as well.

Change-Id: I15a1ec13b381dce3c115c01c21f404ab79e72cc4
Reviewed-on: https://review.openstack.org/15352
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-14 01:18:23 +00:00
Monty Taylor
49a29d9428 Reverse the close-pull logic.
We have a huge list of projects with all of them listing "close-pull" as an
option. Turns out we want to close pull requests for all of them - so instead,
let's only indicate 'has-pull-requests' if there is ever a project for whom
we do not want to close pull requests.

Change-Id: I4db31d324b7f260ea24f538ac5f5fc8e1feca75d
Reviewed-on: https://review.openstack.org/15626
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-10 23:04:27 +00:00
Clark Boylan
361752170b Add change number to DocImpact email subject.
It is hard to filter the DocImpact emails using the subject as there is
little change specific information added to the subject. Correct this by
adding the change number to the subject line.

Change-Id: I8f852184090a517852d57a2f0db34421f8a7ddb5
Reviewed-on: https://review.openstack.org/15246
Reviewed-by: Anne Gentle <anne@openstack.org>
Reviewed-by: Tom Fifield
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-11-02 16:51:01 +00:00
Thierry Carrez
87a6a8801d Add Tempest to directly-released projects
Add openstack/tempest to the list of projects where commits directly
trigger a Launchpad FixReleased status change.

Fixes bug 1058007

Change-Id: Id5f5033e37d92efc5e790722cde88c040541f72d
Reviewed-on: https://review.openstack.org/13818
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-09-28 16:09:07 +00:00
Clark Boylan
b0e002d520 Use devel version of LP API.
For consistency use development version of the LP API in the scripts
that query the Launchpad API.

Change-Id: I39b145684563738dd5615d863720ec364c4987c3
Reviewed-on: https://review.openstack.org/11508
Reviewed-by: linuxjedi <andrew@linuxjedi.co.uk>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-18 13:58:28 +00:00
Monty Taylor
383c023b15 Add support for initial project creation.
If replicate_local is set, this will ensure that /var/lib/git is created,
and that projects listed in the projects.config have repos there.

Additionally, it creates a new config file, projects.config which is a
yaml file listing all of the projects and various operational semantics about
them, such as whether or not they should have pull requests closed and whether
or not they track any remotes. This replaces remotes.config and github.config.

Moving forward, there is no reason to not have this script be able to
do github api calls to create the github repo if it's not there, set the
github project description, gerrit api calls to create the project in gerrit,
and initial project permissions templates.

Change-Id: I1ad803b0aa5f7386206d0c3f4cd858017242fe64
2012-08-02 15:49:02 +00:00
Monty Taylor
0b921968d1 Added an option to toggle replication choices.
New options for github replication and local replication.

Change-Id: I06a6ca5347232ec80e26f6116742ab0007435ffe
2012-07-29 13:04:17 -05:00
Monty Taylor
d20c4523bf Broke launchpad user sync into its own class.
Additionally, the file installation of the scripts wasn't working,
so the sync script wasn't actually getting installed. This moves
the underlying scripts to be installed by the gerrit module,
because it owns /usr/local/gerrit/scripts, and then manages the
gerrit hooks which call those scripts in the openstack_project
class, since that's where the config choice to enable those
functions really should live.

Change-Id: I54fb9edd9fb0c634d8d9de4e57f9ddad6af63a99
2012-07-29 13:04:17 -05:00
Monty Taylor
c510a30e1e Modified gerrit to use MySQL and Apache modules.
Change-Id: I82ff3c46438f8db126fa6a881efa09c90b1906e4
2012-07-27 17:37:37 +00:00
James E. Blair
67a085ba7d Set replication authGroup to Anonymous.
Set the replication authGroup for github to Anonymous Users.

Enable the "mirror" option which "will remove remote branches that absent
locally or invisible to the replication (i.e. read access denied via
authGroup option)."

Disable replicatePermissions which will cause permissions-only projects and
the refs/meta/config branch not to be replicated.  I'm ambivalent about
refs/meta/config, but disabling permissions-only projects will remove
the periodic errors we get when trying to replicate All-Projects to github.

Change-Id: I9c302b68e0a213d35683d7105341788923c5770a
2012-07-25 09:26:03 -07:00
Monty Taylor
5609c50cd5 Move OpenStack branding and launchpad integration.
Launchpad integration and the OpenStack branding files are really
more about the OpenStack specific install of Gerrit than they are
about any installation of gerrit. Both of these are moved to the
openstack_project module.

Change-Id: I8b281aa5cb751a8023c2101c45146a3aca5f90f3
2012-07-23 14:46:55 -05:00
Monty Taylor
8f1adc171f Split github into its own module.
TODO: Add another script that sets the project description. Add the project
description to the config hash.

Change-Id: If4584b2a1e55e6eb912e1f557e31de216d49a516
2012-07-23 11:42:12 -05:00
Monty Taylor
e3e9aaba10 Split gerritbot into its own module.
Change-Id: Ia9034d87321624006ccf447b058ee828a97fcc7a
2012-07-23 10:33:59 -05:00
Clark Boylan
0d50460f02 Update DocImpact notifier with new dest addr.
The openstack documentation team has a new mailing list in part to
accomodate the DocImpact notifier. Update the destination address in
the notify_doc_impact script to send mail to
openstack-docs@lists.openstack.org.

Change-Id: I041194298a18e5f710c6e3bd7221dee2099733e8
2012-07-11 16:16:58 -07:00
Monty Taylor
ae37e2affd Restrict replication to github.
We should only replicate to github things that people can see anyway.

Change-Id: I3a1aa93cc805d64a1c04ea963df54223c06f5837
2012-07-07 09:44:57 -05:00
Jenkins
95fef53864 Merge "Use apache to serve out http git repos." 2012-07-07 14:41:16 +00:00
James E. Blair
5efb744f30 Add gerrit-verification-status-plugin project.
Change-Id: Idc43f0716d152f623459369cab84d6166e140a88
2012-07-06 13:11:57 -07:00
Monty Taylor
0fbbe34dfc Use apache to serve out http git repos.
Assumes that every project in gerrit has a corresponding repo in
/var/lib/git that can be replicated to. That's probably a one-time offline
creation, followed by an additional step in the adding a project docs.

Change-Id: If9b987717550d5b251366c1408d949c55e64828a
2012-07-06 14:06:21 -05:00
Jenkins
7bbb1f38f3 Merge "Fix gerritbot init script" 2012-07-06 15:35:27 +00:00
Andrew Hutchings
39f1fe8abf Fix gerritbot init script
Path to the executable was incorrect

Change-Id: I990a7029f0ce84b308dc60ddbae8003f00106a81
2012-07-06 16:24:59 +01:00
Andrew Hutchings
7b96c527d9 Fix gerritbot projects
heat is in heat-api/heat

Verify trigger is for -2 in the code, not -1

Heat's repo is in heat-api instead of stackforge, so Gerritbot needs
to monitor that

Change-Id: I0526a32489c9af67198fcebeebdf3271c5751c49
2012-07-06 16:10:59 +01:00
Clark Boylan
bc2448199a Allow GerritBot to talk on multiple channels.
Fixes bug #1020987

Update GerritBot with the ability to talk on multiple channels. This
way a single GerritBot instance can operate in multiple channels for
multiple projects. To make this work this change introduces a new
channel configuration file (yaml) for GerritBot that specifies each
channel that GerritBot should join and the changes that channel is
interested in.

The config should look something like:
channel-foo:
    events:
      - patchset-created
      - change-merged
    projects:
      - test/bar
      - test/foo
    branches:
      - master

Change-Id: I8e278f9be5182611981a3d912cc323bd3d386fc5
2012-07-05 15:02:25 -07:00
Thierry Carrez
b56c5f3f75 No longer mark bug fixes in parent project
Stop marking python-PROJECT client bug fixes as fixed in PROJECT, by
removing the exception mapping. This is due to client projects now
having their own Launchpad project.

Change-Id: I56471c9efff143f79421729880626c5e78c6200b
2012-07-04 12:43:27 +02:00
Clark Boylan
d395a98dbc Add doc impact notifier to Gerrit.
Add a doc impact notifier to Gerrit that will email the documentation
team whenever changes with "DocImpact" in their commit messages are
pushed to Gerrit.

Change-Id: Ibbb4ac740efa60ef44fd4753ad8459437d98e592
2012-06-27 14:19:21 -07:00
Clark Boylan
50628cdbf6 Try again to fix the close request script.
Fixes bug #1012310

Seems github won't let you request an issue if issues are disabled
on a repo. So attempt to get around this by creating an Issue object
derived from a pull requests URL. Then comment on this issue object.

Change-Id: If64640ebc1d86d86360e5657f4245541620fcebb
2012-06-13 17:15:25 -07:00
Clark Boylan
e8b306ee59 Fix the close pull requests script.
Fixes bug #1012310

Need to use the .login property on orgs instead of the .name property.

Change-Id: I603f9172966fc99c8f49d592ce7a9009084840cd
2012-06-13 14:48:28 -07:00
Clark Boylan
7bd6b502a0 Fix the close pull requests script.
Fixes bug #1012310

Old version of script didn't appear able to find repos as part of
organizations. Update script to search for the repos under orgs.

Change-Id: I04696152bc3b7ecb63a5704768c27ff796d3ffc9
2012-06-13 13:20:42 -07:00
Clark Boylan
b9ebb81800 Update Github request closer script to v3 of API.
Fixes bug #1012310

Github disabled v1 and v2 of their API permanently, forcing us to
update the script that closes Github pull requests to v3 of the API.
Update the script using the PyGithub lib.

Change-Id: I90c9faacdb7a72a470b8ad6aaea674edd9b8329e
2012-06-13 10:14:36 -07:00
Monty Taylor
6e0d87bffc Add gerrit to the openstack-ci bug projects.
Change-Id: I71649621123d0dfa4de3e4445d3eb5cdb7ceac84
2012-06-10 15:33:33 -04:00
Jenkins
c3f7ed4f0b Merge "Revert "Decode key returned from db into unicode."" 2012-05-27 16:17:34 +00:00
Monty Taylor
352b80f923 Revert "Decode key returned from db into unicode."
This reverts commit 9e63f0b303951da12dd4d96e9842b6c191763522
2012-05-27 16:16:55 +00:00
Jenkins
29e849f3b6 Merge "Decode key returned from db into unicode." 2012-05-27 15:41:36 +00:00
Monty Taylor
9e63f0b303 Decode key returned from db into unicode.
We get this error in cron:

/usr/local/gerrit/scripts/update_gerrit_users.py:339: UnicodeWarning:
Unicode equal comparison failed to convert both arguments to Unicode -
interpreting them as being unequal
  if key.strip() not in db_keys:

The stuff from Launchpad comes back as unicode, but the stuff from MySQL
comes back as string, which makes the in comparison wonky.

Perhaps we should upgrade the database to unicode properly as well...

Change-Id: I5ef66763429ca490d799ebb5b030abdc4d5de67e
2012-05-26 12:01:51 -04:00
Monty Taylor
4793ef2afc Fix two typos in the remote fetch script.
The default values for locations were wrong.
The config file name is remotes.config.
The git repos are in /home/gerrit2/review_site/git.

Change-Id: Ie887b2424e3ee50f802573e147cd4751e390d3e8
2012-05-26 10:16:28 -04:00
Jenkins
7b127cb360 Merge changes I76ad015e,Iabe17164
* changes:
  Add pyflakes to Jekins slaves
  Make all Python pass pyflakes
2012-05-25 16:51:23 +00:00
Andrew Hutchings
aae2f80fdd Make all Python pass pyflakes
This found one bug, but will also help us with Jenkins testing of these scripts

Change-Id: Iabe171645c06f769957db7cf0def1d10a0e47988
2012-05-25 14:26:41 +01:00
Thierry Carrez
c7ceb721f6 Update series bugtasks status on stable/* changes
Makes update_bug.py Gerrit/LP hook support setting series-specific
bug tasks to FixCommitted status on change-merged to stable/*
branches. Fixes bug 921588.

Also sets "In Progress" on patchset-created to stable/*.

Change-Id: I5e3b7c8d249755a71f3425dd33151764be2a1485
2012-05-23 16:51:59 +02:00
Thierry Carrez
735715899c Fix typo causing update_bug hook failure
A typo in update_bug.py recent changes was causing hook
failure. Fixes bug 1003377.

Change-Id: Ie86a8431b19cbf1777ec3ca6abaf0df51f7d51f7
2012-05-23 14:18:43 +02:00