Commit Graph

380 Commits

Author SHA1 Message Date
Monty Taylor eff363f158 Retire repo
Depends-On: https://review.opendev.org/720892
Change-Id: Ib75cd0861d5f20f9ccacf96d38be81122dac75de
2020-04-22 10:18:58 -05:00
Monty Taylor 43f8067c00 Add support for replicateOnStartup config option
Gerrit supports turning off the automatic full replication on startup.
The default config value is on, so set the default here to on as well
so that this is not a behavior change. OpenDev will want to set this
to false.

Change-Id: Ibb16d212ace90750ced51ff43e714532144f577c
2019-08-26 10:12:29 +02:00
Monty Taylor 8b9c5af580 Set a default idle timeout for ssh connections
The default value upstream is 0, which is to not timeout stale
connections. This can lead to an increasing collection of stale
connections for a user behind a flaky connection, which can eventually
cause them to hit their connection limit.

Set a default to 1 hour, which should cause us to stop accumulating
these.

Change-Id: Icd27dccabbbe33230c2d60185cbc9d405c07fc37
2019-08-25 12:32:22 +02:00
Clark Boylan 8a0af16d17 Increase Gerrit startup timeout to 300 seconds
The default is now 90 seconds and we run into that and timeout which
confuses systemd. To avoid confusing systemd increase the timeout to its
old value of 300 seconds which worked back with older Gerrit. Hopefully
this doesn't confuse systemd anymore.

Change-Id: I8476c832f950e18035e11f225202eff8572f5ce8
2019-05-29 08:08:24 -07:00
Monty Taylor de1e1ab2c1 Install libcgi-pm-perl for gitweb
It's needed. It's not provided by the gitweb package, which provides
nothing useful.

Change-Id: I6767703794544365dee18ac4c17c81b8b1eb0253
2019-05-17 07:21:26 -05:00
Monty Taylor 7c43778f2f Fix gitweb link config
We need to set type = gitweb. Also, the gitweb script itself
is in /usr/share from the git package.

Change-Id: I7e73a0ba721ed93e4acf308821ad3efd3d5eb4c8
2019-05-02 16:38:46 +00:00
Monty Taylor 0d533a9a94 Add support for gitea links
If we want to link directly to opendev urls, we need gerrit to
understand what the link structure looks like. Add support.

Change-Id: I8efefe365f3b9ebe97c8c2ce322fa8c6f3b70b3a
2019-04-20 18:15:01 +00:00
Monty Taylor a7422e3645 Fix opendev urls
Change-Id: I7e26218e5787870080254a4a8d74f9220dd9915f
2019-04-20 18:07:28 +00:00
OpenDev Sysadmins ec9f8d475d OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:26:01 +00:00
David Moreau Simard 4dac913508
Add support for enabling replication configuration autoReload
This will allow us to change the replication configuration without
requiring a restart of gerrit [1].

[1]: https://gerrit.googlesource.com/plugins/replication/+doc/master/src/main/resources/Documentation/config.md

Change-Id: Ia360a18f1cfb88800f4c644d8ebd0fe2c2b08b31
2019-04-04 11:12:19 -04:00
Ian Wienand d349554665 Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: I4d99b4b6a09b2d3bdcfff152afac767b76777340
2019-03-24 20:35:38 +00:00
Zuul 352e7c112e Merge "Revert "Create index on fresh install"" 2019-01-14 23:48:30 +00:00
Clark Boylan 0abb2f5716 Revert "Create index on fresh install"
This reverts commit 5c44d09dc7.

This change forced us to do an offline reindex whenever the war was
updated. Unfortunately, that means even on minor upgrades we do a long
reindex, which times out in puppet, then puppet fails as does an
upgrade.

You can address this by setting offline_reindex = true when doing a new
install, then flip that to false (the default) once the new install is
bootstrapped.

Change-Id: I1f730a1cd2bcf96e6b94f2d0a82078f46d49e0ce
2019-01-14 10:06:04 -08:00
Clark Boylan 3a0c45d9a5 Set java lib user ownership to gerrit2
The Gerrit init process likes to rename these libs and it cannot do so
when they are owned by root. Update the process to download and install
the libs out of band of the init process to run as gerrit2 so that these
libs are owned by the gerrit2 user.

