File: js.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (31 lines) | stat: -rw-r--r-- 1,028 bytes parent folder | download | duplicates (2)
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)