From 1ccf5e68e51815479381a941fd9cf4f469498c6d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 9 Oct 2020 10:53:23 -0700 Subject: [PATCH] Remove reviewdb config from Gerrit This should only land once we are on Gerrit 3.x and happy with it. But at this point the mysql reviewdb will not be used anymore and config for it can be removed. We keep general mysql things like tools and backups in place as the accountPatchReviewDb continues to live in MySQL. This also comments out calls to jeepyb's welcome-message, update-blueprint and update-bug entrypoints from the patchset-created event hook, since they rely on database connections for the moment. Calls to update-bug in change-abandoned and change-merged event hooks are retained as those code paths don't rely on database interaction nor attempt to load the removed configuration. Change-Id: I6e24dbb223fd3f76954db3dd74a03887cf2e2a8b --- .../roles/gerrit/files/hooks/patchset-created | 15 ++++++++------- playbooks/roles/gerrit/templates/gerrit.config | 13 ------------- playbooks/roles/gerrit/templates/secure.config | 2 -- .../zuul/templates/group_vars/review-dev.yaml.j2 | 2 +- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/playbooks/roles/gerrit/files/hooks/patchset-created b/playbooks/roles/gerrit/files/hooks/patchset-created index a7b6e29313..11c36199bb 100755 --- a/playbooks/roles/gerrit/files/hooks/patchset-created +++ b/playbooks/roles/gerrit/files/hooks/patchset-created @@ -7,11 +7,12 @@ export PROJECTS_YAML=/var/gerrit/etc/projects.yaml export PROJECTS_INI=/var/gerrit/etc/projects.ini # Use timeout to kill any process running longer than 10 minutes. -timeout -k 2m 10m /usr/local/bin/update-blueprint patchset-created "$@" -timeout -k 2m 10m /usr/local/bin/update-bug patchset-created "$@" timeout -k 2m 10m /usr/local/bin/notify-impact patchset-created "$@" --impact SecurityImpact --dest-address 'openstack-security@lists.openstack.org' -if [ -f /var/gerrit/etc/ssh_welcome_rsa_key ] ; then -timeout -k 2m 10m /usr/local/bin/welcome-message patchset-created \ - --verbose --ssh-user=welcome-message \ - --ssh-key=/var/gerrit/etc/ssh_welcome_rsa_key "$@" -fi +# TODO: reenable these once jeepyb no longer relies on the old Gerrit DB +#timeout -k 2m 10m /usr/local/bin/update-blueprint patchset-created "$@" +#timeout -k 2m 10m /usr/local/bin/update-bug patchset-created "$@" +#if [ -f /var/gerrit/etc/ssh_welcome_rsa_key ] ; then +#timeout -k 2m 10m /usr/local/bin/welcome-message patchset-created \ +# --verbose --ssh-user=welcome-message \ +# --ssh-key=/var/gerrit/etc/ssh_welcome_rsa_key "$@" +#fi diff --git a/playbooks/roles/gerrit/templates/gerrit.config b/playbooks/roles/gerrit/templates/gerrit.config index b8f6dc2ef1..f66b19fc03 100644 --- a/playbooks/roles/gerrit/templates/gerrit.config +++ b/playbooks/roles/gerrit/templates/gerrit.config @@ -9,19 +9,6 @@ reportBugUrl = https://docs.openstack.org/infra/system-config/project.html#contributing gitHttpUrl = https://{{ gerrit_vhost_name }}/ serverId = {{ gerrit_serverid }} -[database] -{% if gerrit_database_type == 'MYSQL' %} - type = MYSQL - hostname = {{ gerrit_mysql_host }} - database = reviewdb - username = gerrit2 - url = jdbc:mysql://{{ gerrit_mysql_host }}/reviewdb?characterSetResults=utf8&characterEncoding=utf8&connectionCollation=utf8_bin&useUnicode=yes - poolLimit = 225 - connectionpool = true -{% else %} - type = h2 - database = tmp/reviewDb -{% endif %} [auth] contributorAgreements = true type = OPENID_SSO diff --git a/playbooks/roles/gerrit/templates/secure.config b/playbooks/roles/gerrit/templates/secure.config index 1e97c050c7..6050ac46fb 100644 --- a/playbooks/roles/gerrit/templates/secure.config +++ b/playbooks/roles/gerrit/templates/secure.config @@ -1,6 +1,4 @@ {% if gerrit_database_type == 'MYSQL' %} -[database] - password = {{ gerrit_mysql_password }} [accountPatchReviewDb] url = jdbc:mysql://{{ gerrit_mysql_host }}:3306/accountPatchReviewDb?characterSetResults=utf8&characterEncoding=utf8&connectionCollation=utf8_bin&useUnicode=yes&user=gerrit2&password={{ gerrit_mysql_password }} {% endif %} diff --git a/playbooks/zuul/templates/group_vars/review-dev.yaml.j2 b/playbooks/zuul/templates/group_vars/review-dev.yaml.j2 index 4cc3d8e338..fd04e8fe37 100644 --- a/playbooks/zuul/templates/group_vars/review-dev.yaml.j2 +++ b/playbooks/zuul/templates/group_vars/review-dev.yaml.j2 @@ -91,6 +91,6 @@ gerrit_run_init: true gerrit_dev_storyboard_token: 4020000c-d1b9-4173-ab33-2f55dbc1c718 gerrit_dev_email_private_key: xxj2lTapostsobbxvpawhjhnzufaGxchrypoddcafqarrq5h # These are here so that interpolation works in the main playbook. They -# are not actually used in the gerrit config. +# are not directly used in the gerrit config. gerrit_dev_mysql_host: unused gerrit_dev_mysql_password: unused