Skip to content

Commit f95ad6a

Browse files
BigCat20196msyyc
andauthored
[Issue helper] Add bot policy for no-feedback issue (Azure#23176)
* initial * rename yml * git push function * only collect issues with label 'Mgmt' * handle exception * date format * update log print * update bot policy * skip self-create issue * add ziwei and zhenbiao * Update python.py * skip self author * skip self author * skip self author * Update python.py * Update python.py * update status * update status * update status * fix bug Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 6aabfa3 commit f95ad6a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/issue_helper/python.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import List
2+
from datetime import datetime
23

34
from github.Issue import Issue
45

@@ -16,6 +17,15 @@ def collect_open_issues(self) -> List[Issue]:
1617
filtered_issues = [i for i in open_issues if i.user.login not in self.language_owner]
1718
return filtered_issues
1819

20+
def judge_status(self, issue: Issue) -> str:
21+
bot_advice = super().judge_status(issue)
22+
# Prompt to add `issue-addressed` tag if customer has not replied > 7 days
23+
issue_labels = [label.name for label in issue.labels]
24+
if not bot_advice and 'issue-addressed' not in issue_labels and 'needs-author-feedback' not in issue_labels:
25+
if (datetime.today() - list(issue.get_comments())[-1].updated_at).days > 7:
26+
return 'no reply > 7'
27+
return bot_advice
28+
1929

2030
def python_process() -> None:
2131
instance = Python(_PYTHON_OWNER, _PYTHON_REPO, _FILE_OUT_NAME_PYTHON)

0 commit comments

Comments
 (0)