Skip to content

Commit

Permalink
Update release name for 2.10
Browse files Browse the repository at this point in the history
Add a list of previously used release names to make it easy to tell what
release names are no longer usable.

Add a test that new release names have been added to the used list.

Fixes #61616
  • Loading branch information
abadger committed Sep 6, 2019
1 parent 832e03d commit f58899e
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/RELEASE_NAMES.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions docs/docsite/rst/dev_guide/testing/sanity/release-names.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Release names
=============

Verifies that the most recent release name has been added to ``./github/RELEASE_NAMES.yml``
2 changes: 1 addition & 1 deletion lib/ansible/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

__version__ = '2.10.0.dev0'
__author__ = 'Ansible, Inc.'
__codename__ = 'Immigrant Song'
__codename__ = 'When the Levee Breaks'
4 changes: 4 additions & 0 deletions test/sanity/code-smell/release-names.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"no_targets": true,
"output": "path-message"
}
50 changes: 50 additions & 0 deletions test/sanity/code-smell/release-names.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""
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()

0 comments on commit f58899e

Please sign in to comment.