Change-Id: I1b619a64c5e324fa8d0c24ef02ace9561c382475
2019-01-14 09:15:29 -08:00
Monty Taylor 8cfffc49bc
Add support for specifying which refs to replicate
Sometimes one would like to only replicate a subset of the refs in
a git repo, such as not replicating refs/changes.

Change-Id: Ibf6c02d59c6901f82be6a96b676b1bd28c4b61f7
2019-01-09 21:20:06 +00:00
Zuul 14a2c2dba8 Merge "Allow lists of trackingid footers" 2018-12-21 21:33:59 +00:00
Zuul f9cda6a6d2 Merge "Fix beaker tests" 2018-07-21 14:47:22 +00:00
Colleen Murphy 86c008cca4 Fix beaker tests
On puppet 4, the tests were failing because the new ordering algorithm
caused the gerrit initializer exec resource to happen before the
database was set up. This patch adds an explicit ordering to the
gerrit::mysql class in the test fixtures to ensure the database is set
up first. This shouldn't be an issue in real life because we don't use
puppet to set up the database.

Also override the vhost_name and canonical server name parameters with
'localhost' since the $fqdn fact on test nodes can be wonky without some
extra setup.

Also add a conditional to the ssl-cert group exec so that it doesn't run
every time. Unfortunately this is not enough to make the tests
idempotent since the tidy resource behaves strangely when the directory
contains a symlink.

Change-Id: I56174d98496cd640b5b6490650a643c1aed740f7
2018-07-13 15:52:23 +02:00
Colleen Murphy 95dba6be3d Update Gemfile for Zuulv3
The logic in the Gemfile was relying on Zuulv2 variables to find out
whether the spec helper gem was already available on disk, and since
Zuulv3 has changed things it was failing to find it and downloading the
master version instead. This patch ensures the Gemfile looks for the gem
in the right place when running in CI.

Change-Id: I66ee4529d821acd41663a83fc371d36de0333fcd
2018-07-12 09:57:44 +02:00
Zuul ed2a3a85ae Merge "Add bindep.txt file" 2018-04-20 18:53:26 +00:00
Paul Belanger 7861ef1b8c
Switch to using openstack-infra/puppet-openstack_infra_spec_helper
Looking at puppet-openstackci, it seems this is the logic needed to
start using our centralized spec helper scripts.

Change-Id: I5b21f6fe14bf288f27f45e0b6c0e58db35b64d71
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-03-19 15:52:04 -04:00
Jeremy Stanley 4af0bfe7d4 Allow lists of trackingid footers
Gerrit allows for multiple footers in a single trackingid. If a
footers list is provided, iterate through all its entries; if not
though, we should continue supporting the old footer string
as a fallback.

Change-Id: I99e16246e81b7ebc50e96054a2e3790aed0089bc
2017-09-22 17:38:59 +00:00
Monty Taylor dce6e65c8e
Override the cgit url settings in gerrit
The upstream ones add a .git. That does't work.

Values taken from:

  http://git.openstack.org/cgit/openstack-infra/gerrit/tree/gerrit-server/src/main/java/com/google/gerrit/server/config/GitwebConfig.java?h=openstack/2.13.8#n158

Change-Id: I197bc90b58db9e7048cc9a3892ef3dcfa575598f
2017-09-19 16:21:20 -05:00
James E. Blair 9740afe771 Allow configuring account/group cache limits
Change-Id: Iedb9fae62b133d76efeac5c8ecffde49704828c2
2017-09-19 09:47:45 -07:00
Jeremy Stanley c3c680a19c Stop supporting the Contact Store feature
Gerrit, as of 2.12, no longer implements the Contact Store
subfeature for their contributor agreement implementation.
OpenStack's Gerrit deployment no longer relies on this, and it's
likely they were the only actual consumer to start with so probably
safe to clean up at this point.

Change-Id: I50572d436b9d59a6184576adb5c27a3fc0fbec04
Depends-On: I8c39a6bf43f5b12db3e8aab18bedbf7e1a0f0b7e
Story: #2001094
Task: #4869
2017-08-07 18:16:56 +00:00
Clark Boylan 73fa243422 Explicitly enable utf8 on jdbc connection url
Testing on review-dev has shown that newer gerrit won't support utf8
properly unless we explicitly enable utf8 on the mysql jdbc string.
Without this non ascii characters get entered into the db as literal
"?". Go ahead and add explicit utf8 parameters to the database url in
this change.

