62 Commits

Author SHA1 Message Date
Spencer Krum
b97a43f14a Fixing deprecation warnings in gerrit module
Change-Id: Ie19d47eb4e02d86e8eaef7541321fb42eb546ad9
2014-07-16 00:09:52 -07:00
James E. Blair
f52d2eb2b6 Revert "Fixing deprecation warnings"
This reverts commit 82b9b59522928863ddadeacfec819e287303ef20.

Change-Id: I746d7ae57802dc76618db9024a0cf94c43774c02
2014-07-02 17:35:02 +00:00
Spencer Krum
82b9b59522 Fixing deprecation warnings
Non instance variable representation is deprecated
so needs to be changed. This change changes varibles
to their instance variable representation.

See more details see:
http://docs.puppetlabs.com/guides/templating.html

Change-Id: Ib77827e01011ef6c0380c9ec7a9d147eafd8ce2f
2014-06-19 22:41:42 -07:00
Jenkins
ab3d3e3fb5 Merge "Configure direct download of files to browser" 2014-05-22 13:44:51 +00:00
Khai Do
009aad7715 Configure direct download of files to browser
Gerrit by default wraps all file downloads in zipped archive. This
can be overridden using the mimetype setting[1]. This change allows
downloading of xml, yaml, rst, html, and txt files without being
wrapped inside of a zipped archives.

[1] https://review.openstack.org/Documentation/config-gerrit.html

Change-Id: I47563de12a2bc8c8a3755fa777abf029cc4e0c28
2014-05-22 13:26:44 +00:00
Jenkins
84264398b5 Merge "Add configuration option to disable top level menu for javamelody plugin" 2014-05-20 18:34:39 +00:00
David Ostrovsky
4d312a5957 Add configuration option to disable top level menu for javamelody plugin
Change-Id: I696db6a16b1ba57000951186367501c376f321de
2014-05-07 09:05:33 +02:00
Sergey Lukjanov
904821c27b Display images in reviews
Due to the gerrit release notes it's support starting from 2.0.17:

GERRIT-139 Allow mimetype.NAME.safe to enable viewing files

https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#mimetype

Change-Id: I28329d82cdbefb838748f4cf91ca79c83bd93e73
2014-05-05 13:18:22 -07:00
James E. Blair
d51658cc18 Enable run-as in gerrit
This just makes the option available.  Actually controlled by ACL.

Change-Id: I3c6f853fa30c69397b0639069d6c38fcd869b469
2014-04-28 17:41:59 -07:00
David Ostrovsky
aa86bee7f3 Gerrit-2.8: Add secondary index support
This rebuilds secondary indexes on gerrit initial-init and init. They
are optional in gerrit 2.8, and mandatory in gerrit 2.9.

A few common strings are refactored into variables to make this more
concise, and less likely to get fat fingered. If desired, further
symbolic refactoring can be done here as well.

Question remains if we need to make this 2.8 conditional, and how we
can get access to the gerrit revision in this part of puppet.

Partial-Bug: #1082781
Change-Id: Iee94934baaa220313a7e888ba0e2a6530eab0d52
2014-04-28 15:42:09 +00:00
Jenkins
9a87145d28 Merge "Make gerrit git replica and jeepyb paths configurable" 2014-04-24 16:39:20 +00:00
James E. Blair
3c2948637a Make gerrit git replica and jeepyb paths configurable
* Gerrit: make the path to the local replica configurable
  (default to /var/lib/git)
* Set the local replica path on review-dev to /opt/lib/git
* Gerrit: make the jeepyb cache dir configurable
  (default to /opt/lib/jeepyb)

Change-Id: I9b94fa540bb400abcc746c5c962bb3b5e2b372e3
2014-04-24 08:57:57 -07:00
David Ostrovsky
25546d376e Gerrit-2.8: Allow encoded path separators in URLs
Partial-Bug: #1082781
Change-Id: Ib446a3332a3ff289cd9f6464009ce5f7416309eb
2014-04-24 07:56:52 -07:00
James E. Blair
0c5b2fad15 Support configurable mysql host in gerrit
In further support of using a trove db, remove the gerrit::mysql
module from review-dev.  Plumb mysql_host throughout and remove
the no longer necessary mysql_root_password.  Configure review-dev
to use mysql_host from hiera, but configure review to use
'localhost'.

