From 50258742c9cd52852293562172209b93632a2a5f Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Wed, 16 Jan 2019 16:56:48 +0100 Subject: [PATCH] Add script to facilitate MembershipFreeze handling This script will compute a list of deliverables present in governance but unknown to release management, for manual processing. Change-Id: Ibebf777911416d978ecea5ba8d7b25b211e7ae52 --- doc/source/reference/process.rst | 11 +++++ doc/source/reference/using.rst | 19 ++++++++ tools/membership_freeze_test.py | 76 ++++++++++++++++++++++++++++++++ tox.ini | 3 ++ 4 files changed, 109 insertions(+) create mode 100644 tools/membership_freeze_test.py diff --git a/doc/source/reference/process.rst b/doc/source/reference/process.rst index 57a19a7897..2a8b23ec9f 100644 --- a/doc/source/reference/process.rst +++ b/doc/source/reference/process.rst @@ -74,6 +74,17 @@ Between Milestone-1 and Milestone-2 List teams that still haven't done a library release yet and remind them of the milestone-2 deadline. +5. Ahead of MembershipFreeze, run membership_freeze_test to check for + any new deliverable in governance that has not been released yet:: + + tox -e membership_freeze_test -- $series ~/branches/governance/reference/projects.yaml + + Those should either get a release management exception (see + release-management key in the governance projects.yaml file) or an + empty deliverable file should be added to the series so that we can + properly track it. Leftovers are considered too young to be released + in the next release and will be reconsidered at the next cycle. + Milestone-2 =========== diff --git a/doc/source/reference/using.rst b/doc/source/reference/using.rst index 2781dffa0f..a98b5dc0e5 100644 --- a/doc/source/reference/using.rst +++ b/doc/source/reference/using.rst @@ -603,6 +603,25 @@ To set the pre-release group membership: tox -e aclmanager -- groups pre_release ttx +tools/membership_freeze_test.py +-------------------------------- + +A script to test for new deliverables in governance that were +never under release management and therefore escape any form of +release management tracking. + +Those need to be checked around milestone-2 (before MembershipFreeze) +so that we create deliverable files for them if they are to be part of +the final release. + +Example: + +To check for Stein release: + +:: + + tox -e membership_freeze_test -- stein ~/branches/governance/reference/projects.yaml + propose-final-releases ---------------------- diff --git a/tools/membership_freeze_test.py b/tools/membership_freeze_test.py new file mode 100644 index 0000000000..9d4cd12a46 --- /dev/null +++ b/tools/membership_freeze_test.py @@ -0,0 +1,76 @@ +#!/usr/bin/python +# +# List deliverables that appear in governance but not in releases +# in preparation for MemberShipFreeze +# +# Copyright 2019 Thierry Carrez +# All Rights Reserved. +# +# 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. + +import argparse +import os.path +import sys +import yaml + + +# Infrastructure/OpenDev repositories escape OpenStack release management +TEAM_EXCEPTIONS = ['Infrastructure'] + + +def deliverable_filename(deliverable, series): + return os.path.join('./deliverables', series, deliverable + '.yaml') + + +def in_governance_but_not_released(args): + missing = [] + dirs = [args.series, '_independent'] + + with open(args.projects_yaml, 'r') as projects: + teams = yaml.load(projects) + for tname, team in teams.items(): + if tname in TEAM_EXCEPTIONS: + continue + + for dname, deliverable in team['deliverables'].items(): + if 'release-management' in deliverable: + continue + for fname in [deliverable_filename(dname, s) for s in dirs]: + if os.path.isfile(fname): + break + else: + missing.append((tname, dname)) + return missing + + +def main(args=sys.argv[1:]): + parser = argparse.ArgumentParser() + parser.add_argument( + 'series', + help='name of the currently-developed series' + ) + parser.add_argument( + 'projects_yaml', + help='path to governance projects.yaml file' + ) + args = parser.parse_args(args) + last_team = '' + for team, deliverable in in_governance_but_not_released(args): + if last_team != team: + print('\n' + team + ':') + last_team = team + print(deliverable) + + +if __name__ == '__main__': + main() diff --git a/tox.ini b/tox.ini index 5d9c814d11..968c8655c3 100644 --- a/tox.ini +++ b/tox.ini @@ -57,6 +57,9 @@ commands = bash -c "find {toxinidir} \ [testenv:aclmanager] commands = python {toxinidir}/tools/aclmanager.py {posargs} +[testenv:membership_freeze_test] +commands = python {toxinidir}/tools/membership_freeze_test.py {posargs} + [testenv:venv] deps = .[sphinxext] commands = {posargs}