Note that this should be safe on older gerrit too as gerrit should
ignore any config options it doesn't know about.

Change-Id: Ib097f93951904951a285ec40a21096988fb13562
2017-07-25 10:50:51 -07:00
Clark Boylan a52cab89f3 Support setting accountPatchReviewDb.url in config
Add accountPatchReviewDb.url as a configurable option to the secure
config file (we put it in secure config as the url likely contains a
database password in it). This is a new database in Gerrit 2.13 which
will default to using an H2 db in review_site/db if a url is not
specified.

Note that this database must have a different name than the review
database (called 'reviewdb' by this module) and if they are the same
that database will be dropped and you will have a sad afternoon.

Change-Id: Ifc04395f076200a68e6398190a0712c80e5278c6
2017-06-27 09:56:31 -07:00
Colleen Murphy 61f6803f1e Make beaker tests work on xenial
Remove all spec assertions for the existence of files. We can assume
that if the puppet finished successfully then the config files were also
laid down correctly. We remove these checks instead of updating the test
for /home/gerrit/id_rsa.pub which was moved to
/home/gerrit/.ssh/id_rsa.pub.

Remove all spec assertions for the existence of packages. Again, we can
assume that if puppet finished successfully then the package was found
and installed. We remove these checks instead of updating the test for
the JRE package to point to the new Xenial package.

Don't set java_home in the gerrit class since the module should be
setting the right default for us based on the release.

Make mysql config changes prompt a service restart (only in the
fixture). gerrit::mysql sets sql-mode to remove NO_ZERO_DATE, but the
mysql module doesn't restart the service by default when the config
changes and bindep preinstalls mysql so the service is already started
when my.cnf is set.

Update the beaker nodeset and spec helper to run on xenial and install
puppet from the Ubuntu repos instead of from puppetlabs since puppetlabs
doesn't support puppet 3 on xenial.

Change-Id: I0b6db86a76fc532443f80d6cbed2b1ef6ca9605e
2017-06-11 13:07:52 +02:00
Colleen Murphy 0fdd0671c0 Make gerrit work on xenial
First, add a params class so that we can distinguish between java packages
on different Ubuntu releases.

Set sql-mode for mysql to remove NO_ZERO_DATE mode so gerrit can
initialize. If not removed, gerrit tries to create the
account_group_by_id_aud table with column added_on with a default value
of 0 and fails. This is only important for CI and downstream since
Infra's gerrit instance uses trove instead of a local database.

Depends-On: If25da754ec107b8dba2d9343f16b54b99cc88e01
Change-Id: Ifd2244ae9dd212b2475f9cd6adb994bc058a4769
2017-06-11 11:54:28 +02:00
Paul Belanger 7fdc054adf
Add bindep.txt file
Bindep is a tool for checking the presence of binary packages needed
to use an application / library. It started life as a way to make it
easier to set up a development environment for OpenStack projects.

Change-Id: Ie8c9ef414d23102797197ad2811084c54ed9bee2
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-05-01 21:08:29 -04:00
Clark Boylan 76454dd134 Small comment cleanup
offline_reindex is not used by the gerrit.config template. It is only
used by puppet itself to know whether or not to perform an offline
reindex during the upgrade process of a gerrit installation.

Change-Id: I9614691e083f38f1b9c367817c394bf1367e6939
2017-04-05 08:27:32 -07:00
Jenkins cde8d6ec51 Merge "Update bouncy castle libraries for Gerrit 2.13" 2017-04-03 21:04:09 +00:00
Jenkins e4de9bc101 Merge "Fix placement of ssh public key" 2017-04-03 20:35:11 +00:00
Jenkins 5fa6b9e081 Merge "Add a known_hosts file" 2017-04-03 20:19:40 +00:00
Colleen Murphy 1b457604ab Fix puppet-lint error
puppet-lint finally released a new major version that enforces the
not-that-new-anymore puppet style guide. This patch updates the
parameter list to avoid the "optional parameter listed before required
parameter" lint warning that is causing the lint jobs to fail.

Change-Id: I7fb22744f91a1c710ba8bf0332d2c4f8995d2ad7
2017-04-01 16:02:36 +02:00
Khai Do c00f473402 Update bouncy castle libraries for Gerrit 2.13
Gerrit 2.12 and 2.13 supports newer version of bouncy castle libs[1][2],
update to get matching libs.

