From e8218a866db5f596d342c4040e35a111aba1d733 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 14:45:03 +0100 Subject: [PATCH 01/29] A new workflow --- .github/workflows/pipeline.yml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 000000000..7453579c2 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,36 @@ +name: Pipeline + + +on: + pull_request: + branches: + - '*' + +jobs: + check-repertoire-changes: + name: Check repertoire changes + runs-on: ubuntu-latest + steps: + - name: Checkout merged unicodetools + uses: actions/checkout@v3 + with: + path: merged + - name: Checkout base unicodetools + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.base.sha }} + path: base + - name: Compare repertoire + id: compare-repertoire + run: | + sed 's/^\([^;]*;[^;]*\);.*$/\1/' merged/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt + sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt + if diff base-repertoire.txt merged-repertoire.txt + then echo "changed=false" >> "$GITHUB_OUTPUT" + else echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Compare repertoire + if: steps.compare-repertoire.changed == 'true' + run: | + echo test + From f9ff2fcf08f5a324bee598770b5be54fbdd446e6 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 14:48:27 +0100 Subject: [PATCH 02/29] More checklist --- docs/pipeline.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/pipeline.md b/docs/pipeline.md index 0da43bd39..f8df415c7 100644 --- a/docs/pipeline.md +++ b/docs/pipeline.md @@ -62,6 +62,9 @@ PR preparation: - [ ] UTC decisions — Cite _in extenso_ - [ ] data-for-new — Set label - [ ] pipeline-* — Set label +- [ ] PR button — Set to DRAFT pull request + - unless approved for the upcoming version +- [ ] PR button — Press ## Scripts From 8ef9a1d60ee95086ed6a913c04fc04b895482cf4 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 14:53:52 +0100 Subject: [PATCH 03/29] sparse --- .github/workflows/pipeline.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 7453579c2..cf55803dd 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -11,15 +11,17 @@ jobs: name: Check repertoire changes runs-on: ubuntu-latest steps: - - name: Checkout merged unicodetools + - name: Checkout merged UnicodeData.txt uses: actions/checkout@v3 with: path: merged - - name: Checkout base unicodetools + sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt + - name: Checkout base UnicodeData.txt uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.base.sha }} path: base + sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt - name: Compare repertoire id: compare-repertoire run: | @@ -29,7 +31,7 @@ jobs: then echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" fi - - name: Compare repertoire + - name: Test if: steps.compare-repertoire.changed == 'true' run: | echo test From 149d8225340f01ed31461388ad2fe3c40cafc47b Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 15:04:28 +0100 Subject: [PATCH 04/29] U+BOOP --- unicodetools/data/ucd/dev/UnicodeData.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/unicodetools/data/ucd/dev/UnicodeData.txt b/unicodetools/data/ucd/dev/UnicodeData.txt index 4376ff723..b3490669f 100644 --- a/unicodetools/data/ucd/dev/UnicodeData.txt +++ b/unicodetools/data/ucd/dev/UnicodeData.txt @@ -15200,6 +15200,7 @@ ABF6;MEETEI MAYEK DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; ABF7;MEETEI MAYEK DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; ABF8;MEETEI MAYEK DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; ABF9;MEETEI MAYEK DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; +BOOP;BETTY BOOP;So;0;L;;;;;N;;;;; AC00;;Lo;0;L;;;;;N;;;;; D7A3;;Lo;0;L;;;;;N;;;;; D7B0;HANGUL JUNGSEONG O-YEO;Lo;0;L;;;;;N;;;;; From ff89b1d01c632291f84404189184b8749f40f0ee Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 15:15:38 +0100 Subject: [PATCH 05/29] .outputs --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index cf55803dd..88686da72 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -32,7 +32,7 @@ jobs: else echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Test - if: steps.compare-repertoire.changed == 'true' + if: steps.compare-repertoire.outputs.changed == 'true' run: | echo test From 50eeea41112a50b4aa1748e81f9fab59ca06340e Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 18:56:39 +0100 Subject: [PATCH 06/29] try to get labels --- .github/workflows/pipeline.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 88686da72..0cfa66374 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -31,8 +31,9 @@ jobs: then echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" fi - - name: Test + - name: Check pipeline labels if: steps.compare-repertoire.outputs.changed == 'true' run: | - echo test + cat $GITHUB_EVENT_PATH | + python3 -c "import sys, json; print(json.load(sys.stdin)['pull_request']['labels'])" From eb3984cb2d11df78d23ad399ee7beeebff795233 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 19:21:54 +0100 Subject: [PATCH 07/29] Require labels --- .github/workflows/pipeline.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0cfa66374..466921fb3 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -3,12 +3,12 @@ name: Pipeline on: pull_request: - branches: - - '*' + branches: ['*'] + types: [opened, synchronize, reopened, labeled, ready_for_review, converted_to_draft] jobs: - check-repertoire-changes: - name: Check repertoire changes + labels-for-repertoire-changes: + name: Labels for repertoire changes runs-on: ubuntu-latest steps: - name: Checkout merged UnicodeData.txt @@ -35,5 +35,14 @@ jobs: if: steps.compare-repertoire.outputs.changed == 'true' run: | cat $GITHUB_EVENT_PATH | - python3 -c "import sys, json; print(json.load(sys.stdin)['pull_request']['labels'])" + python3 < Date: Fri, 15 Dec 2023 19:24:04 +0100 Subject: [PATCH 08/29] ) --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 466921fb3..05de82560 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -37,7 +37,7 @@ jobs: cat $GITHUB_EVENT_PATH | python3 < Date: Fri, 15 Dec 2023 19:28:20 +0100 Subject: [PATCH 09/29] no pipe --- .github/workflows/pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 05de82560..30653ce83 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -34,10 +34,10 @@ jobs: - name: Check pipeline labels if: steps.compare-repertoire.outputs.changed == 'true' run: | - cat $GITHUB_EVENT_PATH | python3 < Date: Fri, 15 Dec 2023 19:33:39 +0100 Subject: [PATCH 10/29] load the file --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 30653ce83..fcfe7d219 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -37,7 +37,7 @@ jobs: python3 < Date: Fri, 15 Dec 2023 19:50:39 +0100 Subject: [PATCH 11/29] trace --- .github/workflows/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index fcfe7d219..f92a0008f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -38,6 +38,7 @@ jobs: import os, json with open(os.environ['GITHUB_EVENT_PATH'], 'r') as event: labels = json.load(event)['pull_request']['labels'] + print(labels) for label in labels: if label.startswith('pipeline-'): print("Labeled", label) From 8d5569984af53469b50ab8dfb1baa8dde1473ae9 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Fri, 15 Dec 2023 19:51:50 +0100 Subject: [PATCH 12/29] trace more --- .github/workflows/pipeline.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index f92a0008f..e1a33ed79 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -36,8 +36,10 @@ jobs: run: | python3 < Date: Fri, 15 Dec 2023 19:52:28 +0100 Subject: [PATCH 13/29] ['name'] --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index e1a33ed79..4d6cafb97 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -42,7 +42,7 @@ jobs: labels = event['pull_request']['labels'] print(labels) for label in labels: - if label.startswith('pipeline-'): + if label['name'].startswith('pipeline-'): print("Labeled", label) exit(0) print("::error file=unicodetools/data/ucd/dev/UnicodeData.txt,title=Missing pipeline label::PRs for character additions must have a pipeline label") From 539e6884f2c4d7705cfbad682534da8c60e3bf71 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Sat, 16 Dec 2023 00:07:53 +0100 Subject: [PATCH 14/29] unlabeled --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 4d6cafb97..3cbc7623f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -4,7 +4,7 @@ name: Pipeline on: pull_request: branches: ['*'] - types: [opened, synchronize, reopened, labeled, ready_for_review, converted_to_draft] + types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review, converted_to_draft] jobs: labels-for-repertoire-changes: From 53607db36bff3570d5d91018b3a7f297a7612b83 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 18 Dec 2023 12:50:12 +0100 Subject: [PATCH 15/29] draft --- .github/workflows/pipeline.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 3cbc7623f..a326bf35e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -44,8 +44,29 @@ jobs: for label in labels: if label['name'].startswith('pipeline-'): print("Labeled", label) + with open(os.environ['GITHUB_OUTPUT'], 'r') as f: + print("pipeline-label=" + label['name'], file=f) exit(0) - print("::error file=unicodetools/data/ucd/dev/UnicodeData.txt,title=Missing pipeline label::PRs for character additions must have a pipeline label") + print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.") exit(1) EOF + draft-unless-approved: + needs: labels-for-repertoire-changes + if: needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-16.0' + name: Draft unless approved + runs-on: ubuntu-latest + steps: + - env: + PIPELINE_LABEL: ${{needs.labels-for-repertoire-changes.outputs.pipeline-label}} + run: | + python3 < Date: Mon, 18 Dec 2023 12:52:16 +0100 Subject: [PATCH 16/29] w --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a326bf35e..f765dab5b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -44,7 +44,7 @@ jobs: for label in labels: if label['name'].startswith('pipeline-'): print("Labeled", label) - with open(os.environ['GITHUB_OUTPUT'], 'r') as f: + with open(os.environ['GITHUB_OUTPUT'], 'w') as f: print("pipeline-label=" + label['name'], file=f) exit(0) print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.") From 7c4cb2846d3413370d0d2e58adddc9d8c4ac8164 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 18 Dec 2023 13:01:26 +0100 Subject: [PATCH 17/29] At most one --- .github/workflows/pipeline.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index f765dab5b..c5cc03ec6 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -40,15 +40,18 @@ jobs: event = json.load(f) print(event) labels = event['pull_request']['labels'] - print(labels) - for label in labels: - if label['name'].startswith('pipeline-'): - print("Labeled", label) - with open(os.environ['GITHUB_OUTPUT'], 'w') as f: - print("pipeline-label=" + label['name'], file=f) - exit(0) - print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.") - exit(1) + pipeline_labels = [label for label in labels if label['name'].startswith('pipeline-')] + if not pipeline_labels: + print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.") + exit(1) + if len(pipeline_labels) > 1 + print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.") + exit(1) + label = pipeline_labels[0]: + print("Labeled", label) + with open(os.environ['GITHUB_OUTPUT'], 'w') as f: + print("pipeline-label=" + label['name'], file=f) + exit(0) EOF draft-unless-approved: needs: labels-for-repertoire-changes @@ -56,7 +59,8 @@ jobs: name: Draft unless approved runs-on: ubuntu-latest steps: - - env: + - name: Check draft status + env: PIPELINE_LABEL: ${{needs.labels-for-repertoire-changes.outputs.pipeline-label}} run: | python3 < Date: Mon, 18 Dec 2023 13:04:14 +0100 Subject: [PATCH 18/29] : --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c5cc03ec6..bba83ef58 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -44,7 +44,7 @@ jobs: if not pipeline_labels: print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.") exit(1) - if len(pipeline_labels) > 1 + if len(pipeline_labels) > 1: print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.") exit(1) label = pipeline_labels[0]: From ac4fa68035053137e6ef93613a24496b624c73c2 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 18 Dec 2023 13:07:51 +0100 Subject: [PATCH 19/29] : --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index bba83ef58..01d23d50d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -47,7 +47,7 @@ jobs: if len(pipeline_labels) > 1: print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.") exit(1) - label = pipeline_labels[0]: + label = pipeline_labels[0] print("Labeled", label) with open(os.environ['GITHUB_OUTPUT'], 'w') as f: print("pipeline-label=" + label['name'], file=f) From 46365845d20ed88ff888c947d6af25170b4f35de Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 18 Dec 2023 14:36:44 +0100 Subject: [PATCH 20/29] Require documentation --- .github/workflows/pipeline.yml | 48 +++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 01d23d50d..e32d19f22 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -28,11 +28,11 @@ jobs: sed 's/^\([^;]*;[^;]*\);.*$/\1/' merged/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt if diff base-repertoire.txt merged-repertoire.txt - then echo "changed=false" >> "$GITHUB_OUTPUT" - else echo "changed=true" >> "$GITHUB_OUTPUT" + then echo "repertoire-changed=false" >> "$GITHUB_OUTPUT" + else echo "repertoire-changed=true" >> "$GITHUB_OUTPUT" fi - name: Check pipeline labels - if: steps.compare-repertoire.outputs.changed == 'true' + if: steps.compare-repertoire.outputs.repertoire-changed == 'true' run: | python3 < Date: Mon, 18 Dec 2023 14:38:30 +0100 Subject: [PATCH 21/29] capitalization --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index e32d19f22..43c5bd400 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -75,7 +75,7 @@ jobs: EOF utc-decision: needs: labels-for-repertoire-changes - if: ${{ always() && needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-recommended-to-utc' }} + if: ${{ always() && needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-recommended-to-UTC' }} name: UTC decision runs-on: ubuntu-latest steps: From b6a3e6d0e63afc0da8cd62cecc461dc5a960cf5c Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 18 Dec 2023 14:44:39 +0100 Subject: [PATCH 22/29] expressions --- .github/workflows/pipeline.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 43c5bd400..eec1237c0 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -55,13 +55,11 @@ jobs: EOF l2-document: needs: labels-for-repertoire-changes - if: ${{ always() }} + if: needs.labels-for-repertoire-changes.outputs.repertoire-changed == 'true' name: Proposal document runs-on: ubuntu-latest steps: - name: Check L2 document - env: - PIPELINE_LABEL: ${{needs.labels-for-repertoire-changes.outputs.pipeline-label}} run: | python3 < Date: Mon, 18 Dec 2023 14:49:26 +0100 Subject: [PATCH 23/29] declare outputs --- .github/workflows/pipeline.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index eec1237c0..da4ff1115 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -9,6 +9,9 @@ on: jobs: labels-for-repertoire-changes: name: Labels for repertoire changes + outputs: + repertoire-changed: ${{ steps.compare-repertoire.outputs.repertoire-changed }} + pipeline-label: ${{ steps.check-labels.outputs.pipeline-label }} runs-on: ubuntu-latest steps: - name: Checkout merged UnicodeData.txt @@ -32,6 +35,7 @@ jobs: else echo "repertoire-changed=true" >> "$GITHUB_OUTPUT" fi - name: Check pipeline labels + id: check-labels if: steps.compare-repertoire.outputs.repertoire-changed == 'true' run: | python3 < Date: Mon, 18 Dec 2023 14:52:48 +0100 Subject: [PATCH 24/29] edited --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index da4ff1115..78ede1032 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -4,7 +4,7 @@ name: Pipeline on: pull_request: branches: ['*'] - types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review, converted_to_draft] + types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review, converted_to_draft, edited] jobs: labels-for-repertoire-changes: From 1d5c6cc1556f84b05b33cb788db30a5e5ec6735c Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 18 Dec 2023 16:13:35 +0100 Subject: [PATCH 25/29] useless exit --- .github/workflows/pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 78ede1032..2b344b1ee 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -55,7 +55,6 @@ jobs: print("Labeled", label) with open(os.environ['GITHUB_OUTPUT'], 'a') as f: print("pipeline-label=" + label['name'], file=f) - exit(0) EOF l2-document: needs: labels-for-repertoire-changes From 0c60c013eee23188f0d1bbd9530ef21672dfd218 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Wed, 20 Dec 2023 15:28:48 +0100 Subject: [PATCH 26/29] =?UTF-8?q?=F0=9F=90=8D=F0=9F=90=8D=F0=9F=90=8D?= =?UTF-8?q?=F0=9F=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pipeline.yml | 80 ++++++++-------------- py/pipeline-workflow/check-draft-status.py | 17 +++++ py/pipeline-workflow/check-l2-document.py | 12 ++++ py/pipeline-workflow/check-utc-decision.py | 12 ++++ py/pipeline-workflow/compare-repertoire.py | 19 +++++ 5 files changed, 87 insertions(+), 53 deletions(-) create mode 100644 py/pipeline-workflow/check-draft-status.py create mode 100644 py/pipeline-workflow/check-l2-document.py create mode 100644 py/pipeline-workflow/check-utc-decision.py create mode 100644 py/pipeline-workflow/compare-repertoire.py diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 2b344b1ee..46270c440 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -28,86 +28,60 @@ jobs: - name: Compare repertoire id: compare-repertoire run: | + # Look for changes affecting the first two fields of UnicodeData.txt (code point and name). sed 's/^\([^;]*;[^;]*\);.*$/\1/' merged/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt if diff base-repertoire.txt merged-repertoire.txt then echo "repertoire-changed=false" >> "$GITHUB_OUTPUT" else echo "repertoire-changed=true" >> "$GITHUB_OUTPUT" fi + - name: Checkout Python scripts + uses: actions/checkout@v3 + with: + sparse-checkout: py/pipeline-workflow - name: Check pipeline labels id: check-labels if: steps.compare-repertoire.outputs.repertoire-changed == 'true' - run: | - python3 < 1: - print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.") - exit(1) - label = pipeline_labels[0] - print("Labeled", label) - with open(os.environ['GITHUB_OUTPUT'], 'a') as f: - print("pipeline-label=" + label['name'], file=f) - EOF + run: python3 py/pipeline-workflow/compare-repertoire.py l2-document: needs: labels-for-repertoire-changes if: ${{ always() && needs.labels-for-repertoire-changes.outputs.repertoire-changed == 'true' }} name: Proposal document runs-on: ubuntu-latest steps: + - name: Checkout Python scripts + uses: actions/checkout@v3 + with: + sparse-checkout: py/pipeline-workflow - name: Check L2 document run: | - python3 < 1: + print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.") + exit(1) +label = pipeline_labels[0] +print("Labeled", label) +with open(os.environ['GITHUB_OUTPUT'], 'a') as f: + print("pipeline-label=" + label['name'], file=f) \ No newline at end of file From d8007f28917d39e9a6eaecd950ef67fc39b85278 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Wed, 20 Dec 2023 15:35:06 +0100 Subject: [PATCH 27/29] eol@eof, .0 --- py/pipeline-workflow/check-draft-status.py | 4 ++-- py/pipeline-workflow/check-l2-document.py | 2 +- py/pipeline-workflow/check-utc-decision.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py/pipeline-workflow/check-draft-status.py b/py/pipeline-workflow/check-draft-status.py index 2fcba58f1..56a8f313d 100644 --- a/py/pipeline-workflow/check-draft-status.py +++ b/py/pipeline-workflow/check-draft-status.py @@ -5,7 +5,7 @@ pipeline_label = os.environ['PIPELINE_LABEL'] with open("unicodetools/data/ucd/dev/DerivedAge.txt", 'r') as f: - version = f.readline().strip().replace("# DerivedAge-", "").replace(".txt", "") + version = f.readline().strip().replace("# DerivedAge-", "").replace(".0.txt", "") if pipeline_label != "pipeline-" + version: with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: @@ -14,4 +14,4 @@ draft = event['pull_request']['draft'] if not draft: print("::error title=PR must be draft::PRs for character additions must be draft unless approved for the upcoming version of Unicode.") - exit(1) \ No newline at end of file + exit(1) diff --git a/py/pipeline-workflow/check-l2-document.py b/py/pipeline-workflow/check-l2-document.py index 2df6c52de..f3ccd43c6 100644 --- a/py/pipeline-workflow/check-l2-document.py +++ b/py/pipeline-workflow/check-l2-document.py @@ -9,4 +9,4 @@ pr_body = event['pull_request']['body'] if not re.search(r"L2/\d\d-\d\d\d", pr_body): print("::error title=Need proposal document::PRs for character additions must include a link to an L2 document in the PR description.") - exit(1) \ No newline at end of file + exit(1) diff --git a/py/pipeline-workflow/check-utc-decision.py b/py/pipeline-workflow/check-utc-decision.py index 515295d8a..5a8e610d4 100644 --- a/py/pipeline-workflow/check-utc-decision.py +++ b/py/pipeline-workflow/check-utc-decision.py @@ -9,4 +9,4 @@ pr_body = event['pull_request']['body'] if not re.search(r"UTC-\d\d\d-[MC]\d", pr_body): print("::error title=Need UTC decision::PRs for approved or provisionally assigned must include a link to a UTC decision.") - exit(1) \ No newline at end of file + exit(1) From 9983450f531d178868f1334d17f080a9ae87f632 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Wed, 20 Dec 2023 15:44:21 +0100 Subject: [PATCH 28/29] Revert "U+BOOP" This reverts commit 149d8225340f01ed31461388ad2fe3c40cafc47b. --- unicodetools/data/ucd/dev/UnicodeData.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/unicodetools/data/ucd/dev/UnicodeData.txt b/unicodetools/data/ucd/dev/UnicodeData.txt index b3490669f..4376ff723 100644 --- a/unicodetools/data/ucd/dev/UnicodeData.txt +++ b/unicodetools/data/ucd/dev/UnicodeData.txt @@ -15200,7 +15200,6 @@ ABF6;MEETEI MAYEK DIGIT SIX;Nd;0;L;;6;6;6;N;;;;; ABF7;MEETEI MAYEK DIGIT SEVEN;Nd;0;L;;7;7;7;N;;;;; ABF8;MEETEI MAYEK DIGIT EIGHT;Nd;0;L;;8;8;8;N;;;;; ABF9;MEETEI MAYEK DIGIT NINE;Nd;0;L;;9;9;9;N;;;;; -BOOP;BETTY BOOP;So;0;L;;;;;N;;;;; AC00;;Lo;0;L;;;;;N;;;;; D7A3;;Lo;0;L;;;;;N;;;;; D7B0;HANGUL JUNGSEONG O-YEO;Lo;0;L;;;;;N;;;;; From d61a95ac98052f09ef39098897c35ba813013a71 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Wed, 20 Dec 2023 15:53:27 +0100 Subject: [PATCH 29/29] lint --- py/pipeline-workflow/check-draft-status.py | 4 +++- py/pipeline-workflow/check-l2-document.py | 4 +++- py/pipeline-workflow/check-utc-decision.py | 4 +++- py/pipeline-workflow/compare-repertoire.py | 8 +++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/py/pipeline-workflow/check-draft-status.py b/py/pipeline-workflow/check-draft-status.py index 56a8f313d..c1bd2e091 100644 --- a/py/pipeline-workflow/check-draft-status.py +++ b/py/pipeline-workflow/check-draft-status.py @@ -13,5 +13,7 @@ print(event) draft = event['pull_request']['draft'] if not draft: - print("::error title=PR must be draft::PRs for character additions must be draft unless approved for the upcoming version of Unicode.") + print("::error title=PR must be draft::" + "PRs for character additions must be draft unless approved for " + "the upcoming version of Unicode.") exit(1) diff --git a/py/pipeline-workflow/check-l2-document.py b/py/pipeline-workflow/check-l2-document.py index f3ccd43c6..11e421817 100644 --- a/py/pipeline-workflow/check-l2-document.py +++ b/py/pipeline-workflow/check-l2-document.py @@ -8,5 +8,7 @@ print(event) pr_body = event['pull_request']['body'] if not re.search(r"L2/\d\d-\d\d\d", pr_body): - print("::error title=Need proposal document::PRs for character additions must include a link to an L2 document in the PR description.") + print("::error title=Need proposal document::" + "PRs for character additions must include a link to an L2 document in" + " the PR description.") exit(1) diff --git a/py/pipeline-workflow/check-utc-decision.py b/py/pipeline-workflow/check-utc-decision.py index 5a8e610d4..1b98d63af 100644 --- a/py/pipeline-workflow/check-utc-decision.py +++ b/py/pipeline-workflow/check-utc-decision.py @@ -8,5 +8,7 @@ print(event) pr_body = event['pull_request']['body'] if not re.search(r"UTC-\d\d\d-[MC]\d", pr_body): - print("::error title=Need UTC decision::PRs for approved or provisionally assigned must include a link to a UTC decision.") + print("::error title=Need UTC decision::" + "PRs for approved or provisionally assigned must include a link to a " + "UTC decision.") exit(1) diff --git a/py/pipeline-workflow/compare-repertoire.py b/py/pipeline-workflow/compare-repertoire.py index 742c6aa15..f420cb08e 100644 --- a/py/pipeline-workflow/compare-repertoire.py +++ b/py/pipeline-workflow/compare-repertoire.py @@ -8,12 +8,14 @@ labels = event['pull_request']['labels'] pipeline_labels = [label for label in labels if label['name'].startswith('pipeline-')] if not pipeline_labels: - print("::error title=Missing pipeline label::PRs for character additions must have a pipeline label.") + print("::error title=Missing pipeline label::" + "PRs for character additions must have a pipeline label.") exit(1) if len(pipeline_labels) > 1: - print("::error title=Multiple pipeline labels::Only one pipeline-* label must be applied.") + print("::error title=Multiple pipeline labels::" + "Only one pipeline-* label must be applied.") exit(1) label = pipeline_labels[0] print("Labeled", label) with open(os.environ['GITHUB_OUTPUT'], 'a') as f: - print("pipeline-label=" + label['name'], file=f) \ No newline at end of file + print("pipeline-label=" + label['name'], file=f)