maintainers.py: Add reverse checks for wiki and updater

* Check if some device has wiki page or updater entry
  and warn when it's not marked as deprecated in wiki
  and doesn't receive builds at the moment.

Change-Id: Ibb7d3f3fee5be01cbc06af27f6bdd3131769ceae
This commit is contained in:
Paul Keith
2017-08-29 23:39:38 +03:00
parent d29417334f
commit a25089d4e5

View File

@@ -29,6 +29,8 @@ cve_entries = []
updater_pages = []
# List of jira developers
jira_devs = []
# Discontinued devices
discontinued_devices = []
# Open file and input lines as items in list
hudson_file = os.path.join(mydir, repo["hudson"] + "/lineage-build-targets")
@@ -65,11 +67,6 @@ with open(updater_json_file) as f:
for device in json_file:
updater_pages.append(device["model"])
# Updater checking
for codename in codenames:
if codename not in updater_pages:
print("{} doesn't have an updater page".format(codename))
# Wiki checking
for codename in codenames:
wiki_yml_file = os.path.join(mydir, repo["wiki"] + "/_data/devices/" + codename + ".yml")
@@ -108,6 +105,27 @@ for codename in codenames:
except KeyError:
pass
wiki_yml_dir = os.path.join(mydir, repo["wiki"] + "/_data/devices")
for wiki_yml in os.listdir(wiki_yml_dir):
codename = re.sub(r"\.yml", "", wiki_yml.strip())
if codename not in codenames:
wiki_yml_file = os.path.join(mydir, repo["wiki"] + "/_data/devices/" + wiki_yml)
with open(wiki_yml_file) as f:
yml = yaml.load(f)
if "discontinued" not in yml["channels"]:
print("{} has a wiki page but isn't in hudson".format(codename))
else:
discontinued_devices.append(codename)
# Updater checking
for codename in codenames:
if codename not in updater_pages:
print("{} doesn't have an updater page".format(codename))
for codename in updater_pages:
if codename not in codenames and codename not in discontinued_devices:
print("{} has an updater page but is not in hudson".format(codename))
# Optionally print out all maintainer info
if args.maintainers:
print("---------------MAINTAINER INFO DUMP---------------")