merobi-hub commented on code in PR #26605:
URL: https://github.com/apache/airflow/pull/26605#discussion_r992405610
##########
dev/stats/get_important_pr_candidates.py:
##########
@@ -71,32 +71,46 @@ def __init__(self, g, pull_request: PullRequest):
self.len_issue_comments = 0
self.num_issue_comments = 0
self.num_issue_reactions = 0
+ self.protm_score = 0
@property
def label_score(self) -> float:
"""assigns label score"""
- for label in self.pull_request.labels:
+ labels = self.pull_request.labels
+ for label in labels:
if "provider" in label.name:
return PrStat.PROVIDER_SCORE
return PrStat.REGULAR_SCORE
@cached_property
def num_comments(self):
- """counts reviewer comments"""
- comments = 0
+ """counts reviewer comments & checks for #protm tag"""
+ num_comments = 0
+ num_protm = 0
for comment in self.pull_request.get_comments():
self._users.add(comment.user.login)
- comments += 1
- return comments
+ if ('protm' in comment.body) or ('PROTM' in comment.body) or
('PRotM' in comment.body):
+ num_protm += 1
+ num_comments += 1
+ self.protm_score = num_protm
+ return num_comments
@cached_property
def num_conv_comments(self) -> int:
- """counts conversational comments"""
- conv_comments = 0
+ """counts conversational comments & checks for #protm tag"""
+ num_conv_comments = 0
+ num_protm = 0
for conv_comment in self.pull_request.get_issue_comments():
self._users.add(conv_comment.user.login)
- conv_comments += 1
- return conv_comments
+ if (
+ ('protm' in conv_comment.body)
Review Comment:
Sounds good, thanks!
--
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]