From d0b782bbdf928e8d851531eb5aa781f5124e5e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C5=91d=20Ill=C3=A9s?= Date: Fri, 2 Sep 2022 15:48:59 +0200 Subject: [PATCH] [tool] Add repository_test_generator.sh This patch adds the process tasks and the helper script that generates test patches against listed deliverables in the current cycle to see that CI is healthy for them. Change-Id: I2e3ba491ccbc9e5a420fe15d37eeb0bda98acd2e Signed-off-by: Elod Illes --- doc/source/reference/process.rst | 32 +++++++++++ tools/repository_test_generator.sh | 89 ++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100755 tools/repository_test_generator.sh diff --git a/doc/source/reference/process.rst b/doc/source/reference/process.rst index e27f1d19a3..0584954aee 100644 --- a/doc/source/reference/process.rst +++ b/doc/source/reference/process.rst @@ -418,6 +418,23 @@ Week before Milestone-2 $series directory, or marked release-model:abandoned if present in the _independent directory. +#. Propose DNM changes on libraries and client libraries where no patches + merged recently (since YYYY-MM-DD date; for example since 30 days ago) + to check that tests are still passing with the current set of + dependencies. + + Get the list of deliverables for the current series:: + + tox -e venv -- list-deliverables --series \ + --no-merge-since YYYY-MM-DD \ + --type library --type client-library >/tmp/deliverables.log + + Edit the generated file (/tmp/deliverables.log) to remove tox’s logs. + + Generate the ``do-not-merge`` patches with the following script:: + + tools/repository_test_generator.sh $(cat /tmp/deliverables.log) + #. Send the following weekly email content:: Development Focus @@ -758,6 +775,21 @@ R-7 week (Extra-AC deadline week) defined, but it is best if any errors can be avoided to make sure the patches get approved in a timely manner. +#. Propose DNM changes on repositories where no patches merged recently + (since YYYY-MM-DD date; for example since 30 days ago) to check that + tests are still passing with the current set of dependencies. + + Get the list of deliverables for the current series:: + + tox -e venv -- list-deliverables --series \ + --no-merge-since YYYY-MM-DD >/tmp/deliverables.log + + Edit the generated file (/tmp/deliverables.log) to remove tox’s logs. + + Generate the ``do-not-merge`` patches with the following script:: + + tools/repository_test_generator.sh $(cat /tmp/deliverables.log) + #. Send the following weekly email content:: Development Focus diff --git a/tools/repository_test_generator.sh b/tools/repository_test_generator.sh new file mode 100755 index 0000000000..8ddcad95f7 --- /dev/null +++ b/tools/repository_test_generator.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# +# 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. + +# This script generates DNM patches to check the gate state of deliverables. + +function help { + # Display helping message + cat <] [...] + +This script generates DNM patches to check the gate health of +deliverables in the current cycle. + +Arguments: + -d, --debug Turn on the debug mode + -h, --help show this help message and exit +examples: + $(basename $0) oslo.db + $(basename $0) nova neutron +EOF +} + +for i in "$@"; do + case $i in + # Turn on the debug mode + -d|--debug) + set -x + shift 1 + ;; + # Display the helping message + -h|--help) + help + exit 0 + ;; + esac +done + + +TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +BASEDIR=$(dirname $TOOLSDIR) +source $TOOLSDIR/functions +enable_tox_venv + +deliverables="$@" + +# Make sure no pager is configured so the output is not blocked +export PAGER= + +setup_temp_space 'repository-test-generator' +cd ${MYTMPDIR} + + +function generate_dnm_patch_for_repo { + echo + echo "Processing repo ${repo}..." + clone_repo "openstack/${repo}" + pushd openstack/${repo} + if [[ $? -eq 0 ]]; then + file_to_edit=$(find -mindepth 2 -maxdepth 2 -type f -size +0 -name "*.py" | head -1) + if [[ -z "${file_to_edit}" ]]; then + file_to_edit=tox.ini + fi + echo "# do-not-merge change" >>${file_to_edit} + git add ${file_to_edit} + git commit -s -m "DNM: gate health test" \ + --trailer="Generated-By:openstack/releases:tools/repository_test_generator.sh" + git show --stat + git review -t "release-health-check" + popd + else + echo "Something went wrong with ${repo}..." + fi +} + + +for repo in ${deliverables}; do + generate_dnm_patch_for_repo "${repo}" +done