[ 
https://issues.apache.org/jira/browse/BEAM-13925?focusedWorklogId=731802&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-731802
 ]

ASF GitHub Bot logged work on BEAM-13925:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Feb/22 18:49
            Start Date: 23/Feb/22 18:49
    Worklog Time Spent: 10m 
      Work Description: KonradJanica commented on a change in pull request 
#16898:
URL: https://github.com/apache/beam/pull/16898#discussion_r813209631



##########
File path: scripts/ci/pr-bot/shared/pr.ts
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ */
+
+const github = require("./githubUtils");
+
+export class Pr {
+  public commentedAboutFailingChecks: boolean;
+  public reviewersAssignedForLabels: { [key: string]: string };
+  public nextAction: string;
+  public stopReviewerNotifications: boolean;
+  public remindAfterTestsPass: string[];
+
+  constructor(propertyDictionary) {
+    this.commentedAboutFailingChecks = false;
+    this.reviewersAssignedForLabels = {}; // map of label to reviewer
+    this.nextAction = "Author";
+    this.stopReviewerNotifications = false;
+    this.remindAfterTestsPass = []; // List of handles
+
+    if (!propertyDictionary) {
+      return;
+    }
+    if (propertyDictionary) {
+      if ("commentedAboutFailingChecks" in propertyDictionary) {
+        this.commentedAboutFailingChecks =
+          propertyDictionary["commentedAboutFailingChecks"];
+      }
+      if ("reviewersAssignedForLabels" in propertyDictionary) {
+        this.reviewersAssignedForLabels =
+          propertyDictionary["reviewersAssignedForLabels"];
+      }
+      if ("nextAction" in propertyDictionary) {
+        this.nextAction = propertyDictionary["nextAction"];
+      }
+      if ("stopReviewerNotifications" in propertyDictionary) {
+        this.stopReviewerNotifications =
+          propertyDictionary["stopReviewerNotifications"];
+      }
+      if ("remindAfterTestsPass" in propertyDictionary) {
+        this.remindAfterTestsPass = propertyDictionary["remindAfterTestsPass"];
+      }
+    }
+  }
+
+  // Returns a label that the reviewer is assigned for.
+  // If none, returns an empty string
+  getLabelForReviewer(reviewer: string): string {
+    const labels = Object.keys(this.reviewersAssignedForLabels);
+    for (let i = 0; i < labels.length; i++) {
+      let label = labels[i];
+      if (this.reviewersAssignedForLabels[label] == reviewer) {
+        return label;
+      }
+    }
+
+    return "";
+  }
+
+  // Returns whether any of the assigned reviewers are committers
+  async isAnyAssignedReviewerCommitter(): Promise<boolean> {
+    const labels = Object.keys(this.reviewersAssignedForLabels);
+    for (let i = 0; i < labels.length; i++) {
+      let label = labels[i];

Review comment:
       Save the line by not assigning this variable.




-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 731802)
    Time Spent: 4h  (was: 3h 50m)

> Automate Reviewer Assignment
> ----------------------------
>
>                 Key: BEAM-13925
>                 URL: https://issues.apache.org/jira/browse/BEAM-13925
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-community
>            Reporter: Danny McCormick
>            Assignee: Danny McCormick
>            Priority: P2
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> Right now, we don't have a well defined automated system for staying on top 
> of pull request reviews - we rely on contributors being able to find the 
> correct OWNERS file and committers manually triaging/calling attention to old 
> pull requests. We should add automation driven by GitHub Actions to 
> automatically round robin new PR reviews to a set of contributors, thus 
> balancing the load.
>  
> Design doc here - 
> https://docs.google.com/document/d/1FhRPRD6VXkYlLAPhNfZB7y2Yese2FCWBzjx67d3TjBo/edit#



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to