File: js.py

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (27 lines) | stat: -rw-r--r-- 891 bytes parent folder | download
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
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 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.file_out_name = 'release_js_status.md'
        self.issue_process_function = IssueProcessJs

def js_process(issues: List[Any]):
    instance = Js(issues, _JS_OWNER, _JS_ASSIGNEE)
    instance.run()