diff --git a/.github/RELEASE_NAMES.yml b/.github/RELEASE_NAMES.yml new file mode 100644 index 0000000000..7705b50b45 --- /dev/null +++ b/.github/RELEASE_NAMES.yml @@ -0,0 +1,12 @@ +--- +- 2.10.0 When the Levee Breaks +- 2.9.0 Immigrant Song +- 2.8.0 How Many More Times +- 2.7.0 In the Light +- 2.6.0 Heartbreaker +- 2.5.0 Kashmir +- 2.4.0 Dancing Days +- 2.3.0 Ramble On +- 2.2.0 The Battle of Evermore +- 2.1.0 The Song Remains the Same +- 2.0.0 Over the Hills and Far Away diff --git a/docs/docsite/rst/dev_guide/testing/sanity/release-names.rst b/docs/docsite/rst/dev_guide/testing/sanity/release-names.rst new file mode 100644 index 0000000000..359f7ecb54 --- /dev/null +++ b/docs/docsite/rst/dev_guide/testing/sanity/release-names.rst @@ -0,0 +1,4 @@ +Release names +============= + +Verifies that the most recent release name has been added to ``./github/RELEASE_NAMES.yml`` diff --git a/lib/ansible/release.py b/lib/ansible/release.py index 429d391068..52b62f9295 100644 --- a/lib/ansible/release.py +++ b/lib/ansible/release.py @@ -21,4 +21,4 @@ __metaclass__ = type __version__ = '2.10.0.dev0' __author__ = 'Ansible, Inc.' -__codename__ = 'Immigrant Song' +__codename__ = 'When the Levee Breaks' diff --git a/test/sanity/code-smell/release-names.json b/test/sanity/code-smell/release-names.json new file mode 100644 index 0000000000..593b765d14 --- /dev/null +++ b/test/sanity/code-smell/release-names.json @@ -0,0 +1,4 @@ +{ + "no_targets": true, + "output": "path-message" +} diff --git a/test/sanity/code-smell/release-names.py b/test/sanity/code-smell/release-names.py new file mode 100755 index 0000000000..f8003320a5 --- /dev/null +++ b/test/sanity/code-smell/release-names.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# (c) 2019, Ansible Project +# +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . +""" +Test that the release name is present in the list of used up release names +""" + + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +from yaml import safe_load + +from ansible.release import __codename__ + + +def main(): + """Entrypoint to the script""" + + with open('.github/RELEASE_NAMES.yml') as f: + releases = safe_load(f.read()) + + # Why this format? The file's sole purpose is to be read by a human when they need to know + # which release names have already been used. So: + # 1) It's easier for a human to find the release names when there's one on each line + # 2) It helps keep other people from using the file and then asking for new features in it + for name in (r.split(maxsplit=1)[1] for r in releases): + if __codename__ == name: + break + else: + print('.github/RELEASE_NAMES.yml: Current codename was not present in the file') + + +if __name__ == '__main__': + main()