1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
import datetime
from common import IssueProcess, Common
from typing import Any, List
# assignee dict which will be assigned to handle issues
_JS_OWNER = {'lirenhe', 'kazrael2119', 'azure-sdk'}
_JS_ASSIGNEE = {'qiaozha', 'MaryGao'}
class IssueProcessJs(IssueProcess):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.language_name = 'js'
def auto_assign_policy(self) -> str:
weeks = datetime.datetime.now().isocalendar()[1]
assignees = list(self.assignee_candidates)
assignees.sort()
random_idx = weeks % len(assignees)
return assignees[random_idx]
class Js(Common):
def __init__(self, issues, language_owner, sdk_assignees):
super(Js, self).__init__(issues, language_owner, sdk_assignees)
self.issue_process_function = IssueProcessJs
if not self.for_test():
self.file_out_name = 'release_js_status.md'
def js_process(issues: List[Any]) -> Js:
return Js(issues, _JS_OWNER, _JS_ASSIGNEE)
|