From 86d0efcd784ca84878945cc09b589df65f189cd7 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 21 Mar 2023 14:32:23 +0100 Subject: [PATCH] Add a script to prepare the next cycle Running tox -eprepare-next-cycle will apply all necessary changes, only requiring that the user review and commit the changes. Change-Id: I5f10d901e47a8062c87506fbc3e68f2536a47480 --- README.rst | 10 ++++ scripts/prepare-next-cycle.sh | 96 +++++++++++++++++++++++++++++++++++ tox.ini | 5 ++ 3 files changed, 111 insertions(+) create mode 100755 scripts/prepare-next-cycle.sh diff --git a/README.rst b/README.rst index 2317431c..222b441a 100644 --- a/README.rst +++ b/README.rst @@ -69,3 +69,13 @@ confidence in the Jenkins result), please execute the following command:: After running ``tox``, the documentation will be available for viewing in HTML format in the ``doc/build/`` directory. Please do not checkin the generated HTML files as a part of your commit. + +At the start of a new cycle, the right files and directories can be created and modified using the following command: + + $ tox -eprepare-next-cycle + +For instance: + + $ tox -eprepare-next-cycle 2023.2 + +The changes should then be reviewed and committed manually. \ No newline at end of file diff --git a/scripts/prepare-next-cycle.sh b/scripts/prepare-next-cycle.sh new file mode 100755 index 00000000..e0c6ea1d --- /dev/null +++ b/scripts/prepare-next-cycle.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +usage () { + echo "Usage: $(basename $0) VERSION" + exit 1 +} + +[[ "$#" -ne "1" ]] && usage + +sed -i "s|priorities/.*|priorities/$1-priorities|; +/Current/,/specs/{ + /specs/ { h; s|specs/.*|specs/$1/*| } +}; +/Past/,/specs/{ + /specs/{x;p;x } +}" doc/source/index.rst + +cat < "priorities/$1-priorities.rst" +.. _$1-priorities: + +========================= +$1 Project Priorities +========================= + +TODO(glance-ptl): fill this in after the PTG + + + + +EOF + +mkdir -p specs/"$1"/approved/{glance,glance_store,python-glanceclient} +mkdir -p specs/"$1"/implemented + +for project in glance glance_store python-glanceclient +do + echo "../../../template.rst" > "specs/$1/approved/$project/template.rst" + echo "../../../spec-lite-template.rst" > "specs/$1/approved/$project/spec-lite-template.rst" +done + + +cat < "specs/$1/index.rst" +===================== +$1 Specifications +===================== + +.. toctree:: + :glob: + :maxdepth: 1 + +$1 implemented specs: + +.. toctree:: + :glob: + :maxdepth: 1 + + implemented/* + +$1 approved (but not implemented) specs: + +.. toctree:: + :glob: + :maxdepth: 1 + + approved/* + + +EOF + +cat < "specs/$1/approved/index.rst" +============================== +$1 Approved Specifications +============================== + +.. toctree:: + :glob: + :maxdepth: 1 + +TODO: fill this in once a new approved spec is added. + + + + +EOF + +cat < "specs/$1/implemented/index.rst" +================================= +$1 Implemented Specifications +================================= + +TODO: fill this in once a new implemented spec is added. + + + + +EOF diff --git a/tox.ini b/tox.ini index 91b6bf9a..d0f10efd 100644 --- a/tox.ini +++ b/tox.ini @@ -20,3 +20,8 @@ commands = rm -rf doc/build sphinx-build -W -b html doc/source doc/build/html whereto doc/source/_extra/.htaccess doc/test/redirect-tests.txt + +[testenv:prepare-next-cycle] +deps = +commands = + {toxinidir}/scripts/prepare-next-cycle.sh {posargs}