You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/27 19:20:52 UTC

[GitHub] [tvm] driazati commented on a change in pull request #9973: Add bot to ping reviewers after no activity

driazati commented on a change in pull request #9973:
URL: https://github.com/apache/tvm/pull/9973#discussion_r793926985



##########
File path: tests/scripts/ping_reviewers.py
##########
@@ -0,0 +1,223 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import os
+import argparse
+import re
+import datetime
+import json
+from typing import Dict, Any, List
+
+from git_utils import git, GitHubRepo, parse_remote
+
+
+def prs_query(user: str, repo: str, cursor: str = None):
+    after = ""
+    if cursor is not None:
+        after = f', before:"{cursor}"'
+    return f"""
+        {{
+    repository(name: "{repo}", owner: "{user}") {{
+        pullRequests(states: [OPEN], last: 10{after}) {{
+        edges {{
+            cursor
+        }}
+        nodes {{
+            number
+            url
+            body
+            isDraft
+            author {{
+                login
+            }}
+            reviews(last:100) {{
+                nodes {{
+                    author {{ login }}
+                    comments(last:100) {{
+                        nodes {{
+                            updatedAt
+                            bodyText
+                        }}
+                    }}
+                }}
+            }}
+            publishedAt
+            comments(last:100) {{
+                nodes {{
+                    authorAssociation
+                    bodyText
+                    updatedAt
+                    author {{
+                        login
+                    }}
+                }}
+            }}
+        }}
+        }}
+    }}
+    }}
+    """
+
+
+def find_reviewers(body: str) -> List[str]:

Review comment:
       We can add that functionality later if need be, but most PRs people are going to be cc-ing people anyways due to the other bot. The main reason I didn't add it here is that non-committers can't be added to the reviewers list until they've actually left a review (which this does query for)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org