Change-Id: Id13cea66601f80c5b17d2a4069a14f7b458ea09d
2014-04-23 10:31:37 -07:00
Aaron Greengrass
9315d1465e Expands ldap to deal with nonstandard ldap configs.
This patch addresses:

LDAP not requiring username or password (anonymous bind)
  This is required to support configurations where LDAP is on a secure network,
  and anonymous bind is enabled.

LDAP using a self signed SSL cert (verify ssl on or off)
  This is required to support configurations where LDAP requires SSL, but ssl is
  using an internal or self signed certificate, and therefore fails cert checks.
  This also covers testing conditions where a consumer might use OS with LDAP+ssl
  unsigned.

LDAP using a nonstandard cn naming convention (ie email address).
  This is required to deal with an edge case where 'cn' in ldap might be something
  other than a bare username.  Gerrit pulls the ssh username from that value and
  will not accept a non-alphanumeric address.  By setting 'accountSshUserName' in
  puppet, that is setable.

LDAP prepopulating account Full name.
  Gerrit has a configuration option to pull Full Name from LDAP, this change exposes
  that option.

Change-Id: Ibd41d59ff98e406b42e1e14cc17e23b3d6211d58
2013-12-30 13:04:39 -08:00
Monty Taylor
c53349587b Use scope::lookupvar for explicit search
Scoping rules mean that we need to be explicit here or else puppet finds
the wrong thing. Also, puppet needs a trailing slash.

Change-Id: Ifc2f03dbf1dd746515e00ded5d76fe7393ce6c7e
2013-11-24 15:07:20 -05:00
Jenkins
b5c69b56f3 Merge "Make the gitweb links in gerrit point to git.o.o" 2013-11-24 19:39:32 +00:00
Monty Taylor
af78ec85cc Make the gitweb links in gerrit point to git.o.o
Gerrit has builtin support for cgit links. Use it - but test it out on
review-dev first.

Change-Id: I8ea38e08258cdc8eb95e2fc3c1da5a4dc8faee57
2013-10-19 10:48:51 -04:00
Monty Taylor
4f5192e0a6 Un-Revert "Make gerrit email server configurable"
This time, make the default value false instead of empty string.

This reverts commit 99d3283dc246da4b4d2d26ecfb193b308881f05d

Change-Id: I88108ff75f1c2bd3aa78856c186312340258ec3c
2013-10-12 17:10:03 +00:00
Monty Taylor
54d0db2fea Parameterize server OpenStack-isms
Make it possible to configure with LDAP or OPENID_SSO.
Also, it's possible to not want to need CLAs.

Change-Id: Ie6660c819f4078dd4dd5be052e74aaa98c54cab4
2013-10-12 17:01:48 +00:00
James E. Blair
99d3283dc2 Revert "Make gerrit email server configurable"
This reverts commit 040073e7463a661340aea83da744fe5ebeb40d1f
2013-10-08 22:08:13 +00:00
Monty Taylor
040073e746 Make gerrit email server configurable
Sometimes people need to send mail through a smarthost. Allow that.

Change-Id: I66ff43a3ca4fce63500755d16be3aa891d55bc75
2013-10-06 15:05:20 -04:00
Jenkins
d78e4e6acc Merge "Use cgit server instead of github for everything" 2013-08-23 17:01:32 +00:00
Monty Taylor
258abe1a23 Use cgit server instead of github for everything
We have a cgit server now, which means we should replace
all references to github with references to git.openstack.org.

Change-Id: I68ad1ce514fb4326c7d9940b5a84999af5b58562
2013-08-19 10:19:47 -07:00
James E. Blair
b93eb82cad Add testresult commentlink
Will take effect when Zuul is running this change:
  I74702fd7d37358e6f4caa7e7ac0a3ede73184077

This change also adds that feature to the Zuul config and enables
it for OpenStack.  It also adds the ability to specify HTML in a
commentlink (and uses it).

Change-Id: Idb4ad8e6079165d681271987a92cab5d8b7c81be
2013-08-18 12:43:15 -07:00
Elizabeth Krumbach
1ae208113d Add replication of git from gerrit to git.o.o
Modify gerrit's git replication configuration so that it
pulls in from a list of replication targets defined in
puppet rather than individually added stanzas.

Pull the replicate_github variable from files, since it
is no longer required.

The replicate_local variable remains because it's used
in the apache configuration and for setup of the local
replication space for git.

Also add the cgit server to the list of servers.

