@@ -107,14 +107,12 @@ def get_prs(pull_request_items: list[dict], label: str = "", state: str = "all")
107
107
108
108
return pr_list
109
109
110
- def get_prs_assignees (pull_request_items : list [dict ], label : str = "" , state : str = "all" ) -> list [str ]:
110
+ def get_prs_assignees (pull_request_items : list [dict ]) -> list [str ]:
111
111
"""
112
- Returns a list of pull request assignees after applying the label and state filters , excludes jjw24.
112
+ Returns a list of pull request assignees, excludes jjw24.
113
113
114
114
Args:
115
- pull_request_items (list[dict]): List of PR items.
116
- label (str): The label name. Filter is not applied when empty string.
117
- state (str): State of PR, e.g. open, closed, all
115
+ pull_request_items (list[dict]): List of PR items to get the assignees from.
118
116
119
117
Returns:
120
118
list: A list of strs, where each string is an assignee name. List is not distinct, so can contain
@@ -123,10 +121,9 @@ def get_prs_assignees(pull_request_items: list[dict], label: str = "", state: st
123
121
"""
124
122
assignee_list = []
125
123
for pr in pull_request_items :
126
- if state in [pr ["state" ], "all" ] and (not label or [item for item in pr ["labels" ] if item ["name" ] == label ]):
127
- [assignee_list .append (assignee ["login" ]) for assignee in pr ["assignees" ] if assignee ["login" ] != "jjw24" ]
124
+ [assignee_list .append (assignee ["login" ]) for assignee in pr ["assignees" ] if assignee ["login" ] != "jjw24" ]
128
125
129
- print (f"Found { len (assignee_list )} assignees with { label if label else 'no filter on' } label and state as { state } " )
126
+ print (f"Found { len (assignee_list )} assignees" )
130
127
131
128
return assignee_list
132
129
@@ -230,7 +227,7 @@ def update_pull_request_description(token: str, owner: str, repo: str, pr_number
230
227
description_content += f"## Features\n { get_pr_descriptions (enhancement_prs )} " if enhancement_prs else ""
231
228
description_content += f"## Bug fixes\n { get_pr_descriptions (bug_fix_prs )} " if bug_fix_prs else ""
232
229
233
- assignees = list (set (get_prs_assignees (pull_requests , "enhancement" , "closed" ) + get_prs_assignees (pull_requests , "bug" , "closed" )))
230
+ assignees = list (set (get_prs_assignees (enhancement_prs ) + get_prs_assignees (bug_fix_prs )))
234
231
assignees .sort (key = str .lower )
235
232
236
233
description_content += f"### Authors:\n { ', ' .join (assignees )} "
0 commit comments