From b1725d8a5f02e325f2feeaeeb4d07924c01f15d9 Mon Sep 17 00:00:00 2001 From: driazati Date: Wed, 25 May 2022 15:27:34 -0700 Subject: [PATCH] Fix error from pr #11442 --- .../ci/sample_prs/pr11442-no-recomment.json | 191 ++++++++++++++++++ tests/python/ci/test_mergebot.py | 6 + tests/scripts/github_mergebot.py | 5 +- 3 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 tests/python/ci/sample_prs/pr11442-no-recomment.json diff --git a/tests/python/ci/sample_prs/pr11442-no-recomment.json b/tests/python/ci/sample_prs/pr11442-no-recomment.json new file mode 100644 index 0000000000000..77af805f2180e --- /dev/null +++ b/tests/python/ci/sample_prs/pr11442-no-recomment.json @@ -0,0 +1,191 @@ +{ + "title": "Add 'static_library' runtime::Module", + "body": "(See https://discuss.tvm.apache.org/t/byoc-supporting-cutlass-byoc-with-collage/12796/6 for\r\ncontext, which in turn is part of Collage (https://github.com/apache/tvm-rfcs/blob/main/rfcs/0062-collage.md).\r\n\r\nThis adds a new 'DSO exportable' runtime module representing the contents of a .o file. It\r\nallows external codegen toolchains to yield a result which:\r\n - Like CSource modules, can be conveyed directly to the final export_library compilation\r\n step for linking into the final .so and saved to a know location without risk the\r\n underlying code artifact will be lost.\r\n - Like DSOLibrary modules, are self contained so that no additional compile-time arguments\r\n need be conveyed from the CSource module to the final export_library command line\r\n\r\nSince this is the third flavor of 'DSO exportable' module, add a Module::IsDSOExportable.\r\n\r\nSince adding the above, can't resist also adding a Module::ImplementsFunction virtual and\r\ncalling it from TEComplier to check if an external codegen function actually provided the\r\nimplementation it promised.\r\n\r\nNote:\r\n - I've left the existing implementation of runtime.load_module alone which\r\n relinks .o files to .so files.\r\n - Though also contained in the .o metadata, I require static libraries to always\r\n carry their list of exported function names.\r\n\r\nThis is all pretty stop gap pending a good rework of TVM to supoprt the notion of artifacts\r\nand, perhaps, build rules.\r\n", + "state": "OPEN", + "author": { + "login": "mbs-octoml" + }, + "comments": { + "pageInfo": { + "hasPreviousPage": false + }, + "nodes": [ + { + "authorAssociation": "MEMBER", + "author": { + "login": "tqchen" + }, + "updatedAt": "2022-05-24T22:13:29Z", + "body": "Thanks @mbs-octoml . I think we go with this as a temp workaround with a mind that the IsDSOExportable and ImplementsFunction likely should go to Artifact." + }, + { + "authorAssociation": "CONTRIBUTOR", + "author": { + "login": "mbs-octoml" + }, + "updatedAt": "2022-05-24T22:56:07Z", + "body": "Yeah, we really need to put some love into that.\r\n\r\nCollecting all the pieces needed for deployment along with their metadata a la Artifact is pretty clearly needed, though I suspect that will need to be abstract to cover the spectrum from firmware image to dynamically loadable .so to ready-to-call JITed code to tar.\r\n\r\nI can't help thinking we should also think about build rules guarded by target kinds & attributes, since again there's just so may ways to proceed." + }, + { + "authorAssociation": "MEMBER", + "author": { + "login": "tqchen" + }, + "updatedAt": "2022-05-24T23:08:00Z", + "body": "Perhaps we will end up building our own cmake/bazel :p in another time" + }, + { + "authorAssociation": "CONTRIBUTOR", + "author": { + "login": "mbs-octoml" + }, + "updatedAt": "2022-05-25T22:11:44Z", + "body": "Thanks Tianqi. Let's see if this new fancy bot works...\r\n\r\n" + }, + { + "authorAssociation": "CONTRIBUTOR", + "author": { + "login": "mbs-octoml" + }, + "updatedAt": "2022-05-25T22:11:50Z", + "body": "@tvm-bot merge" + }, + { + "authorAssociation": "NONE", + "author": { + "login": "github-actions" + }, + "updatedAt": "2022-05-25T22:12:10Z", + "body": "Cannot merge, did not find any approving reviews from users with write access on 96d4e62da5a7b78da18d0ee28cc6261d8fbf31c4" + }, + { + "authorAssociation": "CONTRIBUTOR", + "author": { + "login": "mbs-octoml" + }, + "updatedAt": "2022-05-25T22:12:37Z", + "body": "Hmff." + }, + { + "authorAssociation": "NONE", + "author": { + "login": "github-actions" + }, + "updatedAt": "2022-05-25T22:12:55Z", + "body": "Cannot merge, did not find any approving reviews from users with write access on 96d4e62da5a7b78da18d0ee28cc6261d8fbf31c4" + } + ] + }, + "authorCommits": { + "nodes": [ + { + "commit": { + "authors": { + "nodes": [ + { + "name": "mbs-octoml", + "email": "mbs@octoml.ai" + } + ] + } + } + } + ] + }, + "commits": { + "nodes": [ + { + "commit": { + "oid": "96d4e62da5a7b78da18d0ee28cc6261d8fbf31c4", + "statusCheckRollup": { + "contexts": { + "pageInfo": { + "hasNextPage": false + }, + "nodes": [ + { + "name": "MacOS", + "checkSuite": { + "workflowRun": { + "workflow": { + "name": "CI" + } + } + }, + "status": "COMPLETED", + "conclusion": "SUCCESS", + "url": "https://github.com/apache/tvm/runs/6598275844" + }, + { + "name": "cc-reviewers", + "checkSuite": { + "workflowRun": { + "workflow": { + "name": "PR" + } + } + }, + "status": "COMPLETED", + "conclusion": "SUCCESS", + "url": "https://github.com/apache/tvm/runs/6598273162" + }, + { + "name": "Windows", + "checkSuite": { + "workflowRun": { + "workflow": { + "name": "CI" + } + } + }, + "status": "COMPLETED", + "conclusion": "SUCCESS", + "url": "https://github.com/apache/tvm/runs/6598275717" + }, + { + "name": "Android", + "checkSuite": { + "workflowRun": { + "workflow": { + "name": "CI" + } + } + }, + "status": "COMPLETED", + "conclusion": "SUCCESS", + "url": "https://github.com/apache/tvm/runs/6598275593" + }, + { + "state": "SUCCESS", + "context": "tvm-ci/pr-head", + "targetUrl": "https://ci.tlcpack.ai/job/tvm/job/PR-11442/4/display/redirect" + } + ] + } + } + } + } + ] + }, + "reviewDecision": "APPROVED", + "reviews": { + "pageInfo": { + "hasPreviousPage": false + }, + "nodes": [ + { + "body": "", + "updatedAt": "2022-05-24T23:08:31Z", + "url": "https://github.com/apache/tvm/pull/11442#pullrequestreview-983954561", + "authorCanPushToRepository": true, + "commit": { + "oid": "23c600097cf1c2a55acda059626a060e106dd023" + }, + "author": { + "login": "tqchen" + }, + "state": "APPROVED" + } + ] + } +} \ No newline at end of file diff --git a/tests/python/ci/test_mergebot.py b/tests/python/ci/test_mergebot.py index e1c15d68671d3..b9f944e897d3f 100644 --- a/tests/python/ci/test_mergebot.py +++ b/tests/python/ci/test_mergebot.py @@ -106,6 +106,12 @@ def run(self, *args): "expected": "Co-authored-by: Some One ", "detail": "Check that a merge request with co-authors generates the correct commit message", }, + "no-recomment": { + "number": 11442, + "filename": "pr11442-no-recomment.json", + "expected": "No merge requested, exiting", + "detail": "Check that comments after a failed merge don't trigger another merge", + }, } diff --git a/tests/scripts/github_mergebot.py b/tests/scripts/github_mergebot.py index bbc9fe922e0b8..1a3811ba1c016 100755 --- a/tests/scripts/github_mergebot.py +++ b/tests/scripts/github_mergebot.py @@ -408,6 +408,9 @@ def merge_requested(self) -> bool: ] def parse_action(comment: Dict[str, Any]) -> Optional[str]: + if comment["author"]["login"] == "github-actions": + return "commented" + if not self.comment_can_merge(comment): return None @@ -417,7 +420,7 @@ def parse_action(comment: Dict[str, Any]) -> Optional[str]: if any(f"@tvm-bot {c}" in body for c in cancel_commands): return "cancel" - + return None # Check regular comments and top-level review comments