From c0adfca28e4f44742a6a6737165ec3c1a3e9ef0c Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 1 Jul 2021 22:40:40 +0000 Subject: [PATCH] Good riddance to track-upstream and its cronjob We've stopped relying on jeepyb's track-upstream feature, so stop installing the entrypoint script and cease running its cronjob. Depends-On: https://review.opendev.org/799123 Change-Id: I0d6edcc34f25e6bfe2bc41d328ac76618b59f62d --- doc/source/jeepyb.rst | 5 +--- playbooks/roles/gerrit/tasks/main.yaml | 17 +++---------- .../roles/gerrit/templates/track-upstream.j2 | 25 ------------------- 3 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 playbooks/roles/gerrit/templates/track-upstream.j2 diff --git a/doc/source/jeepyb.rst b/doc/source/jeepyb.rst index 8099c01311..3df84b8cbf 100644 --- a/doc/source/jeepyb.rst +++ b/doc/source/jeepyb.rst @@ -158,10 +158,7 @@ in projects.yaml. Manage Projects --------------- -Some projects may have upstreams defined in Jeepyb; the -``track-upstream`` cron job will update these remotes so that their -commits are available in Gerrit. It will also ensure that project metadata -is set up as defined in projects.yaml. +This ensures that project metadata is set up as defined in projects.yaml. RSS feeds --------- diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index 6c9933e098..65d2889ca1 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -220,16 +220,13 @@ - static/system-cla.html - static/usg-cla.html -- name: Write jeepyb utility scripts +- name: Write manage-projects script template: - src: "{{ item }}.j2" - dest: "/usr/local/bin/{{ item }}" + src: "manage-projects.j2" + dest: "/usr/local/bin/manage-projects" owner: root group: root mode: 0755 - loop: - - manage-projects - - track-upstream - name: Write projects.ini template: @@ -319,14 +316,6 @@ minute: 17 hour: 4 -- name: Set up cron job to track upstream - cron: - name: track-upstream - job: '/usr/local/bin/track-upstream' - user: root - minute: 42 - state: "{{ gerrit_track_upstream | bool | ternary('present', 'absent') }}" - # Gerrit rotates their own logs, but doesn't clean them out # Delete logs older than a month - name: Set up cron job to clean old gerrit logs diff --git a/playbooks/roles/gerrit/templates/track-upstream.j2 b/playbooks/roles/gerrit/templates/track-upstream.j2 deleted file mode 100644 index 65328ea282..0000000000 --- a/playbooks/roles/gerrit/templates/track-upstream.j2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Copyright 2020 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -exec docker run --rm --net=host -u root \ - -v/opt/project-config:/opt/project-config \ - -v/opt/project-config/gerrit/projects.yaml:/home/gerrit2/projects.yaml \ - -v/opt/lib/jeepyb:/opt/lib/jeepyb \ - -v/home/gerrit2/review_site/etc/ssh_project_rsa_key:/home/gerrit2/review_site/etc/ssh_project_rsa_key \ - -v/home/gerrit2/projects.ini:/home/gerrit2/projects.ini \ - -v/root/.ssh/known_hosts:/root/.ssh/known_hosts \ - -v/var/log:/var/log \ - {{ gerrit_container_image }} track-upstream -v -l /var/log/track_upstream.log