Skip to content

Commit 1e0654c

Browse files
authored
Warn about DerivedAge.txt for characters not yet in the pipeline (#668)
1 parent b4bae46 commit 1e0654c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

py/pipeline-workflow/check-draft-status.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,40 @@
77
with open("unicodetools/data/ucd/dev/DerivedAge.txt", 'r') as f:
88
version = f.readline().strip().replace("# DerivedAge-", "").replace(".0.txt", "")
99

10+
PROVISIONALLY_ASSIGNED_AGE_NOTICE = f"""\
11+
While the Unicode Technical Committee has provisionally assigned these
12+
characters, they have not been accepted for Unicode {version}, nor for any
13+
specific version of Unicode.
14+
15+
The Age property values for new characters are likely incorrect right
16+
now. They will be recomputed after the UTC accepts their encoding and
17+
this pull request is updated for the target version.
18+
""".replace("\n", "%0A")
19+
20+
UNREVIEWED_AGE_NOTICE = f"""\
21+
These characters are neither accepted for Unicode {version}, nor for any
22+
specific version of Unicode, nor are they provisionally assigned.
23+
24+
25+
The Age property values for new characters are likely incorrect right
26+
now. They will be recomputed after the UTC accepts their encoding and
27+
this pull request is updated for the target version.
28+
""".replace("\n", "%0A")
29+
1030
if pipeline_label != "pipeline-" + version:
1131
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f:
1232
event = json.load(f)
1333
print(event)
1434
draft = event['pull_request']['draft']
35+
# Caution the reader that the Age values are placeholders.
36+
if pipeline_label == "pipeline-provisionally-assigned":
37+
print("::warning file=unicodetools/data/ucd/dev/DerivedAge.txt,"
38+
f"title=Not in the {version} pipeline::" +
39+
PROVISIONALLY_ASSIGNED_AGE_NOTICE)
40+
else: # Not even provisionally assigned.
41+
print("::warning file=unicodetools/data/ucd/dev/DerivedAge.txt,"
42+
f"title=Not in the {version} pipeline::" +
43+
UNREVIEWED_AGE_NOTICE)
1544
if not draft:
1645
print("::error title=PR must be draft::"
1746
"PRs for character additions must be draft unless approved for "

0 commit comments

Comments
 (0)