From 1e0654cfe567338e29a8733a921caa826257f828 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 22 Jan 2024 23:30:57 +0100 Subject: [PATCH] Warn about DerivedAge.txt for characters not yet in the pipeline (#668) --- py/pipeline-workflow/check-draft-status.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/py/pipeline-workflow/check-draft-status.py b/py/pipeline-workflow/check-draft-status.py index c1bd2e091..8e37f3945 100644 --- a/py/pipeline-workflow/check-draft-status.py +++ b/py/pipeline-workflow/check-draft-status.py @@ -7,11 +7,40 @@ with open("unicodetools/data/ucd/dev/DerivedAge.txt", 'r') as f: version = f.readline().strip().replace("# DerivedAge-", "").replace(".0.txt", "") +PROVISIONALLY_ASSIGNED_AGE_NOTICE = f"""\ +While the Unicode Technical Committee has provisionally assigned these +characters, they have not been accepted for Unicode {version}, nor for any +specific version of Unicode. + +The Age property values for new characters are likely incorrect right +now. They will be recomputed after the UTC accepts their encoding and +this pull request is updated for the target version. +""".replace("\n", "%0A") + +UNREVIEWED_AGE_NOTICE = f"""\ +These characters are neither accepted for Unicode {version}, nor for any +specific version of Unicode, nor are they provisionally assigned. + + +The Age property values for new characters are likely incorrect right +now. They will be recomputed after the UTC accepts their encoding and +this pull request is updated for the target version. +""".replace("\n", "%0A") + if pipeline_label != "pipeline-" + version: with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: event = json.load(f) print(event) draft = event['pull_request']['draft'] + # Caution the reader that the Age values are placeholders. + if pipeline_label == "pipeline-provisionally-assigned": + print("::warning file=unicodetools/data/ucd/dev/DerivedAge.txt," + f"title=Not in the {version} pipeline::" + + PROVISIONALLY_ASSIGNED_AGE_NOTICE) + else: # Not even provisionally assigned. + print("::warning file=unicodetools/data/ucd/dev/DerivedAge.txt," + f"title=Not in the {version} pipeline::" + + UNREVIEWED_AGE_NOTICE) if not draft: print("::error title=PR must be draft::" "PRs for character additions must be draft unless approved for "