This is an automated email from the ASF dual-hosted git repository.
kaxilnaik 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 c63cda22dff Bump score of PROTM tagged PRs (#48221)
c63cda22dff is described below
commit c63cda22dff92af2141184d2271f8a12a2a403f5
Author: Jed Cunningham <[email protected]>
AuthorDate: Tue Mar 25 01:06:36 2025 -0600
Bump score of PROTM tagged PRs (#48221)
---
dev/stats/get_important_pr_candidates.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dev/stats/get_important_pr_candidates.py
b/dev/stats/get_important_pr_candidates.py
index f2899bde320..708ca2791f0 100755
--- a/dev/stats/get_important_pr_candidates.py
+++ b/dev/stats/get_important_pr_candidates.py
@@ -73,7 +73,7 @@ class PrStat:
self.num_issue_reactions: int = 0
self.num_comments: int = 0
self.num_conv_comments: int = 0
- self.num_protm: int = 0
+ self.tagged_protm: bool = False
self.conv_comment_reactions: int = 0
self.interaction_score = 1.0
@@ -92,7 +92,7 @@ class PrStat:
self._users.add(comment.user.login)
lowercase_body = comment.body.lower()
if "protm" in lowercase_body:
- self.num_protm += 1
+ self.tagged_protm = True
self.num_comments += 1
if comment.body is not None:
self.len_comments += len(comment.body)
@@ -106,7 +106,7 @@ class PrStat:
self._users.add(conv_comment.user.login)
lowercase_body = conv_comment.body.lower()
if "protm" in lowercase_body:
- self.num_protm += 1
+ self.tagged_protm = True
self.num_conv_comments += 1
for reaction in conv_comment.get_reactions():
self._users.add(reaction.user.login)
@@ -217,7 +217,8 @@ class PrStat:
return round(score, 3)
def adjust_interaction_score(self):
- self.interaction_score *= min(self.num_protm + 1, 3)
+ if self.tagged_protm:
+ self.interaction_score *= 20
@property
def score(self):
@@ -239,7 +240,7 @@ class PrStat:
# If the body contains fewer than 1000 characters, the PR should
matter 20% less.
#
# Weight PRs with protm tags more heavily:
- # If there is at least one protm tag, multiply the interaction score
by the number of tags, up to 3.
+ # If there is at least one protm tag, multiply the interaction score
by 20.
#
self.calc_comments()
self.calc_conv_comments()
@@ -256,7 +257,7 @@ class PrStat:
)
def __str__(self) -> str:
- if self.num_protm > 0:
+ if self.tagged_protm:
return (
"[magenta]##Tagged PR## [/]"
f"Score: {self.score:.2f}: PR{self.pull_request.number}"
@@ -273,7 +274,7 @@ class PrStat:
)
def verboseStr(self) -> str:
- if self.num_protm > 0:
+ if self.tagged_protm:
console.print("********************* Tagged with '#protm'
*********************", style="magenta")
return (
f"-- Created at [bright_blue]{self.pull_request.created_at}[/], "