[1] https://git.openstack.org/cgit/openstack-infra/gerrit/tree/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config?h=upstream/stable-2.12
[2] https://git.openstack.org/cgit/openstack-infra/gerrit/tree/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config?h=upstream/stable-2.13

Change-Id: I3eb367c23045021127e738d1ee7ab620465cca7d
2017-03-26 22:08:37 -07:00
Khai Do 6e616dd29c Fix placement of ssh public key
The ssh public key should be in ~/.ssh folder instead of at the root
of the user's home folder.

Change-Id: I29c8f068b8765e79439cb5f74f77618c12d6ef4a
2016-11-20 22:59:40 -08:00
Khai Do 5c68123dad Add a known_hosts file
Make puppet install a known_hosts file to gerrit server.

Change-Id: I0bb6638f5362696cd9a9a7401cb2e96ab69eea06
2016-11-20 22:49:40 -08:00
James E. Blair 0f8fc12999 Add apache2.4 acls and permission to gerrit static dir
We serve robots.txt out of the gerrit static dir, but did not allow
apache to access it.  This corrects that.

Change-Id: Ibf7338641247bb5f66e3a9d7be92ce45a72da1fd
2016-09-26 08:52:11 -07:00
Ian Wienand 5c44d09dc7 Create index on fresh install
A fresh install of gerrit was refusing to start with

  com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1) No index versions ready; run Reindex

Because we pre-populate some of the directories in review_site, gerrit
init thinks it is in an upgrade situation and does not create or touch
the index.  Thus manually create the index when we are initalising a
new site.

Also, the gerrit-reindex doesn't have to subscribe to the
gerrit-initial-init; it should only be triggered on updates if
offline-indexing is wanted/required.

Change-Id: I98ce9ff87570a86e9b58b38d0605313ee5ee2758
2016-08-25 12:35:44 +10:00
Khai Do bcdac6b7a3 Add an offline reindex parameter
Add a parameter to tell puppet to run a gerrit offline reindex. Since
newer versions of Gerrit has online reindex we may not want to run
offline reindex anymore.

Change-Id: I9f3b0c1581f81cc0788173c7625b4c8c99ac9ab7
2016-08-13 09:57:34 -07:00
Jenkins b276d1d8be Merge "fix its_rules parameterization in template" 2016-08-09 16:05:45 +00:00
Jeremy Stanley bc599f0118 Ensure git cronjob absent for correct user
When removing a cron resource by setting it absent, it must continue
to specify the user if it wasn't root (the default) since crontabs
are per-user files.

Change-Id: Id68051821b0cca8bbf3e90446f5d915ac9d32be4
2016-08-05 19:55:53 +00:00
Khai Do 188e34af98 fix its_rules parameterization in template
The 'event-type' reference should be 'event_type' instead.
Also fixed a bug in the documentation and subsequent beaker test.

Change-Id: I4802f49e1fb1d3210aa49b4fe12a6e33a9f3bd42
2016-08-05 16:30:02 +00:00
Jenkins 53ec1731cc Merge "Add configurations for gerrit its plugins" 2016-08-03 16:33:54 +00:00
Jenkins e957bd3f2e Merge "allow override to run git gc instead of repack on repos" 2016-07-21 23:16:15 +00:00
Khai Do 7128938119 Add configurations for gerrit its plugins
This change will allow puppet to configure the its-storyboard plugin.
Settings in gerrit.config and secure.config is to associate gerrit
with an its plugin and settings in actions.config is to tell the
plugin to do something when a gerrit change gets updated. These
conditions are provided by the its-base plugin[1].

[1] https://gerrit.googlesource.com/plugins/its-base/+/stable-2.11/src/main/resources/Documentation/config-common.md
Change-Id: I9f47a2ed88ffbe827e494a478c0dc89a08bbe370
2016-07-20 11:22:44 -07:00
Jenkins 4d559ab5ca Merge "Allow puppet to configure gerrit commitmessage parameters" 2016-07-20 17:59:38 +00:00
Jenkins 6abd30a80d Merge "Allow puppet to configure Gerrit's canonicalGitUrl option" 2016-07-19 20:43:29 +00:00
Jenkins c9297a3696 Merge "Fix gerrit plugin installation" 2016-07-18 17:23:14 +00:00