Skip to content

Commit

Permalink
Warn about DerivedAge.txt for characters not yet in the pipeline (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin authored Jan 22, 2024
1 parent b4bae46 commit 1e0654c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions py/pipeline-workflow/check-draft-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 1e0654c

Please sign in to comment.