-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow to check we have a paper trail on répertoire changes #629
Merged
Merged
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
e8218a8
A new workflow
eggrobin f9ff2fc
More checklist
eggrobin 8ef9a1d
sparse
eggrobin 149d822
U+BOOP
eggrobin ff89b1d
.outputs
eggrobin 50eeea4
try to get labels
eggrobin eb3984c
Require labels
eggrobin 86b29fb
)
eggrobin 7d8bbcb
no pipe
eggrobin 652e57b
load the file
eggrobin 63872b7
trace
eggrobin 8d55699
trace more
eggrobin a4d38cb
['name']
eggrobin 539e688
unlabeled
eggrobin 53607db
draft
eggrobin 731697a
w
eggrobin 7c4cb28
At most one
eggrobin 97f78f6
:
eggrobin ac4fa68
:
eggrobin 4636584
Require documentation
eggrobin 997a5df
capitalization
eggrobin b6a3e6d
expressions
eggrobin 35d30f0
declare outputs
eggrobin a6386bc
edited
eggrobin 1d5c6cc
useless exit
eggrobin 0c60c01
🐍🐍🐍🐍
eggrobin d8007f2
eol@eof, .0
eggrobin 9983450
Revert "U+BOOP"
eggrobin d61a95a
lint
eggrobin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: Pipeline | ||
|
||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review, converted_to_draft, edited] | ||
|
||
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 | ||
uses: actions/checkout@v3 | ||
with: | ||
path: merged | ||
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: | | ||
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: Check pipeline labels | ||
id: check-labels | ||
if: steps.compare-repertoire.outputs.repertoire-changed == 'true' | ||
run: | | ||
python3 <<EOF | ||
import os, json | ||
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: | ||
event = json.load(f) | ||
print(event) | ||
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.") | ||
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'], 'a') as f: | ||
print("pipeline-label=" + label['name'], file=f) | ||
EOF | ||
eggrobin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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: Check L2 document | ||
run: | | ||
python3 <<EOF | ||
import os, json, re | ||
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: | ||
event = json.load(f) | ||
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.") | ||
exit(1) | ||
EOF | ||
eggrobin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
utc-decision: | ||
needs: labels-for-repertoire-changes | ||
if: needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-recommended-to-UTC' | ||
name: UTC decision | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check UTC decision | ||
run: | | ||
python3 <<EOF | ||
import os, json, re | ||
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: | ||
event = json.load(f) | ||
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.") | ||
exit(1) | ||
EOF | ||
eggrobin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
draft-unless-approved: | ||
needs: labels-for-repertoire-changes | ||
if: needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-16.0' | ||
eggrobin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: Draft unless approved | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check draft status | ||
run: | | ||
python3 <<EOF | ||
import os, json | ||
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f: | ||
event = json.load(f) | ||
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.") | ||
exit(1) | ||
EOF | ||
eggrobin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 'sed' filter might be best in a local file for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment, but I don’t think there is much to gain from splitting that regex into its own file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be useful on its own… not a high prio