[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 <elod.illes@est.tech>
This commit is contained in:
Előd Illés
2022-09-02 15:48:59 +02:00
parent eda2d29b6d
commit d0b782bbdf
2 changed files with 121 additions and 0 deletions
+32
View File
@@ -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 <SERIES> \
--no-merge-since YYYY-MM-DD \
--type library --type client-library >/tmp/deliverables.log
Edit the generated file (/tmp/deliverables.log) to remove toxs 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 <SERIES> \
--no-merge-since YYYY-MM-DD >/tmp/deliverables.log
Edit the generated file (/tmp/deliverables.log) to remove toxs 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
+89
View File
@@ -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 <<EOF
usage: $0 [<args>] <repo> [<repo>...]
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