Simplify release name tracking and testing (#81151)

Convert the release names list from YAML to plain text, removing the need for YAML parsing in the sanity test.
pull/81171/head
Matt Clay 11 months ago committed by GitHub
parent 8c9f5c9106
commit f1ddcb4ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,17 @@
2.16.0 All My Love
2.15.0 Ten Years Gone
2.14.0 C'mon Everybody
2.13.0 Nobody's Fault but Mine
2.12.0 Dazed and Confused
2.11.0 Hey Hey, What Can I Do
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

@ -1,18 +0,0 @@
---
- 2.16.0 All My Love
- 2.15.0 Ten Years Gone
- 2.14.0 C'mon Everybody
- 2.13.0 Nobody's Fault but Mine
- 2.12.0 Dazed and Confused
- 2.11.0 Hey Hey, What Can I Do
- 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

@ -22,7 +22,7 @@ Test that the release name is present in the list of used up release names
from __future__ import annotations
from yaml import safe_load
import pathlib
from ansible.release import __codename__
@ -30,8 +30,7 @@ from ansible.release import __codename__
def main():
"""Entrypoint to the script"""
with open('.github/RELEASE_NAMES.yml') as f:
releases = safe_load(f.read())
releases = pathlib.Path('.github/RELEASE_NAMES.txt').read_text().splitlines()
# 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:
@ -41,7 +40,7 @@ def main():
if __codename__ == name:
break
else:
print('.github/RELEASE_NAMES.yml: Current codename was not present in the file')
print(f'.github/RELEASE_NAMES.txt: Current codename {__codename__!r} not present in the file')
if __name__ == '__main__':

@ -1,2 +0,0 @@
# edit "release-names.requirements.in" and generate with: hacking/update-sanity-requirements.py --test release-names
PyYAML==6.0
Loading…
Cancel
Save