This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6cef0a27a00 Fix unreachable branch and broken regex in PR-of-the-month 
script (#62438)
6cef0a27a00 is described below

commit 6cef0a27a000ae71273214aeb9f97aa1549d04de
Author: Kaxil Naik <[email protected]>
AuthorDate: Wed Feb 25 04:21:02 2026 +0000

    Fix unreachable branch and broken regex in PR-of-the-month script (#62438)
    
    - Reorder elif chain in quick_score_prs so body_len < 20 (0.4x)
      is checked before body_len < 1000 (0.8x) — previously the < 20
      branch was unreachable since < 20 is a subset of < 1000
    - Fix linked-issue regex: lookbehind matched "elated: #" instead
      of "related: #", and required exactly 5 digits — switch to a
      capture group that handles any issue number length
---
 dev/stats/get_important_pr_candidates.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dev/stats/get_important_pr_candidates.py 
b/dev/stats/get_important_pr_candidates.py
index 3b2636ac9db..83fd5f049a8 100755
--- a/dev/stats/get_important_pr_candidates.py
+++ b/dev/stats/get_important_pr_candidates.py
@@ -285,7 +285,7 @@ class PRFetcher:
         if not pr_body:
             return {"issue_comments": 0, "issue_reactions": 0, "issue_users": 
set()}
 
-        regex = r"(?<=closes: #|elated: #)\d{5}"
+        regex = r"(?:closes|related): #(\d+)"
         issue_nums = re.findall(regex, pr_body)
 
         total_issue_comments = 0
@@ -831,10 +831,10 @@ class SuperFastPRFinder:
             body_len = len(pr.get("body", ""))
             if body_len > 2000:
                 score *= 1.4
-            elif body_len < 1000:
-                score *= 0.8
             elif body_len < 20:
                 score *= 0.4
+            elif body_len < 1000:
+                score *= 0.8
 
             comments = pr.get("comments_count", 0)
             if comments > 30:

Reply via email to