Change-Id: I68de89bb216565f1754eb9b192bd437adcbf768b
2013-08-07 18:17:47 -07:00
Monty Taylor
499ee08c94 Add support for parameterized gerrit ports.
Actually, it's support for parameterized listen_address, but the
real thing you want it for is setting the port.

Change-Id: If75fedce32f35a8f72c92fc709d5c9e8b2d35235
Reviewed-on: https://review.openstack.org/33925
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-06-26 14:25:47 +00:00
James E. Blair
afa87385cc Add robots.txt to gerrit.
And slow down bing (msnbot).

Change-Id: Id8361047abc2cfb52260b3d0ef01275ec3a923f5
Reviewed-on: https://review.openstack.org/32435
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Elizabeth Krumbach Joseph <lyz@princessleia.com>
Reviewed-by: Anita Kuno <anita.kuno@enovance.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-06-10 20:21:16 +00:00
Jeremy Stanley
6bc14d0032 Don't proxy Gerrit's fake contactstore.
* modules/gerrit/templates/gerrit.vhost.erb: If the contactstore
feature is enabled, don't shadow the URL to the fakestore CGI with
the Gerrit loopback proxy.

Change-Id: Ic6d01d671b762370b91f732c1a980051cdb5f6c2
Reviewed-on: https://review.openstack.org/20053
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-19 02:39:50 +00:00
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
74460853d1 Rename CI to Infra in MANY MANY places.
Change-Id: I409bd50ae374e0288531f07cfeea34856c5f8067
Reviewed-on: https://review.openstack.org/17319
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: James E. Blair <corvus@inaugust.com>
2012-12-16 17:30:47 +00:00
Jeremy Stanley
25d4e6f4c9 Enable Gerrit CLA and Contact Store on review-dev.
This replaces the previous Echosign+Launchpad+Wiki+approver-based
asynchronous contributor license agreement signing process with a
fully-automated one contained entirely within Gerrit itself.

Note that the CLA features in Gerrit's WebUI depend on a modified
gerrit.war with an earlier patch reverted:

    https://review.openstack.org/12716

* manifests/site.pp(review-dev.openstack.org): Fill contactstore_appsec
and contactstore_pubkey private material from hiera, for use by Gerrit's
contact store feature. Similar entries should be added for
review.openstack.org before going into production.

* modules/gerrit/manifests/init.pp(gerrit): Add contactstore,
contactstore_appsec and contactstore_url variables needed by the
gerrit.config.erb template, and contactstore_pubkey needed by the
contact_information.pub.erb template. Add a conditional block so that if
contactstore is enabled it installs the libbcpg-java package which
Bouncy Castle needs for OpenPGP operations, links the bcpg.jar into
Gerrit's lib directory, and builds contact_information.pub from the
contact_information.pub.erb template.

* modules/gerrit/templates/contact_information.pub.erb: New template
which is effectively an empty file waiting to be filled with the
contents of the contactstore_pubkey variable. The
gerrit_contact_information.pub file built from it gets used to encrypt
contact information filed by users in such a way that it can only be
decrypted by the private key held by the Foundation.

* modules/gerrit/templates/gerrit.config.erb(contactstore): New section,
implemented conditionally for safety. Once enabled, if the
contactstore_appsec and contactstore_url are unset then Gerrit will
refuse to start. If the system referred to by contactstore_url is
unresponsive or contactstore_appsec does not contain the shared secret
it's expecting, contributors will be unable to file initial or updated
contact information through Gerrit's WebUI.

* modules/openstack_project/files/gerrit/cla.html: A stripped-down HTML
copy of http://wiki.openstack.org/CLA retaining all the original
wording. This will probably need updating by OpenStack Foundation staff.

* modules/openstack_project/manifests/gerrit.pp
(openstack_project::gerrit): Add contactstore, contactstore_appsec,
contactstore_pubkey and contactstore_url variables to pass back into the
gerrit module. Also define the cla_description, cla_file, cla_id and
cla_name variables which get used in the gerrit_set_agreements.sh.erb
template. Add an entry to install the cla.html file.

* modules/openstack_project/manifests/review_dev.pp
(openstack_project::review_dev): Add the contactstore_appsec and
contactstore_pubkey variables so they can be filled in by hiera.
Override the war to pull in the g69c8fa6 test build which has the
aforementioned CLA bits restored. Turn on contactstore and set
contactstore_url to point to an existing test CGI on the Internet until
the Foundation has theirs ready. Pass contactstore_appsec and
contactstore_pubkey through up into gerrit.pp. Add an entry for the
set_agreements.sh script built from the gerrit_set_agreements.sh.erb
template and then execute it to add the new CLA to Gerrit's DB and mark
the old one expired. Similar changes should be made in review.pp before
going into production.

