Skip to content

Commit 2e0dd1c

Browse files
authored
Release 1.20.2 | Plugin 4.7.0 (#3820)
1 parent 7ae91b1 commit 2e0dd1c

File tree

131 files changed

+2825
-1010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+2825
-1010
lines changed

.github/actions/spelling/expect.txt

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file should contain names of products, companies, or individuals that aren't in a standard dictionary (e.g., GitHub, Keptn, VSCode).
2+
13
crowdin
24
DWM
35
workflows
@@ -34,7 +36,6 @@ mscorlib
3436
pythonw
3537
dotnet
3638
winget
37-
jjw24
3839
wolframalpha
3940
gmail
4041
duckduckgo
@@ -49,15 +50,13 @@ srchadmin
4950
EWX
5051
dlgtext
5152
CMD
52-
appref-ms
5353
appref
5454
TSource
5555
runas
5656
dpi
5757
popup
5858
ptr
5959
pluginindicator
60-
TobiasSekan
6160
img
6261
resx
6362
bak
@@ -68,9 +67,6 @@ dlg
6867
ddd
6968
dddd
7069
clearlogfolder
71-
ACCENT_ENABLE_TRANSPARENTGRADIENT
72-
ACCENT_ENABLE_BLURBEHIND
73-
WCA_ACCENT_POLICY
7470
HGlobal
7571
dopusrt
7672
firefox
@@ -91,22 +87,19 @@ keyevent
9187
KListener
9288
requery
9389
vkcode
94-
čeština
9590
Polski
9691
Srpski
97-
Português
98-
Português (Brasil)
9992
Italiano
100-
Slovenský
10193
quicklook
102-
Tiếng Việt
10394
Droplex
10495
Preinstalled
10596
errormetadatafile
10697
noresult
10798
pluginsmanager
10899
alreadyexists
109-
JsonRPC
110-
JsonRPCV2
111100
Softpedia
112101
img
102+
Reloadable
103+
metadatas
104+
WMP
105+
VSTHRD

.github/actions/spelling/patterns.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
2+
# This file should contain strings that contain a mix of letters and numbers, or specific symbols
3+
24

35
# Questionably acceptable forms of `in to`
46
# Personally, I prefer `log into`, but people object
@@ -121,3 +123,14 @@
121123

122124
# version suffix <word>v#
123125
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
126+
127+
\bjjw24\b
128+
\bappref-ms\b
129+
\bTobiasSekan\b
130+
\bJsonRPC\b
131+
\bJsonRPCV2\b
132+
\bTiếng Việt\b
133+
\bPortuguês (Brasil)\b
134+
\bčeština\b
135+
\bPortuguês\b
136+
\bIoc\b

.github/update_release_pr.py

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from os import getenv
2+
from typing import Optional
23

34
import requests
45

56

67
def get_github_prs(token: str, owner: str, repo: str, label: str = "", state: str = "all") -> list[dict]:
78
"""
8-
Fetches pull requests from a GitHub repository that match a given milestone and label.
9+
Fetches pull requests from a GitHub repository that match a given label and state.
910
1011
Args:
1112
token (str): GitHub token.
@@ -23,39 +24,10 @@ def get_github_prs(token: str, owner: str, repo: str, label: str = "", state: st
2324
"Accept": "application/vnd.github.v3+json",
2425
}
2526

26-
milestone_id = None
27-
milestone_url = f"https://api.github.com/repos/{owner}/{repo}/milestones"
28-
params = {"state": "open"}
29-
30-
try:
31-
response = requests.get(milestone_url, headers=headers, params=params)
32-
response.raise_for_status()
33-
milestones = response.json()
34-
35-
if len(milestones) > 2:
36-
print("More than two milestones found, unable to determine the milestone required.")
37-
exit(1)
38-
39-
# milestones.pop()
40-
for ms in milestones:
41-
if ms["title"] != "Future":
42-
milestone_id = ms["number"]
43-
print(f"Gathering PRs with milestone {ms['title']}...")
44-
break
45-
46-
if not milestone_id:
47-
print(f"No suitable milestone found in repository '{owner}/{repo}'.")
48-
exit(1)
49-
50-
except requests.exceptions.RequestException as e:
51-
print(f"Error fetching milestones: {e}")
52-
exit(1)
53-
54-
# This endpoint allows filtering by milestone and label. A PR in GH's perspective is a type of issue.
27+
# This endpoint allows filtering by label(and milestone). A PR in GH's perspective is a type of issue.
5528
prs_url = f"https://api.github.com/repos/{owner}/{repo}/issues"
5629
params = {
5730
"state": state,
58-
"milestone": milestone_id,
5931
"labels": label,
6032
"per_page": 100,
6133
}
@@ -83,14 +55,18 @@ def get_github_prs(token: str, owner: str, repo: str, label: str = "", state: st
8355
return all_prs
8456

8557

86-
def get_prs(pull_request_items: list[dict], label: str = "", state: str = "all") -> list[dict]:
58+
def get_prs(
59+
pull_request_items: list[dict], label: str = "", state: str = "all", milestone_title: Optional[str] = None
60+
) -> list[dict]:
8761
"""
8862
Returns a list of pull requests after applying the label and state filters.
8963
9064
Args:
9165
pull_request_items (list[dict]): List of PR items.
9266
label (str): The label name. Filter is not applied when empty string.
9367
state (str): State of PR, e.g. open, closed, all
68+
milestone_title (Optional[str]): The milestone title to filter by. This is the milestone number you created
69+
in GitHub, e.g. '1.20.0'. If None, no milestone filtering is applied.
9470
9571
Returns:
9672
list: A list of dictionaries, where each dictionary represents a pull request.
@@ -99,22 +75,32 @@ def get_prs(pull_request_items: list[dict], label: str = "", state: str = "all")
9975
pr_list = []
10076
count = 0
10177
for pr in pull_request_items:
102-
if state in [pr["state"], "all"] and (not label or [item for item in pr["labels"] if item["name"] == label]):
103-
pr_list.append(pr)
104-
count += 1
78+
if state not in [pr["state"], "all"]:
79+
continue
80+
81+
if label and not [item for item in pr["labels"] if item["name"] == label]:
82+
continue
10583

106-
print(f"Found {count} PRs with {label if label else 'no filter on'} label and state as {state}")
84+
if milestone_title:
85+
if pr["milestone"] is None or pr["milestone"]["title"] != milestone_title:
86+
continue
87+
88+
pr_list.append(pr)
89+
count += 1
90+
91+
print(
92+
f"Found {count} PRs with {label if label else 'no filter on'} label, state as {state}, and milestone {pr["milestone"] if pr["milestone"] is not None else "None"}"
93+
)
10794

10895
return pr_list
10996

110-
def get_prs_assignees(pull_request_items: list[dict], label: str = "", state: str = "all") -> list[str]:
97+
98+
def get_prs_assignees(pull_request_items: list[dict]) -> list[str]:
11199
"""
112-
Returns a list of pull request assignees after applying the label and state filters, excludes jjw24.
100+
Returns a list of pull request assignees, excludes jjw24.
113101
114102
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
103+
pull_request_items (list[dict]): List of PR items to get the assignees from.
118104
119105
Returns:
120106
list: A list of strs, where each string is an assignee name. List is not distinct, so can contain
@@ -123,13 +109,13 @@ def get_prs_assignees(pull_request_items: list[dict], label: str = "", state: st
123109
"""
124110
assignee_list = []
125111
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" ]
112+
[assignee_list.append(assignee["login"]) for assignee in pr["assignees"] if assignee["login"] != "jjw24"]
128113

129-
print(f"Found {len(assignee_list)} assignees with {label if label else 'no filter on'} label and state as {state}")
114+
print(f"Found {len(assignee_list)} assignees")
130115

131116
return assignee_list
132117

118+
133119
def get_pr_descriptions(pull_request_items: list[dict]) -> str:
134120
"""
135121
Returns the concatenated string of pr title and number in the format of
@@ -207,30 +193,42 @@ def update_pull_request_description(token: str, owner: str, repo: str, pr_number
207193

208194
print(f"Fetching {state} PRs for {repository_owner}/{repository_name} ...")
209195

210-
pull_requests = get_github_prs(github_token, repository_owner, repository_name)
196+
# First, get all PRs to find the release PR and determine the milestone
197+
all_pull_requests = get_github_prs(github_token, repository_owner, repository_name)
211198

212-
if not pull_requests:
213-
print("No matching pull requests found")
199+
if not all_pull_requests:
200+
print("No pull requests found")
214201
exit(1)
215202

216-
print(f"\nFound total of {len(pull_requests)} pull requests")
203+
print(f"\nFound total of {len(all_pull_requests)} pull requests")
217204

218-
release_pr = get_prs(pull_requests, "release", "open")
205+
release_pr = get_prs(all_pull_requests, "release", "open")
219206

220207
if len(release_pr) != 1:
221208
print(f"Unable to find the exact release PR. Returned result: {release_pr}")
222209
exit(1)
223210

224211
print(f"Found release PR: {release_pr[0]['title']}")
225212

226-
enhancement_prs = get_prs(pull_requests, "enhancement", "closed")
227-
bug_fix_prs = get_prs(pull_requests, "bug", "closed")
213+
release_milestone_title = release_pr[0].get("milestone", {}).get("title", None)
214+
215+
if not release_milestone_title:
216+
print("Release PR does not have a milestone assigned.")
217+
exit(1)
218+
219+
print(f"Using milestone number: {release_milestone_title}")
220+
221+
enhancement_prs = get_prs(all_pull_requests, "enhancement", "closed", release_milestone_title)
222+
bug_fix_prs = get_prs(all_pull_requests, "bug", "closed", release_milestone_title)
223+
224+
if len(enhancement_prs) == 0 and len(bug_fix_prs) == 0:
225+
print(f"No PRs with {release_milestone_title} milestone were found")
228226

229227
description_content = "# Release notes\n"
230228
description_content += f"## Features\n{get_pr_descriptions(enhancement_prs)}" if enhancement_prs else ""
231229
description_content += f"## Bug fixes\n{get_pr_descriptions(bug_fix_prs)}" if bug_fix_prs else ""
232230

233-
assignees = list(set(get_prs_assignees(pull_requests, "enhancement", "closed") + get_prs_assignees(pull_requests, "bug", "closed")))
231+
assignees = list(set(get_prs_assignees(enhancement_prs) + get_prs_assignees(bug_fix_prs)))
234232
assignees.sort(key=str.lower)
235233

236234
description_content += f"### Authors:\n{', '.join(assignees)}"

0 commit comments

Comments
 (0)