-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add GitHub Actions bot to merge PRs on demand
This implements https://discuss.tvm.apache.org/t/rfc-allow-merging-via-pr-comments/12220. The bot can be invoked from a top-level review comment or via a regular PR comment. The text `@tvm-bot merge` anywhere in the body will trigger the bot. Right now it checks that the latest commit is reviewed and that all CI jobs that have run on that commit are successful. If it fails, it will leave a comment on the PR with the reason. This is just a start and some features are left for followups: * Various TODOs throughout the code * "Scheduled" merges that happen once CI finishes * Allowing committers to merge without getting a fresh review for changes after an approval
- Loading branch information
Showing
9 changed files
with
1,127 additions
and
6 deletions.
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,28 @@ | ||
|
||
name: Merge | ||
on: | ||
status: | ||
pull_request_review: | ||
types: | ||
- submitted | ||
issue_comment: | ||
|
||
concurrency: | ||
group: merge-${{ github.event.pull_request.number }}-${{ github.event.issue.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
maybe-merge: | ||
if: github.repository == 'driazati/tvm' | ||
# if: github.repository == 'apache/tvm' # TODO: uncomment after testing | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Merge if requested and possible | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.issue.number }} | ||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
run: | | ||
set -eux | ||
python tests/scripts/github_mergebot.py --pr "$PR_NUMBER" --run-url "$RUN_URL" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"title": "[Hexagon] 2-d allocation cleanup", | ||
"body": "- Added device validity check in allocation. HexagonDeviceAPI should only be called for CPU/Hexagon types.\r\n\r\n- Check for \"global.vtcm\" scope instead of \"vtcm\". The ccope of N-d allocations produced by `LowerVtcmAlloc` should be `\"global.vtcm\"`. The previous check allowed unsupported scope such as `\"local.vtcm\"`.\r\n\r\n- Remove `vtcmallocs` entry after calling free. Previously, the vtcm allocation map kept dangling pointers to `HexagonBuffer` objects after they had been freed.\r\n\r\n- Rename N-d alloc and free packed functions. Since most of the similar device functions use snake case, renaming `*.AllocND` to `*.alloc_nd` and `*.FreeND` to `*.free_nd`.\r\n\r\nCo-authored-by: Adam Straw <[email protected]>", | ||
"state": "OPEN", | ||
"comments": { | ||
"pageInfo": { | ||
"hasPreviousPage": false | ||
}, | ||
"nodes": [] | ||
}, | ||
"authorCommits": { | ||
"nodes": [ | ||
{ | ||
"commit": { | ||
"authors": { | ||
"nodes": [ | ||
{ | ||
"name": "Eric Lunderberg", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Adam Straw", | ||
"email": "[email protected]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"commits": { | ||
"nodes": [ | ||
{ | ||
"commit": { | ||
"oid": "6f04bcf57d07f915a98fd91178f04d9e92a09fcd", | ||
"statusCheckRollup": { | ||
"contexts": { | ||
"pageInfo": { | ||
"hasNextPage": false | ||
}, | ||
"nodes": [ | ||
{ | ||
"name": "MacOS", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "CI" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945392" | ||
}, | ||
{ | ||
"name": "cc-reviewers", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "PR" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "FAILED", | ||
"url": "https://github.com/apache/tvm/runs/5694945029" | ||
}, | ||
{ | ||
"name": "tag-teams", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "Teams" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945030" | ||
}, | ||
{ | ||
"name": "Windows", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "CI" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945524" | ||
}, | ||
{ | ||
"state": "SUCCESS", | ||
"context": "tvm-ci/pr-merge", | ||
"targetUrl": "https://ci.tlcpack.ai/job/tvm/job/PR-10786/1/display/redirect" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"reviewDecision": "APPROVED", | ||
"reviews": { | ||
"pageInfo": { | ||
"hasPreviousPage": false | ||
}, | ||
"nodes": [ | ||
{ | ||
"body": "@tvm-bot merge", | ||
"updatedAt": "2022-03-25T22:13:50Z", | ||
"authorCanPushToRepository": true, | ||
"commit": { | ||
"oid": "6f04bcf57d07f915a98fd91178f04d9e92a09fcd" | ||
}, | ||
"state": "APPROVED" | ||
} | ||
] | ||
} | ||
} |
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,123 @@ | ||
{ | ||
"title": "[Hexagon] 2-d allocation cleanup", | ||
"body": "- Added device validity check in allocation. HexagonDeviceAPI should only be called for CPU/Hexagon types.\r\n\r\n- Check for \"global.vtcm\" scope instead of \"vtcm\". The ccope of N-d allocations produced by `LowerVtcmAlloc` should be `\"global.vtcm\"`. The previous check allowed unsupported scope such as `\"local.vtcm\"`.\r\n\r\n- Remove `vtcmallocs` entry after calling free. Previously, the vtcm allocation map kept dangling pointers to `HexagonBuffer` objects after they had been freed.\r\n\r\n- Rename N-d alloc and free packed functions. Since most of the similar device functions use snake case, renaming `*.AllocND` to `*.alloc_nd` and `*.FreeND` to `*.free_nd`.\r\n\r\nCo-authored-by: Adam Straw <[email protected]>", | ||
"state": "OPEN", | ||
"comments": { | ||
"pageInfo": { | ||
"hasPreviousPage": false | ||
}, | ||
"nodes": [] | ||
}, | ||
"authorCommits": { | ||
"nodes": [ | ||
{ | ||
"commit": { | ||
"authors": { | ||
"nodes": [ | ||
{ | ||
"name": "Eric Lunderberg", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Adam Straw", | ||
"email": "[email protected]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"commits": { | ||
"nodes": [ | ||
{ | ||
"commit": { | ||
"oid": "6f04bcf57d07f915a98fd91178f04d9e92a09fcd", | ||
"statusCheckRollup": { | ||
"contexts": { | ||
"pageInfo": { | ||
"hasNextPage": false | ||
}, | ||
"nodes": [ | ||
{ | ||
"name": "MacOS", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "CI" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945392" | ||
}, | ||
{ | ||
"name": "cc-reviewers", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "PR" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945029" | ||
}, | ||
{ | ||
"name": "tag-teams", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "Teams" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945030" | ||
}, | ||
{ | ||
"name": "Windows", | ||
"checkSuite": { | ||
"workflowRun": { | ||
"workflow": { | ||
"name": "CI" | ||
} | ||
} | ||
}, | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS", | ||
"url": "https://github.com/apache/tvm/runs/5694945524" | ||
}, | ||
{ | ||
"state": "SUCCESS", | ||
"context": "tvm-ci/pr-merge", | ||
"targetUrl": "https://ci.tlcpack.ai/job/tvm/job/PR-10786/1/display/redirect" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"reviewDecision": "APPROVED", | ||
"reviews": { | ||
"pageInfo": { | ||
"hasPreviousPage": false | ||
}, | ||
"nodes": [ | ||
{ | ||
"body": "@tvm-bot merge", | ||
"updatedAt": "2022-03-25T22:13:50Z", | ||
"authorCanPushToRepository": true, | ||
"commit": { | ||
"oid": "6f04bcf57d07f915a98fd91178f04d9e92a09fcd" | ||
}, | ||
"state": "APPROVED" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.