andreydevyatkin commented on code in PR #30424:
URL: https://github.com/apache/beam/pull/30424#discussion_r1504676248


##########
.test-infra/tools/flaky_test_detection.py:
##########
@@ -65,11 +63,7 @@ def create_github_issue(repo, alert):
     print(f"Body: {body}")
     print(f"Labels: {labels}")
     print("___")
-
-    if READ_ONLY == "true":
-        print("READ_ONLY is true, not creating issue")
-    else:
-        repo.create_issue(title=title, body=body, labels=labels)
+    repo.create_issue(title=title, body=body, labels=labels)

Review Comment:
   Reverted back



##########
.test-infra/tools/flaky_test_detection.py:
##########
@@ -103,17 +97,23 @@ def main():
     token = os.environ["GITHUB_TOKEN"]
     auth = Auth.Token(token)
     g = Github(auth=auth)
-    repo = g.get_repo(f"{GIT_ORG}/{GIT_REPO}")
+    repo = g.get_repo(f"{GIT_ORG}/beam")
 
     alerts = get_grafana_alerts()
     open_issues = repo.get_issues(state="open", labels=["flaky_test"])
-    workflow_ids = extract_workflow_id_from_issue_label(open_issues)
+    closed_issues = repo.get_issues(state="closed", labels=["flaky_test"])
+    workflow_open_issues = get_workflow_issues(open_issues)
+    workflow_closed_issues = get_workflow_issues(closed_issues)
     for alert in alerts:
-        if alert.workflow_id not in workflow_ids:
+        if alert.workflow_id in workflow_closed_issues.keys():
+            issue = workflow_closed_issues[alert.workflow_id]
+            if issue:
+                issue.edit(state="open")

Review Comment:
   Added



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to