From f9fae7bf4e44cb284621327d259e7842dac856f6 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Tue, 28 Sep 2021 11:43:12 +0200 Subject: [PATCH] CI: wiki: check if device name is on Renamed Devices page (MR 2559) Since the wiki applies to all branches, renaming devices is really difficult without breaking the wiki check. To simplify this, download the Renamed Devices page additionally, and just print a WARNING if a device is missing in the wiki, but is listed there. --- .ci/check_devices_in_wiki.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.ci/check_devices_in_wiki.py b/.ci/check_devices_in_wiki.py index 6bf603f90..2dcbd2e86 100755 --- a/.ci/check_devices_in_wiki.py +++ b/.ci/check_devices_in_wiki.py @@ -53,6 +53,13 @@ def get_wiki_devices_html(path): return {"booting": split[0], "not_booting": split[1]} +def get_wiki_renamed_devices_html(): + """:returns: HTML of the page""" + # Download wiki page + url = "http://wiki.postmarketos.org/wiki/Renamed_Devices" + return urllib.request.urlopen(url).read().decode("utf-8") + + def check_device(device, html, is_booting): """:param is_booting: require the device to be in the booting section, not just anywhere in the page (i.e. in the not booting @@ -67,6 +74,9 @@ def check_device(device, html, is_booting): " section already)") return False return True + if device in html["renamed"]: + print(f"WARNING: {device} was renamed in the wiki") + return True print(device + ": not in the wiki yet.") return False @@ -87,6 +97,7 @@ def main(): # Check all devices html = get_wiki_devices_html(args.path) + html["renamed"] = get_wiki_renamed_devices_html() error = False for device in get_devices(): if not check_device(device, html, args.booting):