Skip to content

Commit bf7679f

Browse files
committed
check 2: PR comment CI
1 parent 3c08271 commit bf7679f

File tree

3 files changed

+29
-23
lines changed

3 files changed

+29
-23
lines changed

.github/workflows/self-comment-ci.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- created
77
branches-ignore:
88
- main
9-
concurrency:
10-
group: ${{ github.workflow }}-${{ github.event.issue.number }}-${{ startsWith(github.event.comment.body, 'run-slow') || startsWith(github.event.comment.body, 'run slow') || startsWith(github.event.comment.body, 'run_slow') }}
11-
cancel-in-progress: true
9+
pull_request:
10+
#concurrency:
11+
# group: ${{ github.workflow }}-${{ github.event.issue.number }}-${{ startsWith(github.event.comment.body, 'run-slow') || startsWith(github.event.comment.body, 'run slow') || startsWith(github.event.comment.body, 'run_slow') }}
12+
# cancel-in-progress: true
1213
permissions: read-all
1314

1415
env:
@@ -27,7 +28,7 @@ env:
2728
jobs:
2829
get-pr-number:
2930
name: Get PR number
30-
if: ${{ github.event.issue.state == 'open' && contains(fromJSON('["ydshieh", "ArthurZucker", "zucchini-nlp", "molbap", "gante", "LysandreJik", "Cyrilvallez", "Rocketknight1", "SunMarc", "eustlb", "MekkCyber", "vasqu", "ivarflakstad", "stevhliu", "ebezzam", "remi-or", "itazap"]'), github.actor) && (startsWith(github.event.comment.body, 'run-slow') || startsWith(github.event.comment.body, 'run slow') || startsWith(github.event.comment.body, 'run_slow')) }}
31+
# if: ${{ github.event.issue.state == 'open' && contains(fromJSON('["ydshieh", "ArthurZucker", "zucchini-nlp", "molbap", "gante", "LysandreJik", "Cyrilvallez", "Rocketknight1", "SunMarc", "eustlb", "MekkCyber", "vasqu", "ivarflakstad", "stevhliu", "ebezzam", "remi-or", "itazap"]'), github.actor) && (startsWith(github.event.comment.body, 'run-slow') || startsWith(github.event.comment.body, 'run slow') || startsWith(github.event.comment.body, 'run_slow')) }}
3132
uses: ./.github/workflows/get-pr-number.yml
3233

3334
get-pr-info:
@@ -51,13 +52,14 @@ jobs:
5152
COMMENT_DATE: ${{ github.event.comment.created_at }}
5253
PR_MERGE_COMMIT_TIMESTAMP: ${{ needs.get-pr-info.outputs.PR_MERGE_COMMIT_TIMESTAMP }}
5354
run: |
54-
COMMENT_TIMESTAMP=$(date -d "${COMMENT_DATE}" +"%s")
55-
echo "COMMENT_DATE: $COMMENT_DATE"
56-
echo "COMMENT_TIMESTAMP: $COMMENT_TIMESTAMP"
57-
if [ $COMMENT_TIMESTAMP -le $PR_MERGE_COMMIT_TIMESTAMP ]; then
58-
echo "Last commit on the pull request is newer than the issue comment triggering this run! Abort!";
59-
exit -1;
60-
fi
55+
echo "Bon"
56+
# COMMENT_TIMESTAMP=$(date -d "${COMMENT_DATE}" +"%s")
57+
# echo "COMMENT_DATE: $COMMENT_DATE"
58+
# echo "COMMENT_TIMESTAMP: $COMMENT_TIMESTAMP"
59+
# if [ $COMMENT_TIMESTAMP -le $PR_MERGE_COMMIT_TIMESTAMP ]; then
60+
# echo "Last commit on the pull request is newer than the issue comment triggering this run! Abort!";
61+
# exit -1;
62+
# fi
6163

6264
# use a python script to handle this complex logic.
6365
get-tests:
@@ -72,25 +74,29 @@ jobs:
7274
fetch-depth: "0"
7375
ref: "refs/pull/${{ needs.get-pr-number.outputs.PR_NUMBER }}/merge"
7476

75-
- name: Verify merge commit SHA
76-
env:
77-
VERIFIED_PR_MERGE_SHA: ${{ needs.check-timestamps.outputs.PR_MERGE_SHA }}
78-
run: |
79-
PR_MERGE_SHA=$(git log -1 --format=%H)
80-
if [ $PR_MERGE_SHA != $VERIFIED_PR_MERGE_SHA ]; then
81-
echo "The merged commit SHA is not the same as the verified one! Security issue detected, abort the workflow!";
82-
exit -1;
83-
fi
77+
# - name: Verify merge commit SHA
78+
# env:
79+
# VERIFIED_PR_MERGE_SHA: ${{ needs.check-timestamps.outputs.PR_MERGE_SHA }}
80+
# run: |
81+
# PR_MERGE_SHA=$(git log -1 --format=%H)
82+
# if [ $PR_MERGE_SHA != $VERIFIED_PR_MERGE_SHA ]; then
83+
# echo "The merged commit SHA is not the same as the verified one! Security issue detected, abort the workflow!";
84+
# exit -1;
85+
# fi
8486

8587
- name: Get models to test
8688
env:
87-
PR_COMMENT: ${{ github.event.comment.body }}
89+
# PR_COMMENT: ${{ github.event.comment.body }}
90+
PR_COMMENT: "run-slow: vit"
8891
run: |
8992
python -m pip install GitPython
9093
python utils/pr_slow_ci_models.py --message "$PR_COMMENT" | tee output.txt
9194
echo "models=$(tail -n 1 output.txt)" >> $GITHUB_ENV
9295
python utils/pr_slow_ci_models.py --message "$PR_COMMENT" --quantization | tee output2.txt
9396
echo "quantizations=$(tail -n 1 output2.txt)" >> $GITHUB_ENV
97+
echo $PR_COMMENT
98+
echo "$(tail -n 1 output.txt)"
99+
echo "$(tail -n 1 output2.txt)"
94100
95101
- name: Show models to test
96102
id: models_to_run

.github/workflows/self-scheduled-caller.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "17 2 * * *"
77
push:
88
branches:
9-
- cleanup_workflow
9+
- cleanup_workflowxxx
1010
workflow_dispatch:
1111
inputs:
1212
prev_workflow_run_id:

utils/notification_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ def pop_default(l: list[Any], i: int, default: Any) -> Any:
15261526
)
15271527
other_workflow_run_ids.append(other_workflow_run_id)
15281528
# triggered via `issue_comment` for CI on pull requests (e.g. using the comment `run-slow:`)
1529-
elif os.environ.get("GITHUB_EVENT_NAME") in ["issue_comment"]:
1529+
elif os.environ.get("GITHUB_EVENT_NAME") in ["issue_comment", "pull_request"]:
15301530
# TODO (ydshieh): Make this flexible once we implement `run-slow` for AMD CI and others.
15311531
# The id of the workflow `.github/workflows/self-scheduled-caller.yml` (not of a workflow run of it).
15321532
prev_workflow_id = "90575235"

0 commit comments

Comments
 (0)