* modules/openstack_project/templates/gerrit_set_agreements.sh.erb: New
template used to build a set_agreements.sh script which checks Gerrit's
database and, if necessary, expires the old Echosign CLA and adds the
new local CLA. These conditions are checked and associated operations
performed independently, so subsequent runs become a no-op.
Post-migration, this can probably be neutered further and kept around
for pushing future CLA modifications into the database when needed.

Change-Id: Ib7136fef23dbd5602955649b33a57bc8d7106026
Reviewed-on: https://review.openstack.org/13058
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-09-20 15:15:42 +00:00
Monty Taylor
7d8c838038 Align all web server usage on apache module.
Change-Id: Idd712a8ee5ec81c6b88b7d3e2270dce4da254927
Reviewed-on: https://review.openstack.org/10838
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-12 17:03:46 +00:00
Monty Taylor
e63619e980 Make gitweb a boolean option.
Change-Id: Iff55f35c0d9888f1029115c17d4644a68d4e8b4c
Reviewed-on: https://review.openstack.org/10727
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-03 23:12:38 +00:00
Monty Taylor
892a620737 Have apache honor replicate_local.
Change-Id: I44538a151afda2086469d0309b8113be0a477f93
2012-08-02 10:55:08 -05: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
46282d44c1 Fixed a template typo.
Variable interpolation needs <%= not just <%. :)

Also, while I was in there, I replaced default with "oneiric",
because I don't actually know that the value is a good default value,
and I removed a couple of comments about moving to MySQL and Apache
modules from upstream.

Change-Id: Iec5b10cee2cbd0e0a2573fefa707d34d2a363cb4
2012-07-28 10:04:43 -05:00
Monty Taylor
c510a30e1e Modified gerrit to use MySQL and Apache modules.
Change-Id: I82ff3c46438f8db126fa6a881efa09c90b1906e4
2012-07-27 17:37:37 +00: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
Monty Taylor
221869cd60 Change database_password to mysql_password
The parameter, which filters straight down, is mysql_password, not
database_password.

Change-Id: Ib6a0dfbb65657367bda51b3ca54905740c13cf6b
2012-07-21 19:21:52 -07:00
Monty Taylor
d025dca604 First pass at parameterizing secret infos.
Change-Id: Iee56a7e65be51ebf19a61eefd60cc93de6a764bf
2012-07-20 14:40:42 -07:00
David Ostrovsky
89c230cb4e reconfigure gitweb to show the whole content of the commit and not only the changed filed
Change-Id: Ie9940a0b8afc0fa85f89395c4fa8bdc84f9be6ff
2012-07-07 22:26:12 +02: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
James E. Blair
7558862fde Set gerrit http maxwait.
Set the timeout to 5000 minutes, which, due to a bug in gerrit
really means 5 minutes, which is the documented default value.

Change-Id: I85127cc44ed6f182a0e06083641d2d872f11d8b3
2012-07-02 12:35:51 -07:00
Clark Boylan
17c836ab28 Enable Melody on review-dev.
Review-dev is running a Melody capable WAR, but the Melody service
was not enabled. Enable it.

Change-Id: I68934151a38c2572f37d996e1c923a880ab9f50f
2012-06-25 13:26:46 -07:00
Andrew Hutchings
d42c95b727 Add color values
Gerrit without my patch will ignore these config values.  Review-dev will apply
them.

Change-Id: I5f01229ad6c2e1c3a0cf2de53fffd0c2b1a3626b
2012-06-20 14:12:19 -07:00
James E. Blair
0082fa9c49 More gerrit tuning.
Increase the heap size and dramatically increase the ssh threads.
Add some more recommended parameters (see site manifest for details).

Parameterize tunables in gerrit config file.

Change-Id: Ia6446b29426f56a77425eed93a7f0e448c3cd7b1
2012-05-29 18:15:27 +00:00
Monty Taylor
6fdebcf5af Adds support for tracking an upstream repos.
Change-Id: I3c92c19cf2c2fd6a911fbdbf4aeeb66e53cf07e0
2012-05-10 13:12:31 -04:00