Adding a tool to track project who need to drop eol branches

Since transition from the EOL model to the EM model eol branches
are no longer removed and this step is no longer in the release team
process.

Keep stale branches can be an issue in some situation especially with
zuul and our gates. To avoid this situation the release team propose
to reintroduce regular checks to ensure that we remove stale branches
that have been tagged eol previously.

As discussed during our previous meetings soon it will be possible to design
a new job and to trigger it to remove eol branches automatically.
This will possible when the infra would have been updated and when all
the needed pieces will be in place.

Change-Id: I53aeb3211bb3251a3278472a514a39afe825cdd2
This commit is contained in:
Hervé Beraud 2020-10-20 16:27:42 +02:00 committed by Thierry Carrez
parent 9289284e33
commit 003eb35717
3 changed files with 103 additions and 0 deletions

View File

@ -816,6 +816,23 @@ For more usage and examples:
::
$ tools/search_emails.py -h
tools/list_eol_stale_branches.sh
---------------------------------
A script to detect deliverables who have eol stale branches in their repos.
Example:
::
tools/list_eol_stale_branches.sh
The reason behind this tool is that since the extended maintenance model
have been introduced we stopped removing automatically EOL branches when a
deliverable become EOL, this tool aim to list projects that have been declared
EOL on a series that is EM and where the corresponding series branch
still exists.
tools/membership_freeze_test.py
--------------------------------

View File

@ -141,6 +141,11 @@ def main():
help=('deliverables that do not have a release candidate, yet '
'(implies --model cycle-with-rc)'),
)
grp.add_argument(
'--is-eol',
action='store_true',
help='limit the list to deliverables EOL in the cycle',
)
grp.add_argument(
'--missing-final',
action='store_true',
@ -233,6 +238,8 @@ def main():
continue
if args.unreleased and (deliv.is_released or not deliv.is_releasable):
continue
if args.is_eol and 'eol' not in deliv.latest_release:
continue
if version_ending and deliv.is_released:
found = False
for release in deliv.releases:

View File

@ -0,0 +1,79 @@
#!/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.
# Extended Maintenance was introduced during Queens
# All the following cycle under EM should be added there.
function help {
# Display helping message
cat <<EOF
usage: $0 [<args>]
Provide a list of repositories that contains eol stale branches
Arguments:
-d, --debug Turn on the debug mode
-h, --help show this help message and exit
examples:
$(basename $0)
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
em_series=($(list-em-series))
# Make sure no pager is configured so the output is not blocked
export PAGER=
setup_temp_space 'list-eol-stale-branches'
branch=$(series_to_branch "$series")
function is_eol {
clone_repo ${repo} stable/${em_serie}
if [[ $? -eq 0 ]]; then
echo "${repo} contains eol stale branch (${em_serie})"
fi
}
for em_serie in "${em_series[@]}"; do
repos=$(list-deliverables -r --series "${em_serie}" --is-eol)
# Show the eol stale branches for each repository.
for repo in ${repos}; do
cd ${MYTMPDIR}
echo
is_eol "${repo}" "${em_serie}"
done
done